Author: kono
Date: 2010-08-16 02:22:06 -0700 (Mon, 16 Aug 2010)
New Revision: 21394
Added:
core3/viewmodel-impl/trunk/src/test/java/org/cytoscape/viewmodel/ITViewModelImpl.java
Modified:
core3/viewmodel-impl/trunk/pom.xml
Log:
Integration test template. Not working now because required services should be
provided from other bundle.
Modified: core3/viewmodel-impl/trunk/pom.xml
===================================================================
--- core3/viewmodel-impl/trunk/pom.xml 2010-08-16 07:30:10 UTC (rev 21393)
+++ core3/viewmodel-impl/trunk/pom.xml 2010-08-16 09:22:06 UTC (rev 21394)
@@ -36,6 +36,9 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
+ <excludes>
+
<exclude>**/ViewModelImplIntegrationTest.java</exclude>
+ </excludes>
<redirectTestOutputToFile>true</redirectTestOutputToFile>
</configuration>
</plugin>
@@ -48,7 +51,28 @@
to the maven-bundle-plugin section -->
<extensions>true</extensions>
</plugin>
+
<plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-failsafe-plugin</artifactId>
+ <version>2.5</version>
+ <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>
+
+ <plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>${maven-bundle-plugin.version}</version>
@@ -124,6 +148,9 @@
<version>1.0-SNAPSHOT</version>
</dependency>
+
+
+
<dependency>
<groupId>org.springframework.osgi</groupId>
<artifactId>spring-osgi-test</artifactId>
@@ -178,6 +205,12 @@
<type>bundle</type>
<scope>test</scope>
</dependency>
+
+ <dependency>
+ <groupId>org.cytoscape</groupId>
+ <artifactId>test-support</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ </dependency>
</dependencies>
Added:
core3/viewmodel-impl/trunk/src/test/java/org/cytoscape/viewmodel/ITViewModelImpl.java
===================================================================
---
core3/viewmodel-impl/trunk/src/test/java/org/cytoscape/viewmodel/ITViewModelImpl.java
(rev 0)
+++
core3/viewmodel-impl/trunk/src/test/java/org/cytoscape/viewmodel/ITViewModelImpl.java
2010-08-16 09:22:06 UTC (rev 21394)
@@ -0,0 +1,60 @@
+package org.cytoscape.viewmodel;
+
+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;
+
+public class ITViewModelImpl 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("###### Integration Test OSGi System
Bundles ######");
+
+ for (int i = 0; i < bundles.length; i++) {
+ Bundle bundle = bundles[i];
+
System.out.println(OsgiStringUtils.nullSafeName(bundle));
+ ServiceReference[] services =
bundle.getRegisteredServices();
+ if (services != null)
+ for (ServiceReference ref : services)
+ System.out.println("\tService = " +
ref);
+ }
+
+ }
+
+ 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",
+ // "file:./target/test-classes/META-INF/spring/bundle-context-test.xml"
+ //
+ // };
+ // }
+
+ protected String[] getTestBundlesNames() {
+ return new String[] {
+ "org.cytoscape, event-api, 1.0-SNAPSHOT",
+ "org.cytoscape, model-api, 1.0-SNAPSHOT",
+ "org.cytoscape, service-util, 1.0-SNAPSHOT",
+ "org.cytoscape, viewmodel-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.