idents[i] = new DummyIdentity(String.valueOf(i));
nms.assignNode(this.getClass(), idents[i]);
}
// Node 1 uses.
AffinityGraphBuilder builder1 = driver1.getGraphBuilder();
AccessedObjectsDetailTest detail = new AccessedObjectsDetailTest();
detail.addAccess(new String("o1"));
detail.addAccess(new String("o2"));
detail.addAccess(new String("o3"));
detail.addAccess(new String("o5"));
detail.addAccess(new String("o8"));
detail.addAccess(new String("o11"));
detail.addAccess(new String("o12"));
detail.addAccess(new String("o16"));
detail.addAccess(new String("o18"));
detail.addAccess(new String("o20"));
detail.addAccess(new String("o32"));
detail.addAccess(new String("o84"));
builder1.updateGraph(idents[1], detail);
detail = new AccessedObjectsDetailTest();
detail.addAccess(new String("o1"));
detail.addAccess(new String("o13"));
detail.addAccess(new String("o87"));
builder1.updateGraph(idents[4], detail);
detail = new AccessedObjectsDetailTest();
detail.addAccess(new String("o2"));
detail.addAccess(new String("o4"));
detail.addAccess(new String("o15"));
builder1.updateGraph(idents[7], detail);
detail = new AccessedObjectsDetailTest();
detail.addAccess(new String("o7"));
detail.addAccess(new String("o40"));
builder1.updateGraph(idents[10], detail);
detail = new AccessedObjectsDetailTest();
detail.addAccess(new String("o12"));
detail.addAccess(new String("o13"));
builder1.updateGraph(idents[13], detail);
detail = new AccessedObjectsDetailTest();
detail.addAccess(new String("o35"));
detail.addAccess(new String("o43"));
builder1.updateGraph(idents[16], detail);
detail = new AccessedObjectsDetailTest();
detail.addAccess(new String("o36"));
detail.addAccess(new String("o44"));
builder1.updateGraph(idents[19], detail);
detail = new AccessedObjectsDetailTest();
detail.addAccess(new String("o20"));
detail.addAccess(new String("o21"));
builder1.updateGraph(idents[22], detail);
detail = new AccessedObjectsDetailTest();
detail.addAccess(new String("o23"));
detail.addAccess(new String("o26"));
builder1.updateGraph(idents[25], detail);
detail = new AccessedObjectsDetailTest();
detail.addAccess(new String("o24"));
detail.addAccess(new String("o25"));
detail.addAccess(new String("o26"));
detail.addAccess(new String("o50"));
builder1.updateGraph(idents[28], detail);
detail = new AccessedObjectsDetailTest();
detail.addAccess(new String("o30"));
detail.addAccess(new String("o31"));
builder1.updateGraph(idents[31], detail);
detail = new AccessedObjectsDetailTest();
detail.addAccess(new String("o31"));
detail.addAccess(new String("o40"));
detail.addAccess(new String("o41"));
detail.addAccess(new String("o42"));
detail.addAccess(new String("o43"));
detail.addAccess(new String("o44"));
detail.addAccess(new String("o45"));
detail.addAccess(new String("o46"));
detail.addAccess(new String("o47"));
detail.addAccess(new String("o48"));
detail.addAccess(new String("o49"));
detail.addAccess(new String("o50"));
detail.addAccess(new String("o51"));
detail.addAccess(new String("o52"));
detail.addAccess(new String("o53"));
builder1.updateGraph(idents[34], detail);
// Node 2
AffinityGraphBuilder builder2 = driver2.getGraphBuilder();
detail = new AccessedObjectsDetailTest();
detail.addAccess(new String("o1"));
detail.addAccess(new String("o17"));
detail.addAccess(new String("o19"));
detail.addAccess(new String("o21"));
detail.addAccess(new String("o30"));
detail.addAccess(new String("o85"));
builder2.updateGraph(idents[2], detail);
detail = new AccessedObjectsDetailTest();
detail.addAccess(new String("o2"));
detail.addAccess(new String("o9"));
builder2.updateGraph(idents[5], detail);
detail = new AccessedObjectsDetailTest();
detail.addAccess(new String("o1"));
builder2.updateGraph(idents[8], detail);
detail = new AccessedObjectsDetailTest();
detail.addAccess(new String("o8"));
detail.addAccess(new String("o9"));
detail.addAccess(new String("o10"));
builder2.updateGraph(idents[11], detail);
detail = new AccessedObjectsDetailTest();
detail.addAccess(new String("o84"));
detail.addAccess(new String("o85"));
detail.addAccess(new String("o86"));
detail.addAccess(new String("o87"));
detail.addAccess(new String("o41"));
builder2.updateGraph(idents[14], detail);
detail = new AccessedObjectsDetailTest();
detail.addAccess(new String("o14"));
detail.addAccess(new String("o15"));
builder2.updateGraph(idents[17], detail);
detail = new AccessedObjectsDetailTest();
detail.addAccess(new String("o18"));
detail.addAccess(new String("o19"));
detail.addAccess(new String("o45"));
builder2.updateGraph(idents[20], detail);
detail = new AccessedObjectsDetailTest();
detail.addAccess(new String("o38"));
detail.addAccess(new String("o47"));
builder2.updateGraph(idents[23], detail);
detail = new AccessedObjectsDetailTest();
detail.addAccess(new String("o22"));
detail.addAccess(new String("o23"));
builder2.updateGraph(idents[26], detail);
detail = new AccessedObjectsDetailTest();
detail.addAccess(new String("o27"));
detail.addAccess(new String("o51"));
detail.addAccess(new String("o66"));
builder2.updateGraph(idents[29], detail);
detail = new AccessedObjectsDetailTest();
detail.addAccess(new String("o23"));
detail.addAccess(new String("o66"));
detail.addAccess(new String("o32"));
detail.addAccess(new String("o39"));
detail.addAccess(new String("o53"));
builder2.updateGraph(idents[32], detail);
// Node 3
AffinityGraphBuilder builder3 = driver3.getGraphBuilder();
detail = new AccessedObjectsDetailTest();
detail.addAccess(new String("o1"));
detail.addAccess(new String("o6"));
detail.addAccess(new String("o7"));
detail.addAccess(new String("o24"));
detail.addAccess(new String("o27"));
detail.addAccess(new String("o33"));
detail.addAccess(new String("o86"));
builder3.updateGraph(idents[3], detail);
detail = new AccessedObjectsDetailTest();
detail.addAccess(new String("o3"));
detail.addAccess(new String("o4"));
detail.addAccess(new String("o10"));
detail.addAccess(new String("o14"));
builder3.updateGraph(idents[6], detail);
detail = new AccessedObjectsDetailTest();
detail.addAccess(new String("o5"));
detail.addAccess(new String("o6"));
detail.addAccess(new String("o31"));
builder3.updateGraph(idents[9], detail);
detail = new AccessedObjectsDetailTest();
detail.addAccess(new String("o11"));
builder3.updateGraph(idents[12], detail);
detail = new AccessedObjectsDetailTest();
detail.addAccess(new String("o34"));
detail.addAccess(new String("o42"));
builder3.updateGraph(idents[15], detail);
detail = new AccessedObjectsDetailTest();
detail.addAccess(new String("o16"));
detail.addAccess(new String("o17"));
builder3.updateGraph(idents[18], detail);
detail = new AccessedObjectsDetailTest();
detail.addAccess(new String("o37"));
detail.addAccess(new String("o46"));
builder3.updateGraph(idents[21], detail);
detail = new AccessedObjectsDetailTest();
detail.addAccess(new String("o22"));
detail.addAccess(new String("o25"));
detail.addAccess(new String("o28"));
detail.addAccess(new String("o48"));
builder3.updateGraph(idents[24], detail);
detail = new AccessedObjectsDetailTest();
detail.addAccess(new String("o29"));
detail.addAccess(new String("o49"));
builder3.updateGraph(idents[27], detail);
detail = new AccessedObjectsDetailTest();
detail.addAccess(new String("o28"));
detail.addAccess(new String("o29"));
detail.addAccess(new String("o52"));
builder3.updateGraph(idents[30], detail);
detail = new AccessedObjectsDetailTest();
detail.addAccess(new String("o28"));
detail.addAccess(new String("o31"));
detail.addAccess(new String("o33"));
detail.addAccess(new String("o34"));
detail.addAccess(new String("o35"));
detail.addAccess(new String("o36"));
detail.addAccess(new String("o37"));
detail.addAccess(new String("o38"));
detail.addAccess(new String("o39"));
builder3.updateGraph(idents[33], detail);
UndirectedGraph<LabelVertex, WeightedEdge> graphModel =
new ZachBuilder().getAffinityGraph();
System.out.println("MODEL GRAPH IS " + graphModel);
LPADriver driver = (LPADriver)
finderField.get(serverNode.getNodeMappingService());
GraphListener serverListener = driver.getGraphListener();
AffinityGraphBuilder builder = driver.getGraphBuilder();
// The graph can only be found on the server side. Let's make
// sure it looks like the expected Zachary graph.
// The core server graph listener builds a DistGraphBuilder,
// which (on the core node) creates the DistGraphBuilderServerImpl.
// We can find it if we look for the group finder.
AffinityGraphBuilder serverBuilder =
(AffinityGraphBuilder) builder.getAffinityGroupFinder();
UndirectedGraph<LabelVertex, WeightedEdge> graph =
serverBuilder.getAffinityGraph();
System.out.println("GRAPH IS " + graph);
Assert.assertEquals(34, graph.getVertexCount());
Assert.assertEquals(78, graph.getEdgeCount());
ProfileCollector col =
serverNode.getSystemRegistry().