public ItemProcessingMap resolveItemProcessingMap(final TestPlanNode testPlanNode) { if (testPlanNode.getTestNodeType() != TestNodeType.ASSESSMENT_ITEM_REF) { throw new IllegalArgumentException( "Expected " + TestNodeType.ASSESSMENT_ITEM_REF + " but got " + testPlanNode.getTestNodeType()); } final AbstractPart abstractPart = resolveAbstractPart(testPlanNode); if (!(abstractPart instanceof AssessmentItemRef)) { throw new IllegalStateException( "Expected" + testPlanNode + " to resolve to an " + AssessmentItemRef.class.getSimpleName() + " but got " + abstractPart); } final AssessmentItemRef assessmentItemRef = (AssessmentItemRef) abstractPart; final URI resolvedUri = resolvedAssessmentTest.getSystemIdByItemRefMap().get(assessmentItemRef); if (resolvedUri == null) { throw new IllegalStateException( "System ID resolution lookup failed for " + assessmentItemRef + " resolved from " + testPlanNode); } final ItemProcessingMap itemProcessingMap = itemProcessingMapMap.get(resolvedUri); if (itemProcessingMap == null) { throw new IllegalStateException( "ItemProcessingMap lookup failed for " + resolvedUri + " resolved from " + testPlanNode); } return itemProcessingMap; }
public EffectiveItemSessionControl resolveEffectiveItemSessionControl( final TestPlanNode testPlanNode) { if (testPlanNode.getTestNodeType() == TestNodeType.ROOT) { throw new IllegalArgumentException( "This method should not be called for " + testPlanNode.getTestNodeType()); } final AbstractPart abstractPart = resolveAbstractPart(testPlanNode); return effectiveItemSessionControlMap.get(abstractPart); }
public AbstractPart resolveAbstractPart(final TestPlanNode testPlanNode) { if (testPlanNode.getTestNodeType() == TestNodeType.ROOT) { throw new IllegalArgumentException( "This method should not be called for " + testPlanNode.getTestNodeType()); } final int abstractPartGlobalIndex = testPlanNode.getAbstractPartGlobalIndex(); if (abstractPartGlobalIndex < 0 || abstractPartGlobalIndex >= abstractPartList.size()) { throw new IllegalStateException("Global index of " + testPlanNode + " is out of bounds"); } return abstractPartList.get(abstractPartGlobalIndex); }