예제 #1
0
 @Test
 public void chronoref_ref_evaluates_to_false()
     throws InvalidChrononogramExpressionException, InvalidNPMLConfigurationException,
         InvalidChronogramException {
   DateTime dt = new DateTime().withHourOfDay(12);
   ChronogramSimple simple = new ChronogramSimple("13-11");
   simple.setClock(new Clock());
   simple.getClock().setNow(dt);
   simple.setName("Simple");
   ChronogramReference c1 = new ChronogramReference(simple.getName());
   c1.setReferencedElement(simple);
   assertFalse(c1.isTrue());
 }
예제 #2
0
 @Test
 public void chronoref_xml()
     throws InvalidChrononogramExpressionException, InvalidNPMLConfigurationException,
         InvalidChronogramException {
   DateTime dt = new DateTime().withHourOfDay(12);
   ChronogramSimple simple = new ChronogramSimple("13-11");
   simple.setClock(new Clock());
   simple.getClock().setNow(dt);
   simple.setName("Simple");
   ChronogramReference c1 = new ChronogramReference(simple.getName());
   c1.setReferencedElement(simple);
   assertFalse(c1.isTrue());
   //  Check xml.
   assertEquals(_serialize.outputString(c1.xml()), "<chronogram_ref ref=\"Simple\" />");
 }