コード例 #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());
 }