예제 #1
0
 /*
  * Test the setValue() method when the value of the expression is set by the
  * constructor.
  */
 public void testSetValue_Constructor() throws Exception {
   MockObject mo = new MockObject(false);
   Expression t = new Expression(mo, mo, "method", new Object[0]);
   assertSame(mo, t.getValue());
   MockObject.assertNotCalled();
   t.setValue(null);
   assertSame(null, t.getValue());
   MockObject.assertNotCalled();
 }
예제 #2
0
 /*
  * Test the setValue() method with a non-null value when the value of the
  * expression is still unbounded.
  */
 public void testSetValue_UnboundNormal() throws Exception {
   MockObject mo = new MockObject(false);
   Expression t = new Expression(mo, "method", new Object[0]);
   t.setValue(mo);
   assertSame(mo, t.getValue());
   MockObject.assertNotCalled();
 }
예제 #3
0
 /*
  * Test the getValue() method when the value of the expression is evaluated
  * by a previous call to getValue().
  */
 public void testGetValue_Evaluated() throws Exception {
   MockObject mo = new MockObject(false);
   Expression t = new Expression(mo, "method", new Object[0]);
   assertEquals("method1", t.getValue());
   MockObject.assertCalled("method1", new Object[0]);
   assertEquals("method1", t.getValue());
   MockObject.assertNotCalled();
 }