Author: mes
Date: 2010-11-18 16:56:31 -0800 (Thu, 18 Nov 2010)
New Revision: 22917
Modified:
core3/model-impl/trunk/it/pom.xml
core3/model-impl/trunk/it/src/test/java/org/cytoscape/model/ServiceConfigurationTest.java
Log:
cleaned up to use integration test support
Modified: core3/model-impl/trunk/it/pom.xml
===================================================================
--- core3/model-impl/trunk/it/pom.xml 2010-11-19 00:52:01 UTC (rev 22916)
+++ core3/model-impl/trunk/it/pom.xml 2010-11-19 00:56:31 UTC (rev 22917)
@@ -27,26 +27,25 @@
</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>
+ <plugins>
+ <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>
+ <configuration>
+ <options>
+ <platform>felix</platform>
+ <profiles>spring.dm</profiles>
+ </options>
+ </configuration>
-->
</plugin>
<plugin>
@@ -91,16 +90,19 @@
<groupId>org.cytoscape</groupId>
<artifactId>model-api</artifactId>
<version>3.0.0-alpha2-SNAPSHOT</version>
+ <scope>test</scope>
</dependency>
<dependency>
<groupId>org.cytoscape</groupId>
<artifactId>model-impl</artifactId>
<version>3.0.0-alpha2-SNAPSHOT</version>
+ <scope>test</scope>
</dependency>
<dependency>
<groupId>org.cytoscape</groupId>
<artifactId>event-api</artifactId>
<version>3.0.0-alpha2-SNAPSHOT</version>
+ <scope>test</scope>
</dependency>
<dependency>
<groupId>org.cytoscape</groupId>
@@ -109,25 +111,34 @@
<scope>test</scope>
</dependency>
<dependency>
+ <groupId>org.cytoscape</groupId>
+ <artifactId>integration-test-support</artifactId>
+ <version>3.0.0-alpha3-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>
+ <dependency>
+ <groupId>org.ops4j.pax.exam</groupId>
+ <artifactId>pax-exam</artifactId>
+ <version>1.2.0</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.ops4j.pax.exam</groupId>
+ <artifactId>pax-exam-junit</artifactId>
+ <version>1.2.0</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.ops4j.pax.exam</groupId>
+ <artifactId>pax-exam-container-default</artifactId>
+ <version>1.2.0</version>
+ <scope>test</scope>
+ </dependency>
</dependencies>
</project>
Modified:
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
2010-11-19 00:52:01 UTC (rev 22916)
+++
core3/model-impl/trunk/it/src/test/java/org/cytoscape/model/ServiceConfigurationTest.java
2010-11-19 00:56:31 UTC (rev 22917)
@@ -12,52 +12,17 @@
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;
+import org.cytoscape.integration.ServiceTestSupport;
//@RunWith(MavenConfiguredJUnit4TestRunner.class)
@RunWith(JUnit4TestRunner.class)
-public class ServiceConfigurationTest /*extends ServiceTestSupport*/ {
+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(),
@@ -66,17 +31,17 @@
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()
+
mavenBundle().groupId("org.cytoscape").artifactId("event-impl").versionAsInProject(),
+
mavenBundle().groupId("org.cytoscape").artifactId("integration-test-support").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);
+ checkService(CyNetworkManager.class);
}
}
--
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.