Author: mes
Date: 2010-11-18 16:50:03 -0800 (Thu, 18 Nov 2010)
New Revision: 22915

Added:
   core3/model-impl/trunk/it/
   core3/model-impl/trunk/it/pom.xml
   core3/model-impl/trunk/it/src/
   core3/model-impl/trunk/it/src/test/
   core3/model-impl/trunk/it/src/test/java/
   core3/model-impl/trunk/it/src/test/java/org/
   core3/model-impl/trunk/it/src/test/java/org/cytoscape/
   core3/model-impl/trunk/it/src/test/java/org/cytoscape/model/
   
core3/model-impl/trunk/it/src/test/java/org/cytoscape/model/ServiceConfigurationTest.java
   core3/model-impl/trunk/pom.xml
Removed:
   core3/model-impl/trunk/impl/src/integration/
Modified:
   core3/model-impl/trunk/impl/pom.xml
Log:
refactored to run integration tests

Modified: core3/model-impl/trunk/impl/pom.xml
===================================================================
--- core3/model-impl/trunk/impl/pom.xml 2010-11-19 00:47:06 UTC (rev 22914)
+++ core3/model-impl/trunk/impl/pom.xml 2010-11-19 00:50:03 UTC (rev 22915)
@@ -2,9 +2,9 @@
 <project xmlns="http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/maven-v4_0_0.xsd";>
 
        <parent>
-               <artifactId>parent</artifactId>
+               <artifactId>model-impl-parent</artifactId>
                <groupId>org.cytoscape</groupId>
-               <version>3.0.0-alpha4-SNAPSHOT</version>
+               <version>3.0.0-alpha2-SNAPSHOT</version>
        </parent>
 
        <properties>
@@ -15,7 +15,6 @@
        <modelVersion>4.0.0</modelVersion>
        <groupId>org.cytoscape</groupId>
        <artifactId>model-impl</artifactId>
-       <version>3.0.0-alpha2-SNAPSHOT</version>
 
        <name>${bundle.symbolicName}</name>
 
@@ -28,15 +27,7 @@
        </scm>
 
        <build>
-               <resources>
-                       <resource>
-                               <directory>src/main/resources</directory>
-                       </resource>
-                       <resource>
-                               <directory>src/integration/resources</directory>
-                       </resource>
-               </resources>
-               <plugins>
+    <plugins>
                        <plugin>
                                <groupId>org.apache.maven.plugins</groupId>
                                <artifactId>maven-jar-plugin</artifactId>
@@ -49,17 +40,6 @@
                                </executions>
                        </plugin>
                        <plugin>
-                               <artifactId>maven-clean-plugin</artifactId>
-                               <version>2.4.1</version>
-                               <configuration>
-                                       <filesets>
-                                               <fileset>
-                                                       
<directory>${basedir}/eclipse_config</directory>
-                                               </fileset>
-                                       </filesets>
-                               </configuration>
-                       </plugin>
-                       <plugin>
                                <groupId>org.apache.maven.plugins</groupId>
                                <artifactId>maven-surefire-plugin</artifactId>
                                <configuration>
@@ -70,17 +50,12 @@
                                <groupId>org.ops4j</groupId>
                                <artifactId>maven-pax-plugin</artifactId>
                                <version>1.4</version>
-                               <!-- | enable improved OSGi compilation support 
for the bundle life-cycle. 
-                                       | to switch back to the standard bundle 
life-cycle, move this setting | down 
-                                       to the maven-bundle-plugin section -->
                                <extensions>true</extensions>
                        </plugin>
                        <plugin>
                                <groupId>org.apache.felix</groupId>
                                <artifactId>maven-bundle-plugin</artifactId>
                                <version>1.4.3</version>
-                               <!-- | the following instructions build a 
simple set of public/private 
-                                       classes into an OSGi bundle -->
                                <configuration>
                                        <instructions>
                                                
<Bundle-SymbolicName>${bundle.symbolicName}</Bundle-SymbolicName>
@@ -89,51 +64,6 @@
                                        </instructions>
                                </configuration>
                        </plugin>
-
-                       <plugin>
-                               <groupId>org.codehaus.mojo</groupId>
-                               
<artifactId>build-helper-maven-plugin</artifactId>
-                               <version>1.5</version>
-                               <executions>
-                                       <execution>
-                                               <id>add-test-source</id>
-                                               
<phase>generate-test-sources</phase>
-                                               <goals>
-                                                       
<goal>add-test-source</goal>
-                                               </goals>
-                                               <configuration>
-                                                       <sources>
-                                                               
<source>${basedir}/src/integration/java</source>
-                                                       </sources>
-                                               </configuration>
-                                       </execution>
-                               </executions>
-                       </plugin>
-
-                       <plugin>
-                               <groupId>org.apache.maven.plugins</groupId>
-                               <artifactId>maven-failsafe-plugin</artifactId>
-                               <version>2.6</version>
-                               <configuration>
-                                       
<testSourceDirectory>${basedir}/src/integration/java</testSourceDirectory>
-                                       
<redirectTestOutputToFile>true</redirectTestOutputToFile>
-                               </configuration>
-                               <executions>
-                                       <execution>
-                                               <id>integration-test</id>
-                                               <goals>
-                                                       
<goal>integration-test</goal>
-                                               </goals>
-                                       </execution>
-                                       <execution>
-                                               <id>verify</id>
-                                               <goals>
-                                                       <goal>verify</goal>
-                                               </goals>
-                                       </execution>
-                               </executions>
-                       </plugin>
-
                </plugins>
        </build>
 
@@ -170,7 +100,6 @@
                        <artifactId>model-api</artifactId>
                        <version>3.0.0-alpha2-SNAPSHOT</version>
                </dependency>
-
                <dependency>
                        <groupId>org.cytoscape</groupId>
                        <artifactId>model-api</artifactId>
@@ -186,12 +115,6 @@
                        <scope>test</scope>
                </dependency>
                <dependency>
-                       <groupId>org.cytoscape</groupId>
-                       <artifactId>event-impl</artifactId>
-                       <version>3.0.0-alpha2-SNAPSHOT</version>
-                       <scope>test</scope>
-               </dependency>
-               <dependency>
                        <groupId>junit</groupId>
                        <artifactId>junit</artifactId>
                        <version>${junit.version}</version>
@@ -203,13 +126,5 @@
                        <version>1.8.1</version>
                        <scope>test</scope>
                </dependency>
-
-               <dependency>
-                       <groupId>org.cytoscape</groupId>
-                       <artifactId>integration-test-support</artifactId>
-                       <version>3.0.0-alpha2</version>
-                       <scope>test</scope>
-               </dependency>
        </dependencies>
-
 </project>

Added: core3/model-impl/trunk/it/pom.xml
===================================================================
--- core3/model-impl/trunk/it/pom.xml                           (rev 0)
+++ core3/model-impl/trunk/it/pom.xml   2010-11-19 00:50:03 UTC (rev 22915)
@@ -0,0 +1,133 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/maven-v4_0_0.xsd";>
+
+       <parent>
+               <artifactId>model-impl-parent</artifactId>
+               <groupId>org.cytoscape</groupId>
+               <version>3.0.0-alpha2-SNAPSHOT</version>
+       </parent>
+
+       <properties>
+               
<bundle.symbolicName>org.cytoscape.model-impl-it</bundle.symbolicName>
+               <bundle.namespace>org.cytoscape.model</bundle.namespace>
+       </properties>
+
+       <modelVersion>4.0.0</modelVersion>
+       <groupId>org.cytoscape</groupId>
+       <artifactId>model-impl-it</artifactId>
+
+       <name>${bundle.symbolicName}</name>
+
+       <packaging>jar</packaging>
+
+       <scm>
+               
<connection>scm:svn:http://chianti.ucsd.edu/svn/core3/model-impl/trunk</connection>
+               
<developerConnection>scm:svn:svn+ssh://grenache.ucsd.edu/cellar/common/svn/core3/model-impl/trunk</developerConnection>
+               <url>http://chianti.ucsd.edu/svn/core3/model-impl/trunk</url>
+       </scm>
+
+       <build>
+    <plugins>
+      <!-- use pax exam maven plugin -->
+      <plugin>
+        <groupId>org.ops4j.pax.exam</groupId>
+        <artifactId>maven-paxexam-plugin</artifactId>
+        <executions>
+          <execution>
+            <id>generate-config</id>
+            <goals>
+              <goal>generate-depends-file</goal>
+            </goals>
+          </execution>
+        </executions>
+               <!--
+        <configuration>
+          <options>
+            <platform>felix</platform>
+            <profiles>spring.dm</profiles>
+          </options>
+        </configuration>
+               -->
+       </plugin>
+                       <plugin>
+                               <groupId>org.apache.maven.plugins</groupId>
+                               <artifactId>maven-surefire-plugin</artifactId>
+                               <configuration>
+                                       
<redirectTestOutputToFile>true</redirectTestOutputToFile>
+                               </configuration>
+                       </plugin>
+               </plugins>
+       </build>
+
+       <repositories>
+               <!-- bootstrap for cytoscape dependencies, namely the parent 
POM snapshots -->
+               <repository>
+                       <id>cytoscape_snapshots</id>
+                       <snapshots>
+                               <enabled>true</enabled>
+                       </snapshots>
+                       <releases>
+                               <enabled>false</enabled>
+                       </releases>
+                       <name>Cytoscape Snapshots</name>
+                       
<url>http://cytoscape.wodaklab.org/nexus/content/repositories/snapshots/</url>
+               </repository>
+               <!-- bootstrap for cytoscape dependencies, namely the parent 
POM releases -->
+               <repository>
+                       <id>cytoscape_releases</id>
+                       <snapshots>
+                               <enabled>false</enabled>
+                       </snapshots>
+                       <releases>
+                               <enabled>true</enabled>
+                       </releases>
+                       <name>Cytoscape Releases</name>
+                       
<url>http://cytoscape.wodaklab.org/nexus/content/repositories/releases/</url>
+               </repository>
+       </repositories>
+
+       <dependencies>
+               <dependency>
+                       <groupId>org.cytoscape</groupId>
+                       <artifactId>model-api</artifactId>
+                       <version>3.0.0-alpha2-SNAPSHOT</version>
+               </dependency>
+               <dependency>
+                       <groupId>org.cytoscape</groupId>
+                       <artifactId>model-impl</artifactId>
+                       <version>3.0.0-alpha2-SNAPSHOT</version>
+               </dependency>
+               <dependency>
+                       <groupId>org.cytoscape</groupId>
+                       <artifactId>event-api</artifactId>
+                       <version>3.0.0-alpha2-SNAPSHOT</version>
+               </dependency>
+               <dependency>
+                       <groupId>org.cytoscape</groupId>
+                       <artifactId>event-impl</artifactId>
+                       <version>3.0.0-alpha2-SNAPSHOT</version>
+                       <scope>test</scope>
+               </dependency>
+               <dependency>
+                       <groupId>junit</groupId>
+                       <artifactId>junit</artifactId>
+                       <version>${junit.version}</version>
+                       <scope>test</scope>
+               </dependency>
+    <dependency>
+      <groupId>org.ops4j.pax.exam</groupId>
+      <artifactId>pax-exam</artifactId>
+      <version>1.2.0</version>
+    </dependency>
+    <dependency>
+      <groupId>org.ops4j.pax.exam</groupId>
+      <artifactId>pax-exam-junit</artifactId>
+      <version>1.2.0</version>
+    </dependency>
+    <dependency>
+      <groupId>org.ops4j.pax.exam</groupId>
+      <artifactId>pax-exam-container-default</artifactId>
+      <version>1.2.0</version>
+    </dependency>
+       </dependencies>
+</project>

Added: 
core3/model-impl/trunk/it/src/test/java/org/cytoscape/model/ServiceConfigurationTest.java
===================================================================
--- 
core3/model-impl/trunk/it/src/test/java/org/cytoscape/model/ServiceConfigurationTest.java
                           (rev 0)
+++ 
core3/model-impl/trunk/it/src/test/java/org/cytoscape/model/ServiceConfigurationTest.java
   2010-11-19 00:50:03 UTC (rev 22915)
@@ -0,0 +1,82 @@
+package org.cytoscape.model; 
+
+import static org.ops4j.pax.exam.CoreOptions.*;
+import static org.ops4j.pax.exam.container.def.PaxRunnerOptions.*;
+import static org.junit.Assert.*;
+import org.junit.Test;
+import org.junit.Before;
+import org.junit.runner.RunWith;
+import org.ops4j.pax.exam.Option;
+import org.ops4j.pax.exam.Inject;
+import org.ops4j.pax.exam.junit.Configuration;
+import org.ops4j.pax.exam.junit.MavenConfiguredJUnit4TestRunner;
+import org.ops4j.pax.exam.junit.JUnit4TestRunner;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.ServiceReference;
+import org.osgi.util.tracker.ServiceTracker;
+
+
+import org.cytoscape.model.subnetwork.CyRootNetworkFactory;
+import org.cytoscape.event.CyEventHelper;
+import java.util.Properties; 
+//import org.cytoscape.integration.ServiceTestSupport;
+
+//@RunWith(MavenConfiguredJUnit4TestRunner.class)
+...@runwith(JUnit4TestRunner.class)
+public class ServiceConfigurationTest /*extends ServiceTestSupport*/ {
+
+    /**
+     * The OSGi BundleContext made available for additional testing.
+     */
+    @Inject
+    protected BundleContext bundleContext;
+
+    /**
+     * Asserts that a service of the specified type exists.
+     * @param clazz The service interface type to be checked. 
+     */
+    protected void checkService(Class<?> clazz) {
+        checkService(clazz,1000);
+    }
+
+    /**
+     * Asserts that a service of the specified type exists.
+     * @param clazz The service interface type to be checked. 
+     * @param waitTime The time the service tracker should wait to 
+     * find the specified service in milliseconds.
+     */
+    protected void checkService(Class<?> clazz, int waitTime) {
+        try {
+            ServiceTracker tracker = new ServiceTracker(bundleContext, 
clazz.getName(), null);
+            tracker.open();
+            Object service = tracker.waitForService(waitTime);
+            tracker.close();
+            assertNotNull(service);
+        } catch (Exception e) {
+            fail(e.getMessage());
+        }
+    }
+
+       @Configuration
+       public static Option[] configuration() {      
+               return options(felix(), 
+                              profile("spring.dm"), 
+                              provision( 
+                                        
mavenBundle().groupId("org.cytoscape").artifactId("model-impl").versionAsInProject(),
+                                        
mavenBundle().groupId("org.cytoscape").artifactId("model-api").versionAsInProject(),
+                                        
mavenBundle().groupId("org.cytoscape").artifactId("event-api").versionAsInProject(),
+                                        
mavenBundle().groupId("org.cytoscape").artifactId("event-impl").versionAsInProject()
+               ));
+       }  
+
+       @Test
+       public void testExpectedServices() {
+               for ( Bundle b : bundleContext.getBundles() )
+                       System.out.println("bundle: " + b.getSymbolicName());
+               checkService(CyNetworkFactory.class);
+               checkService(CyTableFactory.class);
+               checkService(CyRootNetworkFactory.class);
+               checkService(CyTableManager.class);
+       }
+}

Added: core3/model-impl/trunk/pom.xml
===================================================================
--- core3/model-impl/trunk/pom.xml                              (rev 0)
+++ core3/model-impl/trunk/pom.xml      2010-11-19 00:50:03 UTC (rev 22915)
@@ -0,0 +1,21 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/maven-v4_0_0.xsd";>
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>org.cytoscape</groupId>
+    <artifactId>parent</artifactId>
+    <version>3.0.0-alpha4-SNAPSHOT</version>
+  </parent>
+
+  <groupId>org.cytoscape</groupId>
+  <artifactId>model-impl-parent</artifactId>
+  <packaging>pom</packaging>
+  <version>3.0.0-alpha2-SNAPSHOT</version>
+  <name>model-impl-parent</name>
+
+  <modules>
+    <module>impl</module>
+    <module>it</module>
+  </modules>
+
+</project>
+

-- 
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