if (readAll.hasError()) { request.setError(readAll.getError()); return;
@Test public void shouldCreateValidRequestWithValidLocation() { request = new ReadAllChildrenRequest(validPathLocation1, workspace1); assertThat(request.of(), is(sameInstance(validPathLocation1))); assertThat(request.inWorkspace(), is(sameInstance(workspace1))); assertThat(request.hasError(), is(false)); assertThat(request.getError(), is(nullValue())); }
/** * {@inheritDoc} * * @see org.modeshape.graph.request.processor.RequestProcessor#process(org.modeshape.graph.request.ReadAllChildrenRequest) */ @Override public void process( ReadAllChildrenRequest request ) { MapWorkspace workspace = getWorkspace(request, request.inWorkspace()); MapNode node = getTargetNode(workspace, request, request.of()); if (node == null) { assert request.hasError(); return; } Location actualLocation = getActualLocation(request.of(), node); assert actualLocation != null; Path path = actualLocation.getPath(); // Get the names of the children ... List<MapNode> children = node.getChildren(); for (MapNode child : children) { Segment childName = child.getName(); Path childPath = pathFactory.create(path, childName); request.addChild(childPath, propertyFactory.create(ModeShapeLexicon.UUID, child.getUuid())); } request.setActualLocationOfNode(actualLocation); setCacheableInfo(request); }
if (readChildren.hasError()) { request.setError(readChildren.getError()); return;
NodeType node = getTargetNode(workspace, request, request.of()); if (node == null) { assert request.hasError(); return;
if (readChildren.hasError()) { request.setError(readChildren.getError()); return;
if (readAll.hasError()) { request.setError(readAll.getError()); return;