Author: [email protected]
Date: Tue Jun 28 14:05:22 2011
New Revision: 1196
Log:
AMDATU-393 upgraded parent to dm 3.0.0 / fix some unit tests that fell over
Modified:
trunk/amdatu-core/tenantstore-fs/src/test/java/org/amdatu/core/tenantstore/fs/osgi/FSTenantStorageProviderActivatorTest.java
trunk/amdatu-core/useradminstore-fs/src/test/java/org/amdatu/core/useradminstore/fs/osgi/FSUserAdminStorageProviderActivatorTest.java
trunk/amdatu-parent/pom.xml
Modified:
trunk/amdatu-core/tenantstore-fs/src/test/java/org/amdatu/core/tenantstore/fs/osgi/FSTenantStorageProviderActivatorTest.java
==============================================================================
---
trunk/amdatu-core/tenantstore-fs/src/test/java/org/amdatu/core/tenantstore/fs/osgi/FSTenantStorageProviderActivatorTest.java
(original)
+++
trunk/amdatu-core/tenantstore-fs/src/test/java/org/amdatu/core/tenantstore/fs/osgi/FSTenantStorageProviderActivatorTest.java
Tue Jun 28 14:05:22 2011
@@ -99,11 +99,6 @@
allowing(bundleContext).getServiceReferences(with(LogService.class.getName()),
with(any(String.class)));
will(returnValue(null));
- // assert that DM registers a component and store it for
callback
-
one(bundleContext).registerService(with(ComponentDeclaration.class.getName()),
- with(aNonNull(Object.class)), with(any(Dictionary.class)));
- will(addRegisteredService());
-
// assert that DM registers a managed service and store it for
callback
one(bundleContext).registerService(with(ManagedService.class.getName()),
with(aNonNull(Object.class)), with(any(Dictionary.class)));
@@ -123,10 +118,10 @@
// simulate config admin callback
Dictionary<String, String> dict = new Hashtable<String, String>();
dict.put(FSTenantStorageProvider.DATA_DIRECTORY,
bundleStorageDir.getAbsolutePath());
- ((ManagedService) m_registeredServices.get(1)).updated(dict);
+ ((ManagedService) m_registeredServices.get(0)).updated(dict);
// invoke the storage provider to get it persist something
- TenantStorageProvider provider = (TenantStorageProvider)
m_registeredServices.get(2);
+ TenantStorageProvider provider = (TenantStorageProvider)
m_registeredServices.get(1);
provider.store(new TenantEntity("1", "Bram"));
// assert that the bundleContext storage directory was used
@@ -163,11 +158,6 @@
allowing(bundleContext).getServiceReferences(with(LogService.class.getName()),
with(any(String.class)));
will(returnValue(null));
- // assert that DM registers a component and store it for
callback
-
one(bundleContext).registerService(with(ComponentDeclaration.class.getName()),
- with(aNonNull(Object.class)), with(any(Dictionary.class)));
- will(addRegisteredService());
-
// assert that DM registers a managed service and store it for
callback
one(bundleContext).registerService(with(ManagedService.class.getName()),
with(aNonNull(Object.class)), with(any(Dictionary.class)));
@@ -188,10 +178,10 @@
System.setProperty("user.dir", JAVA_IO_TMPDIR);
Dictionary<String, String> dict = new Hashtable<String, String>();
dict.put(FSTenantStorageProvider.DATA_DIRECTORY,
relativeStorageDirectoryPath);
- ((ManagedService) m_registeredServices.get(1)).updated(dict);
+ ((ManagedService) m_registeredServices.get(0)).updated(dict);
// invoke the storage provider to get it persist something
- TenantStorageProvider provider = (TenantStorageProvider)
m_registeredServices.get(2);
+ TenantStorageProvider provider = (TenantStorageProvider)
m_registeredServices.get(1);
provider.store(new TenantEntity("1", "Bram"));
// assert that the correct storage directory was actually used
Modified:
trunk/amdatu-core/useradminstore-fs/src/test/java/org/amdatu/core/useradminstore/fs/osgi/FSUserAdminStorageProviderActivatorTest.java
==============================================================================
---
trunk/amdatu-core/useradminstore-fs/src/test/java/org/amdatu/core/useradminstore/fs/osgi/FSUserAdminStorageProviderActivatorTest.java
(original)
+++
trunk/amdatu-core/useradminstore-fs/src/test/java/org/amdatu/core/useradminstore/fs/osgi/FSUserAdminStorageProviderActivatorTest.java
Tue Jun 28 14:05:22 2011
@@ -121,10 +121,14 @@
allowing(tenantServiceReference).getPropertyKeys();
will(returnValue(new String[] {}));
-
allowing(tenantServiceReference).getProperty(Constants.SERVICE_ID);
- will(returnValue(123));
+
allowing(tenantServiceReference).getProperty(Constants.SERVICE_ID);
+ will(returnValue(123l));
+
allowing(tenantServiceReference).getProperty(Constants.SERVICE_RANKING);
+ will(returnValue(1));
allowing(tenantServiceReference).getBundle();
will(returnValue(tenantBundle));
+
allowing(tenantServiceReference).getProperty("org.apache.felix.dependencymanager.aspect");
+ will(returnValue(null));
// assert that the adaptor will get the tenant service
one(bundleContext).getServiceReferences(with(Tenant.class.getName()),
with(any(String.class)));
@@ -139,9 +143,13 @@
allowing(configServiceReference).getPropertyKeys();
will(returnValue(new String[] {}));
allowing(configServiceReference).getProperty(Constants.SERVICE_ID);
- will(returnValue(1234));
+ will(returnValue(1234l));
+
allowing(configServiceReference).getProperty(Constants.SERVICE_RANKING);
+ will(returnValue(1));
allowing(configServiceReference).getBundle();
will(returnValue(configBundle));
+
allowing(configServiceReference).getProperty("org.apache.felix.dependencymanager.aspect");
+ will(returnValue(null));
// assert that the service will get the config service
allowing(bundleContext).getServiceReference(with(FSUserAdminStorageConfig.class.getName()));
@@ -151,10 +159,6 @@
allowing(bundleContext).getService(with(configServiceReference));
will(returnValue(configService));
- // assert that DM registers a component and store it for
callback
-
allowing(bundleContext).registerService(with(ComponentDeclaration.class.getName()),
- with(aNonNull(Object.class)), with(any(Dictionary.class)));
-
// assert that DM registers a managed service and store it for
callback
allowing(bundleContext).registerService(with(ManagedService.class.getName()),
with(aNonNull(Object.class)), with(any(Dictionary.class)));
@@ -237,9 +241,13 @@
allowing(tenantServiceReference).getPropertyKeys();
will(returnValue(new String[] {}));
allowing(tenantServiceReference).getProperty(Constants.SERVICE_ID);
- will(returnValue(123));
+ will(returnValue(123l));
+
allowing(tenantServiceReference).getProperty(Constants.SERVICE_RANKING);
+ will(returnValue(1));
allowing(tenantServiceReference).getBundle();
will(returnValue(tenantBundle));
+
allowing(tenantServiceReference).getProperty("org.apache.felix.dependencymanager.aspect");
+ will(returnValue(null));
// assert that the adaptor will get the tenant service
one(bundleContext).getServiceReferences(with(Tenant.class.getName()),
with(any(String.class)));
@@ -254,9 +262,13 @@
allowing(configServiceReference).getPropertyKeys();
will(returnValue(new String[] {}));
allowing(configServiceReference).getProperty(Constants.SERVICE_ID);
- will(returnValue(1234));
+ will(returnValue(1234l));
+
allowing(configServiceReference).getProperty(Constants.SERVICE_RANKING);
+ will(returnValue(1));
allowing(configServiceReference).getBundle();
- will(returnValue(configBundle));
+ will(returnValue(configBundle));
+
allowing(configServiceReference).getProperty("org.apache.felix.dependencymanager.aspect");
+ will(returnValue(null));
// assert that the service will get the config service
allowing(bundleContext).getServiceReference(with(FSUserAdminStorageConfig.class.getName()));
@@ -266,10 +278,6 @@
allowing(bundleContext).getService(with(configServiceReference));
will(returnValue(configService));
- // assert that DM registers a component and store it for
callback
-
allowing(bundleContext).registerService(with(ComponentDeclaration.class.getName()),
- with(aNonNull(Object.class)), with(any(Dictionary.class)));
-
// assert that DM registers a managed service and store it for
callback
allowing(bundleContext).registerService(with(ManagedService.class.getName()),
with(aNonNull(Object.class)), with(any(Dictionary.class)));
Modified: trunk/amdatu-parent/pom.xml
==============================================================================
--- trunk/amdatu-parent/pom.xml (original)
+++ trunk/amdatu-parent/pom.xml Tue Jun 28 14:05:22 2011
@@ -32,7 +32,7 @@
<javax.servlet.version>2.5</javax.servlet.version>
<org.osgi.version>4.2.0</org.osgi.version>
<jsr311-api.version>1.1.1</jsr311-api.version>
-
<org.apache.felix.dependencymanager.version>3.0.0-r1062017</org.apache.felix.dependencymanager.version>
+
<org.apache.felix.dependencymanager.version>3.0.0</org.apache.felix.dependencymanager.version>
<junit.version>4.8.1</junit.version>
<jmock.version>2.5.1</jmock.version>
</properties>
_______________________________________________
Amdatu-commits mailing list
[email protected]
http://lists.amdatu.org/mailman/listinfo/amdatu-commits