示例#1
0
 @Test
 public void nameValuePair() {
   atts.setValue("name", "v1");
   atts.setValue("value", "work");
   propertyAction.begin(ec, null, atts);
   assertEquals("work", ec.getProperty("v1"));
 }
示例#2
0
 @Test
 public void testFileNotLoaded() {
   atts.setValue("file", "toto");
   atts.setValue("value", "work");
   propertyAction.begin(ec, null, atts);
   assertEquals(1, context.getStatusManager().getCount());
   assertTrue(checkError());
 }
示例#3
0
 @Test
 public void nameValuePairWithPrerequisiteSubsitution() {
   context.putProperty("w", "wor");
   atts.setValue("name", "v1");
   atts.setValue("value", "${w}k");
   propertyAction.begin(ec, null, atts);
   assertEquals("work", ec.getProperty("v1"));
 }
示例#4
0
 @Test
 public void noName() {
   atts.setValue("value", "v1");
   propertyAction.begin(ec, null, atts);
   assertEquals(1, context.getStatusManager().getCount());
   assertTrue(checkError());
 }
示例#5
0
 @Test
 public void testLoadNotPossible() {
   atts.setValue("file", "toto");
   propertyAction.begin(ec, null, atts);
   assertEquals(1, context.getStatusManager().getCount());
   assertTrue(checkFileErrors());
 }
示例#6
0
 @Test
 public void testLoadResource() {
   atts.setValue("resource", "asResource/joran/propertyActionTest.properties");
   propertyAction.begin(ec, null, atts);
   assertEquals("tata", ec.getProperty("r1"));
   assertEquals("toto", ec.getProperty("r2"));
 }
示例#7
0
 @Test
 public void testLoadResourceWithPrerequisiteSubsitution() {
   context.putProperty("STEM", "asResource/joran");
   atts.setValue("resource", "${STEM}/propertyActionTest.properties");
   propertyAction.begin(ec, null, atts);
   assertEquals("tata", ec.getProperty("r1"));
   assertEquals("toto", ec.getProperty("r2"));
 }
示例#8
0
 @Test
 public void testLoadFile() {
   atts.setValue(
       "file", CoreTestConstants.TEST_SRC_PREFIX + "input/joran/propertyActionTest.properties");
   propertyAction.begin(ec, null, atts);
   assertEquals("tata", ec.getProperty("v1"));
   assertEquals("toto", ec.getProperty("v2"));
 }
示例#9
0
 @Test
 public void testLoadFileWithPrerequisiteSubsitution() {
   context.putProperty("STEM", CoreTestConstants.TEST_SRC_PREFIX + "input/joran");
   atts.setValue("file", "${STEM}/propertyActionTest.properties");
   propertyAction.begin(ec, null, atts);
   assertEquals("tata", ec.getProperty("v1"));
   assertEquals("toto", ec.getProperty("v2"));
 }