Author: ruschein
Date: 2010-09-01 15:52:44 -0700 (Wed, 01 Sep 2010)
New Revision: 21659

Added:
   core3/work-api/trunk/src/test/java/org/cytoscape/work/TunableHandlerTest.java
   core3/work-api/trunk/src/test/java/org/cytoscape/work/util/
   
core3/work-api/trunk/src/test/java/org/cytoscape/work/util/BoundedDoubleTest.java
   
core3/work-api/trunk/src/test/java/org/cytoscape/work/util/BoundedFloatTest.java
   
core3/work-api/trunk/src/test/java/org/cytoscape/work/util/BoundedIntegerTest.java
   
core3/work-api/trunk/src/test/java/org/cytoscape/work/util/BoundedLongTest.java
Log:
Added various unit tests.

Added: 
core3/work-api/trunk/src/test/java/org/cytoscape/work/TunableHandlerTest.java
===================================================================
--- 
core3/work-api/trunk/src/test/java/org/cytoscape/work/TunableHandlerTest.java   
                            (rev 0)
+++ 
core3/work-api/trunk/src/test/java/org/cytoscape/work/TunableHandlerTest.java   
    2010-09-01 22:52:44 UTC (rev 21659)
@@ -0,0 +1,178 @@
+/*
+ Copyright (c) 2010, The Cytoscape Consortium (www.cytoscape.org)
+
+ This library is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as published
+ by the Free Software Foundation; either version 2.1 of the License, or
+ any later version.
+
+ This library is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF
+ MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  The software and
+ documentation provided hereunder is on an "as is" basis, and the
+ Institute for Systems Biology and the Whitehead Institute
+ have no obligations to provide maintenance, support,
+ updates, enhancements or modifications.  In no event shall the
+ Institute for Systems Biology and the Whitehead Institute
+ be liable to any party for direct, indirect, special,
+ incidental or consequential damages, including lost profits, arising
+ out of the use of this software and its documentation, even if the
+ Institute for Systems Biology and the Whitehead Institute
+ have been advised of the possibility of such damage.  See
+ the GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this library; if not, write to the Free Software Foundation,
+ Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+*/
+package org.cytoscape.work;
+
+
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+
+import static org.junit.Assert.*;
+import org.junit.Before;
+import org.junit.Test;
+
+
+public class TunableHandlerTest {
+       private final HasAnnotatedField hasAnnotatedField = new 
HasAnnotatedField();
+       private final HasAnnotatedSetterAndGetterMethods 
hasAnnotatedSetterAndGetterMethods = new HasAnnotatedSetterAndGetterMethods();
+       private TunableHandler fieldHandler;
+       private TunableHandler getterAndSetterHandler;
+
+       @Before
+       public final void init() throws Exception {
+               final Field annotatedIntField = 
hasAnnotatedField.getClass().getField("annotatedInt");
+               final Tunable annotatedIntTunable = 
annotatedIntField.getAnnotation(Tunable.class);
+               fieldHandler = new SimpleTunableHandler(annotatedIntField, 
hasAnnotatedField, annotatedIntTunable);
+
+               final Method getterMethod = 
HasAnnotatedSetterAndGetterMethods.class.getMethod("getPrivateInt");
+               final Method setterMethod = 
HasAnnotatedSetterAndGetterMethods.class.getMethod("setPrivateInt", int.class);
+               final Tunable getterAndSetterTunable = 
getterMethod.getAnnotation(Tunable.class);
+               getterAndSetterHandler = new SimpleTunableHandler(getterMethod, 
setterMethod,
+                                                                 
hasAnnotatedSetterAndGetterMethods,
+                                                                 
getterAndSetterTunable);
+       }
+
+       @Test
+       public final void testSetAndGetValue() throws Exception {
+               final Integer newIntValue = Integer.valueOf(-3);
+               fieldHandler.setValue(newIntValue);
+               assertEquals("Value set on an annotated field is not as 
expected!", newIntValue, fieldHandler.getValue());
+
+               getterAndSetterHandler.setValue(newIntValue);
+               assertEquals("Value set on an annotated getter/setter pair is 
not as expected!", newIntValue, getterAndSetterHandler.getValue());
+       }
+
+       @Test
+       public final void testGetDescription() {
+               assertEquals("Description on an annotated field is not as 
expected!", "An annotated field", fieldHandler.getDescription());
+               assertEquals("Description on an annotated getter/setter pair is 
not as expected!",
+                            "Annotated setters and getters", 
getterAndSetterHandler.getDescription());
+       }
+
+       @Test
+       public final void testGetFlags() {
+               assertArrayEquals("The flags property of the tunable of an 
annotated field is not as expected!",
+                                 new Tunable.Param[] { }, 
fieldHandler.getFlags());
+               assertArrayEquals("The flags property of the tunable of an 
annotated getter/setter pair is not as expected!",
+                                 new Tunable.Param[] { }, 
getterAndSetterHandler.getFlags());
+       }
+
+       @Test
+       public final void testGetAlignments() {
+               assertArrayEquals("The alignments property of the tunable of an 
annotated field is not as expected!",
+                                 new Tunable.Param[] { }, 
fieldHandler.getAlignments());
+               assertArrayEquals("The alignments property of the tunable of an 
annotated getter/setter pair is not as expected!",
+                                 new Tunable.Param[] { }, 
getterAndSetterHandler.getAlignments());
+       }
+
+       @Test
+       public final void testGetGroups() {
+               assertArrayEquals("The groups property of the tunable of an 
annotated field is not as expected!",
+                                 new String[] { "group1" }, 
fieldHandler.getGroups());
+               assertArrayEquals("The groups property of the tunable of an 
annotated getter/setter pair is not as expected!",
+                                 new String[] { "group2" }, 
getterAndSetterHandler.getGroups());
+       }
+
+       @Test
+       public final void testGetGroupTitleFlags() {
+               assertArrayEquals("The group title flags property of the 
tunable of an annotated field is not as expected!",
+                                 new Tunable.Param[] { }, 
fieldHandler.getGroupTitleFlags());
+               assertArrayEquals("The group title flags property of the 
tunable of an annotated getter/setter pair is not as expected!",
+                                 new Tunable.Param[] { }, 
getterAndSetterHandler.getGroupTitleFlags());
+       }
+
+       @Test
+       public final void testControlsMutuallyExclusiveNestedChildren() {
+               assertEquals("The controls-mutually-exclusive-nexted-children 
state of the tunable of an annotated field is not as expected!",
+                            false, 
fieldHandler.controlsMutuallyExclusiveNestedChildren());
+               assertEquals("The controls-mutually-exclusive-nexted-children 
state of the tunable of annotated getter/setter pair is not as expected!",
+                            false, 
getterAndSetterHandler.controlsMutuallyExclusiveNestedChildren());
+       }
+
+       @Test
+       public final void testGetChildKey() {
+               assertEquals("The child-key property of an annotated field is 
not as expected!",
+                            "", fieldHandler.getChildKey());
+               assertEquals("The child-key property of an annotated 
getter/setter pair is not as expected!",
+                            "", getterAndSetterHandler.getChildKey());
+       }
+
+       @Test
+       public final void testGetName() {
+               assertEquals("Name of an annotated field is not as expected!", 
"annotatedInt", fieldHandler.getName());
+               assertEquals("Name of an annotated getter/setter pair is not as 
expected!", "PrivateInt", getterAndSetterHandler.getName());
+       }
+
+       @Test
+       public final void testGetDependsOn() {
+               assertEquals("The depends-on property of an annotated field is 
not as expected!",
+                            "Fred", fieldHandler.dependsOn());
+               assertEquals("The depends-on property of an annotated 
getter/setter pair is not as expected!",
+                            "Bob", getterAndSetterHandler.dependsOn());
+       }
+
+       @Test
+       public final void testGetQualifiedName() {
+               assertEquals("Qualified name of an annotated field is not as 
expected!",
+                            "HasAnnotatedField.annotatedInt", 
fieldHandler.getQualifiedName());
+               assertEquals("Qualified name of an annotated getter/setter pair 
is not as expected!",
+                            "HasAnnotatedSetterAndGetterMethods.PrivateInt", 
getterAndSetterHandler.getQualifiedName());
+       }
+}
+
+
+class HasAnnotatedField {
+       @Tunable(description="An annotated field", groups={"group1"}, 
dependsOn="Fred")
+       public int annotatedInt;
+
+       public int getAnnotatedInt() { return annotatedInt; }
+}
+
+
+class HasAnnotatedSetterAndGetterMethods {
+       private int privateInt;
+
+       public void setPrivateInt(final int newValue) {
+               privateInt = newValue;
+       }
+
+       @Tunable(description="Annotated setters and getters", 
groups={"group2"}, dependsOn="Bob")
+       public int getPrivateInt() {
+               return privateInt;
+       }
+}
+
+
+class SimpleTunableHandler extends AbstractTunableHandler {
+       public SimpleTunableHandler(final Field field, final Object instance, 
final Tunable tunable) {
+               super(field, instance, tunable);
+       }
+
+       public SimpleTunableHandler(final Method getter, final Method setter, 
final Object instance, final Tunable tunable) {
+               super(getter, setter, instance, tunable);
+       }
+}

Added: 
core3/work-api/trunk/src/test/java/org/cytoscape/work/util/BoundedDoubleTest.java
===================================================================
--- 
core3/work-api/trunk/src/test/java/org/cytoscape/work/util/BoundedDoubleTest.java
                           (rev 0)
+++ 
core3/work-api/trunk/src/test/java/org/cytoscape/work/util/BoundedDoubleTest.java
   2010-09-01 22:52:44 UTC (rev 21659)
@@ -0,0 +1,92 @@
+/*
+ Copyright (c) 2010, The Cytoscape Consortium (www.cytoscape.org)
+
+ This library is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as published
+ by the Free Software Foundation; either version 2.1 of the License, or
+ any later version.
+
+ This library is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF
+ MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  The software and
+ documentation provided hereunder is on an "as is" basis, and the
+ Institute for Systems Biology and the Whitehead Institute
+ have no obligations to provide maintenance, support,
+ updates, enhancements or modifications.  In no event shall the
+ Institute for Systems Biology and the Whitehead Institute
+ be liable to any party for direct, indirect, special,
+ incidental or consequential damages, including lost profits, arising
+ out of the use of this software and its documentation, even if the
+ Institute for Systems Biology and the Whitehead Institute
+ have been advised of the possibility of such damage.  See
+ the GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this library; if not, write to the Free Software Foundation,
+ Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+*/
+package org.cytoscape.work.util;
+
+
+import static org.junit.Assert.*;
+import org.junit.Before;
+import org.junit.Test;
+
+
+public class BoundedDoubleTest {
+       private BoundedDouble bd;
+       
+       @Before
+       public void init() {
+               bd = new BoundedDouble(-1.0, 0.0, 1.0, /* lowerStrict = */ 
true, /* upperStrict = */ false);
+       }
+
+       @Test
+       public final void testLowerBound() throws Exception {
+               assertEquals("Lower bound not as expected!", 
Double.valueOf(-1.0), bd.getLowerBound());
+       }
+
+       @Test
+       public final void testUpperBound() throws Exception {
+               assertEquals("Upper bound not as expected!", 
Double.valueOf(1.0), bd.getUpperBound());
+       }
+
+       @Test
+       public final void testIsLowerBoundStrict() throws Exception {
+               assertEquals("Strictness of lower bound not as expected!", 
true, bd.isLowerBoundStrict());
+       }
+
+       @Test
+       public final void testIsUpperBoundStrict() throws Exception {
+               assertEquals("Strictness of upper bound not as expected!", 
false, bd.isUpperBoundStrict());
+       }
+
+       @Test
+       public final void testSettingValidValue() throws Exception {
+               bd.setValue(0.3);
+               assertEquals("Value not as expected!", Double.valueOf(0.3), 
bd.getValue());
+       }
+
+       @Test
+       public final void testSettingValidValueWithString() throws Exception {
+               bd.setValue("0.3");
+               assertEquals("Value not as expected!", Double.valueOf(0.3), 
bd.getValue());
+       }
+
+       @Test(expected=IllegalArgumentException.class)
+               public final void testSettingInvalidValue() throws Exception {
+               bd.setValue(-1.0);
+       }
+
+       @Test
+       public final void testSettingValueEqualToUpperBound() throws Exception {
+               bd.setValue(1.0);
+               assertEquals("Value not as expected!", Double.valueOf(1.0), 
bd.getValue());
+               
+       }
+
+       @Test(expected=IllegalArgumentException.class)
+       public final void 
testConstructionWithLowerBoundBeingGreaterThanUpperBound() throws Exception {
+               new BoundedDouble(1.0, 0.0, -1.0, /* lowerStrict = */ true, /* 
upperStrict = */ false);
+       }
+}

Added: 
core3/work-api/trunk/src/test/java/org/cytoscape/work/util/BoundedFloatTest.java
===================================================================
--- 
core3/work-api/trunk/src/test/java/org/cytoscape/work/util/BoundedFloatTest.java
                            (rev 0)
+++ 
core3/work-api/trunk/src/test/java/org/cytoscape/work/util/BoundedFloatTest.java
    2010-09-01 22:52:44 UTC (rev 21659)
@@ -0,0 +1,92 @@
+/*
+ Copyright (c) 2010, The Cytoscape Consortium (www.cytoscape.org)
+
+ This library is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as published
+ by the Free Software Foundation; either version 2.1 of the License, or
+ any later version.
+
+ This library is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF
+ MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  The software and
+ documentation provided hereunder is on an "as is" basis, and the
+ Institute for Systems Biology and the Whitehead Institute
+ have no obligations to provide maintenance, support,
+ updates, enhancements or modifications.  In no event shall the
+ Institute for Systems Biology and the Whitehead Institute
+ be liable to any party for direct, indirect, special,
+ incidental or consequential damages, including lost profits, arising
+ out of the use of this software and its documentation, even if the
+ Institute for Systems Biology and the Whitehead Institute
+ have been advised of the possibility of such damage.  See
+ the GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this library; if not, write to the Free Software Foundation,
+ Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+*/
+package org.cytoscape.work.util;
+
+
+import static org.junit.Assert.*;
+import org.junit.Before;
+import org.junit.Test;
+
+
+public class BoundedFloatTest {
+       private BoundedFloat bf;
+       
+       @Before
+       public void init() {
+               bf = new BoundedFloat(-1.0f, 0.0f, 1.0f, /* lowerStrict = */ 
true, /* upperStrict = */ false);
+       }
+
+       @Test
+       public final void testLowerBound() throws Exception {
+               assertEquals("Lower bound not as expected!", 
Float.valueOf(-1.0f), bf.getLowerBound());
+       }
+
+       @Test
+       public final void testUpperBound() throws Exception {
+               assertEquals("Upper bound not as expected!", 
Float.valueOf(1.0f), bf.getUpperBound());
+       }
+
+       @Test
+       public final void testIsLowerBoundStrict() throws Exception {
+               assertEquals("Strictness of lower bound not as expected!", 
true, bf.isLowerBoundStrict());
+       }
+
+       @Test
+       public final void testIsUpperBoundStrict() throws Exception {
+               assertEquals("Strictness of upper bound not as expected!", 
false, bf.isUpperBoundStrict());
+       }
+
+       @Test
+       public final void testSettingValidValue() throws Exception {
+               bf.setValue(0.3f);
+               assertEquals("Value not as expected!", Float.valueOf(0.3f), 
bf.getValue());
+       }
+
+       @Test
+       public final void testSettingValidValueWithString() throws Exception {
+               bf.setValue("0.3");
+               assertEquals("Value not as expected!", Float.valueOf(0.3f), 
bf.getValue());
+       }
+
+       @Test(expected=IllegalArgumentException.class)
+               public final void testSettingInvalidValue() throws Exception {
+               bf.setValue(-1.0f);
+       }
+
+       @Test
+       public final void testSettingValueEqualToUpperBound() throws Exception {
+               bf.setValue(1.0f);
+               assertEquals("Value not as expected!", Float.valueOf(1.0f), 
bf.getValue());
+               
+       }
+
+       @Test(expected=IllegalArgumentException.class)
+       public final void 
testConstructionWithLowerBoundBeingGreaterThanUpperBound() throws Exception {
+               new BoundedFloat(1.0f, 0.0f, -1.0f, /* lowerStrict = */ true, 
/* upperStrict = */ false);
+       }
+}

Added: 
core3/work-api/trunk/src/test/java/org/cytoscape/work/util/BoundedIntegerTest.java
===================================================================
--- 
core3/work-api/trunk/src/test/java/org/cytoscape/work/util/BoundedIntegerTest.java
                          (rev 0)
+++ 
core3/work-api/trunk/src/test/java/org/cytoscape/work/util/BoundedIntegerTest.java
  2010-09-01 22:52:44 UTC (rev 21659)
@@ -0,0 +1,92 @@
+/*
+ Copyright (c) 2010, The Cytoscape Consortium (www.cytoscape.org)
+
+ This library is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as published
+ by the Free Software Foundation; either version 2.1 of the License, or
+ any later version.
+
+ This library is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF
+ MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  The software and
+ documentation provided hereunder is on an "as is" basis, and the
+ Institute for Systems Biology and the Whitehead Institute
+ have no obligations to provide maintenance, support,
+ updates, enhancements or modifications.  In no event shall the
+ Institute for Systems Biology and the Whitehead Institute
+ be liable to any party for direct, indirect, special,
+ incidental or consequential damages, including lost profits, arising
+ out of the use of this software and its documentation, even if the
+ Institute for Systems Biology and the Whitehead Institute
+ have been advised of the possibility of such damage.  See
+ the GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this library; if not, write to the Free Software Foundation,
+ Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+*/
+package org.cytoscape.work.util;
+
+
+import static org.junit.Assert.*;
+import org.junit.Before;
+import org.junit.Test;
+
+
+public class BoundedIntegerTest {
+       private BoundedInteger bi;
+
+       @Before
+       public void init() {
+               bi = new BoundedInteger(-2, 0, 2, /* lowerStrict = */ true, /* 
upperStrict = */ false);
+       }
+
+       @Test
+       public final void testLowerBound() throws Exception {
+               assertEquals("Lower bound not as expected!", 
Integer.valueOf(-2), bi.getLowerBound());
+       }
+
+       @Test
+       public final void testUpperBound() throws Exception {
+               assertEquals("Upper bound not as expected!", 
Integer.valueOf(2), bi.getUpperBound());
+       }
+
+       @Test
+       public final void testIsLowerBoundStrict() throws Exception {
+               assertEquals("Strictness of lower bound not as expected!", 
true, bi.isLowerBoundStrict());
+       }
+
+       @Test
+       public final void testIsUpperBoundStrict() throws Exception {
+               assertEquals("Strictness of upper bound not as expected!", 
false, bi.isUpperBoundStrict());
+       }
+
+       @Test
+       public final void testSettingValidValue() throws Exception {
+               bi.setValue(1);
+               assertEquals("Value not as expected!", Integer.valueOf(1), 
bi.getValue());
+       }
+
+       @Test
+       public final void testSettingValidValueWithString() throws Exception {
+               bi.setValue("1");
+               assertEquals("Value not as expected!", Integer.valueOf(1), 
bi.getValue());
+       }
+
+       @Test(expected=IllegalArgumentException.class)
+               public final void testSettingInvalidValue() throws Exception {
+               bi.setValue(-2);
+       }
+
+       @Test
+       public final void testSettingValueEqualToUpperBound() throws Exception {
+               bi.setValue(2);
+               assertEquals("Value not as expected!", Integer.valueOf(2), 
bi.getValue());
+
+       }
+
+       @Test(expected=IllegalArgumentException.class)
+       public final void 
testConstructionWithLowerBoundBeingGreaterThanUpperBound() throws Exception {
+               new BoundedInteger(2, 0, -2, /* lowerStrict = */ true, /* 
upperStrict = */ false);
+       }
+}

Added: 
core3/work-api/trunk/src/test/java/org/cytoscape/work/util/BoundedLongTest.java
===================================================================
--- 
core3/work-api/trunk/src/test/java/org/cytoscape/work/util/BoundedLongTest.java 
                            (rev 0)
+++ 
core3/work-api/trunk/src/test/java/org/cytoscape/work/util/BoundedLongTest.java 
    2010-09-01 22:52:44 UTC (rev 21659)
@@ -0,0 +1,92 @@
+/*
+ Copyright (c) 2010, The Cytoscape Consortium (www.cytoscape.org)
+
+ This library is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as published
+ by the Free Software Foundation; either version 2.1 of the License, or
+ any later version.
+
+ This library is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF
+ MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  The software and
+ documentation provided hereunder is on an "as is" basis, and the
+ Institute for Systems Biology and the Whitehead Institute
+ have no obligations to provide maintenance, support,
+ updates, enhancements or modifications.  In no event shall the
+ Institute for Systems Biology and the Whitehead Institute
+ be liable to any party for direct, indirect, special,
+ incidental or consequential damages, including lost profits, arising
+ out of the use of this software and its documentation, even if the
+ Institute for Systems Biology and the Whitehead Institute
+ have been advised of the possibility of such damage.  See
+ the GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this library; if not, write to the Free Software Foundation,
+ Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+*/
+package org.cytoscape.work.util;
+
+
+import static org.junit.Assert.*;
+import org.junit.Before;
+import org.junit.Test;
+
+
+public class BoundedLongTest {
+       private BoundedLong bi;
+
+       @Before
+       public void init() {
+               bi = new BoundedLong(-2L, 0L, 2L, /* lowerStrict = */ true, /* 
upperStrict = */ false);
+       }
+
+       @Test
+       public final void testLowerBound() throws Exception {
+               assertEquals("Lower bound not as expected!", Long.valueOf(-2L), 
bi.getLowerBound());
+       }
+
+       @Test
+       public final void testUpperBound() throws Exception {
+               assertEquals("Upper bound not as expected!", Long.valueOf(2L), 
bi.getUpperBound());
+       }
+
+       @Test
+       public final void testIsLowerBoundStrict() throws Exception {
+               assertEquals("Strictness of lower bound not as expected!", 
true, bi.isLowerBoundStrict());
+       }
+
+       @Test
+       public final void testIsUpperBoundStrict() throws Exception {
+               assertEquals("Strictness of upper bound not as expected!", 
false, bi.isUpperBoundStrict());
+       }
+
+       @Test
+       public final void testSettingValidValue() throws Exception {
+               bi.setValue(1L);
+               assertEquals("Value not as expected!", Long.valueOf(1L), 
bi.getValue());
+       }
+
+       @Test
+       public final void testSettingValidValueWithString() throws Exception {
+               bi.setValue("1");
+               assertEquals("Value not as expected!", Long.valueOf(1L), 
bi.getValue());
+       }
+
+       @Test(expected=IllegalArgumentException.class)
+               public final void testSettingInvalidValue() throws Exception {
+               bi.setValue(-2L);
+       }
+
+       @Test
+       public final void testSettingValueEqualToUpperBound() throws Exception {
+               bi.setValue(2L);
+               assertEquals("Value not as expected!", Long.valueOf(2L), 
bi.getValue());
+
+       }
+
+       @Test(expected=IllegalArgumentException.class)
+       public final void 
testConstructionWithLowerBoundBeingGreaterThanUpperBound() throws Exception {
+               new BoundedLong(2L, 0L, -2L, /* lowerStrict = */ true, /* 
upperStrict = */ false);
+       }
+}

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