use of pcgen.persistence.lst.output.prereq.PrerequisiteWriterInterface in project pcgen by PCGen.
the class PreAbilityRoundRobin method testCombineSubNegativeSub.
@Override
public void testCombineSubNegativeSub() {
String original = "!PREMULT:2,[!PRE" + getBaseString() + ":1," + getPrefix() + "Foo (Bar)],[!PRE" + getBaseString() + ":1," + getPrefix() + "Spot (Check)]";
String consolidatedPre = "PRE" + getBaseString() + ":1," + getPrefix() + "Foo (Bar),Spot (Check)";
try {
Prerequisite p = PreParserFactory.getInstance().parse(original);
PrerequisiteWriterInterface writer = PrerequisiteWriterFactory.getInstance().getWriter(p.getKind());
if (writer == null) {
fail("Could not find Writer for: " + p.getKind());
}
StringWriter w = new StringWriter();
writer.write(w, p);
boolean consolidated = w.toString().equals(consolidatedPre);
boolean separate = w.toString().equals(original);
assertTrue(consolidated || separate);
} catch (PersistenceLayerException e) {
fail(e.getLocalizedMessage());
}
}
use of pcgen.persistence.lst.output.prereq.PrerequisiteWriterInterface in project pcgen by PCGen.
the class PreAbilityRoundRobin method testCombineSubAnyCategory.
public void testCombineSubAnyCategory() {
// runSimpleRoundRobin("PREMULT:2,[!PRE" + getBaseString() + ":1,"
// + getAnyPrefix() + "Foo],[!PRE" + getBaseString() + ":1,"
// + getAnyPrefix() + "Spot]", "!PRE" + getBaseString() + ":1,"
// + getAnyPrefix() + "Foo,Spot");
String original = "PREMULT:2,[!PRE" + getBaseString() + ":1," + getAnyPrefix() + "Foo],[!PRE" + getBaseString() + ":1," + getAnyPrefix() + "Spot]";
String consolidatedPre = "!PRE" + getBaseString() + ":1," + getAnyPrefix() + "Foo,Spot";
try {
Prerequisite p = PreParserFactory.getInstance().parse(original);
PrerequisiteWriterInterface writer = PrerequisiteWriterFactory.getInstance().getWriter(p.getKind());
if (writer == null) {
fail("Could not find Writer for: " + p.getKind());
}
StringWriter w = new StringWriter();
writer.write(w, p);
boolean consolidated = w.toString().equals(consolidatedPre);
boolean separate = w.toString().equals(original);
assertTrue(consolidated || separate);
} catch (PersistenceLayerException e) {
fail(e.getLocalizedMessage());
}
}
use of pcgen.persistence.lst.output.prereq.PrerequisiteWriterInterface in project pcgen by PCGen.
the class PreAbilityRoundRobin method testCombineSubNegativeCheckMult.
public void testCombineSubNegativeCheckMult() {
// runSimpleRoundRobin("!PREMULT:2,[!PRE" + getBaseString() + ":1,"
// + "CHECKMULT," + getPrefix() + "Foo],[!PRE" + getBaseString()
// + ":1," + "CHECKMULT," + getPrefix() + "Spot]", "PRE"
// + getBaseString() + ":1," + "CHECKMULT," + getPrefix()
// + "Foo,Spot");
String original = "!PREMULT:2,[!PRE" + getBaseString() + ":1," + "CHECKMULT," + getPrefix() + "Foo],[!PRE" + getBaseString() + ":1," + "CHECKMULT," + getPrefix() + "Spot]";
String consolidatedPre = "PRE" + getBaseString() + ":1," + "CHECKMULT," + getPrefix() + "Foo,Spot";
try {
Prerequisite p = PreParserFactory.getInstance().parse(original);
PrerequisiteWriterInterface writer = PrerequisiteWriterFactory.getInstance().getWriter(p.getKind());
if (writer == null) {
fail("Could not find Writer for: " + p.getKind());
}
StringWriter w = new StringWriter();
writer.write(w, p);
boolean consolidated = w.toString().equals(consolidatedPre);
boolean separate = w.toString().equals(original);
assertTrue(consolidated || separate);
} catch (PersistenceLayerException e) {
fail(e.getLocalizedMessage());
}
}
use of pcgen.persistence.lst.output.prereq.PrerequisiteWriterInterface in project pcgen by PCGen.
the class PreAbilityRoundRobin method testCombineSub.
@Override
public void testCombineSub() {
String original = "PREMULT:2,[!PRE" + getBaseString() + ":1," + getPrefix() + "Foo],[!PRE" + getBaseString() + ":1," + getPrefix() + "Spot]";
String consolidatedPre = "!PRE" + getBaseString() + ":1," + getPrefix() + "Foo,Spot";
try {
Prerequisite p = PreParserFactory.getInstance().parse(original);
PrerequisiteWriterInterface writer = PrerequisiteWriterFactory.getInstance().getWriter(p.getKind());
if (writer == null) {
fail("Could not find Writer for: " + p.getKind());
}
StringWriter w = new StringWriter();
writer.write(w, p);
boolean consolidated = w.toString().equals(consolidatedPre);
boolean separate = w.toString().equals(original);
assertTrue(consolidated || separate);
} catch (PersistenceLayerException e) {
fail(e.getLocalizedMessage());
}
}
use of pcgen.persistence.lst.output.prereq.PrerequisiteWriterInterface in project pcgen by PCGen.
the class PreAbilityRoundRobin method testCombineSubNegativeAnyCategory.
public void testCombineSubNegativeAnyCategory() {
// runSimpleRoundRobin("!PREMULT:2,[!PRE" + getBaseString() + ":1,"
// + getAnyPrefix() + "Foo],[!PRE" + getBaseString() + ":1,"
// + getAnyPrefix() + "Spot]", "PRE" + getBaseString() + ":1,"
// + getAnyPrefix() + "Foo,Spot");
String original = "!PREMULT:2,[!PRE" + getBaseString() + ":1," + getAnyPrefix() + "Foo],[!PRE" + getBaseString() + ":1," + getAnyPrefix() + "Spot]";
String consolidatedPre = "PRE" + getBaseString() + ":1," + getAnyPrefix() + "Foo,Spot";
try {
Prerequisite p = PreParserFactory.getInstance().parse(original);
PrerequisiteWriterInterface writer = PrerequisiteWriterFactory.getInstance().getWriter(p.getKind());
if (writer == null) {
fail("Could not find Writer for: " + p.getKind());
}
StringWriter w = new StringWriter();
writer.write(w, p);
boolean consolidated = w.toString().equals(consolidatedPre);
boolean separate = w.toString().equals(original);
assertTrue(consolidated || separate);
} catch (PersistenceLayerException e) {
fail(e.getLocalizedMessage());
}
}
Aggregations