use of pcgen.core.system.MigrationRule in project pcgen by PCGen.
the class NewKeyTokenTest method setUp.
/**
* @throws java.lang.Exception
*/
@Before
public void setUp() throws Exception {
migrationRule = new MigrationRule(ObjectType.SOURCE, "OldKey");
migrationRuleEquip = new MigrationRule(ObjectType.EQUIPMENT, "OldKey");
token = new NewKeyToken();
gameModeName = "Pathfinder";
}
use of pcgen.core.system.MigrationRule in project pcgen by PCGen.
the class MigrationLoaderTest method testParseFirstTokenValidAbility.
@Test
public void testParseFirstTokenValidAbility() {
MigrationRule migrationRule = migrationLoader.parseFirstToken("ABILITY:OldCat|Old Key", "", sourceURI);
assertNotNull("Should have been able to parse valid ability", migrationRule);
assertEquals("Object type", ObjectType.ABILITY, migrationRule.getObjectType());
assertEquals("Old key", "Old Key", migrationRule.getOldKey());
assertEquals("Old category", "OldCat", migrationRule.getOldCategory());
}
use of pcgen.core.system.MigrationRule in project pcgen by PCGen.
the class MigrationLoaderTest method testParseFirstTokenInValidObjType.
@Test
public void testParseFirstTokenInValidObjType() {
MigrationRule migrationRule = migrationLoader.parseFirstToken("FOO:Old Key", "", sourceURI);
assertNull(migrationRule);
}
use of pcgen.core.system.MigrationRule in project pcgen by PCGen.
the class MigrationLoaderTest method testParseFirstTokenInValidCharsInAbilityKey.
/**
* Check that these invalid characters are rejected in a key ,\\|\\:;.%*=[]
*/
@Test
public void testParseFirstTokenInValidCharsInAbilityKey() {
String invalidChars = ",|\\:;%*=[]";
for (char invalid : invalidChars.toCharArray()) {
MigrationRule migrationRule = migrationLoader.parseFirstToken("ABILITY:Old|Key" + invalid, "", sourceURI);
assertNull("Key containing " + invalid + " should have been rejected.", migrationRule);
}
}
use of pcgen.core.system.MigrationRule in project pcgen by PCGen.
the class MigrationLoaderTest method testParseFirstTokenValidEquipment.
@Test
public void testParseFirstTokenValidEquipment() {
MigrationRule migrationRule = migrationLoader.parseFirstToken("EQUIPMENT:Old Key", "", sourceURI);
assertNotNull(migrationRule);
assertEquals("Object type", ObjectType.EQUIPMENT, migrationRule.getObjectType());
assertEquals("Old key", "Old Key", migrationRule.getOldKey());
assertNull("Old category", migrationRule.getOldCategory());
}
Aggregations