Author: kono
Date: 2012-05-18 18:09:15 -0700 (Fri, 18 May 2012)
New Revision: 29301

Added:
   
core3/impl/trunk/session-impl/integration-test/src/test/java/org/cytoscape/session/AbstractSessionTest.java
   
core3/impl/trunk/session-impl/integration-test/src/test/java/org/cytoscape/session/BasicIntegrationTest.java
   core3/impl/trunk/session-impl/integration-test/src/test/resources/
   core3/impl/trunk/session-impl/integration-test/src/test/resources/testData/
   
core3/impl/trunk/session-impl/integration-test/src/test/resources/testData/smallSession.cys
Modified:
   core3/impl/trunk/session-impl/integration-test/pom.xml
Log:
refs #6 First version of pax exam integration test for automating session 
loading/saving test.

Modified: core3/impl/trunk/session-impl/integration-test/pom.xml
===================================================================
--- core3/impl/trunk/session-impl/integration-test/pom.xml      2012-05-19 
00:21:59 UTC (rev 29300)
+++ core3/impl/trunk/session-impl/integration-test/pom.xml      2012-05-19 
01:09:15 UTC (rev 29301)
@@ -1,5 +1,6 @@
 <?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";>
+<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>session-impl-parent</artifactId>
@@ -10,52 +11,152 @@
        <properties>
                
<bundle.symbolicName>org.cytoscape.session-impl-integration-test</bundle.symbolicName>
                <bundle.namespace>org.cytoscape.session</bundle.namespace>
+
+               <!-- Karaf + Pax Exam -->
+               <exam.version>2.4.0</exam.version>
+               <paxrunnerversion>1.7.6</paxrunnerversion>
+               <url.version>1.3.3</url.version>
+               <felixversion>3.2.2</felixversion>
        </properties>
 
        <modelVersion>4.0.0</modelVersion>
-       <groupId>org.cytoscape</groupId>
        <artifactId>session-impl-integration-test</artifactId>
 
-    <name>Cytoscape Session Impl Integration Test 
(${project.artifactId})</name>
+       <name>Cytoscape Session Impl Integration Test 
(${project.artifactId})</name>
 
        <packaging>jar</packaging>
 
        <build>
                <plugins>
-                       <plugin>
-                               <groupId>org.ops4j.pax.exam</groupId>
-                               <artifactId>maven-paxexam-plugin</artifactId>
-                               
<version>${maven-paxexam-plugin.version}</version>
-                               <executions>
-                                       <execution>
-                                               <id>generate-config</id>
-                                               <goals>
-                                                       
<goal>generate-config</goal>
-                                               </goals>
-                                       </execution>
-                               </executions>
-                               <configuration>
-                                       <options>
-                                               <platform>felix</platform>
-                                               
<version>${felix.version}</version>
-                                               
<profiles>spring.dm/${spring.osgi.version}</profiles>
-                                       </options>
-                               </configuration>
-                       </plugin>
+
                </plugins>
+
        </build>
 
-       <!--
-       This is where any additional implementation dependencies necessary for
-       running the integration tests should reside, NOT in the top level 
pom.xml.
-       -->
+       <!-- Build minimal application to test session mechanism. -->
        <dependencies>
                <dependency>
                        <groupId>org.cytoscape</groupId>
+                       <artifactId>event-impl</artifactId>
+                       <version>${project.version}</version>
+                       <scope>test</scope>
+               </dependency>
+
+               <dependency>
+                       <groupId>org.cytoscape</groupId>
+                       <artifactId>model-impl</artifactId>
+                       <version>${project.version}</version>
+                       <scope>test</scope>
+               </dependency>
+               <dependency>
+                       <groupId>org.cytoscape</groupId>
+                       <artifactId>ding-presentation-impl</artifactId>
+                       <version>${project.version}</version>
+                       <scope>test</scope>
+               </dependency>
+
+               <dependency>
+                       <groupId>org.cytoscape</groupId>
+                       <artifactId>vizmap-impl</artifactId>
+                       <version>${project.version}</version>
+                       <scope>test</scope>
+               </dependency>
+
+               <dependency>
+                       <groupId>org.cytoscape</groupId>
                        <artifactId>session-impl</artifactId>
                        <version>${project.version}</version>
-                       <scope>provided</scope>
+                       <scope>test</scope>
                </dependency>
+
+               <dependency>
+                       <groupId>org.cytoscape</groupId>
+                       <artifactId>io-impl</artifactId>
+                       <version>${project.version}</version>
+                       <scope>test</scope>
+               </dependency>
+
+               <dependency>
+                       <groupId>org.cytoscape</groupId>
+                       <artifactId>application-impl</artifactId>
+                       <version>${project.version}</version>
+                       <scope>test</scope>
+               </dependency>
+
+
+               <!-- Pax Exam Dependencies -->
+               <!-- Pax Exam Dependencies -->
+
+               <dependency>
+                       <groupId>org.glassfish.hk2.external</groupId>
+                       <artifactId>javax.inject</artifactId>
+                       <version>2.1.3</version>
+               </dependency>
+
+               <dependency>
+                       <groupId>org.ops4j.pax.exam</groupId>
+                       <artifactId>pax-exam-container-forked</artifactId>
+                       <version>${exam.version}</version>
+                       <scope>test</scope>
+               </dependency>
+
+               <dependency>
+                       <groupId>org.ops4j.pax.exam</groupId>
+                       <artifactId>pax-exam-junit4</artifactId>
+                       <version>${exam.version}</version>
+                       <scope>test</scope>
+               </dependency>
+
+               <dependency>
+                       <groupId>org.ops4j.pax.exam</groupId>
+                       <artifactId>pax-exam-link-mvn</artifactId>
+                       <version>${exam.version}</version>
+                       <scope>test</scope>
+               </dependency>
+
+               <dependency>
+                       <groupId>org.ops4j.pax.url</groupId>
+                       <artifactId>pax-url-aether</artifactId>
+                       <version>${url.version}</version>
+                       <scope>test</scope>
+               </dependency>
+
+               <dependency>
+                       <groupId>org.apache.felix</groupId>
+                       <artifactId>org.apache.felix.framework</artifactId>
+                       <version>4.0.2</version>
+                       <scope>test</scope>
+               </dependency>
+
+               <dependency>
+                       <groupId>ch.qos.logback</groupId>
+                       <artifactId>logback-core</artifactId>
+                       <version>0.9.29</version>
+                       <scope>test</scope>
+               </dependency>
+
+               <dependency>
+                       <groupId>ch.qos.logback</groupId>
+                       <artifactId>logback-classic</artifactId>
+                       <version>0.9.29</version>
+                       <scope>test</scope>
+               </dependency>
+
+
+
+
+
+
+
+               <!-- Karaf Extension -->
+               <dependency>
+                       <groupId>org.apache.karaf.tooling</groupId>
+                       
<artifactId>org.apache.karaf.tooling.testing</artifactId>
+                       <version>2.2.7</version>
+                       <scope>test</scope>
+               </dependency>
+
+
        </dependencies>
 </project>
 

Added: 
core3/impl/trunk/session-impl/integration-test/src/test/java/org/cytoscape/session/AbstractSessionTest.java
===================================================================
--- 
core3/impl/trunk/session-impl/integration-test/src/test/java/org/cytoscape/session/AbstractSessionTest.java
                         (rev 0)
+++ 
core3/impl/trunk/session-impl/integration-test/src/test/java/org/cytoscape/session/AbstractSessionTest.java
 2012-05-19 01:09:15 UTC (rev 29301)
@@ -0,0 +1,147 @@
+package org.cytoscape.session;
+
+import static org.mockito.Mockito.mock;
+
+import java.io.File;
+import java.io.InputStream;
+import java.net.URL;
+import java.util.Properties;
+
+import org.cytoscape.equations.EquationCompiler;
+import org.cytoscape.equations.EquationParser;
+import org.cytoscape.equations.Interpreter;
+import org.cytoscape.equations.internal.EquationCompilerImpl;
+import org.cytoscape.equations.internal.EquationParserImpl;
+import org.cytoscape.equations.internal.interpreter.InterpreterImpl;
+import org.cytoscape.event.CyEventHelper;
+import org.cytoscape.event.internal.CyEventHelperImpl;
+import org.cytoscape.event.internal.CyListenerAdapter;
+import org.cytoscape.io.BasicCyFileFilter;
+import org.cytoscape.io.DataCategory;
+import org.cytoscape.io.internal.read.CyNetworkReaderManagerImpl;
+import org.cytoscape.io.internal.read.CyPropertyReaderManagerImpl;
+import org.cytoscape.io.internal.read.VizmapReaderManagerImpl;
+import org.cytoscape.io.internal.read.datatable.CSVCyReaderFactory;
+import org.cytoscape.io.internal.read.session.Cy3SessionReaderImpl;
+import org.cytoscape.io.internal.read.vizmap.VizmapXMLFileFilter;
+import org.cytoscape.io.internal.read.vizmap.VizmapXMLReaderFactory;
+import org.cytoscape.io.internal.util.ReadCache;
+import org.cytoscape.io.internal.util.StreamUtilImpl;
+import org.cytoscape.io.internal.util.vizmap.CalculatorConverterFactory;
+import org.cytoscape.io.internal.util.vizmap.VisualStyleSerializer;
+import org.cytoscape.io.read.CyNetworkReaderManager;
+import org.cytoscape.io.read.CyPropertyReaderManager;
+import org.cytoscape.io.read.CySessionReader;
+import org.cytoscape.io.read.VizmapReaderManager;
+import org.cytoscape.io.util.StreamUtil;
+import org.cytoscape.model.CyNetworkTableManager;
+import org.cytoscape.model.CyTableFactory;
+import org.cytoscape.model.internal.CyNetworkTableManagerImpl;
+import org.cytoscape.model.internal.CyRootNetworkManagerImpl;
+import org.cytoscape.model.internal.CyTableFactoryImpl;
+import org.cytoscape.model.subnetwork.CyRootNetworkManager;
+import org.cytoscape.property.CyProperty;
+import org.cytoscape.service.util.CyServiceRegistrar;
+import org.cytoscape.service.util.internal.CyServiceRegistrarImpl;
+import org.cytoscape.work.TaskMonitor;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.osgi.framework.BundleContext;
+
+/**
+ * Build real application with minimal functionality.
+ * 
+ */
+public class AbstractSessionTest {
+
+       private CySessionReader sessionReader;
+
+       private URL session1;
+       private TaskMonitor taskMonitor = mock(TaskMonitor.class);
+
+       @Before
+       public void setUp() throws Exception {
+               buildHeadlessApplication();
+       }
+
+       @After
+       public void tearDown() throws Exception {
+       }
+
+       @Test
+       public void test() throws Exception {
+               
+               //sessionReader.run(taskMonitor);
+       }
+
+       private void buildHeadlessApplication() throws Exception {
+               BundleContext bc = mock(BundleContext.class);
+               CyListenerAdapter normal = new CyListenerAdapter(bc);
+               CyEventHelper cyEventHelper = new CyEventHelperImpl(normal);
+
+               final File sessionFile1 = new 
File("./src/test/resources/testData/" + "smallSession.cys");
+
+               final URL sessionFileURL1 = sessionFile1.toURI().toURL();
+               InputStream sourceInputStream = sessionFileURL1.openStream();
+
+               final ReadCache cache = new ReadCache();
+               CyProperty<Properties> prop = new CyProperty<Properties>() {
+
+                       @Override
+                       public String getName() {
+                               // TODO Auto-generated method stub
+                               return null;
+                       }
+
+                       @Override
+                       public Properties getProperties() {
+                               // TODO Auto-generated method stub
+                               return null;
+                       }
+
+                       @Override
+                       public org.cytoscape.property.CyProperty.SavePolicy 
getSavePolicy() {
+                               // TODO Auto-generated method stub
+                               return null;
+                       }
+
+                       @Override
+                       public Class<? extends Properties> getPropertyType() {
+                               // TODO Auto-generated method stub
+                               return null;
+                       }
+
+               };
+               StreamUtil streamUtil = new StreamUtilImpl(prop);
+               CyNetworkReaderManager networkReaderMgr = new 
CyNetworkReaderManagerImpl(streamUtil);
+               CyPropertyReaderManager propertyReaderMgr = new 
CyPropertyReaderManagerImpl(streamUtil);
+               VizmapReaderManager vizmapReaderMgr = new 
VizmapReaderManagerImpl(streamUtil);
+               
+               CalculatorConverterFactory calculatorConverterFactory = new 
CalculatorConverterFactory();
+
+//             VisualStyleSerializer visualStyleSerializer = new 
VisualStyleSerializer(calculatorConverterFactory,visualStyleFactoryServiceRef,visualMappingManagerServiceRef,renderingEngineManagerServiceRef,discreteMappingFactoryServiceRef,continuousMappingFactoryServiceRef,passthroughMappingFactoryServiceRef);
+//             VizmapXMLFileFilter vizmapXMLFilter = new 
VizmapXMLFileFilter(new String[]{"xml"}, new String[]{}, "Vizmap XML 
files",DataCategory.VIZMAP, streamUtil);
+//             VizmapXMLReaderFactory vizmapXMLReaderFactory = new 
VizmapXMLReaderFactory(vizmapXMLFilter,visualStyleSerializer);
+
+               
+               
+
+               Interpreter interpreter = new InterpreterImpl();
+               CyServiceRegistrar serviceRegistrar = new 
CyServiceRegistrarImpl(bc);
+               CyTableFactory tableFactory = new 
CyTableFactoryImpl(cyEventHelper, interpreter, serviceRegistrar);
+               EquationParser parser = new EquationParserImpl();
+               EquationCompiler compiler = new EquationCompilerImpl(parser);
+
+               BasicCyFileFilter sessionTableFilter = new 
BasicCyFileFilter(new String[] { "cytable" },
+                               new String[] { "text/plain" }, "Session table 
file", DataCategory.TABLE, streamUtil);
+
+               CSVCyReaderFactory sessionTableReaderFactory = new 
CSVCyReaderFactory(sessionTableFilter, true, true,
+                               tableFactory, compiler);
+
+               CyNetworkTableManager networkTableMgr = new 
CyNetworkTableManagerImpl();
+               CyRootNetworkManager rootNetworkMgr = new 
CyRootNetworkManagerImpl();
+               sessionReader = new Cy3SessionReaderImpl(sourceInputStream, 
cache, networkReaderMgr, propertyReaderMgr,
+                               vizmapReaderMgr, sessionTableReaderFactory, 
networkTableMgr, rootNetworkMgr);
+       }
+}

Added: 
core3/impl/trunk/session-impl/integration-test/src/test/java/org/cytoscape/session/BasicIntegrationTest.java
===================================================================
--- 
core3/impl/trunk/session-impl/integration-test/src/test/java/org/cytoscape/session/BasicIntegrationTest.java
                                (rev 0)
+++ 
core3/impl/trunk/session-impl/integration-test/src/test/java/org/cytoscape/session/BasicIntegrationTest.java
        2012-05-19 01:09:15 UTC (rev 29301)
@@ -0,0 +1,199 @@
+/*
+ * Copyright (C) 2011 Toni Menzel
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.cytoscape.session;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.ops4j.pax.exam.CoreOptions.felix;
+import static org.ops4j.pax.exam.CoreOptions.junitBundles;
+import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
+import static org.ops4j.pax.exam.CoreOptions.options;
+import static org.ops4j.pax.exam.CoreOptions.repository;
+
+import java.io.File;
+import java.util.Set;
+
+import javax.inject.Inject;
+
+import org.cytoscape.model.CyNetwork;
+import org.cytoscape.model.CyNetworkFactory;
+import org.cytoscape.model.CyNetworkManager;
+import org.cytoscape.task.read.OpenSessionTaskFactory;
+import org.cytoscape.view.model.VisualLexicon;
+import org.cytoscape.view.presentation.RenderingEngineManager;
+import org.cytoscape.work.SynchronousTaskManager;
+import org.cytoscape.work.TaskIterator;
+import org.junit.After;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.ops4j.pax.exam.Option;
+import org.ops4j.pax.exam.junit.Configuration;
+import org.ops4j.pax.exam.junit.ExamReactorStrategy;
+import org.ops4j.pax.exam.junit.JUnit4TestRunner;
+import org.ops4j.pax.exam.spi.reactors.AllConfinedStagedReactorFactory;
+import org.ops4j.pax.exam.util.Filter;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+
+@RunWith(JUnit4TestRunner.class)
+@ExamReactorStrategy( AllConfinedStagedReactorFactory.class )
+public class BasicIntegrationTest {
+
+       final String API_BUNDLE_VERSION = "3.0.0-beta2-SNAPSHOT";
+       final String IMPL_BUNDLE_VERSION = "3.0.0-alpha9-SNAPSHOT";
+
+       @Inject
+       private BundleContext bundleContext;
+
+       @Inject
+       private CyNetworkManager networkManager;
+       @Inject
+       private CyNetworkFactory networkFactory;
+       
+       @Inject
+       private CySessionManager sessionManager;
+       
+       @Inject
+       private RenderingEngineManager renderingEngineManager;
+       
+       @Inject @Filter("(id=ding)")
+       private VisualLexicon lexicon;
+       
+       @Inject
+       private OpenSessionTaskFactory openSessionTF;
+       
+       @Inject
+       private SynchronousTaskManager tm;
+
+       /**
+        * Build minimal set of bundles.
+        */
+       @Configuration
+       public Option[] config() {
+               return options(
+                               junitBundles(),
+                               felix(),
+                               
repository("http://code.cytoscape.org/nexus/content/repositories/snapshots/";),
+
+                               
+                               
+                               // Misc. bundles required to run minimal 
Cytoscape
+                               
mavenBundle().groupId("cytoscape-sun").artifactId("jhall").version("1.0"),
+                               // API bundles
+                               
+                               
+                               
+                               
mavenBundle().groupId("org.cytoscape").artifactId("event-api").version(API_BUNDLE_VERSION),
+                               
mavenBundle().groupId("org.cytoscape").artifactId("model-api").version(API_BUNDLE_VERSION),
+                               
mavenBundle().groupId("org.cytoscape").artifactId("group-api").version(API_BUNDLE_VERSION),
+                               
mavenBundle().groupId("org.cytoscape").artifactId("viewmodel-api").version(API_BUNDLE_VERSION),
+                               
mavenBundle().groupId("org.cytoscape").artifactId("presentation-api").version(API_BUNDLE_VERSION),
+                               
mavenBundle().groupId("org.cytoscape").artifactId("vizmap-api").version(API_BUNDLE_VERSION),
+                               
mavenBundle().groupId("org.cytoscape").artifactId("session-api").version(API_BUNDLE_VERSION),
+                               
mavenBundle().groupId("org.cytoscape").artifactId("io-api").version(API_BUNDLE_VERSION),
+                               
mavenBundle().groupId("org.cytoscape").artifactId("property-api").version(API_BUNDLE_VERSION),
+                               
mavenBundle().groupId("org.cytoscape").artifactId("work-api").version(API_BUNDLE_VERSION),
+                               
mavenBundle().groupId("org.cytoscape").artifactId("core-task-api").version(API_BUNDLE_VERSION),
+                               
mavenBundle().groupId("org.cytoscape").artifactId("application-api").version(API_BUNDLE_VERSION),
+                               
mavenBundle().groupId("org.cytoscape").artifactId("layout-api").version(API_BUNDLE_VERSION),
+                               
mavenBundle().groupId("org.cytoscape").artifactId("datasource-api").version(API_BUNDLE_VERSION),
+                               
mavenBundle().groupId("org.cytoscape").artifactId("vizmap-gui-api").version(API_BUNDLE_VERSION),
+                               
+                               
mavenBundle().groupId("org.cytoscape").artifactId("work-swing-api").version(API_BUNDLE_VERSION),
+                               
mavenBundle().groupId("org.cytoscape").artifactId("swing-application-api").version(API_BUNDLE_VERSION),
+                               
mavenBundle().groupId("org.cytoscape").artifactId("equations-api").version(API_BUNDLE_VERSION),
+                               
+                               
mavenBundle().groupId("org.cytoscape").artifactId("swing-application-api").version(API_BUNDLE_VERSION),
+                               
+                               
mavenBundle().groupId("org.cytoscape").artifactId("service-api").version(API_BUNDLE_VERSION),
+                               
+                               
mavenBundle().groupId("com.googlecode.guava-osgi").artifactId("guava-osgi").version("9.0.0"),
+                               
mavenBundle().groupId("cytoscape-temp").artifactId("parallelcolt").version("0.9.4"),
+                               
mavenBundle().groupId("cytoscape-temp").artifactId("opencsv").version("2.1"),
+                               
mavenBundle().groupId("com.lowagie.text").artifactId("com.springsource.com.lowagie.text").version("2.0.8"),
+                               
mavenBundle().groupId("cytoscape-temp").artifactId("freehep-graphicsio").version("2.1.3"),
+                               
mavenBundle().groupId("cytoscape-temp").artifactId("freehep-graphicsio-svg").version("2.1.3"),
+                               
mavenBundle().groupId("cytoscape-temp").artifactId("freehep-graphicsio-ps").version("2.1.3"),
+                               
mavenBundle().groupId("cytoscape-temp").artifactId("freehep-graphics2d").version("2.1.3"),
+                               
mavenBundle().groupId("cytoscape-temp").artifactId("l2fprod-common-shared").version("7.3"),
+                               
mavenBundle().groupId("cytoscape-temp").artifactId("l2fprod-common-fontchooser").version("7.3"),
+                               
mavenBundle().groupId("cytoscape-temp").artifactId("l2fprod-common-sheet").version("7.3"),
+                               
mavenBundle().groupId("cytoscape-temp").artifactId("org.swinglabs.swingx").version("1.6.1"),
+                               
mavenBundle().groupId("cytoscape-temp").artifactId("freehep-export").version("2.1.1"),
+                               
mavenBundle().groupId("cytoscape-temp").artifactId("freehep-util").version("2.0.2"),
+                               
+                               
+                               
mavenBundle().groupId("org.cytoscape").artifactId("property-impl").version(IMPL_BUNDLE_VERSION),
+                               
mavenBundle().groupId("org.cytoscape").artifactId("datasource-impl").version(IMPL_BUNDLE_VERSION),
+                               
mavenBundle().groupId("org.cytoscape").artifactId("equations-impl").version(IMPL_BUNDLE_VERSION),
+                               
mavenBundle().groupId("org.cytoscape").artifactId("event-impl").version(IMPL_BUNDLE_VERSION),
+                               
mavenBundle().groupId("org.cytoscape").artifactId("swing-util-api").version(API_BUNDLE_VERSION),
+                               
mavenBundle().groupId("org.cytoscape").artifactId("model-impl").version(IMPL_BUNDLE_VERSION),
+                               
mavenBundle().groupId("org.cytoscape").artifactId("group-impl").version(IMPL_BUNDLE_VERSION),
+                               
mavenBundle().groupId("org.cytoscape").artifactId("work-impl").version(IMPL_BUNDLE_VERSION),
+                               
mavenBundle().groupId("org.cytoscape").artifactId("work-headless-impl").version(IMPL_BUNDLE_VERSION),
+                               
+                               
mavenBundle().groupId("org.cytoscape").artifactId("layout-impl").version(IMPL_BUNDLE_VERSION),
+                               
mavenBundle().groupId("org.cytoscape").artifactId("viewmodel-impl").version(IMPL_BUNDLE_VERSION),
+                               
mavenBundle().groupId("org.cytoscape").artifactId("presentation-impl").version(IMPL_BUNDLE_VERSION),
+                               
mavenBundle().groupId("org.cytoscape").artifactId("vizmap-impl").version(IMPL_BUNDLE_VERSION),
+                               
mavenBundle().groupId("org.cytoscape").artifactId("application-impl").version(IMPL_BUNDLE_VERSION),
+                               
mavenBundle().groupId("org.cytoscape").artifactId("session-impl").version(IMPL_BUNDLE_VERSION),
+                               
mavenBundle().groupId("org.cytoscape").artifactId("ding-presentation-impl").version(IMPL_BUNDLE_VERSION),
+                               
+                               
mavenBundle().groupId("org.cytoscape").artifactId("io-impl").version(IMPL_BUNDLE_VERSION),
+                               
mavenBundle().groupId("org.cytoscape").artifactId("core-task-impl").version(IMPL_BUNDLE_VERSION),
+                               
+                               
mavenBundle().groupId("org.cytoscape").artifactId("vizmap-gui-impl").version(IMPL_BUNDLE_VERSION)
+               );
+       }
+
+       @Test
+       public void test() throws Exception {
+               assertNotNull(bundleContext);
+               Bundle[] bundles = bundleContext.getBundles();
+               
+               for(Bundle bundle:bundles) {
+                       System.out.println(bundle.getState() + ": Bundle: " + 
bundle.getSymbolicName() + " Correct state=" + Bundle.ACTIVE);
+                       ServiceReference<?>[] services = 
bundle.getRegisteredServices();
+                       if(services != null)
+                               System.out.println("# service: " + 
services.length);
+               }
+               assertNotNull(bundles);
+               assertNotNull(networkManager);
+               assertNotNull(networkFactory);
+               assertNotNull(sessionManager);
+               assertNotNull(renderingEngineManager);
+               
+               assertNotNull(tm);
+               assertNotNull(openSessionTF);
+               
+               final File sessionFile1 = new 
File("./src/test/resources/testData/" + "smallSession.cys");
+               final TaskIterator ti = 
openSessionTF.createTaskIterator(sessionFile1);
+               tm.execute(ti);
+       }
+       
+       @After
+       public void confirm() {
+               Set<CyNetwork> networks = networkManager.getNetworkSet();
+               assertEquals(2, networks.size());
+//             CyNetwork net1 = networks.iterator().next();
+//             CyNetwork net2 = networks.iterator().next();
+//             assertEquals(22, net1.getNodeCount());
+       }
+       
+}

Added: 
core3/impl/trunk/session-impl/integration-test/src/test/resources/testData/smallSession.cys
===================================================================
(Binary files differ)


Property changes on: 
core3/impl/trunk/session-impl/integration-test/src/test/resources/testData/smallSession.cys
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

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