Author: ivol37 at gmail.com
Date: Thu Nov 11 12:25:13 2010
New Revision: 401

Log:
[AMDATU-159] Decoupled bundles being deployed to Pax Exam such that each 
integration test only deploys bundles that it actually needs

Modified:
   
trunk/amdatu-core/cassandra-listener/src/main/java/org/amdatu/core/cassandra/listener/osgi/Activator.java
   
trunk/amdatu-core/cassandra-listener/src/main/java/org/amdatu/core/cassandra/listener/service/CassandraDaemonServiceListener.java
   
trunk/amdatu-core/cassandra-listener/src/main/java/org/amdatu/core/cassandra/listener/service/ColumnFamilyProviderListener.java
   trunk/amdatu-core/cassandra-useradminstore/pom.xml
   
trunk/integration-tests/src/test/java/org/amdatu/test/integration/base/IntegrationTestBase.java
   
trunk/integration-tests/src/test/java/org/amdatu/test/integration/tests/CassandraDaemonIntegrationTest.java
   
trunk/integration-tests/src/test/java/org/amdatu/test/integration/tests/CassandraPersistenceManagerTest.java
   
trunk/integration-tests/src/test/java/org/amdatu/test/integration/tests/HttpServiceTest.java
   
trunk/integration-tests/src/test/java/org/amdatu/test/integration/tests/TenantManagementServiceTest.java
   
trunk/integration-tests/src/test/java/org/amdatu/test/integration/tests/UserAdminStoreTest.java

Modified: 
trunk/amdatu-core/cassandra-listener/src/main/java/org/amdatu/core/cassandra/listener/osgi/Activator.java
==============================================================================
--- 
trunk/amdatu-core/cassandra-listener/src/main/java/org/amdatu/core/cassandra/listener/osgi/Activator.java
   (original)
+++ 
trunk/amdatu-core/cassandra-listener/src/main/java/org/amdatu/core/cassandra/listener/osgi/Activator.java
   Thu Nov 11 12:25:13 2010
@@ -49,6 +49,7 @@
                 .setImplementation(ColumnFamilyProviderListener.class)
                 
.add(createServiceDependency().setService(LogService.class).setRequired(true))
                 
.add(createServiceDependency().setService(CassandraDaemonService.class).setRequired(true))
+                
.add(createServiceDependency().setService(CassandraPersistenceManagerFactory.class).setRequired(true))
                 .add(
                 
createServiceDependency().setService(ColumnFamilyProvider.class).setCallbacks("onAdded",
 "onRemoved")));
     }

Modified: 
trunk/amdatu-core/cassandra-listener/src/main/java/org/amdatu/core/cassandra/listener/service/CassandraDaemonServiceListener.java
==============================================================================
--- 
trunk/amdatu-core/cassandra-listener/src/main/java/org/amdatu/core/cassandra/listener/service/CassandraDaemonServiceListener.java
   (original)
+++ 
trunk/amdatu-core/cassandra-listener/src/main/java/org/amdatu/core/cassandra/listener/service/CassandraDaemonServiceListener.java
   Thu Nov 11 12:25:13 2010
@@ -100,5 +100,6 @@
         catch (InvalidRequestException e) {
             m_logService.log(LogService.LOG_ERROR, "Failed to start 
CassandraDaemonServiceListener", e);
         }
+        m_logService.log(LogService.LOG_INFO, "Cassandra Listener started");
     }
 }

Modified: 
trunk/amdatu-core/cassandra-listener/src/main/java/org/amdatu/core/cassandra/listener/service/ColumnFamilyProviderListener.java
==============================================================================
--- 
trunk/amdatu-core/cassandra-listener/src/main/java/org/amdatu/core/cassandra/listener/service/ColumnFamilyProviderListener.java
     (original)
+++ 
trunk/amdatu-core/cassandra-listener/src/main/java/org/amdatu/core/cassandra/listener/service/ColumnFamilyProviderListener.java
     Thu Nov 11 12:25:13 2010
@@ -21,6 +21,7 @@
 import org.amdatu.core.cassandra.application.CassandraDaemonService;
 import org.amdatu.core.cassandra.listener.ColumnFamilyDefinition;
 import org.amdatu.core.cassandra.listener.ColumnFamilyProvider;
+import 
org.amdatu.core.cassandra.persistencemanager.CassandraPersistenceManagerFactory;
 import org.apache.cassandra.db.Table;
 import org.apache.cassandra.thrift.CassandraServer;
 import org.apache.cassandra.thrift.InvalidRequestException;
@@ -38,7 +39,8 @@
     // Members initialized in the constructor
     private volatile LogService m_logService;
     private volatile CassandraDaemonService m_daemonService;
-
+    private volatile CassandraPersistenceManagerFactory m_pmFactory;
+    
     public void onAdded(ColumnFamilyProvider provider) {
         try {
             CassandraServer cs = m_daemonService.getCassandraServer();
@@ -56,6 +58,10 @@
                             if (!m_daemonService.keyspaceExists(ksName)) {
                                 // Add keyspace and ColumnFamily since they do 
not yet exist
                                 m_daemonService.addKeyspace(ksName);
+                                
+                                // Register a persistence manager for this new 
keyspace
+                                
m_pmFactory.createCassandraPersistenceManager(ksName);
+                                
                                 m_logService.log(LogService.LOG_INFO, 
"Keyspace '" + ksName + "' added");
                             }
 

Modified: trunk/amdatu-core/cassandra-useradminstore/pom.xml
==============================================================================
--- trunk/amdatu-core/cassandra-useradminstore/pom.xml  (original)
+++ trunk/amdatu-core/cassandra-useradminstore/pom.xml  Thu Nov 11 12:25:13 2010
@@ -36,13 +36,7 @@
       <artifactId>persistencemanager</artifactId>
       <scope>provided</scope>
       <type>bundle</type>
-    </dependency>   
-    <dependency>
-      <groupId>org.amdatu.core</groupId>
-      <artifactId>tenant</artifactId>
-      <scope>provided</scope>
-      <type>bundle</type>
-    </dependency>       
+    </dependency>        
     <dependency>
       <groupId>com.google.code.gson</groupId>
       <artifactId>gson</artifactId>

Modified: 
trunk/integration-tests/src/test/java/org/amdatu/test/integration/base/IntegrationTestBase.java
==============================================================================
--- 
trunk/integration-tests/src/test/java/org/amdatu/test/integration/base/IntegrationTestBase.java
     (original)
+++ 
trunk/integration-tests/src/test/java/org/amdatu/test/integration/base/IntegrationTestBase.java
     Thu Nov 11 12:25:13 2010
@@ -75,66 +75,62 @@
      * This base-configure method includes all default options, and 
instantiates all of Amdatu
      */
     public Option[] configure() {
-        return options(
-            mavenConfiguration(),
+        Option[] baseOptions = 
+            options(
+                mavenConfiguration(),
+
+                // Run test in a Felix container
+                frameworks(felix()),
+
+                // Setting this system property unfortunately is necessary 
with the current Cassandra implementation
+                
systemProperty("org.osgi.framework.system.packages.extra").value("sun.misc,com.sun.management"),
+
+                // Set System property to enable Jetty for the Felix http 
bundle
+                
systemProperty("org.apache.felix.http.jettyEnabled").value("true"),
+                
systemProperty("org.apache.felix.http.whiteboardEnabled").value("true"),
+                
systemProperty("org.osgi.service.http.hostname").value(HOST_NAME),
+                systemProperty("org.osgi.service.http.port").value(new 
Integer(PORT_NR).toString()),
+
+                new VMOption("-Xmx1g"),
+                // Enable this line to allow a remote debugger to attach to 
the VM in which Pax Exam runs
+                //new 
VMOption("-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005"),
 
-        // Run test in a Felix container
-            frameworks(felix()),
-
-            // Setting this system property unfortunately is necessary with 
the current Cassandra implementation
-            
systemProperty("org.osgi.framework.system.packages.extra").value("sun.misc,com.sun.management"),
-
-            // Set System property to enable Jetty for the Felix http bundle
-            systemProperty("org.apache.felix.http.jettyEnabled").value("true"),
-            
systemProperty("org.apache.felix.http.whiteboardEnabled").value("true"),
-            systemProperty("org.osgi.service.http.hostname").value(HOST_NAME),
-            systemProperty("org.osgi.service.http.port").value(new 
Integer(PORT_NR).toString()),
-
-            new VMOption("-Xmx1g"),
-            // Enable this line to allow a remote debugger to attach to the VM 
in which Pax Exam runs
-            //new 
VMOption("-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005"),
-
-            // Install bundles we need to execute our test
-            provision(
+                // Install bundles we need to execute our test
+                provision(
                     compendium(),
                     dependencyManager(),
                     configAdmin(),
                     felixLog(),
-                    felixHttpService(),
-                    paxUserAdmin(),
-                    slingMime(),
-                    slingCommons(),
-                    felixScr(),
-                    paxSwissbox(),
-                    ops4jBaseLang(),
-                    commonsHttpClient(),
-                    commonsLogging(),
-                    commonsCodec(),
-
-                // Amdatu platform bundles
-                // TODO: this works fine when running 'mvn install' since the 
artifacts will then be deployed to the maven
-                // repository prior to running this integration test. With 
'mvn integration-test' however, artifacts will
-                // not be deployed and so this will only work when artifacts 
have been deployed to the maven repository
-                // before, possibly using outdated artifacts.
+                 
+                    // Amdatu platform bundles
+                    // TODO: this works fine when running 'mvn install' since 
the artifacts will then be deployed to the maven
+                    // repository prior to running this integration test. With 
'mvn integration-test' however, artifacts will
+                    // not be deployed and so this will only work when 
artifacts have been deployed to the maven repository
+                    // before, possibly using outdated artifacts.
                     fileBasedConfiguration(),
-                    amdatuHttpContext(),
                     amdatuConfigTemplateManager(),
-                    amdatuCassandraApplication(),
-                    amdatuCassandraListener(),
-                    amdatuCassandraPersistenceManager(),
-                    amdatuTenantService(),
-                    amdatuUserAdminCassandraStore(),
-                    amdatuJaxRs(),
-                    amdatuWink(),
                     amdatuLogHandler(),
-                    amdatuJspSupport(),
 
-                // And finally deploy ourselves
-                bundle(integrationTestJarFile().toURI().toString())
-                 ));
+                    // And finally deploy ourselves
+                    bundle(integrationTestJarFile().toURI().toString())
+                ));
+        if (provisionBundles() == null) {
+            return baseOptions;
+        }
+        Option[] options = new Option[baseOptions.length+1];
+        for (int i=0; i<baseOptions.length; i++) {
+            options[i] = baseOptions[i];
+        }
+        options[baseOptions.length] = provisionBundles();
+        return options;
     }
 
     /**
+     * Return the list of bundles here that are required to run the 
integration test.
+     */
+    protected abstract Option provisionBundles();
+
+    /**
      * Gets a list of Component objects which should be started before
      * the test can start. You can include the test class in this too, so
      * you can get the services you depend on injected.
@@ -166,7 +162,7 @@
         try {
             if (!semaphore.tryAcquire(SERVICE_TIMEOUT, TimeUnit.SECONDS)) {
                 Assert.fail("Timed out waiting for all services to get 
started, still "
-                        + (-semaphore.availablePermits()) + " to go.");
+                    + (1-semaphore.availablePermits()) + " to go.");
             }
         }
         catch (InterruptedException e) {
@@ -257,9 +253,9 @@
         FileFilter ff = new FileFilter() {
             public boolean accept(File pathname) {
                 return 
pathname.getName().startsWith("org.amdatu.test.integration-")
-                    && pathname.getName().endsWith(".jar")
-                    && !pathname.getName().endsWith("-javadoc.jar")
-                    && !pathname.getName().endsWith("-sources.jar");
+                && pathname.getName().endsWith(".jar")
+                && !pathname.getName().endsWith("-javadoc.jar")
+                && !pathname.getName().endsWith("-sources.jar");
             }
         };
         return new File("target").listFiles(ff)[0];

Modified: 
trunk/integration-tests/src/test/java/org/amdatu/test/integration/tests/CassandraDaemonIntegrationTest.java
==============================================================================
--- 
trunk/integration-tests/src/test/java/org/amdatu/test/integration/tests/CassandraDaemonIntegrationTest.java
 (original)
+++ 
trunk/integration-tests/src/test/java/org/amdatu/test/integration/tests/CassandraDaemonIntegrationTest.java
 Thu Nov 11 12:25:13 2010
@@ -16,18 +16,18 @@
  */
 package org.amdatu.test.integration.tests;
 
+import static org.ops4j.pax.exam.CoreOptions.provision;
+
 import java.util.List;
 
 import junit.framework.Assert;
 
-import org.amdatu.core.cassandra.application.CassandraConfigurationService;
 import org.amdatu.core.cassandra.application.CassandraDaemonService;
 import org.amdatu.core.cassandra.listener.ColumnFamilyDefinition.ColumnType;
 import org.amdatu.core.cassandra.listener.ColumnFamilyDefinition.CompareType;
 import 
org.amdatu.core.cassandra.persistencemanager.CassandraPersistenceManager;
-import org.amdatu.core.config.templates.ConfigTemplateManager;
-import org.amdatu.web.httpcontext.HttpContextServiceFactory;
 import org.amdatu.test.integration.base.IntegrationTestBase;
+import org.apache.cassandra.db.Table;
 import org.apache.cassandra.thrift.InvalidRequestException;
 import org.apache.felix.dm.Component;
 import org.apache.felix.dm.DependencyManager;
@@ -38,13 +38,10 @@
 import org.ops4j.pax.exam.Option;
 import org.ops4j.pax.exam.junit.Configuration;
 import org.ops4j.pax.exam.junit.JUnit4TestRunner;
-import org.osgi.service.cm.ConfigurationAdmin;
-import org.osgi.service.http.HttpService;
-import org.osgi.service.log.LogService;
 
 /**
  * This class provides an integration test for the Cassandra Daemon service.
- *
+ * 
  * @author ivol
  */
 @RunWith(JUnit4TestRunner.class)
@@ -59,17 +56,26 @@
         return super.configure();
     }
 
+    protected Option provisionBundles() {
+        // Deploy bundles needed by cassandra daemon integration test
+        return provision(
+            amdatuCassandraApplication(),
+            amdatuCassandraListener(),
+            amdatuCassandraPersistenceManager());
+    }
+
     @Override
     protected Component[] getDependencies(DependencyManager manager) {
-        // We must ensure that the keyspace 'Default' is available before we 
add our own keyspace
+        // We must ensure that the system keyspace is available before we add 
our own keyspace
         // during this integration test. If we don't, it is likely that the 
two schema updates conflict
         // with each other (see org.apache.cassandra.db.migration.Migration)
         String filter = "(" + CassandraPersistenceManager.KEYSPACE_AWARE_KEY + 
"="
-                    + CassandraPersistenceManager.DEFAULT_KEYSPACE + ")";
+            + Table.SYSTEM_TABLE + ")";
         return new Component[] { manager.createComponent()
             .setImplementation(this)
             
.add(manager.createServiceDependency().setService(CassandraDaemonService.class).setRequired(true))
-            
.add(manager.createServiceDependency().setService(CassandraPersistenceManager.class,
 filter).setRequired(true))};
+            .add(
+            
manager.createServiceDependency().setService(CassandraPersistenceManager.class, 
filter).setRequired(true)) };
     }
 
     @Before

Modified: 
trunk/integration-tests/src/test/java/org/amdatu/test/integration/tests/CassandraPersistenceManagerTest.java
==============================================================================
--- 
trunk/integration-tests/src/test/java/org/amdatu/test/integration/tests/CassandraPersistenceManagerTest.java
        (original)
+++ 
trunk/integration-tests/src/test/java/org/amdatu/test/integration/tests/CassandraPersistenceManagerTest.java
        Thu Nov 11 12:25:13 2010
@@ -16,6 +16,8 @@
  */
 package org.amdatu.test.integration.tests;
 
+import static org.ops4j.pax.exam.CoreOptions.provision;
+
 import java.io.UnsupportedEncodingException;
 import java.util.Arrays;
 
@@ -28,6 +30,7 @@
 import 
org.amdatu.core.cassandra.persistencemanager.CassandraPersistenceManager;
 import 
org.amdatu.core.cassandra.persistencemanager.CassandraPersistenceManagerFactory;
 import org.amdatu.test.integration.base.IntegrationTestBase;
+import org.apache.cassandra.db.Table;
 import org.apache.felix.dm.Component;
 import org.apache.felix.dm.DependencyManager;
 import org.junit.After;
@@ -58,6 +61,14 @@
     public Option[] configure() {
         return super.configure();
     }
+    
+    protected Option provisionBundles() {
+        // Deploy bundles needed by cassandra daemon integration test
+        return provision(
+            amdatuCassandraApplication(),
+            amdatuCassandraListener(),
+            amdatuCassandraPersistenceManager());
+    }
 
     @Override
     protected Component[] getDependencies(DependencyManager manager) {
@@ -65,14 +76,12 @@
         // during this integration test. If we don't, it is likely that the 
two schema updates conflict
         // with each other (see org.apache.cassandra.db.migration.Migration)
         String filter = "(" + CassandraPersistenceManager.KEYSPACE_AWARE_KEY + 
"="
-            + CassandraPersistenceManager.DEFAULT_KEYSPACE + ")";
-
+            + Table.SYSTEM_TABLE + ")";
         return new Component[] { manager.createComponent()
             .setImplementation(this)
             
.add(manager.createServiceDependency().setService(CassandraDaemonService.class).setRequired(true))
             
.add(manager.createServiceDependency().setService(CassandraPersistenceManager.class,
 filter).setRequired(true)) };
     }
-
    
     public void setUp() throws Exception {
         m_daemonService = getService(CassandraDaemonService.class);

Modified: 
trunk/integration-tests/src/test/java/org/amdatu/test/integration/tests/HttpServiceTest.java
==============================================================================
--- 
trunk/integration-tests/src/test/java/org/amdatu/test/integration/tests/HttpServiceTest.java
        (original)
+++ 
trunk/integration-tests/src/test/java/org/amdatu/test/integration/tests/HttpServiceTest.java
        Thu Nov 11 12:25:13 2010
@@ -16,6 +16,8 @@
  */
 package org.amdatu.test.integration.tests;
 
+import static org.ops4j.pax.exam.CoreOptions.provision;
+
 import java.io.IOException;
 import java.net.URL;
 import java.util.Dictionary;
@@ -33,9 +35,9 @@
 
 import junit.framework.Assert;
 
+import org.amdatu.test.integration.base.IntegrationTestBase;
 import org.amdatu.web.httpcontext.HttpContextServiceFactory;
 import org.amdatu.web.httpcontext.ResourceProvider;
-import org.amdatu.test.integration.base.IntegrationTestBase;
 import org.apache.commons.httpclient.Header;
 import org.apache.commons.httpclient.HttpClient;
 import org.apache.commons.httpclient.HttpMethod;
@@ -50,7 +52,6 @@
 import org.ops4j.pax.exam.Option;
 import org.ops4j.pax.exam.junit.Configuration;
 import org.ops4j.pax.exam.junit.JUnit4TestRunner;
-import org.osgi.service.http.HttpContext;
 import org.osgi.service.http.HttpService;
 import org.osgi.service.log.LogService;
 
@@ -64,29 +65,39 @@
     private final static String TEST_HEADER_AFTER = "testFilterAfter";
     private final static String TEST_HEADER_AFTER_VALUE = "after";
     private final static String TEST_JSP_CONTENT = "<html><body>Test JSP 
body</body></html>";
-    
+
     private volatile LogService m_logService;
     private volatile HttpContextServiceFactory m_httpContextFactoryService;
 
     private Component m_httpContextComponent;
     private String m_baseUrl;
     private TestServlet m_testServlet;
-    private HttpContext m_httpContext;
 
     @Configuration
     public Option[] configure() {
         return super.configure();
     }
 
+    protected Option provisionBundles() {
+        return provision(
+            felixHttpService(),
+            commonsHttpClient(),
+            paxSwissbox(),
+            ops4jBaseLang(),
+            commonsLogging(),
+            commonsCodec(),
+            amdatuHttpContext(),
+            amdatuJspSupport());
+    }
+
     @Before
     public void setUp() throws Exception {
         m_baseUrl = "http://"; + IntegrationTestBase.HOST_NAME + ":" + 
IntegrationTestBase.PORT_NR;
-        
+
         // Initialize the HTTP Context in which the filter, servlet and JSP 
under test are registered
         m_testServlet = new TestServlet();
         m_httpContextFactoryService = 
getService(HttpContextServiceFactory.class);
         m_httpContextComponent = 
m_httpContextFactoryService.create(m_bundleContext, m_testServlet);
-        m_httpContext = (HttpContext) m_httpContextComponent.getService();
     }
 
     @Override

Modified: 
trunk/integration-tests/src/test/java/org/amdatu/test/integration/tests/TenantManagementServiceTest.java
==============================================================================
--- 
trunk/integration-tests/src/test/java/org/amdatu/test/integration/tests/TenantManagementServiceTest.java
    (original)
+++ 
trunk/integration-tests/src/test/java/org/amdatu/test/integration/tests/TenantManagementServiceTest.java
    Thu Nov 11 12:25:13 2010
@@ -18,6 +18,7 @@
 
 import static junit.framework.Assert.assertNotNull;
 import static junit.framework.Assert.assertNull;
+import static org.ops4j.pax.exam.CoreOptions.provision;
 
 import java.util.Properties;
 import java.util.concurrent.Semaphore;
@@ -47,7 +48,7 @@
  * This class provides an integration test for testing the Tenant Management 
Service. We
  * make sure the right services are registered when they should.
  * 
- * TODO When the Cassandra-based storaged is factored out of the main bundle, 
we should
+ * TODO When the Cassandra-based storage is factored out of the main bundle, 
we should
  * add a test for basic interaction with this storage.
  */
 @RunWith(JUnit4TestRunner.class)
@@ -60,6 +61,14 @@
         return super.configure();
     }
 
+    protected Option provisionBundles() {
+        return provision(
+            amdatuCassandraApplication(),
+            amdatuCassandraListener(),
+            amdatuCassandraPersistenceManager(),
+            amdatuTenantService());
+    }
+
     public Component[] getDependencies(DependencyManager manager) {
         Component testComponent = manager.createComponent()
             .setImplementation(this)
@@ -107,12 +116,12 @@
         /*
          * FIXME: temporary disabled this integration test since it seems to 
hang when running mvn clean install
          * from the root. See issue 
http://jira.amdatu.org/jira/browse/AMDATU-121
-        m_tenantManagementService.createTenant("tenant1", "Tenant1");
-        Assert.assertTrue("Tenant service did not become available", 
waitForTenantServiceAdded());
-        */
+         * m_tenantManagementService.createTenant("tenant1", "Tenant1");
+         * Assert.assertTrue("Tenant service did not become available", 
waitForTenantServiceAdded());
+         */
     }
 
-    //@Test
+    // @Test
     public void shouldRemoveTenantService() throws TenantException, 
InterruptedException {
         TenantEntity tenant = 
m_tenantManagementService.createTenant("tenant1", "Tenant1");
         waitForTenantServiceAdded();
@@ -120,7 +129,7 @@
         Assert.assertTrue("Tenant service did not disappear", 
waitForTenantServiceRemoved());
     }
 
-    //@Test
+    // @Test
     public void shouldPublishTenantProperties() throws TenantException, 
InterruptedException, InvalidSyntaxException {
         TenantEntity tenant =
             
m_tenantManagementService.createTenant("shouldPublishTenantProperties", 
"shouldPublishTenantProperties");
@@ -131,7 +140,7 @@
             getService(Tenant.class, "(" + Tenant.SERVICE_PREFIX + 
"host=shouldPublishTenantProperties.org)"));
     }
 
-    //@Test
+    // @Test
     public void shouldUpdateTenantProperties() throws TenantException, 
InterruptedException, InvalidSyntaxException {
         TenantEntity tenant =
             
m_tenantManagementService.createTenant("shouldUpdateTenantProperties", 
"shouldUpdateTenantProperties");

Modified: 
trunk/integration-tests/src/test/java/org/amdatu/test/integration/tests/UserAdminStoreTest.java
==============================================================================
--- 
trunk/integration-tests/src/test/java/org/amdatu/test/integration/tests/UserAdminStoreTest.java
     (original)
+++ 
trunk/integration-tests/src/test/java/org/amdatu/test/integration/tests/UserAdminStoreTest.java
     Thu Nov 11 12:25:13 2010
@@ -16,6 +16,7 @@
  */
 package org.amdatu.test.integration.tests;
 
+import static org.ops4j.pax.exam.CoreOptions.provision;
 import junit.framework.Assert;
 
 import org.amdatu.test.integration.base.IntegrationTestBase;
@@ -52,17 +53,30 @@
     public Option[] configure() {
         return super.configure();
     }
-    
+
+    protected Option provisionBundles() {
+        return provision(
+            felixHttpService(),
+            amdatuHttpContext(),
+            amdatuJaxRs(),
+            amdatuCassandraApplication(),
+            amdatuCassandraListener(),
+            amdatuCassandraPersistenceManager(),
+            paxUserAdmin(),
+            amdatuUserAdminCassandraStore()
+        );
+    }
+
     private void sleep() throws InterruptedException {
         // Wait for 100 milliseconds, remember that Cassandra write operations 
are asynchronously
         Thread.sleep(WAIT);
     }
-    
+
     @Before
     public void setUp() throws Exception {
         m_userAdmin = getService(UserAdmin.class);
     }
-    
+
     @SuppressWarnings("unchecked")
     @Test
     public void testAdminStore() throws Exception {
@@ -96,7 +110,8 @@
 
         // Now see if we can find these users from credentials
         sleep();
-        Assert.assertTrue("TestAdmin user could not be found", 
m_userAdmin.getUser("name", "TestAdministrator") != null);
+        Assert
+            .assertTrue("TestAdmin user could not be found", 
m_userAdmin.getUser("name", "TestAdministrator") != null);
         Assert.assertTrue("TestEditor user could not be found", 
m_userAdmin.getUser("name", "TestEditor") != null);
         Assert.assertTrue("TestGuest user could not be found", 
m_userAdmin.getUser("name", "TestGuest") != null);
 
@@ -207,7 +222,7 @@
                 + ". Members found: " + sMembers, false);
         }
     }
-    
+
     private String toString(Role[] members) {
         String sMembers = "";
         for (Role role : members) {

Reply via email to