use of pcgen.core.system.MigrationRule in project pcgen by PCGen.
the class MigrationLoaderTest method testParseFirstTokenValidCharsInSourceKey.
@Test
public void testParseFirstTokenValidCharsInSourceKey() {
String sourceKey = "Paizo - Second Darkness, Chapter 6: Descent into Midnight.";
MigrationRule migrationRule = migrationLoader.parseFirstToken("SOURCE:" + sourceKey, "", sourceURI);
assertNotNull("Key should have been accepted.", migrationRule);
assertEquals("Source key should have been recorded", sourceKey, migrationRule.getOldKey());
}
use of pcgen.core.system.MigrationRule in project pcgen by PCGen.
the class MinDevVerTokenTest method setUp.
/**
* @throws java.lang.Exception
*/
@Before
public void setUp() throws Exception {
migrationRule = new MigrationRule(ObjectType.SOURCE, "OldKey");
token = new MinDevVerToken();
gameModeName = "Pathfinder";
}
use of pcgen.core.system.MigrationRule in project pcgen by PCGen.
the class NewCategoryTokenTest method setUp.
/**
* @throws java.lang.Exception
*/
@Before
public void setUp() throws Exception {
migrationRule = new MigrationRule(ObjectType.SOURCE, "OldKey");
token = new NewCategoryToken();
gameModeName = "Pathfinder";
}
use of pcgen.core.system.MigrationRule in project pcgen by PCGen.
the class MigrationLoaderTest method testParseFirstTokenInValidCharsInAbilityCategory.
/**
* Check that these invalid characters are rejected in a category ,\\|\\:;.%*=[]
*/
@Test
public void testParseFirstTokenInValidCharsInAbilityCategory() {
String invalidChars = ",|\\:;%*=[]";
for (char invalid : invalidChars.toCharArray()) {
MigrationRule migrationRule = migrationLoader.parseFirstToken("ABILITY:Old" + invalid + "|Key", "", 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 testParseAbilityLine.
@Test
public void testParseAbilityLine() throws Exception {
String abilityMigration = "ABILITY:Special Ability|Animal Fury NEWKEY:Animal Fury ~ Rage Power " + "MAXVER:6.00.00 MAXDEVVER:6.01.01";
migrationLoader.parseLine(null, abilityMigration, new URI("http://UNIT_TEST_CASE"));
boolean found = false;
List<MigrationRule> migrationRuleList = SystemCollections.getUnmodifiableMigrationRuleList(SettingsHandler.getGame().getName());
for (MigrationRule migrationRule : migrationRuleList) {
if (migrationRule.getObjectType() == ObjectType.ABILITY && migrationRule.getOldCategory().equals("Special Ability") && migrationRule.getOldKey().equals("Animal Fury")) {
assertNull("new category", migrationRule.getNewCategory());
assertEquals("new key", "Animal Fury ~ Rage Power", migrationRule.getNewKey());
assertEquals("max ver", "6.00.00", migrationRule.getMaxVer());
assertEquals("max dev ver", "6.01.01", migrationRule.getMaxDevVer());
found = true;
}
}
assertTrue("Unable to find migration rule", found);
}
Aggregations