Author: ruschein
Date: 2011-07-12 10:52:26 -0700 (Tue, 12 Jul 2011)
New Revision: 26150
Modified:
core3/work-swing-impl/trunk/it/src/test/java/org/cytoscape/work/ServiceConfigurationTest.java
Log:
Fixed some integration test failures.
Modified:
core3/work-swing-impl/trunk/it/src/test/java/org/cytoscape/work/ServiceConfigurationTest.java
===================================================================
---
core3/work-swing-impl/trunk/it/src/test/java/org/cytoscape/work/ServiceConfigurationTest.java
2011-07-12 17:28:39 UTC (rev 26149)
+++
core3/work-swing-impl/trunk/it/src/test/java/org/cytoscape/work/ServiceConfigurationTest.java
2011-07-12 17:52:26 UTC (rev 26150)
@@ -1,4 +1,4 @@
-package org.cytoscape.work;
+package org.cytoscape.work;
import java.util.Properties;
@@ -6,6 +6,7 @@
import org.cytoscape.integration.ServiceTestSupport;
import org.cytoscape.property.BasicCyProperty;
import org.cytoscape.property.CyProperty;
+import org.cytoscape.property.bookmark.Bookmarks;
import org.cytoscape.property.bookmark.BookmarksUtil;
import org.cytoscape.work.swing.GUITaskManager;
import org.cytoscape.work.swing.GUITunableHandlerFactory;
@@ -25,16 +26,21 @@
public void setup() {
Properties coreP = new Properties();
coreP.setProperty("cyPropertyName","coreSettings");
-
+
Properties p = new Properties();
p.setProperty("cyPropertyName","bookmarks");
- CyProperty<Properties> cyProp = new BasicCyProperty(new
Properties(), CyProperty.SavePolicy.CONFIG_DIR);
+ CyProperty<Properties> cyProp =
+ new BasicCyProperty(new Properties(),
CyProperty.SavePolicy.CONFIG_DIR);
registerMockService(CyProperty.class, cyProp, coreP);
- registerMockService(CyProperty.class, cyProp, p);
+
+ BookmarksCyProperty cyBookProp =
+ new BookmarksCyProperty(new Bookmarks(),
CyProperty.SavePolicy.CONFIG_DIR);
+ registerMockService(CyProperty.class, cyBookProp, p);
+
registerMockService(BookmarksUtil.class);
}
-
+
@Test
public void testExpectedServices() {
checkService(GUITaskManager.class);
@@ -45,3 +51,33 @@
checkService(UndoSupport.class);
}
}
+
+
+/**
+ * A simple implementation of CyProperty<Properties> suitable for
+ * general purpose use.
+ */
+final class BookmarksCyProperty implements CyProperty<Bookmarks> {
+ private final Bookmarks bookmarks;
+ private final CyProperty.SavePolicy savePolicy;
+
+ public BookmarksCyProperty(final Bookmarks bookmarks, final
CyProperty.SavePolicy savePolicy)
+ {
+ if (bookmarks == null)
+ throw new NullPointerException("\"bookmarks\" parameter
is null!");
+ if (savePolicy == null)
+ throw new NullPointerException("\"savePolicy\"
parameter is null!");
+
+ this.bookmarks = bookmarks;
+ this.savePolicy = savePolicy;
+ }
+
+ public Bookmarks getProperties() {
+ return bookmarks;
+
+ }
+
+ public CyProperty.SavePolicy getSavePolicy() {
+ return savePolicy;
+ }
+}
--
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.