@Test(expected = NotAllowedException.class) public void visit_should_not_work_without_effectivity() throws EntityConstraintException, NotAllowedException, PartMasterNotFoundException { String workspaceId = "workspace01"; ConfigurationItem configurationItem = createConfigurationItem(workspaceId); ProductConfigSpec filter = new SerialNumberBasedEffectivityConfigSpec("2", configurationItem); User user = configurationItem.getAuthor(); Workspace workspace = configurationItem.getWorkspace(); PartMaster designItem = new PartMaster(workspace, "1", user); PartRevision partRevision = new PartRevision(designItem, "A", configurationItem.getAuthor()); partRevision.setStatus(RevisionStatus.RELEASED); designItem.setPartRevisions(new ArrayList<PartRevision>() {{ add(partRevision); }}); visit(workspaceId, filter, designItem); }
public Component visit(String workspaceId, ProductStructureFilter pFilter, PartMaster pNodeFrom, Integer pStopAtDepth, PSFilterVisitorCallbacks callbacks) throws PartMasterNotFoundException, EntityConstraintException, NotAllowedException { init(workspaceId, pStopAtDepth, pFilter, callbacks); return visit(pNodeFrom, new ArrayList<PartLink>() {{ add(createVirtualRootLink(pNodeFrom)); }}, new ArrayList<PartMaster>() {{ add(pNodeFrom); }} ); }
PSFilterVisitor { public Component visit(String workspaceId, ProductStructureFilter pFilter, PartMaster pNodeFrom, Integer pStopAtDepth, PSFilterVisitorCallbacks callbacks) throws PartMasterNotFoundException, EntityConstraintException, NotAllowedException { init(workspaceId, pStopAtDepth, pFilter, callbacks); return visit(pNodeFrom, new ArrayList<PartLink>() {{ add(createVirtualRootLink(pNodeFrom)); }}, new ArrayList<PartMaster>() {{ add(pNodeFrom); }} ); } }
PSFilterVisitor { public Component visit(String workspaceId, ProductStructureFilter pFilter, PartMaster pNodeFrom, Integer pStopAtDepth, PSFilterVisitorCallbacks callbacks) throws PartMasterNotFoundException, EntityConstraintException, NotAllowedException { init(workspaceId, pStopAtDepth, pFilter, callbacks); return visit(pNodeFrom, new ArrayList<PartLink>() {{ add(createVirtualRootLink(pNodeFrom)); }}, new ArrayList<PartMaster>() {{ add(pNodeFrom); }} ); }  }
PSFilterVisitor { public Component visit(String workspaceId, ProductStructureFilter pFilter, PartMaster pNodeFrom, Integer pStopAtDepth, PSFilterVisitorCallbacks callbacks) throws PartMasterNotFoundException, EntityConstraintException, NotAllowedException { init(workspaceId, pStopAtDepth, pFilter, callbacks); return visit(pNodeFrom, new ArrayList<PartLink>() {{ add(createVirtualRootLink(pNodeFrom)); }}, new ArrayList<PartMaster>() {{ add(pNodeFrom); }} ); }  Component visit(String workspaceId, ProductStructureFilter pFilter, PartMaster pNodeFrom, Integer pStopAtDepth, PSFilterVisitorCallbacks callbacks); Component visit(String workspaceId, ProductStructureFilter pFilter, List<PartLink> pStartingPath, Integer pStopAtDepth, PSFilterVisitorCallbacks callbacks); void stop(); }
PSFilterVisitor { public Component visit(String workspaceId, ProductStructureFilter pFilter, PartMaster pNodeFrom, Integer pStopAtDepth, PSFilterVisitorCallbacks callbacks) throws PartMasterNotFoundException, EntityConstraintException, NotAllowedException { init(workspaceId, pStopAtDepth, pFilter, callbacks); return visit(pNodeFrom, new ArrayList<PartLink>() {{ add(createVirtualRootLink(pNodeFrom)); }}, new ArrayList<PartMaster>() {{ add(pNodeFrom); }} ); }  Component visit(String workspaceId, ProductStructureFilter pFilter, PartMaster pNodeFrom, Integer pStopAtDepth, PSFilterVisitorCallbacks callbacks); Component visit(String workspaceId, ProductStructureFilter pFilter, List<PartLink> pStartingPath, Integer pStopAtDepth, PSFilterVisitorCallbacks callbacks); void stop();  }