Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Waibel2017-01-24 19:18:25 +0000
committerFlorian Waibel2017-01-24 19:18:25 +0000
commit2448d9eb6711206e751da3c2f893f7e48c798c5a (patch)
treebcb74f7aa1246271fab4d26574a22efa1e6a268b
parent4123399c1ab0b6b5b32bcbbe7323b08e1a67b26d (diff)
downloadorg.eclipse.virgo.kernel-2448d9eb6711206e751da3c2f893f7e48c798c5a.tar.gz
org.eclipse.virgo.kernel-2448d9eb6711206e751da3c2f893f7e48c798c5a.tar.xz
org.eclipse.virgo.kernel-2448d9eb6711206e751da3c2f893f7e48c798c5a.zip
510305 - Update Spring Framework to 4.2.9.RELEASE
Update Spring Framework versions used in (integration) tests.
-rw-r--r--org.eclipse.virgo.kernel.userregion/src/test/java/org/eclipse/virgo/kernel/userregion/internal/equinox/EquinoxOsgiFrameworkTests.java6
-rw-r--r--org.eclipse.virgo.kernel.userregion/src/test/java/org/eclipse/virgo/kernel/userregion/internal/importexpansion/ImportExpansionHandlerTests.java40
-rw-r--r--org.eclipse.virgo.kernel.userregion/src/test/resources/silht/libraries/spring.libd7
3 files changed, 26 insertions, 27 deletions
diff --git a/org.eclipse.virgo.kernel.userregion/src/test/java/org/eclipse/virgo/kernel/userregion/internal/equinox/EquinoxOsgiFrameworkTests.java b/org.eclipse.virgo.kernel.userregion/src/test/java/org/eclipse/virgo/kernel/userregion/internal/equinox/EquinoxOsgiFrameworkTests.java
index fdc2174e..c01d3718 100644
--- a/org.eclipse.virgo.kernel.userregion/src/test/java/org/eclipse/virgo/kernel/userregion/internal/equinox/EquinoxOsgiFrameworkTests.java
+++ b/org.eclipse.virgo.kernel.userregion/src/test/java/org/eclipse/virgo/kernel/userregion/internal/equinox/EquinoxOsgiFrameworkTests.java
@@ -32,7 +32,7 @@ import org.eclipse.virgo.kernel.userregion.internal.equinox.KernelBundleClassLoa
/**
*/
public class EquinoxOsgiFrameworkTests extends AbstractOsgiFrameworkLaunchingTests {
-
+
@Override
protected String getRepositoryConfigDirectory() {
return new File("src/test/resources/config/EquinoxOsgiFrameworkTests").getAbsolutePath();
@@ -53,7 +53,7 @@ public class EquinoxOsgiFrameworkTests extends AbstractOsgiFrameworkLaunchingTes
assertEquals(0, b.getBundleId());
}
- @Test(expected = BundleClassLoaderUnavailableException.class)
+ @Test(expected = BundleClassLoaderUnavailableException.class)
public void testGetClassLoaderFromUnresolved() throws Exception {
Bundle faultyBundle = this.framework.getBundleContext().installBundle(new File("src/test/resources/EquinoxOsgiFrameworkTests/faulty").toURI().toString());
assertEquals(Bundle.INSTALLED, faultyBundle.getState());
@@ -98,6 +98,6 @@ public class EquinoxOsgiFrameworkTests extends AbstractOsgiFrameworkLaunchingTes
private Bundle installSpringCore(EquinoxOsgiFramework osgi) throws BundleException {
osgi.getBundleContext().installBundle("file:///" + new File(System.getProperty("user.home") + "/.gradle/caches/modules-2/files-2.1/org.eclipse.virgo.mirrored/org.apache.commons.logging/1.2.0/16f574f7c054451477d7fc9d1f294e22b70a8eba/org.apache.commons.logging-1.2.0.jar").getAbsolutePath());
osgi.getBundleContext().installBundle("file:///" + new File(System.getProperty("user.home") + "/.gradle/caches/modules-2/files-2.1/org.eclipse.virgo.mirrored/org.apache.commons.codec/1.10.0/8aff50e99bd7e53f8c4f5fe45c2a63f1d47dd19c/org.apache.commons.codec-1.10.0.jar").getAbsolutePath());
- return osgi.getBundleContext().installBundle("file:///" + new File(System.getProperty("user.home") + "/.gradle/caches/modules-2/files-2.1/org.eclipse.virgo.mirrored/org.springframework.core/4.2.4.RELEASE/b8fe7a25e1f006af08e447e2e11560eb3adbae3d/org.springframework.core-4.2.4.RELEASE.jar").getAbsolutePath());
+ return osgi.getBundleContext().installBundle("file:///" + new File(System.getProperty("user.home") + "/.gradle/caches/modules-2/files-2.1/org.eclipse.virgo.mirrored/org.springframework.core/4.2.9.RELEASE/a8d6a7492a2dabd36ab8955ff34da628697f5ea/org.springframework.core-4.2.9.RELEASE.jar").getAbsolutePath());
}
}
diff --git a/org.eclipse.virgo.kernel.userregion/src/test/java/org/eclipse/virgo/kernel/userregion/internal/importexpansion/ImportExpansionHandlerTests.java b/org.eclipse.virgo.kernel.userregion/src/test/java/org/eclipse/virgo/kernel/userregion/internal/importexpansion/ImportExpansionHandlerTests.java
index e0e44bd3..4f79d135 100644
--- a/org.eclipse.virgo.kernel.userregion/src/test/java/org/eclipse/virgo/kernel/userregion/internal/importexpansion/ImportExpansionHandlerTests.java
+++ b/org.eclipse.virgo.kernel.userregion/src/test/java/org/eclipse/virgo/kernel/userregion/internal/importexpansion/ImportExpansionHandlerTests.java
@@ -73,8 +73,8 @@ public class ImportExpansionHandlerTests {
BundleBridge bundleBridge = new BundleBridge(new StubHashGenerator());
LibraryBridge libraryBridge = new LibraryBridge(new StubHashGenerator());
- this.repository.addArtifactDescriptor(bundleBridge.generateArtifactDescriptor(new File(System.getProperty("user.home") + "/.gradle/caches/modules-2/files-2.1/org.springframework/org.springframework.core/3.1.0.RELEASE/3a18c725dd321e457cfb48547d40c2862216bb3b/org.springframework.core-3.1.0.RELEASE.jar")));
- this.repository.addArtifactDescriptor(bundleBridge.generateArtifactDescriptor(new File(System.getProperty("user.home") + "/.gradle/caches/modules-2/files-2.1/org.springframework/org.springframework.beans/3.1.0.RELEASE/d12bb11cc2469cca2d8ba33d86d188733544d7e0/org.springframework.beans-3.1.0.RELEASE.jar")));
+ this.repository.addArtifactDescriptor(bundleBridge.generateArtifactDescriptor(new File(System.getProperty("user.home") + "/.gradle/caches/modules-2/files-2.1/org.eclipse.virgo.mirrored/org.springframework.core/4.2.9.RELEASE/a8d6a7492a2dabd36ab8955ff34da628697f5ea/org.springframework.core-4.2.9.RELEASE.jar")));
+ this.repository.addArtifactDescriptor(bundleBridge.generateArtifactDescriptor(new File(System.getProperty("user.home") + "/.gradle/caches/modules-2/files-2.1/org.eclipse.virgo.mirrored/org.springframework.beans/4.2.9.RELEASE/2134af7cf6177d253ffb1e07d3eb6468b9fdffb6/org.springframework.beans-4.2.9.RELEASE.jar")));
this.repository.addArtifactDescriptor(bundleBridge.generateArtifactDescriptor(new File("src/test/resources/silht/bundles/fragmentOne")));
this.repository.addArtifactDescriptor(bundleBridge.generateArtifactDescriptor(new File("src/test/resources/silht/bundles/fragmentTwo")));
this.repository.addArtifactDescriptor(bundleBridge.generateArtifactDescriptor(new File("src/test/resources/silht/bundles/fragmentThree")));
@@ -94,7 +94,7 @@ public class ImportExpansionHandlerTests {
ImportedBundle bundleImport = createAndStoreMock(ImportedBundle.class, mocks);
expect(bundleImport.getBundleSymbolicName()).andReturn("org.springframework.core").atLeastOnce();
- expect(bundleImport.getVersion()).andReturn(new VersionRange("[3.1,4)")).atLeastOnce();
+ expect(bundleImport.getVersion()).andReturn(new VersionRange("[4.2,5)")).atLeastOnce();
expect(bundleImport.isApplicationImportScope()).andReturn(false).atLeastOnce();
expect(bundleImport.getResolution()).andReturn(Resolution.MANDATORY).atLeastOnce();
@@ -108,13 +108,13 @@ public class ImportExpansionHandlerTests {
verifyMocks(mocks);
- assertEquals(20, bundleManifest.getImportPackage().getImportedPackages().size());
+ assertTrue(bundleManifest.getImportPackage().getImportedPackages().size() > 19);
List<ImportedPackage> packageImports = bundleManifest.getImportPackage().getImportedPackages();
for (ImportedPackage packageImport : packageImports) {
Map<String, String> attributes = packageImport.getAttributes();
assertTrue("org.springframework.core".equals(attributes.get("bundle-symbolic-name")));
- assertEquals(new VersionRange("[3.1.0.RELEASE,3.1.0.RELEASE]"), new VersionRange(attributes.get("bundle-version")));
+ assertEquals(new VersionRange("[4.2.9.RELEASE,4.2.9.RELEASE]"), new VersionRange(attributes.get("bundle-version")));
}
}
@@ -126,7 +126,7 @@ public class ImportExpansionHandlerTests {
ImportedLibrary libraryImport = createAndStoreMock(ImportedLibrary.class, mocks);
expect(libraryImport.getLibrarySymbolicName()).andReturn("org.springframework").atLeastOnce();
- expect(libraryImport.getVersion()).andReturn(new VersionRange("[3.1,4)")).atLeastOnce();
+ expect(libraryImport.getVersion()).andReturn(new VersionRange("[4.2,5)")).atLeastOnce();
expect(libraryImport.getResolution()).andReturn(Resolution.MANDATORY).anyTimes();
ImportExpansionHandler handler = new ImportExpansionHandler(repository, packagesExportedBySystemBundle, new MockEventLogger());
@@ -139,7 +139,7 @@ public class ImportExpansionHandlerTests {
verifyMocks(mocks);
- assertEquals(34, bundleManifest.getImportPackage().getImportedPackages().size());
+ assertTrue(bundleManifest.getImportPackage().getImportedPackages().size() > 33);
List<ImportedPackage> packageImports = bundleManifest.getImportPackage().getImportedPackages();
for (ImportedPackage packageImport : packageImports) {
@@ -149,7 +149,7 @@ public class ImportExpansionHandlerTests {
} else {
assertTrue("org.springframework.core".equals(attributes.get("bundle-symbolic-name")));
}
- assertEquals(new VersionRange("[3.1.0.RELEASE,3.1.0.RELEASE]"), new VersionRange(attributes.get("bundle-version")));
+ assertEquals(new VersionRange("[4.2.9.RELEASE,4.2.9.RELEASE]"), new VersionRange(attributes.get("bundle-version")));
}
}
@@ -182,7 +182,7 @@ public class ImportExpansionHandlerTests {
assertEquals(new VersionRange("[1.0, 2.0)"), new VersionRange(attributes.get("bundle-version")));
assertEquals("com.foo.host", packageImport.getPackageName());
}
-
+
@Test
public void basicImportFragmentBundleSpecifyingExactBundleVersionRange() throws UnableToSatisfyDependenciesException {
List<Object> mocks = new ArrayList<Object>();
@@ -325,9 +325,9 @@ public class ImportExpansionHandlerTests {
/**
* Test the expansion of the following import:
- *
+ *
* Import-Library: com.foo;bundle-version="[1.0,2.0)"
- *
+ *
* @throws UnableToSatisfyDependenciesException
*/
@Test
@@ -447,7 +447,7 @@ public class ImportExpansionHandlerTests {
ImportedBundle bundleImport = createAndStoreMock(ImportedBundle.class, mocks);
expect(bundleImport.getBundleSymbolicName()).andReturn("org.springframework.core").atLeastOnce();
- expect(bundleImport.getVersion()).andReturn(new VersionRange("[3.1,4)")).atLeastOnce();
+ expect(bundleImport.getVersion()).andReturn(new VersionRange("[4.2,5)")).atLeastOnce();
expect(bundleImport.getResolution()).andReturn(Resolution.MANDATORY).atLeastOnce();
expect(bundleImport.isApplicationImportScope()).andReturn(false);
@@ -456,12 +456,12 @@ public class ImportExpansionHandlerTests {
replayMocks(mocks);
BundleManifest bundleManifest = BundleManifestFactory.createBundleManifest(new StringReader(
- "Manifest-Version: 1.0, Bundle-SymbolicName: B\nImport-Package: org.springframework.core;version=\"[2.5,2.6)\""));
+ "Manifest-Version: 1.0, Bundle-SymbolicName: B\nImport-Package: org.springframework.core;version=\"[4.5,4.6)\""));
handler.expandImports(Arrays.asList(new ImportedLibrary[0]), Arrays.asList(new ImportedBundle[] { bundleImport }), bundleManifest);
verifyMocks(mocks);
- assertEquals(20, bundleManifest.getImportPackage().getImportedPackages().size());
+ assertTrue(bundleManifest.getImportPackage().getImportedPackages().size() > 19);
}
@Test
@@ -470,19 +470,19 @@ public class ImportExpansionHandlerTests {
ImportedLibrary libraryImport = createAndStoreMock(ImportedLibrary.class, mocks);
expect(libraryImport.getLibrarySymbolicName()).andReturn("org.springframework").atLeastOnce();
- expect(libraryImport.getVersion()).andReturn(new VersionRange("[3.1,4)")).atLeastOnce();
+ expect(libraryImport.getVersion()).andReturn(new VersionRange("[4.2,5)")).atLeastOnce();
ImportExpansionHandler handler = new ImportExpansionHandler(repository, packagesExportedBySystemBundle, new MockEventLogger());
replayMocks(mocks);
BundleManifest bundleManifest = BundleManifestFactory.createBundleManifest(new StringReader(
- "Manifest-Version: 1.0\nBundle-SymbolicName: B\nImport-Package: org.springframework.core;version=\"[2.5,2.6)\""));
+ "Manifest-Version: 1.0\nBundle-SymbolicName: B\nImport-Package: org.springframework.core;version=\"[4.5,4.6)\""));
handler.expandImports(Arrays.asList(new ImportedLibrary[] { libraryImport }), Arrays.asList(new ImportedBundle[0]), bundleManifest);
verifyMocks(mocks);
- assertEquals(34, bundleManifest.getImportPackage().getImportedPackages().size());
+ assertTrue(bundleManifest.getImportPackage().getImportedPackages().size() > 33);
}
@Test(expected = UnableToSatisfyDependenciesException.class)
@@ -521,13 +521,13 @@ public class ImportExpansionHandlerTests {
ImportedBundle bundleImport = createAndStoreMock(ImportedBundle.class, mocks);
expect(bundleImport.getBundleSymbolicName()).andReturn("org.springframework.core").atLeastOnce();
- expect(bundleImport.getVersion()).andReturn(new VersionRange("[3.1,4)")).atLeastOnce();
+ expect(bundleImport.getVersion()).andReturn(new VersionRange("[4.2,5)")).atLeastOnce();
expect(bundleImport.isApplicationImportScope()).andReturn(false).atLeastOnce();
expect(bundleImport.getResolution()).andReturn(Resolution.MANDATORY).atLeastOnce();
ImportedLibrary libraryImport = createAndStoreMock(ImportedLibrary.class, mocks);
expect(libraryImport.getLibrarySymbolicName()).andReturn("org.springframework").atLeastOnce();
- expect(libraryImport.getVersion()).andReturn(new VersionRange("[3.1,4)")).atLeastOnce();
+ expect(libraryImport.getVersion()).andReturn(new VersionRange("[4.2,5)")).atLeastOnce();
expect(libraryImport.getResolution()).andReturn(Resolution.MANDATORY).atLeastOnce();
ImportExpansionHandler handler = new ImportExpansionHandler(repository, packagesExportedBySystemBundle, new MockEventLogger());
@@ -673,7 +673,7 @@ public class ImportExpansionHandlerTests {
assertImported(bundleManifest, Arrays.asList(new String[] { "a" }), Arrays.asList(new String[] { "1.0.0" }));
}
-
+
private static <T> T createAndStoreMock(Class<T> classToMock, List<Object> mocks) {
T mock = createMock(classToMock);
mocks.add(mock);
diff --git a/org.eclipse.virgo.kernel.userregion/src/test/resources/silht/libraries/spring.libd b/org.eclipse.virgo.kernel.userregion/src/test/resources/silht/libraries/spring.libd
index 3e859c7f..0a8bfd67 100644
--- a/org.eclipse.virgo.kernel.userregion/src/test/resources/silht/libraries/spring.libd
+++ b/org.eclipse.virgo.kernel.userregion/src/test/resources/silht/libraries/spring.libd
@@ -1,5 +1,4 @@
Library-SymbolicName: org.springframework
-Library-Version: 3.1.0
-Import-Bundle: org.springframework.core;version="[3.1.0.RELEASE,3.1.0.RELEASE]",
- org.springframework.beans;version="[3.1.0.RELEASE,3.1.0.RELEASE]"
- \ No newline at end of file
+Library-Version: 4.2.9
+Import-Bundle: org.springframework.core;version="[4.2.9.RELEASE,4.2.9.RELEASE]",
+ org.springframework.beans;version="[4.2.9.RELEASE,4.2.9.RELEASE]"

Back to the top