Ejemplo n.º 1
0
 /** Test */
 @Test
 public void testNewValue1Prepend() {
   AttributeModifier prepender = AttributeModifier.prepend("attr", null);
   assertEquals("newvalue oldvalue", prepender.newValue("oldvalue", "newvalue"));
   assertEquals("newvalue", prepender.newValue("", "newvalue"));
   assertEquals("newvalue", prepender.newValue(null, "newvalue"));
   assertEquals("oldvalue", prepender.newValue("oldvalue", ""));
   assertEquals("oldvalue", prepender.newValue("oldvalue", null));
   assertNull(prepender.newValue(null, null));
 }
Ejemplo n.º 2
0
 /** Test */
 @Test
 public void testNewValue2Prepend() {
   AttributeModifier appender = AttributeModifier.prepend("attr", null).setSeparator(";");
   assertEquals("newvalue;oldvalue", appender.newValue("oldvalue", "newvalue"));
   assertEquals("newvalue", appender.newValue("", "newvalue"));
   assertEquals("newvalue", appender.newValue(null, "newvalue"));
   assertEquals("oldvalue", appender.newValue("oldvalue", ""));
   assertEquals("oldvalue", appender.newValue("oldvalue", null));
   assertNull(appender.newValue(null, null));
 }
Ejemplo n.º 3
0
 /** Test */
 @Test
 public void testNewValue1Append() {
   AttributeModifier appender = AttributeModifier.append("attr", null);
   assertEquals("oldvalue newvalue", appender.newValue("oldvalue", "newvalue"));
   assertEquals("newvalue", appender.newValue("", "newvalue"));
   assertEquals("newvalue", appender.newValue(null, "newvalue"));
   assertEquals("oldvalue", appender.newValue("oldvalue", ""));
   assertEquals("oldvalue", appender.newValue("oldvalue", null));
   assertNull(appender.newValue(null, null));
 }