public void testSmapGeneration2() { SmapStratum stratum_role2 = new SmapStratum(ISMAPConstants.OTJ_STRATUM_NAME); FileInfo fileinfo = stratum_role2.getOrCreateFileInfo("Team.java", "org/objectteams/Team.java"); LineInfo lineInfo1 = new LineInfo(OT_CONFINED_GET_TEAM_LINE, 3); fileinfo.addLineInfo(lineInfo1); LineInfo lineInfo2 = new LineInfo(ISMAPConstants.STEP_INTO_LINENUMBER, ISMAPConstants.STEP_INTO_LINENUMBER); LineInfo lineInfo3 = new LineInfo(ISMAPConstants.STEP_OVER_LINENUMBER, ISMAPConstants.STEP_OVER_LINENUMBER); fileinfo.addLineInfo(lineInfo2); fileinfo.addLineInfo(lineInfo3); stratum_role2.optimize(); TYPENAME = "__OT__Confined"; _enclosingTypename = "SuperTeam"; List<SmapStratum> strata_role2 = new ArrayList<SmapStratum>(); strata_role2.add(stratum_role2); expectedStrata.put(TYPENAME, strata_role2); try { parseAndCompile( new org.eclipse.jdt.core.ICompilationUnit[] {_baseClass, _superTeam, _subTeam}); } catch (JavaModelException e) { fail(e.getMessage()); } }
public void testSmapGeneration1() throws JavaModelException { TYPENAME = "__OT__RoleA"; _enclosingTypename = "SuperTeam"; SmapStratum stratum_role1 = new SmapStratum(ISMAPConstants.OTJ_STRATUM_NAME); FileInfo fileInfo_role1 = stratum_role1.getOrCreateFileInfo("SuperTeam.java", "calloutOverride/SuperTeam.java"); LineInfo lineInfo1_role1 = new LineInfo(4, 4); // RoleA is l4-15 lineInfo1_role1.setRepeatCount(12); LineInfo lineInfo1_role2 = new LineInfo(ISMAPConstants.STEP_INTO_LINENUMBER, ISMAPConstants.STEP_INTO_LINENUMBER); LineInfo lineInfo1_role3 = new LineInfo(ISMAPConstants.STEP_OVER_LINENUMBER, ISMAPConstants.STEP_OVER_LINENUMBER); fileInfo_role1.addLineInfo(lineInfo1_role1); fileInfo_role1.addLineInfo(lineInfo1_role2); fileInfo_role1.addLineInfo(lineInfo1_role3); List<SmapStratum> strata_role1 = new ArrayList<SmapStratum>(); strata_role1.add(stratum_role1); stratum_role1.optimize(); expectedStrata.put(TYPENAME, strata_role1); try { parseAndCompile( new org.eclipse.jdt.core.ICompilationUnit[] {_baseClass, _superTeam, _subTeam}); } catch (JavaModelException e) { fail(e.getMessage()); } }