ace-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r821600 - in /incubator/ace/trunk/test/src/org/apache/ace/test/repositoryadmin: Activator.java RepositoryAdminTest.java
Date Sun, 04 Oct 2009 20:19:35 GMT
Author: marrs
Date: Sun Oct  4 20:19:34 2009
New Revision: 821600

URL: http://svn.apache.org/viewvc?rev=821600&view=rev
Log:
Refactored the test code a bit, setup with the dependency manager contained some unnecessary
and potentially harmful steps.

Modified:
    incubator/ace/trunk/test/src/org/apache/ace/test/repositoryadmin/Activator.java
    incubator/ace/trunk/test/src/org/apache/ace/test/repositoryadmin/RepositoryAdminTest.java

Modified: incubator/ace/trunk/test/src/org/apache/ace/test/repositoryadmin/Activator.java
URL: http://svn.apache.org/viewvc/incubator/ace/trunk/test/src/org/apache/ace/test/repositoryadmin/Activator.java?rev=821600&r1=821599&r2=821600&view=diff
==============================================================================
--- incubator/ace/trunk/test/src/org/apache/ace/test/repositoryadmin/Activator.java (original)
+++ incubator/ace/trunk/test/src/org/apache/ace/test/repositoryadmin/Activator.java Sun Oct
 4 20:19:34 2009
@@ -37,7 +37,6 @@
 import org.apache.ace.client.repository.stateful.StatefulGatewayRepository;
 import org.apache.ace.server.log.store.LogStore;
 import org.apache.ace.test.osgi.dm.TestActivatorBase;
-import org.apache.ace.test.utils.TestUtils;
 import org.apache.felix.dependencymanager.DependencyManager;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.Constants;
@@ -50,8 +49,7 @@
  * Activator for the integration test.
  */
 public class Activator extends TestActivatorBase {
-
-    private ConfigurationAdmin m_configAdmin;
+    private volatile ConfigurationAdmin m_configAdmin;
 
     @Override
     protected void initServices(BundleContext context, DependencyManager manager) {
@@ -59,7 +57,14 @@
             .setImplementation(this)
             .add(createServiceDependency().setService(ConfigurationAdmin.class).setRequired(true)));
         RepositoryAdminTest test = new RepositoryAdminTest();
+        Dictionary<String, Object> topics = new Hashtable<String, Object>();
+        topics.put(EventConstants.EVENT_TOPIC, new String[] {RepositoryObject.PUBLIC_TOPIC_ROOT
+ "*",
+            RepositoryObject.PRIVATE_TOPIC_ROOT + "*",
+            RepositoryAdmin.PUBLIC_TOPIC_ROOT + "*",
+            RepositoryAdmin.PRIVATE_TOPIC_ROOT + "*",
+            StatefulGatewayObject.TOPIC_ALL});
         manager.add(createService()
+            .setInterface(EventHandler.class.getName(), topics)
             .setImplementation(test)
             .add(createServiceDependency().setService(RepositoryAdmin.class).setRequired(true))
             .add(createServiceDependency().setService(ArtifactRepository.class).setRequired(true))
@@ -73,16 +78,6 @@
             .add(createServiceDependency().setService(StatefulGatewayRepository.class).setRequired(true))
             .add(createServiceDependency().setService(LogStore.class, "(&("+Constants.OBJECTCLASS+"="+LogStore.class.getName()+")(name=auditlog))").setRequired(true))
             .add(createServiceDependency().setService(ConfigurationAdmin.class).setRequired(true)));
-        Dictionary<String, Object> topics = new Hashtable<String, Object>();
-        topics.put(EventConstants.EVENT_TOPIC, new String[] {RepositoryObject.PUBLIC_TOPIC_ROOT
+ "*",
-            RepositoryObject.PRIVATE_TOPIC_ROOT + "*",
-            RepositoryAdmin.PUBLIC_TOPIC_ROOT + "*",
-            RepositoryAdmin.PRIVATE_TOPIC_ROOT + "*",
-            StatefulGatewayObject.TOPIC_ALL});
-        manager.add(createService()
-            .setImplementation(test)
-            .setInterface(EventHandler.class.getName(), topics));
-        TestUtils.configureObject(test, DependencyManager.class, manager);
     }
 
     public void start() throws IOException {

Modified: incubator/ace/trunk/test/src/org/apache/ace/test/repositoryadmin/RepositoryAdminTest.java
URL: http://svn.apache.org/viewvc/incubator/ace/trunk/test/src/org/apache/ace/test/repositoryadmin/RepositoryAdminTest.java?rev=821600&r1=821599&r2=821600&view=diff
==============================================================================
--- incubator/ace/trunk/test/src/org/apache/ace/test/repositoryadmin/RepositoryAdminTest.java
(original)
+++ incubator/ace/trunk/test/src/org/apache/ace/test/repositoryadmin/RepositoryAdminTest.java
Sun Oct  4 20:19:34 2009
@@ -103,9 +103,9 @@
 import org.testng.annotations.Test;
 
 public class RepositoryAdminTest implements EventHandler {
-    private BundleContext m_context; /* Injected by dependency manager */
-    private ConfigurationAdmin m_configAdmin; /* Injected by dependency manager */
-    private DependencyManager m_depManager; /* Configured from outside */
+    private volatile BundleContext m_context; /* Injected by dependency manager */
+    private volatile ConfigurationAdmin m_configAdmin; /* Injected by dependency manager
*/
+    private volatile DependencyManager m_depManager; /* injected by dependency manager */
     private volatile RepositoryAdmin m_repositoryAdmin; /* Injected by dependency manager
*/
     private volatile ArtifactRepository m_artifactRepository; /* Injected by dependency manager
*/
     private volatile Artifact2GroupAssociationRepository m_artifact2groupRepository; /* Injected
by dependency manager */



Mime
View raw message