Author: [email protected]
Date: Thu Jan 26 10:38:14 2012
New Revision: 2002
Log:
Small cleanups.
Modified:
trunk/amdatu-core/itest/tests/src/test/java/org/amdatu/core/itest/tests/tenant/MultiTenantTest.java
Modified:
trunk/amdatu-core/itest/tests/src/test/java/org/amdatu/core/itest/tests/tenant/MultiTenantTest.java
==============================================================================
---
trunk/amdatu-core/itest/tests/src/test/java/org/amdatu/core/itest/tests/tenant/MultiTenantTest.java
(original)
+++
trunk/amdatu-core/itest/tests/src/test/java/org/amdatu/core/itest/tests/tenant/MultiTenantTest.java
Thu Jan 26 10:38:14 2012
@@ -220,7 +220,7 @@
@Test
public void
testAddingMultiTenantAwareServiceCausesNewServiceRegistrations() throws
Exception {
String tenantId = generateTenantId();
-
+
Properties properties = createTenantConfiguration(tenantId);
updateTenantConfig(properties);
@@ -253,16 +253,16 @@
@Test
public void testMultiTenantAwareServiceOnlySeesItsOwnServices() throws
Exception {
String tenantId = generateTenantId();
-
+
List<String> msg = m_eventHandler.getMessages();
-
+
Properties properties = createTenantConfiguration(tenantId);
updateTenantConfig(properties);
msg = m_eventHandler.getMessages();
assertNotNull(msg);
- assertStringFound(msg, "START{tenant_id;" +tenantId + "}");
+ assertStringFound(msg, "START{tenant_id;" + tenantId +
"}{tenant_name;Tenant " + tenantId + "}");
}
/**
@@ -273,11 +273,12 @@
@Test
public void
testObtainMultiTenantServiceInstanceFailsForNonMultiTenantService() throws
Exception {
String tenantId = generateTenantId();
-
+
Properties properties = createTenantConfiguration(tenantId);
updateTenantConfig(properties);
- ServiceReference[] serviceRefs =
m_bundleContext.getServiceReferences(MyDependentService.class.getName(),
"(tenant_id=" + tenantId + ")");
+ ServiceReference[] serviceRefs =
+
m_bundleContext.getServiceReferences(MyDependentService.class.getName(),
"(tenant_id=" + tenantId + ")");
assertNull(serviceRefs);
}
@@ -290,14 +291,15 @@
@Test
public void
testObtainPlatformServiceInstanceSucceedsForNonMultiTenantService() throws
Exception {
String tenantId = generateTenantId();
-
+
Properties properties = createTenantConfiguration(tenantId);
updateTenantConfig(properties);
- ServiceReference serviceRef =
m_bundleContext.getServiceReference(MyDependentService.class.getName());
+ ServiceReference[] serviceRef =
+
m_bundleContext.getServiceReferences(MyDependentService.class.getName(),
"(tenant_id=*)");
assertNotNull("Failed to obtain the MT-platform service?!",
serviceRef);
}
-
+
/**
* Tests that when a multi-tenant aware service is registered, multiple
service registrations are made, one for each tenant.
*
@@ -307,7 +309,7 @@
public void
testRemovingMultiTenantAwareServiceCausesServiceDeregistrations() throws
Exception {
String tenantId = generateTenantId();
List<String> msg = m_eventHandler.getMessages();
-
+
Properties properties = createTenantConfiguration(tenantId);
Configuration config = updateTenantConfig(properties);
@@ -322,10 +324,10 @@
// A non-MT aware bundle should be able to see *all* service
registrations...
assertEquals(expectedServiceCount - 1,
countAllServices(m_bundleContext, MyDependentService.class));
-
+
msg = m_eventHandler.getMessages();
- assertStringFound(msg, "STOP{tenant_id;" + tenantId + "}");
+ assertStringFound(msg, "STOP{tenant_id;" + tenantId +
"}{tenant_name;Tenant " + tenantId + "}");
}
/**
_______________________________________________
Amdatu-commits mailing list
[email protected]
http://lists.amdatu.org/mailman/listinfo/amdatu-commits