Search in sources :

Example 16 with RuntimeReferenceContext

use of pcgen.rules.context.RuntimeReferenceContext in project pcgen by PCGen.

the class AbstractGlobalTokenTestCase method setUp.

@Override
@Before
public void setUp() throws PersistenceLayerException, URISyntaxException {
    if (!classSetUpFired) {
        classSetUp();
    }
    TokenRegistration.register(getToken());
    primaryContext = new RuntimeLoadContext(new RuntimeReferenceContext(), new ConsolidatedListCommitStrategy());
    secondaryContext = new RuntimeLoadContext(new RuntimeReferenceContext(), new ConsolidatedListCommitStrategy());
    primaryProf = primaryContext.getReferenceContext().constructCDOMObject(getCDOMClass(), "TestObj");
    secondaryProf = secondaryContext.getReferenceContext().constructCDOMObject(getCDOMClass(), "TestObj");
    primaryContext.getReferenceContext().importObject(AbilityCategory.FEAT);
    secondaryContext.getReferenceContext().importObject(AbilityCategory.FEAT);
}
Also used : ConsolidatedListCommitStrategy(pcgen.rules.context.ConsolidatedListCommitStrategy) RuntimeReferenceContext(pcgen.rules.context.RuntimeReferenceContext) RuntimeLoadContext(pcgen.rules.context.RuntimeLoadContext) Before(org.junit.Before)

Example 17 with RuntimeReferenceContext

use of pcgen.rules.context.RuntimeReferenceContext in project pcgen by PCGen.

the class AbstractKitTokenTestCase method setUp.

@Override
@Before
public void setUp() throws PersistenceLayerException, URISyntaxException {
    if (!classSetUpFired) {
        classSetUp();
    }
    // Yea, this causes warnings...
    TokenRegistration.register(getToken());
    primaryContext = new RuntimeLoadContext(new RuntimeReferenceContext(), new ConsolidatedListCommitStrategy());
    secondaryContext = new RuntimeLoadContext(new RuntimeReferenceContext(), new ConsolidatedListCommitStrategy());
    URI testURI = testCampaign.getURI();
    primaryContext.setSourceURI(testURI);
    primaryContext.setExtractURI(testURI);
    secondaryContext.setSourceURI(testURI);
    secondaryContext.setExtractURI(testURI);
    primaryContext.getReferenceContext().importObject(AbilityCategory.FEAT);
    secondaryContext.getReferenceContext().importObject(AbilityCategory.FEAT);
    primaryProf = getSubInstance();
    secondaryProf = getSubInstance();
    expectedPrimaryMessageCount = 0;
}
Also used : ConsolidatedListCommitStrategy(pcgen.rules.context.ConsolidatedListCommitStrategy) RuntimeReferenceContext(pcgen.rules.context.RuntimeReferenceContext) URI(java.net.URI) RuntimeLoadContext(pcgen.rules.context.RuntimeLoadContext) Before(org.junit.Before)

Example 18 with RuntimeReferenceContext

use of pcgen.rules.context.RuntimeReferenceContext in project pcgen by PCGen.

the class TableLoaderTest method setUp.

@Before
public void setUp() throws Exception {
    uri = new URI("file:/Test%20Case");
    context = new RuntimeLoadContext(new RuntimeReferenceContext(), new ConsolidatedListCommitStrategy());
    loader = new TableLoader();
}
Also used : ConsolidatedListCommitStrategy(pcgen.rules.context.ConsolidatedListCommitStrategy) RuntimeReferenceContext(pcgen.rules.context.RuntimeReferenceContext) URI(java.net.URI) RuntimeLoadContext(pcgen.rules.context.RuntimeLoadContext) Before(org.junit.Before)

Example 19 with RuntimeReferenceContext

use of pcgen.rules.context.RuntimeReferenceContext in project pcgen by PCGen.

the class DataTypeTokenTest method resetContext.

protected void resetContext() {
    URI testURI = testCampaign.getURI();
    context = new RuntimeLoadContext(new RuntimeReferenceContext(), new ConsolidatedListCommitStrategy());
    context.setSourceURI(testURI);
    context.setExtractURI(testURI);
    cd = new FactDefinition();
}
Also used : FactDefinition(pcgen.cdom.content.fact.FactDefinition) ConsolidatedListCommitStrategy(pcgen.rules.context.ConsolidatedListCommitStrategy) RuntimeReferenceContext(pcgen.rules.context.RuntimeReferenceContext) URI(java.net.URI) RuntimeLoadContext(pcgen.rules.context.RuntimeLoadContext)

Example 20 with RuntimeReferenceContext

use of pcgen.rules.context.RuntimeReferenceContext in project pcgen by PCGen.

the class ExplanationTokenTest method resetContext.

protected void resetContext() {
    URI testURI = testCampaign.getURI();
    context = new RuntimeLoadContext(new RuntimeReferenceContext(), new ConsolidatedListCommitStrategy());
    context.setSourceURI(testURI);
    context.setExtractURI(testURI);
    cd = new FactDefinition();
}
Also used : FactDefinition(pcgen.cdom.content.fact.FactDefinition) ConsolidatedListCommitStrategy(pcgen.rules.context.ConsolidatedListCommitStrategy) RuntimeReferenceContext(pcgen.rules.context.RuntimeReferenceContext) URI(java.net.URI) RuntimeLoadContext(pcgen.rules.context.RuntimeLoadContext)

Aggregations

ConsolidatedListCommitStrategy (pcgen.rules.context.ConsolidatedListCommitStrategy)23 RuntimeLoadContext (pcgen.rules.context.RuntimeLoadContext)23 RuntimeReferenceContext (pcgen.rules.context.RuntimeReferenceContext)23 URI (java.net.URI)14 FactDefinition (pcgen.cdom.content.fact.FactDefinition)8 Before (org.junit.Before)4 Test (org.junit.Test)2 FormulaSemantics (pcgen.base.formula.base.FormulaSemantics)2 LegalScope (pcgen.base.formula.base.LegalScope)2 ScopeInstance (pcgen.base.formula.base.ScopeInstance)2 VariableID (pcgen.base.formula.base.VariableID)2 VariableLibrary (pcgen.base.formula.base.VariableLibrary)2 SimpleNode (pcgen.base.formula.parse.SimpleNode)2 ReconstructionVisitor (pcgen.base.formula.visitor.ReconstructionVisitor)2 SemanticsVisitor (pcgen.base.formula.visitor.SemanticsVisitor)2 UserFunction (pcgen.cdom.content.UserFunction)2 Equipment (pcgen.core.Equipment)2 LoadContext (pcgen.rules.context.LoadContext)2 IndividualSetup (pcgen.base.solver.IndividualSetup)1 CDOMObject (pcgen.cdom.base.CDOMObject)1