"40" ) );
person.fieldData.add( new FieldData( "name",
"michael" ) );
sc.fixtures.add( person );
sc.fixtures.add( new ExecutionTrace() );
VerifyRuleFired vr = new VerifyRuleFired( "rule1",
1,
null );
sc.fixtures.add( vr );
VerifyFact vf = new VerifyFact();
vf.name = "p";
vf.fieldValues.add( new VerifyField( "name",
"michael",
"==" ) );
vf.fieldValues.add( new VerifyField( "age",
"42",
"==" ) );
sc.fixtures.add( vf );
FactData cheese = new FactData();
cheese.name = "cheese";
cheese.type = "Cheese";
cheese.fieldData.add( new FieldData( "price",
"42" ) );
sc.globals.add( cheese );
ScenarioRunResult res = impl.runScenario( pkg.getName(),
sc ).result;
assertEquals( null,
res.errors );
assertNotNull( res.scenario );
assertTrue( vf.wasSuccessful() );
assertTrue( vr.wasSuccessful() );
res = impl.runScenario( pkg.getName(),
sc ).result;
assertEquals( null,
res.errors );
assertNotNull( res.scenario );
assertTrue( vf.wasSuccessful() );
assertTrue( vr.wasSuccessful() );
impl.ruleBaseCache.clear();
res = impl.runScenario( pkg.getName(),
sc ).result;
assertEquals( null,
res.errors );
assertNotNull( res.scenario );
assertTrue( vf.wasSuccessful() );
assertTrue( vr.wasSuccessful() );
//BuilderResult[] results = impl.buildPackage(pkg.getUUID(), null, true);
//assertNull(results);
rule1.updateContent( "Junk" );
rule1.checkin( "" );
impl.ruleBaseCache.clear();
pkg.updateBinaryUpToDate( false );
repo.save();
res = impl.runScenario( pkg.getName(),
sc ).result;
assertNotNull( res.errors );
assertNull( res.scenario );
assertTrue( res.errors.length > 0 );
impl.createCategory( "/",
"sc",
"" );
String scenarioId = impl.createNewRule( "sc1",
"s",
"sc",
pkg.getName(),
AssetFormats.TEST_SCENARIO );
RuleAsset asset = impl.loadRuleAsset( scenarioId );
assertNotNull( asset.content );
assertTrue( asset.content instanceof Scenario );
Scenario sc_ = (Scenario) asset.content;
sc_.fixtures.add( new ExecutionTrace() );
impl.checkinVersion( asset );
asset = impl.loadRuleAsset( scenarioId );
assertNotNull( asset.content );
assertTrue( asset.content instanceof Scenario );
sc_ = (Scenario) asset.content;