Author: kono
Date: 2009-03-10 01:31:46 -0700 (Tue, 10 Mar 2009)
New Revision: 16191
Modified:
core3/io-impl/trunk/pom.xml
core3/io-impl/trunk/src/main/resources/META-INF/spring/bundle-context.xml
core3/io-impl/trunk/src/test/java/org/cytoscape/io/internal/BeanIntegrationTest.java
Log:
Mock objects had been added to Integration Test.
Modified: core3/io-impl/trunk/pom.xml
===================================================================
--- core3/io-impl/trunk/pom.xml 2009-03-10 00:01:07 UTC (rev 16190)
+++ core3/io-impl/trunk/pom.xml 2009-03-10 08:31:46 UTC (rev 16191)
@@ -84,6 +84,14 @@
<dependencies>
<dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.4</version>
+ <scope>test</scope>
+ </dependency>
+
+
+ <dependency>
<groupId>org.osgi</groupId>
<artifactId>osgi_R4_core</artifactId>
<version>1.0</version>
@@ -98,13 +106,8 @@
<optional>true</optional>
</dependency>
+
<dependency>
- <groupId>org.junit</groupId>
- <artifactId>com.springsource.org.junit</artifactId>
- <version>4.5.0</version>
- <scope>test</scope>
- </dependency>
- <dependency>
<groupId>org.easymock</groupId>
<artifactId>com.springsource.org.easymock</artifactId>
<version>2.3.0</version>
Modified:
core3/io-impl/trunk/src/main/resources/META-INF/spring/bundle-context.xml
===================================================================
--- core3/io-impl/trunk/src/main/resources/META-INF/spring/bundle-context.xml
2009-03-10 00:01:07 UTC (rev 16190)
+++ core3/io-impl/trunk/src/main/resources/META-INF/spring/bundle-context.xml
2009-03-10 08:31:46 UTC (rev 16191)
@@ -66,10 +66,10 @@
<!-- Network Readers -->
<bean id="sifReader"
class="org.cytoscape.io.read.internal.sif.InteractionsReader">
<constructor-arg ref="readUtil" />
- <property name="cyNetworkFactory"
ref="cyNetworkFactoryServiceRef" />
+ <!--<property name="cyNetworkFactory"
ref="cyNetworkFactoryServiceRef" />
<property name="graphViewFactory"
ref="graphViewFactoryServiceRef" />
<property name="layouts" ref="cyLayoutsServiceRef" />
- </bean>
+ --></bean>
<!-- Utilities for XGMML Reader -->
@@ -93,13 +93,13 @@
</bean>
<bean id="xgmmlReader"
class="org.cytoscape.io.read.internal.xgmml.XGMMLReader">
- <property name="cyNetworkFactory"
ref="cyNetworkFactoryServiceRef" />
<property name="parser" ref="xgmmlParser" />
<property name="readDataManager" ref="readDataManager" />
<property name="attributeValueUtil" ref="attributeValueUtil" />
- <property name="graphViewFactory"
ref="graphViewFactoryServiceRef" />
+ <!--<property name="graphViewFactory"
ref="graphViewFactoryServiceRef" />
<property name="layouts" ref="cyLayoutsServiceRef" />
- </bean>
+ <property name="cyNetworkFactory"
ref="cyNetworkFactoryServiceRef" />
+ --></bean>
<!-- Attribute Readers -->
Modified:
core3/io-impl/trunk/src/test/java/org/cytoscape/io/internal/BeanIntegrationTest.java
===================================================================
---
core3/io-impl/trunk/src/test/java/org/cytoscape/io/internal/BeanIntegrationTest.java
2009-03-10 00:01:07 UTC (rev 16190)
+++
core3/io-impl/trunk/src/test/java/org/cytoscape/io/internal/BeanIntegrationTest.java
2009-03-10 08:31:46 UTC (rev 16191)
@@ -1,33 +1,61 @@
package org.cytoscape.io.internal;
+import org.cytoscape.io.CyFileFilter;
import org.cytoscape.io.read.CyReader;
import org.cytoscape.io.read.CyReaderManager;
+import org.cytoscape.io.read.internal.AbstractNetworkReader;
+import org.cytoscape.model.CyNetworkFactory;
+import org.cytoscape.view.GraphViewFactory;
import org.junit.Before;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import
org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests;
+import static org.easymock.EasyMock.*;
+
+
/**
* Integration test the bundle locally (outside of OSGi). Use AbstractOsgiTests
* and a separate integration test project for testing inside of OSGi.
*/
-...@contextconfiguration(locations = "META-INF/spring/bundle-context.xml")
+...@contextconfiguration(locations =
"classpath:META-INF/spring/bundle-context.xml")
public class BeanIntegrationTest extends AbstractJUnit4SpringContextTests {
@Autowired
private CyReaderManager manager;
- @Autowired
private CyReader sifReader;
+ private CyReader xgmmlReader;
+
+ private CyNetworkFactory factoryMock;
+ private GraphViewFactory viewFactoryMock;
+ private CyFileFilter sifFilter;
+
@Before
- public void init() {
+ public void initializeTest1() {
+ sifReader = (CyReader) applicationContext.getBean("sifReader");
+ xgmmlReader = (CyReader)
applicationContext.getBean("xgmmlReader");
+ sifFilter = (CyFileFilter)
applicationContext.getBean("sifFilter");
+
+
+ factoryMock = createMock(CyNetworkFactory.class);
+ viewFactoryMock = createMock(GraphViewFactory.class);
+
+
((AbstractNetworkReader)sifReader).setCyNetworkFactory(factoryMock);
+
+ System.out.println("--------------------------------------- SIF
Description = " + sifFilter.getDescription());
}
- @Test
- public void testManager() {
+
+ /**
+ * Test using mock service objects.
+ */
+ @Test public void fooManager() {
+ System.out.println("---------------------------------------
Test1 ");
+ System.out.println("---------------------------------------
Test12 " + this.applicationContext);
}
}
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---