@@ -43,8 +43,6 @@ public abstract class JdkDownloadPluginIT extends GradleIntegrationTestCase {
43
43
private static final Pattern JDK_HOME_LOGLINE = Pattern .compile ("JDK HOME: (.*)" );
44
44
private static final Pattern NUM_CONFIGS_LOGLINE = Pattern .compile ("NUM CONFIGS: (.*)" );
45
45
46
- protected abstract String oldJdkVersion ();
47
-
48
46
protected abstract String jdkVersion ();
49
47
50
48
protected abstract String jdkVendor ();
@@ -61,18 +59,6 @@ public final void testWindowsExtraction() throws IOException {
61
59
assertExtraction ("getWindowsJdk" , "windows" , "bin/java" , jdkVendor (), jdkVersion ());
62
60
}
63
61
64
- public final void testLinuxExtractionOldVersion () throws IOException {
65
- assertExtraction ("getLinuxJdk" , "linux" , "bin/java" , jdkVendor (), oldJdkVersion ());
66
- }
67
-
68
- public final void testDarwinExtractionOldVersion () throws IOException {
69
- assertExtraction ("getDarwinJdk" , "osx" , "Contents/Home/bin/java" , jdkVendor (), oldJdkVersion ());
70
- }
71
-
72
- public final void testWindowsExtractionOldVersion () throws IOException {
73
- assertExtraction ("getWindowsJdk" , "windows" , "bin/java" , jdkVendor (), oldJdkVersion ());
74
- }
75
-
76
62
public final void testCrossProjectReuse () throws IOException {
77
63
runBuild ("numConfigurations" , "linux" , result -> {
78
64
Matcher matcher = NUM_CONFIGS_LOGLINE .matcher (result .getOutput ());
@@ -81,7 +67,7 @@ public final void testCrossProjectReuse() throws IOException {
81
67
}, jdkVendor (), jdkVersion ());
82
68
}
83
69
84
- private void assertExtraction (String taskname , String platform , String javaBin , String vendor , String version ) throws IOException {
70
+ protected void assertExtraction (String taskname , String platform , String javaBin , String vendor , String version ) throws IOException {
85
71
runBuild (taskname , platform , result -> {
86
72
Matcher matcher = JDK_HOME_LOGLINE .matcher (result .getOutput ());
87
73
assertTrue ("could not find jdk home in output: " + result .getOutput (), matcher .find ());
@@ -91,7 +77,7 @@ private void assertExtraction(String taskname, String platform, String javaBin,
91
77
}, vendor , version );
92
78
}
93
79
94
- protected abstract String urlPath (boolean isOld , String platform , String extension );
80
+ protected abstract String urlPath (String version , String platform , String extension );
95
81
96
82
protected abstract byte [] filebytes (String platform , String extension ) throws IOException ;
97
83
@@ -100,11 +86,10 @@ private void runBuild(String taskname, String platform, Consumer<BuildResult> as
100
86
WireMockServer wireMock = new WireMockServer (0 );
101
87
try {
102
88
String extension = platform .equals ("windows" ) ? "zip" : "tar.gz" ;
103
- boolean isOld = version .equals (oldJdkVersion ());
104
89
105
- wireMock .stubFor (head (urlEqualTo (urlPath (isOld , platform , extension ))).willReturn (aResponse ().withStatus (200 )));
90
+ wireMock .stubFor (head (urlEqualTo (urlPath (version , platform , extension ))).willReturn (aResponse ().withStatus (200 )));
106
91
wireMock .stubFor (
107
- get (urlEqualTo (urlPath (isOld , platform , extension ))).willReturn (
92
+ get (urlEqualTo (urlPath (version , platform , extension ))).willReturn (
108
93
aResponse ().withStatus (200 ).withBody (filebytes (platform , extension ))
109
94
)
110
95
);
0 commit comments