Author: mes
Date: 2010-10-28 17:01:04 -0700 (Thu, 28 Oct 2010)
New Revision: 22633
Modified:
core3/viewmodel-impl/trunk/pom.xml
core3/viewmodel-impl/trunk/src/test/java/org/cytoscape/view/model/CyNetworkViewTest.java
core3/viewmodel-impl/trunk/src/test/java/org/cytoscape/view/model/CyNodeViewTest.java
Log:
fixed unit tests to use mockito instead of impl code
Modified: core3/viewmodel-impl/trunk/pom.xml
===================================================================
--- core3/viewmodel-impl/trunk/pom.xml 2010-10-28 23:59:33 UTC (rev 22632)
+++ core3/viewmodel-impl/trunk/pom.xml 2010-10-29 00:01:04 UTC (rev 22633)
@@ -158,12 +158,12 @@
<dependency>
<groupId>org.cytoscape</groupId>
<artifactId>viewmodel-api</artifactId>
- <version>1.0-SNAPSHOT</version>
+ <version>3.0.0-alpha2</version>
</dependency>
<dependency>
<groupId>org.cytoscape</groupId>
<artifactId>service-util</artifactId>
- <version>1.0-SNAPSHOT</version>
+ <version>3.0.0-alpha1</version>
</dependency>
<!-- for spring integration testing -->
@@ -174,35 +174,28 @@
<scope>test</scope>
</dependency>
<dependency>
- <groupId>org.cytoscape</groupId>
- <artifactId>integration-test-support</artifactId>
- <version>1.0-SNAPSHOT</version>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-all</artifactId>
+ <version>1.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.cytoscape</groupId>
- <artifactId>model-impl</artifactId>
- <version>1.0-SNAPSHOT</version>
- <type>test-jar</type>
+ <artifactId>integration-test-support</artifactId>
+ <version>3.0.0-alpha2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.cytoscape</groupId>
- <artifactId>model-impl</artifactId>
- <version>1.0-SNAPSHOT</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.cytoscape</groupId>
<artifactId>event-api</artifactId>
- <version>1.0-SNAPSHOT</version>
+ <version>3.0.0-alpha1</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.cytoscape</groupId>
<artifactId>viewmodel-api</artifactId>
- <version>1.0-SNAPSHOT</version>
+ <version>3.0.0-alpha2</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
Modified:
core3/viewmodel-impl/trunk/src/test/java/org/cytoscape/view/model/CyNetworkViewTest.java
===================================================================
---
core3/viewmodel-impl/trunk/src/test/java/org/cytoscape/view/model/CyNetworkViewTest.java
2010-10-28 23:59:33 UTC (rev 22632)
+++
core3/viewmodel-impl/trunk/src/test/java/org/cytoscape/view/model/CyNetworkViewTest.java
2010-10-29 00:01:04 UTC (rev 22633)
@@ -2,7 +2,6 @@
import org.cytoscape.event.CyEventHelper;
import org.cytoscape.event.DummyCyEventHelper;
-import org.cytoscape.model.TestCyNetworkFactory;
import org.cytoscape.view.model.AbstractCyNetworkViewTest;
import org.cytoscape.view.model.internal.NetworkViewImpl;
import org.junit.After;
@@ -13,17 +12,8 @@
@Before
public void setUp() throws Exception {
- network = TestCyNetworkFactory.getInstance();
buildNetwork();
final CyEventHelper mockHelper = new DummyCyEventHelper();
view = new NetworkViewImpl(network, mockHelper);
}
-
-
- @After
- public void tearDown() throws Exception {
- }
-
-
-
}
Modified:
core3/viewmodel-impl/trunk/src/test/java/org/cytoscape/view/model/CyNodeViewTest.java
===================================================================
---
core3/viewmodel-impl/trunk/src/test/java/org/cytoscape/view/model/CyNodeViewTest.java
2010-10-28 23:59:33 UTC (rev 22632)
+++
core3/viewmodel-impl/trunk/src/test/java/org/cytoscape/view/model/CyNodeViewTest.java
2010-10-29 00:01:04 UTC (rev 22633)
@@ -2,12 +2,12 @@
import static org.junit.Assert.*;
import static org.junit.Assert.assertNotNull;
+import static org.mockito.Mockito.*;
import org.cytoscape.event.CyEventHelper;
import org.cytoscape.event.DummyCyEventHelper;
import org.cytoscape.model.CyNetwork;
import org.cytoscape.model.CyNode;
-import org.cytoscape.model.TestCyNetworkFactory;
import org.cytoscape.view.model.AbstractViewTest;
import org.cytoscape.view.model.internal.NodeViewImpl;
import org.cytoscape.view.model.internal.ViewImpl;
@@ -21,20 +21,12 @@
public void setUp() throws Exception {
super.setUp();
- final CyNetwork network = TestCyNetworkFactory.getInstance();
- final CyNode node = network.addNode();
-
+ final CyNode node = mock(CyNode.class);
final CyEventHelper mockHelper = new DummyCyEventHelper();
view = new NodeViewImpl(node, mockHelper, null);
-
}
-
- @After
- public void tearDown() throws Exception {
- }
-
@Test
public void testGetModel() {
assertNotNull( view.getModel() );
@@ -44,7 +36,5 @@
modelTypeTest = true;
assertTrue(modelTypeTest);
-
}
-
}
--
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.