@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]); }
@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]); }
@Test public void testInvalidInputTrailingPipe() throws PersistenceLayerException { assertFalse(token.parseToken(context, fd, "SKILL|").passed()); }
@Test public void testInvalidInputEmptyString() throws PersistenceLayerException { assertFalse(token.parseToken(context, fd, "").passed()); }
@Test public void testInvalidInputDoublePipe2() throws PersistenceLayerException { assertFalse(token.parseToken(context, fd, "SKILL|Possibility|Exception").passed()); }
@Test public void testInvalidInputLeadingPipe() throws PersistenceLayerException { assertFalse(token.parseToken(context, fd, "|Possibility").passed()); }