|
51 | 51 | import java.util.zip.ZipInputStream; |
52 | 52 |
|
53 | 53 | import org.junit.Before; |
54 | | -import org.junit.Ignore; |
55 | 54 | import org.junit.Rule; |
56 | 55 | import org.junit.Test; |
57 | 56 |
|
|
86 | 85 | import com.ibm.ws.repository.transport.client.DataModelSerializer; |
87 | 86 | import com.ibm.ws.repository.transport.model.AppliesToFilterInfo; |
88 | 87 | import com.ibm.ws.repository.transport.model.Asset; |
89 | | -import com.ibm.ws.repository.transport.model.JavaSEVersionRequirements; |
90 | 88 | import com.ibm.ws.repository.transport.model.WlpInformation; |
91 | 89 |
|
92 | 90 | /** |
|
95 | 93 | */ |
96 | 94 | public class MassiveEsaTest { |
97 | 95 |
|
98 | | - private static final String EE_7_FEATURE_COMPATIBILITY = "Java SE 7, Java SE 8"; |
99 | | - private static final String EE_6_FEATURE_COMPATIBILITY = "Java SE 6, Java SE 7, Java SE 8"; |
100 | | - |
101 | 96 | private static final String ENABLES = "Features that this feature enables"; |
102 | 97 | private static final String ENABLED_BY = "Features that enable this feature"; |
103 | 98 | private static final String SUPERSEDES = "Features that this feature supersedes"; |
@@ -183,93 +178,6 @@ public void testRealFeature() throws Throwable { |
183 | 178 | assertEquals("Wrong attachment size", (long) esaSizes.get("wlp/lafiles/LA_zh"), license.getSize()); |
184 | 179 | } |
185 | 180 |
|
186 | | - @Test |
187 | | - public void testJava6Feature() throws Throwable { |
188 | | - File java6_esa = new File(esaDir, "requires_java6.esa"); |
189 | | - EsaResourceImpl java6Feature = (EsaResourceImpl) uploadAsset(java6_esa); |
190 | | - |
191 | | - JavaSEVersionRequirements reqs = java6Feature.getJavaSEVersionRequirements(); |
192 | | - assertEquals("Incorrect minimum version", "1.6.0", reqs.getMinVersion()); |
193 | | - assertNull("Max version should be null, actually was: " + reqs.getMaxVersion(), reqs.getMaxVersion()); |
194 | | - assertEquals("Display version was incorrect", EE_6_FEATURE_COMPATIBILITY, reqs.getVersionDisplayString()); |
195 | | - } |
196 | | - |
197 | | - @Test |
198 | | - public void testJava7Feature() throws Throwable { |
199 | | - File java7_esa = new File(esaDir, "requires_java7.esa"); |
200 | | - EsaResourceImpl java7Feature = (EsaResourceImpl) uploadAsset(java7_esa); |
201 | | - |
202 | | - JavaSEVersionRequirements reqs = java7Feature.getJavaSEVersionRequirements(); |
203 | | - assertEquals("Incorrect minimum version", "1.7.0", reqs.getMinVersion()); |
204 | | - assertNull("Max version should be null, actually was: " + reqs.getMaxVersion(), reqs.getMaxVersion()); |
205 | | - assertEquals("Display version was incorrect", EE_7_FEATURE_COMPATIBILITY, reqs.getVersionDisplayString()); |
206 | | - } |
207 | | - |
208 | | - /** |
209 | | - * Test an esa where a bundle has an '=' requirement for the java version, rather than an |
210 | | - * implied exact version from a combination of intersecting ranges of the various bundles. |
211 | | - * Should still just end up with a minimum required, as maximums don't need to be specified |
212 | | - * |
213 | | - * @throws Throwable |
214 | | - */ |
215 | | - @Test |
216 | | - public void testExactJavaRequirementFeature() throws Throwable { |
217 | | - File broken_esa = new File(esaDir, "requires_java7_exact.esa"); |
218 | | - EsaResourceImpl java7Feature = (EsaResourceImpl) uploadAsset(broken_esa); |
219 | | - JavaSEVersionRequirements reqs = java7Feature.getJavaSEVersionRequirements(); |
220 | | - assertEquals("Incorrect minimum version", "1.7.0", reqs.getMinVersion()); |
221 | | - assertEquals("Incorrect maximum version", "1.7.0", reqs.getMaxVersion()); |
222 | | - assertEquals("Display version was incorrect", EE_7_FEATURE_COMPATIBILITY, reqs.getVersionDisplayString()); |
223 | | - |
224 | | - } |
225 | | - |
226 | | - @Test |
227 | | - public void testIncompatibleVersionsFeature() throws Throwable { |
228 | | - File java7_esa = new File(esaDir, "requires_incompatible_versions.esa"); |
229 | | - try { |
230 | | - uploadAsset(java7_esa); |
231 | | - } catch (RepositoryException e) { |
232 | | - assertEquals("The message from the exception was unexpected.", |
233 | | - "ESA requires_incompatible_versions.esa is invalid, two bundles require incompatible JavaSE versions" |
234 | | - , e.getMessage()); |
235 | | - return; |
236 | | - } |
237 | | - fail("The ESA is invalid so an exception should have been thrown"); |
238 | | - } |
239 | | - |
240 | | - @Test |
241 | | - public void testMultipleVersionFeature() throws Throwable { |
242 | | - File java7_esa = new File(esaDir, "requires_multiple_versions.esa"); |
243 | | - EsaResourceImpl java7Feature = (EsaResourceImpl) uploadAsset(java7_esa); |
244 | | - |
245 | | - JavaSEVersionRequirements reqs = java7Feature.getJavaSEVersionRequirements(); |
246 | | - assertEquals("Incorrect minimum version", "1.7.0", reqs.getMinVersion()); |
247 | | - assertNull("Incorrect maxmimum version, should have been null", reqs.getMaxVersion()); |
248 | | - assertEquals("Incorrect minimum version", EE_7_FEATURE_COMPATIBILITY, reqs.getVersionDisplayString()); |
249 | | - } |
250 | | - |
251 | | - /** |
252 | | - * The Java version required by the ESA needs converting into something displayable. If the |
253 | | - * required version is unexpected and hence can't be converted to a nice format for display, an |
254 | | - * exception should be thrown |
255 | | - * |
256 | | - * @throws Throwable |
257 | | - */ |
258 | | - @Test |
259 | | - public void testBadJavaVersionFeature() throws Throwable { |
260 | | - File java7_esa = new File(esaDir, "requires_bad_java_version.esa"); |
261 | | - try { |
262 | | - uploadAsset(java7_esa); |
263 | | - } catch (RepositoryException e) { |
264 | | - assertEquals("Incorrect message in the exception", |
265 | | - "Lower bound to Java version range is expected to be either Java 6 or Java 7. Actually was 5.9.0", e.getMessage()); |
266 | | - return; |
267 | | - } |
268 | | - |
269 | | - fail("An exception should be thrown if an unexpected Java version is required"); |
270 | | - |
271 | | - } |
272 | | - |
273 | 181 | @Test |
274 | 182 | public void testMainAttachment() throws Throwable { |
275 | 183 | File simpleESA = new File(esaDir, "simple.esa"); |
|
0 commit comments