public static void badRelationshipValidate(String[] vars, int numStmt, int numSel, int numVal) throws RecognitionException, TokenStreamException { Block_c[] blk = Block_c.BlockInstances(modelRoot); assertEquals(1, blk.length); Statement_c[] st = Statement_c.StatementInstances(modelRoot); assertEquals(numStmt, st.length); for (int i = 0; i < numStmt; ++i) assertEquals(blk[0].getBlock_id(), st[i].getBlock_id()); Variable_c[] t = Variable_c.VariableInstances(modelRoot); assertEquals(vars.length, t.length); for (int i = 0; i < vars.length; ++i) assertEquals(vars[i], t[i].getName()); Relate_c rel[] = Relate_c.RelateInstances(modelRoot); assertEquals(0, rel.length); RelateUsing_c ru[] = RelateUsing_c.RelateUsingInstances(modelRoot); assertEquals(0, ru.length); SelectFromInstances_c sel[] = SelectFromInstances_c.SelectFromInstancesInstances(modelRoot); assertEquals(numSel, sel.length); Value_c[] val = Value_c.ValueInstances(modelRoot); assertEquals(numVal, val.length); }
public static void validateBlkStmtVal(int numBlock, int numStmt, int numVal) { FunctionBody_c[] fb = FunctionBody_c.FunctionBodyInstances(modelRoot); BridgeBody_c[] bb = BridgeBody_c.BridgeBodyInstances(modelRoot); OperationBody_c[] ob = OperationBody_c.OperationBodyInstances(modelRoot); StateActionBody_c[] sab = StateActionBody_c.StateActionBodyInstances(modelRoot); DerivedAttributeBody_c[] dab = DerivedAttributeBody_c.DerivedAttributeBodyInstances(modelRoot); TransitionActionBody_c[] tab = TransitionActionBody_c.TransitionActionBodyInstances(modelRoot); Body_c b[] = Body_c.BodyInstances(modelRoot); assertEquals( b.length, fb.length + bb.length + ob.length + sab.length + dab.length + tab.length); Block_c[] blk = Block_c.BlockInstances(modelRoot); assertEquals(numBlock, blk.length); Body_c[] bods = Body_c.BodyInstances(modelRoot); for (int i = 0; i < bods.length; ++i) assertEquals(IdAssigner.NULL_UUID, bods[i].getCurrentscope_id()); Statement_c[] st = Statement_c.StatementInstances(modelRoot); assertEquals(numStmt, st.length); Value_c[] val = Value_c.ValueInstances(modelRoot); assertEquals(numVal, val.length); }