Author: mes
Date: 2010-08-17 12:01:12 -0700 (Tue, 17 Aug 2010)
New Revision: 21407

Modified:
   core3/viewmodel-impl/trunk/pom.xml
   
core3/viewmodel-impl/trunk/src/test/java/org/cytoscape/viewmodel/ITViewModelImpl.java
Log:
updated to use integration-test-support

Modified: core3/viewmodel-impl/trunk/pom.xml
===================================================================
--- core3/viewmodel-impl/trunk/pom.xml  2010-08-17 19:00:20 UTC (rev 21406)
+++ core3/viewmodel-impl/trunk/pom.xml  2010-08-17 19:01:12 UTC (rev 21407)
@@ -54,6 +54,9 @@
                                <groupId>org.apache.maven.plugins</groupId>
                                <artifactId>maven-failsafe-plugin</artifactId>
                                <version>2.5</version>
+                               <configuration>
+                                       
<redirectTestOutputToFile>true</redirectTestOutputToFile>
+                               </configuration>
                                <executions>
                                        <execution>
                                                <id>integration-test</id>
@@ -113,14 +116,6 @@
                        
<url>http://cytoscape.wodaklab.org/nexus/content/repositories/releases/</url>
                </repository>
 
-               <repository>
-                       <id>i21-s3-osgi-repo</id>
-                       <name>i21 osgi artifacts repo</name>
-                       <snapshots>
-                               <enabled>true</enabled>
-                       </snapshots>
-                       <url>http://maven.springframework.org/osgi</url>
-               </repository>
        </repositories>
 
 
@@ -138,55 +133,12 @@
                        <version>1.0-SNAPSHOT</version>
                </dependency>
 
-
-               <!-- Bundles required for testing -->
+               <!-- for spring integration testing -->
                <dependency>
-                       <groupId>org.springframework.osgi</groupId>
-                       <artifactId>spring-osgi-test</artifactId>
-                       <version>${spring.osgi.version}</version>
+                       <groupId>org.cytoscape</groupId>
+                       <artifactId>integration-test-support</artifactId>
+                       <version>1.0-SNAPSHOT</version>
                        <scope>test</scope>
                </dependency>
-               <dependency>
-                       <groupId>org.springframework.osgi</groupId>
-                       <artifactId>spring-osgi-annotation</artifactId>
-                       <version>${spring.osgi.version}</version>
-                       <scope>test</scope>
-               </dependency>
-               <dependency>
-                       <groupId>org.springframework.osgi</groupId>
-                       <artifactId>spring-osgi-extender</artifactId>
-                       <version>${spring.osgi.version}</version>
-                       <scope>test</scope>
-               </dependency>
-               <dependency>
-                       <groupId>org.springframework.osgi</groupId>
-                       <artifactId>log4j.osgi</artifactId>
-                       <version>1.2.15-SNAPSHOT</version>
-                       <scope>test</scope>
-               </dependency>
-               <dependency>
-                       <groupId>org.slf4j</groupId>
-                       <artifactId>com.springsource.slf4j.api</artifactId>
-                       <version>1.5.0</version>
-                       <scope>test</scope>
-               </dependency>
-               <dependency>
-                       <groupId>org.slf4j</groupId>
-                       <artifactId>com.springsource.slf4j.log4j</artifactId>
-                       <version>1.5.0</version>
-                       <scope>test</scope>
-               </dependency>
-               <dependency>
-                       <groupId>org.slf4j</groupId>
-                       
<artifactId>com.springsource.slf4j.org.apache.commons.logging</artifactId>
-                       <version>1.5.0</version>
-                       <scope>test</scope>
-               </dependency>
-               <dependency>
-                       <groupId>org.sonatype.tycho</groupId>
-                       <artifactId>org.eclipse.osgi</artifactId>
-                       <version>3.6.0.v20100517</version>
-                       <scope>test</scope>
-               </dependency>
        </dependencies>
 </project>

Modified: 
core3/viewmodel-impl/trunk/src/test/java/org/cytoscape/viewmodel/ITViewModelImpl.java
===================================================================
--- 
core3/viewmodel-impl/trunk/src/test/java/org/cytoscape/viewmodel/ITViewModelImpl.java
       2010-08-17 19:00:20 UTC (rev 21406)
+++ 
core3/viewmodel-impl/trunk/src/test/java/org/cytoscape/viewmodel/ITViewModelImpl.java
       2010-08-17 19:01:12 UTC (rev 21407)
@@ -2,119 +2,27 @@
 
 import org.cytoscape.view.model.CyNetworkViewFactory;
 import org.cytoscape.view.model.RootVisualLexicon;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.Constants;
-import org.osgi.framework.ServiceReference;
-import org.springframework.osgi.test.AbstractConfigurableBundleCreatorTests;
-import org.springframework.osgi.util.OsgiStringUtils;
+import org.cytoscape.integration.AbstractIntegrationTester;
 
 /**
  * Integration test for viewmodel-impl bundle.
  * 
  * @author kono
- * 
+ * @author mes
  */
-public class ITViewModelImpl extends AbstractConfigurableBundleCreatorTests {
+public class ITViewModelImpl extends AbstractIntegrationTester {
 
-       // Exported services (FROM viewmodel-impl bundle)
-       private RootVisualLexicon rootVisualLexicon;
-       private CyNetworkViewFactory cyNetworkViewFactory;
-
-       // Inject those services to this test (by setter injection)
-       public void setRootVisualLexicon(RootVisualLexicon rootVisualLexicon) {
-               this.rootVisualLexicon = rootVisualLexicon;
+       public ITViewModelImpl() {
+               super( "org.cytoscape.viewmodel-impl",
+                      new String[] { "org.cytoscape, event-api, 1.0-SNAPSHOT",
+                                     "org.cytoscape, event-impl, 1.0-SNAPSHOT",
+                                     "org.cytoscape, model-api, 1.0-SNAPSHOT",
+                                     "org.cytoscape, integration-test-support, 
1.0-SNAPSHOT",
+                                     "org.cytoscape, service-util, 
1.0-SNAPSHOT",
+                                     "org.cytoscape, viewmodel-api, 
1.0-SNAPSHOT",
+                                     "org.cytoscape, viewmodel-impl, 
1.0-SNAPSHOT", },
+                      new String[] { "rootVisualLexicon", 
"cyNetworkViewFactory" },
+                      new Class[] { RootVisualLexicon.class, 
CyNetworkViewFactory.class } 
+                          );
        }
-
-       public void setCyNetworkViewFactory(
-                       CyNetworkViewFactory cyNetworkViewFactory) {
-               this.cyNetworkViewFactory = cyNetworkViewFactory;
-       }
-
-       public void testOsgiPlatformStarts() throws Exception {
-               System.out.println("###### Starting Integration Test ######");
-               // Make sure bundle context exists.
-               assertNotNull(bundleContext);
-
-               System.out.println(bundleContext
-                               .getProperty(Constants.FRAMEWORK_VENDOR));
-               System.out.println(bundleContext
-                               .getProperty(Constants.FRAMEWORK_VERSION));
-               System.out.println(bundleContext
-                               
.getProperty(Constants.FRAMEWORK_EXECUTIONENVIRONMENT));
-
-               final Bundle[] bundles = bundleContext.getBundles();
-
-               Bundle viewModelImplBundle = null;
-               for (int i = 0; i < bundles.length; i++) {
-                       final Bundle bundle = bundles[i];
-                       final String bundleName = 
OsgiStringUtils.nullSafeName(bundle);
-                       System.out.println(bundleName);
-                       if (bundleName.equals("org.cytoscape.viewmodel-impl"))
-                               viewModelImplBundle = bundle;
-                       ServiceReference[] services = 
bundle.getRegisteredServices();
-                       if (services != null)
-                               for (ServiceReference ref : services)
-                                       System.out.println("\tService = " + 
ref);
-                       System.out.println("\n");
-               }
-
-               // Make sure viewmodel-impl bundle is running
-               assertNotNull(viewModelImplBundle);
-
-               System.out.println("###### ViewModel bundle registered. 
######");
-       }
-
-       public void testServiceReferencesExist() {
-               System.out.println("###### Starting Service Reference Tests 
######");
-               final ServiceReference rootVisualLexiconServiceReference = 
bundleContext
-                               
.getServiceReference(RootVisualLexicon.class.getName());
-               assertNotNull(rootVisualLexiconServiceReference);
-               Object beanName = rootVisualLexiconServiceReference
-                               
.getProperty("org.springframework.osgi.bean.name");
-               assertEquals("rootVisualLexicon", beanName);
-
-               final ServiceReference cyNetworkViewFactoryServiceReference = 
bundleContext
-                               
.getServiceReference(CyNetworkViewFactory.class.getName());
-               assertNotNull(cyNetworkViewFactoryServiceReference);
-               beanName = cyNetworkViewFactoryServiceReference
-                               
.getProperty("org.springframework.osgi.bean.name");
-               assertEquals("cyNetworkViewFactory", beanName);
-
-               System.out.println("###### SR test done! ######");
-       }
-
-       /**
-        * Do very basic tests for injected services. Complete tests for all 
methods
-        * will be done in the Unit tests.
-        * 
-        */
-       public void testInjectedServices() {
-               System.out.println("###### Simple tests for injected services 
######");
-               assertNotNull(rootVisualLexicon);
-               assertNotNull(cyNetworkViewFactory);
-               System.out.println("###### Injected services pass the tests. 
######");
-       }
-
-       /**
-        * Specify Spring DM config file to import registered services by
-        * viewmodel-impl bundle.
-        * 
-        */
-       @Override
-       protected String[] getConfigLocations() {
-               return new String[] { 
"file:./target/test-classes/META-INF/spring/bundle-context-test.xml" };
-       }
-
-       /**
-        * Import bundles required to run viewmodel-impl bundle.
-        */
-       @Override
-       protected String[] getTestBundlesNames() {
-               return new String[] { "org.cytoscape, event-api, 1.0-SNAPSHOT",
-                               "org.cytoscape, event-impl, 1.0-SNAPSHOT",
-                               "org.cytoscape, model-api, 1.0-SNAPSHOT",
-                               "org.cytoscape, service-util, 1.0-SNAPSHOT",
-                               "org.cytoscape, viewmodel-api, 1.0-SNAPSHOT",
-                               "org.cytoscape, viewmodel-impl, 1.0-SNAPSHOT", 
};
-       }
 }

-- 
You received this message because you are subscribed to the Google Groups 
"cytoscape-cvs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/cytoscape-cvs?hl=en.

Reply via email to