예제 #1
0
 @Test
 public void testValidStringNo() throws PersistenceLayerException {
   assertNull(fd.getFactSetName());
   assertNull(fd.getUsableLocation());
   assertTrue(token.parseToken(context, fd, "DOMAIN|Caster").passed());
   assertNotNull(fd.getFactSetName());
   assertNotNull(fd.getUsableLocation());
   assertEquals("Caster", fd.getFactSetName());
   assertEquals(Domain.class, fd.getUsableLocation());
   String[] unparsed = token.unparse(context, fd);
   assertNotNull(unparsed);
   assertEquals(1, unparsed.length);
   assertEquals("DOMAIN|Caster", unparsed[0]);
 }
예제 #2
0
 @Test
 public void testValidStringString() throws PersistenceLayerException {
   assertNull(fd.getFactSetName());
   assertNull(fd.getUsableLocation());
   assertTrue(token.parseToken(context, fd, "SKILL|Possibility").passed());
   assertNotNull(fd.getFactSetName());
   assertNotNull(fd.getUsableLocation());
   assertEquals("Possibility", fd.getFactSetName());
   assertEquals(Skill.class, fd.getUsableLocation());
   String[] unparsed = token.unparse(context, fd);
   assertNotNull(unparsed);
   assertEquals(1, unparsed.length);
   assertEquals("SKILL|Possibility", unparsed[0]);
 }
예제 #3
0
 @Test
 public void testInvalidInputTrailingPipe() throws PersistenceLayerException {
   assertFalse(token.parseToken(context, fd, "SKILL|").passed());
 }
예제 #4
0
 @Test
 public void testInvalidInputEmptyString() throws PersistenceLayerException {
   assertFalse(token.parseToken(context, fd, "").passed());
 }
예제 #5
0
 @Test
 public void testInvalidInputDoublePipe2() throws PersistenceLayerException {
   assertFalse(token.parseToken(context, fd, "SKILL|Possibility|Exception").passed());
 }
예제 #6
0
 @Test
 public void testInvalidInputLeadingPipe() throws PersistenceLayerException {
   assertFalse(token.parseToken(context, fd, "|Possibility").passed());
 }