Author: kono
Date: 2010-08-13 19:39:33 -0700 (Fri, 13 Aug 2010)
New Revision: 21388

Added:
   
core3/viewmodel-impl/trunk/src/test/java/org/cytoscape/viewmodel/ViewModelImplIntegrationTest.java
Modified:
   core3/viewmodel-impl/trunk/pom.xml
   
core3/viewmodel-impl/trunk/src/main/resources/META-INF/spring/bundle-context.xml
Log:
Start adding integration test to validate spring config files.  It's still not 
working.

Modified: core3/viewmodel-impl/trunk/pom.xml
===================================================================
--- core3/viewmodel-impl/trunk/pom.xml  2010-08-13 21:55:24 UTC (rev 21387)
+++ core3/viewmodel-impl/trunk/pom.xml  2010-08-14 02:39:33 UTC (rev 21388)
@@ -90,39 +90,96 @@
                        <name>Cytoscape Releases</name>
                        
<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>
 
+
        <dependencies>
 
                <!-- Cytoscape modules -->
                <dependency>
                        <groupId>org.cytoscape</groupId>
-                       <artifactId>event-api</artifactId>
+                       <artifactId>viewmodel-api</artifactId>
                        <version>1.0-SNAPSHOT</version>
                </dependency>
                <dependency>
                        <groupId>org.cytoscape</groupId>
-                       <artifactId>viewmodel-api</artifactId>
+                       <artifactId>service-util</artifactId>
                        <version>1.0-SNAPSHOT</version>
                </dependency>
+
+
+
                <dependency>
                        <groupId>org.cytoscape</groupId>
-                       <artifactId>service-util</artifactId>
+                       <artifactId>event-api</artifactId>
                        <version>1.0-SNAPSHOT</version>
                </dependency>
 
-               <!-- unit test modules -->
                <dependency>
-                       <groupId>junit</groupId>
-                       <artifactId>junit</artifactId>
-                       <version>${junit.version}</version>
+                       <groupId>org.springframework.osgi</groupId>
+                       <artifactId>spring-osgi-test</artifactId>
+                       <version>1.2.1</version>
                        <scope>test</scope>
                </dependency>
+
                <dependency>
-                       <groupId>org.easymock</groupId>
-                       <artifactId>com.springsource.org.easymock</artifactId>
-                       <version>${easymock.version}</version>
+                       <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>
+               </dependency>
+
+               <dependency>
+                       <groupId>org.slf4j</groupId>
+                       <artifactId>com.springsource.slf4j.log4j</artifactId>
+                       <version>1.5.0</version>
+               </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>
+
+               <dependency>
+                       <groupId>org.springframework.osgi</groupId>
+                       <artifactId>spring-osgi-annotation</artifactId>
+                       <version>1.2.1</version>
+                       <scope>test</scope>
+               </dependency>
+
+
+               <dependency>
+                       <groupId>org.springframework.osgi</groupId>
+                       <artifactId>spring-osgi-extender</artifactId>
+                       <version>1.2.1</version>
+                       <type>bundle</type>
+                       <scope>test</scope>
+               </dependency>
        </dependencies>
+
+
+
 </project>

Modified: 
core3/viewmodel-impl/trunk/src/main/resources/META-INF/spring/bundle-context.xml
===================================================================
--- 
core3/viewmodel-impl/trunk/src/main/resources/META-INF/spring/bundle-context.xml
    2010-08-13 21:55:24 UTC (rev 21387)
+++ 
core3/viewmodel-impl/trunk/src/main/resources/META-INF/spring/bundle-context.xml
    2010-08-14 02:39:33 UTC (rev 21388)
@@ -6,6 +6,7 @@
     http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
     http://www.springframework.org/schema/context
     http://www.springframework.org/schema/context/spring-context-2.5.xsd";>
+       <import resource="bundle-context-osgi.xml" />
 
        <context:annotation-config />
 
@@ -16,8 +17,7 @@
                <constructor-arg ref="cyServiceRegistrarRef" />
        </bean>
 
-       <!-- Catalog object of available VP.  This will be exported as service. 
-->
-       <bean id="rootVisualLexicon"
-               class="org.cytoscape.view.model.internal.RootVisualLexiconImpl" 
/>
-
+       <!-- Catalog object of available VP. This will be exported as service. 
-->
+       <bean id="rootVisualLexicon" 
class="org.cytoscape.view.model.internal.RootVisualLexiconImpl" />
+       
 </beans>

Added: 
core3/viewmodel-impl/trunk/src/test/java/org/cytoscape/viewmodel/ViewModelImplIntegrationTest.java
===================================================================
--- 
core3/viewmodel-impl/trunk/src/test/java/org/cytoscape/viewmodel/ViewModelImplIntegrationTest.java
                          (rev 0)
+++ 
core3/viewmodel-impl/trunk/src/test/java/org/cytoscape/viewmodel/ViewModelImplIntegrationTest.java
  2010-08-14 02:39:33 UTC (rev 21388)
@@ -0,0 +1,45 @@
+package org.cytoscape.viewmodel;
+
+import org.osgi.framework.Bundle;
+import org.osgi.framework.Constants;
+import org.springframework.osgi.test.AbstractConfigurableBundleCreatorTests;
+import org.springframework.osgi.util.OsgiStringUtils;
+
+public class ViewModelImplIntegrationTest extends
+               AbstractConfigurableBundleCreatorTests {
+
+       public void testOsgiPlatformStarts() throws Exception {
+
+               // 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();
+               System.out.println("###### OSGi System Bundles ######");
+               for (int i = 0; i < bundles.length; i++) {
+                       
System.out.println(OsgiStringUtils.nullSafeName(bundles[i]));
+               }
+       }
+
+       public String getRootPath() {
+               return "file:./target/test-classes";
+       }
+
+//     protected String[] getConfigLocations() {
+//             return new String[] {
+//                             
"file:./target/classes/META-INF/spring/bundle-context.xml",
+//                             
"file:./target/classes/META-INF/spring/bundle-context-osgi.xml" };
+//     }
+
+//     @Override
+//     protected String[] getTestBundlesNames() {
+//             return new String[] { "org.cytoscape, viewmodel-api, 
1.0-SNAPSHOT", "org.cytoscape, service-util, 1.0-SNAPSHOT", "org.cytoscape, 
model-api, 1.0-SNAPSHOT", "org.cytoscape, viewmodel-impl, 1.0-SNAPSHOT", 
"org.cytoscape, event-api, 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