Skip to content

Commit 3580472

Browse files
eclipse-equinox-botakurtakov
authored andcommitted
Perform clean code of bundles/org.eclipse.equinox.p2.tests
1 parent 98a6750 commit 3580472

File tree

180 files changed

+409
-424
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

180 files changed

+409
-424
lines changed

bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/AbstractProvisioningTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -581,7 +581,7 @@ public static IInstallableUnitFragment createIUFragment(IInstallableUnit host, S
581581
}
582582
if (host != null) {
583583
VersionRange hostRange = new VersionRange(host.getVersion(), true, host.getVersion(), true);
584-
fragment.setHost(new IRequirement[] {MetadataFactory.createRequirement(IInstallableUnit.NAMESPACE_IU_ID, host.getId(), hostRange, null, false, false)});
584+
fragment.setHost(MetadataFactory.createRequirement(IInstallableUnit.NAMESPACE_IU_ID, host.getId(), hostRange, null, false, false));
585585
}
586586
fragment.setCapabilities(new IProvidedCapability[] {getSelfCapability(name, version)});
587587
return MetadataFactory.createInstallableUnitFragment(fragment);

bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/IUDescription.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
* https://www.eclipse.org/legal/epl-2.0/
88
*
99
* SPDX-License-Identifier: EPL-2.0
10-
*
11-
* Contributors:
12-
* Sonatype, Inc. - initial implementation and ideas
10+
*
11+
* Contributors:
12+
* Sonatype, Inc. - initial implementation and ideas
1313
******************************************************************************/
1414

1515
package org.eclipse.equinox.p2.tests;

bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/StringBufferStream.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* https://www.eclipse.org/legal/epl-2.0/
88
*
99
* SPDX-License-Identifier: EPL-2.0
10-
*
10+
*
1111
* Contributors:
1212
* IBM Corporation - initial API and implementation
1313
*******************************************************************************/

bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/ant/MirrorTaskTest.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -800,8 +800,7 @@ public void testBaselineCompareUsingComparator() throws FileNotFoundException {
800800
assertEquals("Ensuring destination contains the descriptor from the baseline",
801801
descriptor2.getProperty(DOWNLOAD_CHECKSUM), destDescriptors[0].getProperty(DOWNLOAD_CHECKSUM));
802802
String msg = NLS.bind(Messages.warning_different_checksum,
803-
new Object[] { URIUtil.toUnencodedString(baseline.getLocation()),
804-
URIUtil.toUnencodedString(repo.getLocation()), "SHA-256", descriptor1 });
803+
URIUtil.toUnencodedString(baseline.getLocation()), URIUtil.toUnencodedString(repo.getLocation()), "SHA-256", descriptor1);
805804

806805
assertLogContains(msg);
807806
}

bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/ArtifactRepositoryMissingSizeData.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ protected void setUp() throws Exception {
5454
source = mgr.loadRepository(uri, null);
5555

5656
context = new ProvisioningContext(getAgent());
57-
context.setMetadataRepositories(new URI[] {metaRepo.getLocation()});
58-
context.setArtifactRepositories(new URI[] {source.getLocation()});
57+
context.setMetadataRepositories(metaRepo.getLocation());
58+
context.setArtifactRepositories(source.getLocation());
5959
engine = getEngine();
6060
}
6161

bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/CorruptedJar.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,12 @@
77
* https://www.eclipse.org/legal/epl-2.0/
88
*
99
* SPDX-License-Identifier: EPL-2.0
10-
*
10+
*
1111
* Contributors:
1212
* IBM Corporation - initial API and implementation
1313
*******************************************************************************/
1414
package org.eclipse.equinox.p2.tests.artifact.repository;
1515

16-
import java.net.URI;
1716
import org.eclipse.core.runtime.IStatus;
1817
import org.eclipse.core.runtime.NullProgressMonitor;
1918
import org.eclipse.equinox.internal.p2.artifact.repository.MirrorRequest;
@@ -47,7 +46,7 @@ protected void setUp() throws Exception {
4746

4847
public void testDownloadCorruptedJar() {
4948
ProvisioningContext ctx = new ProvisioningContext(getAgent());
50-
ctx.setArtifactRepositories(new URI[] {getTestData("CorruptedJar repo", testDataLocation).toURI()});
49+
ctx.setArtifactRepositories(getTestData("CorruptedJar repo", testDataLocation).toURI());
5150
DownloadManager mgr = new DownloadManager(ctx, getAgent());
5251
IArtifactKey key = source.query(ArtifactKeyQuery.ALL_KEYS, null).iterator().next();
5352
mgr.add(new MirrorRequest(key, target, null, null, getTransport()));

bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/StatsTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,8 +183,8 @@ public void testDownloadStatsWhileInstall() throws AuthenticationFailedException
183183
req.addInstallableUnits(metaRepo.query(QueryUtil.ALL_UNITS, null).toArray(IInstallableUnit.class));
184184
IPlanner planner = getAgent().getService(IPlanner.class);
185185
ProvisioningContext context = new ProvisioningContext(getAgent());
186-
context.setArtifactRepositories(new URI[] {repositoryURI});
187-
context.setMetadataRepositories(new URI[] {repositoryURI});
186+
context.setArtifactRepositories(repositoryURI);
187+
context.setMetadataRepositories(repositoryURI);
188188
IProvisioningPlan plan = planner.getProvisioningPlan(req, context, null);
189189
IEngine engine = getAgent().getService(IEngine.class);
190190
assertTrue("Failed on install test iu.", engine.perform(plan, null).isOK());

bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/director/OracleTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,13 @@ protected void setUp() throws Exception {
5555

5656
public void testInstallA1() {
5757
ProfileChangeRequest request = new ProfileChangeRequest(profile);
58-
request.addInstallableUnits(new IInstallableUnit[] {a1});
58+
request.addInstallableUnits(a1);
5959
assertEquals(IStatus.OK, director.provision(request, null, null).getSeverity());
6060

6161
createTestMetdataRepository(new IInstallableUnit[] {d2});
6262
// assertEquals(new Oracle().canInstall(new IInstallableUnit[] {b1}, profile, null), true);
6363
request = new ProfileChangeRequest(profile);
64-
request.addInstallableUnits(new IInstallableUnit[] {b1});
64+
request.addInstallableUnits(b1);
6565
assertEquals(IStatus.OK, director.provision(request, null, null).getSeverity());
6666
}
6767
}

bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/director/OracleTest2.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,11 @@ protected void setUp() throws Exception {
6969
7070
public void testInstallA1() {
7171
assertEquals(director.install(new IInstallableUnit[] {a1}, profile, null).getSeverity(), IStatus.OK);
72-
72+
7373
createTestMetdataRepository(new IInstallableUnit[] {a2, c2, b1});
7474
Collection brokenEntryPoint = (Collection) new Oracle().canInstall(new IInstallableUnit[] {b1}, profile, null);
7575
// assertNotNull(brokenEntryPoint.getProperty("entryPoint"));
76-
76+
7777
new Oracle().hasUpdate(a1);
7878
System.out.println(new Oracle().canInstall(new IInstallableUnit[] {b1}, (IInstallableUnit[]) brokenEntryPoint.toArray(new IInstallableUnit[brokenEntryPoint.size()]), profile, null));
7979
}
@@ -84,7 +84,7 @@ public void testInstallA1bis() {
8484
director = createDirector();
8585
createTestMetdataRepository(new IInstallableUnit[] {a1, a2, c1, c2, b1});
8686
ProfileChangeRequest request = new ProfileChangeRequest(profile);
87-
request.addInstallableUnits(new IInstallableUnit[] {a1});
87+
request.addInstallableUnits(a1);
8888
assertEquals(IStatus.OK, director.provision(request, null, null).getSeverity());
8989
}
9090
}

bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/director/ReplacePlanTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ protected void setUp() throws Exception {
6969
planner = createPlanner();
7070

7171
ProfileChangeRequest request = new ProfileChangeRequest(profile);
72-
request.addInstallableUnits(new IInstallableUnit[] {fa, frag1});
72+
request.addInstallableUnits(fa, frag1);
7373
director.provision(request, null, null);
7474

7575
createTestMetdataRepository(new IInstallableUnit[] {f1_1, f1_4, frag1_1, frag1_4});
@@ -93,7 +93,7 @@ public void testReplaceFragment() {
9393
//TODO it is strange that this succeeds, since frag1_4 and fa cannot co-exist
9494
ProfileChangeRequest request = new ProfileChangeRequest(profile);
9595
request.removeInstallableUnits(new IInstallableUnit[] {frag1});
96-
request.addInstallableUnits(new IInstallableUnit[] {frag1_4});
96+
request.addInstallableUnits(frag1_4);
9797
IProvisioningPlan plan = planner.getProvisioningPlan(request, new ProvisioningContext(getAgent()), null);
9898
assertTrue("1.0", plan.getStatus().isOK());
9999
}

0 commit comments

Comments
 (0)