Skip to content

Commit da128d4

Browse files
committed
Switch IT tests to run against 2021-12 for latest platform.
1 parent cacd9e8 commit da128d4

File tree

9 files changed

+67
-64
lines changed

9 files changed

+67
-64
lines changed

tycho-its/projects/TYCHO0367localRepositoryCrosstalk/bundle02/src/TYCHO0367localRepositoryCrosstalk/bundle02/Eclipse35Test.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public void test() throws Exception {
2525
Bundle equinox = getBundle("org.eclipse.osgi");
2626

2727
assertEquals(3, equinox.getVersion().getMajor());
28-
assertEquals(16, equinox.getVersion().getMinor());
28+
assertEquals(17, equinox.getVersion().getMinor());
2929
}
3030

3131
public Bundle getBundle(String id) {

tycho-its/projects/p2Repository/category.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<category name="Test Category" />
77
</iu>
88
<iu>
9-
<query><expression type="match">id ~= /javax.annotat*/</expression></query>
9+
<query><expression type="match">id == "javax.annotation"</expression></query>
1010
<category name="Test Category" />
1111
</iu>
1212
<category-def label="Test Category Label" name="Test Category">

tycho-its/projects/target.restriction.filter/META-INF/MANIFEST.MF

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ Bundle-Name: trf.testbundle
44
Bundle-SymbolicName: trf.testbundle;singleton:=true
55
Bundle-Version: 0.1.0.qualifier
66
Require-Bundle: org.eclipse.osgi,
7+
org.eclipse.equinox.common,
78
org.junit
89
Bundle-Activator: test.Activator
910
Bundle-ActivationPolicy: lazy
10-
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
11+
Bundle-RequiredExecutionEnvironment: JavaSE-11

tycho-its/projects/target.restriction.filter/pom.xml

+2-1
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,15 @@
3939
<artifactId>target-platform-configuration</artifactId>
4040
<version>${tycho-version}</version>
4141
<configuration>
42+
<executionEnvironment>JavaSE-11</executionEnvironment>
4243
<filters>
4344
<filter>
4445
<!-- make sure that a 3.4.x version of bundle org.eclipse.osgi is used -->
4546
<type> eclipse-plugin </type>
4647
<id> org.eclipse.osgi </id> <!-- extra whitespace is not needed; it is just here to make the test harder -->
4748
<restrictTo>
4849
<versionRange>
49-
[3.12,3.13)
50+
[3.16,3.17)
5051
</versionRange>
5152
</restrictTo>
5253
</filter>

tycho-its/projects/target.restriction.filter/src/test/Test.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public class Test extends TestCase {
2020

2121
public void test() {
2222
Version version = new Version((String) Activator.context.getBundle(0).getHeaders().get("Bundle-Version"));
23-
assertTrue(version.compareTo(new Version("3.13")) < 0);
23+
assertTrue(version.compareTo(new Version("3.17")) < 0);
2424
}
2525

2626
}

tycho-its/src/test/java/org/eclipse/tycho/test/pomGenerator/TYCHO45Test.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public void test() throws Exception {
2727
// generate poms
2828
verifier.getSystemProperties().setProperty("groupId", "tycho45");
2929
verifier.getSystemProperties().setProperty("failIfNoTests", "false");
30-
verifier.getSystemProperties().setProperty("repoURL", "http://download.eclipse.org/releases/oxygen/");
30+
verifier.getSystemProperties().setProperty("repoURL", "https://download.eclipse.org/releases/oxygen/");
3131
verifier.getSystemProperties().setProperty("repoName", "oxygen");
3232
verifier.setAutoclean(false);
3333
verifier.setLogFileName("log-init.txt");

tycho-its/src/test/java/org/eclipse/tycho/test/surefire/ExplodedTestDependenciesTest.java

+15-13
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2008, 2012 Sonatype Inc. and others.
2+
* Copyright (c) 2008, 2022 Sonatype Inc. and others.
33
* This program and the accompanying materials
44
* are made available under the terms of the Eclipse Public License 2.0
55
* which accompanies this distribution, and is available at
@@ -22,17 +22,19 @@
2222

2323
public class ExplodedTestDependenciesTest extends AbstractTychoIntegrationTest {
2424

25-
@Test
26-
public void testLocalMavenRepository() throws Exception {
27-
// project that marks org.apache.ant as "exploded" (unpacked) for the test runtime -> supported since TYCHO-340
28-
Verifier v01 = getVerifier("surefire.bundleUnpack", false);
29-
v01.getSystemProperties().setProperty("p2.repo", P2Repositories.ECLIPSE_LATEST.toString());
30-
v01.executeGoal("install");
31-
v01.verifyErrorFreeLog();
32-
// TODO this is only an indirect test; it should test that the bundles nested jars are accessible as file URLs
33-
File antHome = new File(v01.getBasedir(),
34-
"tycho340.test/target/work/plugins/org.apache.ant_1.10.9.v20201106-1946");
35-
Assert.assertTrue(antHome.isDirectory());
36-
}
25+
@Test
26+
public void testLocalMavenRepository() throws Exception {
27+
// project that marks org.apache.ant as "exploded" (unpacked) for the test
28+
// runtime -> supported since TYCHO-340
29+
Verifier v01 = getVerifier("surefire.bundleUnpack", false);
30+
v01.getSystemProperties().setProperty("p2.repo", P2Repositories.ECLIPSE_LATEST.toString());
31+
v01.executeGoal("install");
32+
v01.verifyErrorFreeLog();
33+
// TODO this is only an indirect test; it should test that the bundles nested
34+
// jars are accessible as file URLs
35+
File antHome = new File(v01.getBasedir(),
36+
"tycho340.test/target/work/plugins/org.apache.ant_1.10.12.v20211102-1452");
37+
Assert.assertTrue(antHome.isDirectory());
38+
}
3739

3840
}

tycho-its/src/test/java/org/eclipse/tycho/test/target/TargetPlatformFilteringIntegrationTest.java

+8-8
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@
1919

2020
public class TargetPlatformFilteringIntegrationTest extends AbstractTychoIntegrationTest {
2121

22-
@Test
23-
public void test() throws Exception {
24-
Verifier verifier = getVerifier("target.restriction.filter", false);
25-
verifier.getSystemProperties().put("e342-repo", P2Repositories.ECLIPSE_OXYGEN.toString());
26-
verifier.getSystemProperties().put("e352-repo", P2Repositories.ECLIPSE_LATEST.toString());
27-
verifier.executeGoal("verify");
28-
verifier.verifyErrorFreeLog();
29-
}
22+
@Test
23+
public void test() throws Exception {
24+
Verifier verifier = getVerifier("target.restriction.filter", false);
25+
verifier.getSystemProperties().put("e342-repo", "https:////download.eclipse.org/releases/2021-06/");
26+
verifier.getSystemProperties().put("e352-repo", P2Repositories.ECLIPSE_LATEST.toString());
27+
verifier.executeGoal("verify");
28+
verifier.verifyErrorFreeLog();
29+
}
3030
}

tycho-its/src/test/java/org/eclipse/tycho/test/util/ResourceUtil.java

+36-37
Original file line numberDiff line numberDiff line change
@@ -20,41 +20,40 @@
2020
*/
2121
public class ResourceUtil {
2222

23-
public enum P2Repositories {
24-
ECLIPSE_342("e342"), ECLIPSE_352("e352"), ECLIPSE_OXYGEN(
25-
"https:////download.eclipse.org/releases/oxygen/"), ECLIPSE_LATEST(
26-
"https:////download.eclipse.org/releases/2020-12/");
27-
28-
private final String path;
29-
30-
P2Repositories(String path) {
31-
this.path = path;
32-
}
33-
34-
public URI getResolvedLocation() throws IllegalStateException {
35-
if (path.startsWith("https:") || path.startsWith("http:")) {
36-
return URI.create(path);
37-
}
38-
return resolveTestResource("repositories/" + path).toURI();
39-
}
40-
41-
@Override
42-
public String toString() {
43-
return getResolvedLocation().toString();
44-
}
45-
}
46-
47-
public static File resolveTestResource(String pathRelativeToProjectRoot) throws IllegalStateException {
48-
File resolvedFile = new File(pathRelativeToProjectRoot).getAbsoluteFile();
49-
50-
if (!resolvedFile.canRead()) {
51-
throw new IllegalStateException(
52-
"Test resource \"" + pathRelativeToProjectRoot + "\" is not available; " + workingDirMessage());
53-
}
54-
return resolvedFile;
55-
}
56-
57-
private static String workingDirMessage() {
58-
return "(working directory is \"" + new File(".").getAbsolutePath() + "\")";
59-
}
23+
public enum P2Repositories {
24+
ECLIPSE_342("e342"), ECLIPSE_352("e352"), ECLIPSE_OXYGEN("https:////download.eclipse.org/releases/oxygen/"),
25+
ECLIPSE_LATEST("https:////download.eclipse.org/releases/2021-12/");
26+
27+
private final String path;
28+
29+
P2Repositories(String path) {
30+
this.path = path;
31+
}
32+
33+
public URI getResolvedLocation() throws IllegalStateException {
34+
if (path.startsWith("https:") || path.startsWith("http:")) {
35+
return URI.create(path);
36+
}
37+
return resolveTestResource("repositories/" + path).toURI();
38+
}
39+
40+
@Override
41+
public String toString() {
42+
return getResolvedLocation().toString();
43+
}
44+
}
45+
46+
public static File resolveTestResource(String pathRelativeToProjectRoot) throws IllegalStateException {
47+
File resolvedFile = new File(pathRelativeToProjectRoot).getAbsoluteFile();
48+
49+
if (!resolvedFile.canRead()) {
50+
throw new IllegalStateException(
51+
"Test resource \"" + pathRelativeToProjectRoot + "\" is not available; " + workingDirMessage());
52+
}
53+
return resolvedFile;
54+
}
55+
56+
private static String workingDirMessage() {
57+
return "(working directory is \"" + new File(".").getAbsolutePath() + "\")";
58+
}
6059
}

0 commit comments

Comments
 (0)