Examples of IdentityImpl


Examples of com.sun.sgs.impl.auth.IdentityImpl

    @Test
    public void testEvilServerAssignNode() throws Exception {
        // replace the serverimpl with our evil proxy
        Object oldServer = swapToEvilServer(nodeMappingService);
       
        Identity id = new IdentityImpl("first");
       
        try {
            nodeMappingService.assignNode(NodeMappingService.class, id);
        } catch (IllegalStateException e) {
            // All OK, the server is probably shutting down
View Full Code Here

Examples of com.sun.sgs.impl.auth.IdentityImpl

    }
   
    @Test
    public void testEvilServerGetNode() throws Exception {
        // replace the serverimpl with our evil proxy
        Identity id = new IdentityImpl("first");
        nodeMappingService.assignNode(NodeMappingService.class, id);
       
        Object oldServer = swapToEvilServer(nodeMappingService);
       
        GetNodeTask task = new GetNodeTask(id);
View Full Code Here

Examples of com.sun.sgs.impl.auth.IdentityImpl

   
    @Test
    public void testEvilServerGetIdentities() throws Exception {
        // put an identity in with a node
        // try to getNode that identity.
        final Identity id1 = new IdentityImpl("first");
        nodeMappingService.assignNode(NodeMappingService.class, id1);
       
        Object oldServer = swapToEvilServer(nodeMappingService);
       
        txnScheduler.runTask(new TestAbstractKernelRunnable(){
View Full Code Here

Examples of com.sun.sgs.impl.auth.IdentityImpl

        swapToNormalServer(nodeMappingService, oldServer);
    }
   
    @Test
    public void testEvilServerSetStatus() throws Exception {
        final Identity id = new IdentityImpl("first");
        nodeMappingService.assignNode(NodeMappingService.class, id);

        Object oldServer = swapToEvilServer(nodeMappingService);
       
        try {
View Full Code Here

Examples of com.sun.sgs.impl.auth.IdentityImpl

        Assert.assertEquals(0, graph.getVertexCount());
    }

    @Test
    public void testNoDetail() throws Exception {
        ProfileReport report = makeReport(new IdentityImpl("something"));
        listener.report(report);

        Graph<LabelVertex, WeightedEdge> graph = builder.getAffinityGraph();
        Assert.assertEquals(0, graph.getEdgeCount());
        // no accessed objects
View Full Code Here

Examples of com.sun.sgs.impl.auth.IdentityImpl

        Assert.assertEquals(0, graph.getVertexCount());
    }

    @Test
    public void testOneAccess() throws Exception {
        ProfileReport report = makeReport(new IdentityImpl("something"));
        AccessedObjectsDetailTest detail = new AccessedObjectsDetailTest();
        detail.addAccess(new String("obj1"));
        setAccessedObjectsDetailMethod.invoke(report, detail);
        listener.report(report);
View Full Code Here

Examples of com.sun.sgs.impl.auth.IdentityImpl

    @Test
    public void testOneEdge() throws Exception {
        // Note that the graph listener believes edges are the same
        // objects if their reported objIds are equal.
        ProfileReport report = makeReport(new IdentityImpl("something"));
        AccessedObjectsDetailTest detail = new AccessedObjectsDetailTest();
        detail.addAccess(new String("obj1"));
        setAccessedObjectsDetailMethod.invoke(report, detail);
        listener.report(report);

        report = makeReport(new IdentityImpl("somethingElse"));

        detail = new AccessedObjectsDetailTest();
        detail.addAccess(new String("obj1"));
        setAccessedObjectsDetailMethod.invoke(report, detail);
        listener.report(report);
View Full Code Here

Examples of com.sun.sgs.impl.auth.IdentityImpl

        Assert.assertEquals(2, graph.getVertexCount());
    }

    @Test
    public void testOneEdgeTwice() throws Exception {
        ProfileReport report = makeReport(new IdentityImpl("something"));
        AccessedObjectsDetailTest detail = new AccessedObjectsDetailTest();
        detail.addAccess(new String("obj1"));
        setAccessedObjectsDetailMethod.invoke(report, detail);
        listener.report(report);

        report = makeReport(new IdentityImpl("somethingElse"));
        detail = new AccessedObjectsDetailTest();
        detail.addAccess(new String("obj1"));
        setAccessedObjectsDetailMethod.invoke(report, detail);
        listener.report(report);

        report = makeReport(new IdentityImpl("something"));
        detail = new AccessedObjectsDetailTest();
        detail.addAccess(new String("obj1"));
        setAccessedObjectsDetailMethod.invoke(report, detail);
        listener.report(report);
View Full Code Here

Examples of com.sun.sgs.impl.auth.IdentityImpl

        Assert.assertTrue("end2 check", ok);
    }

    @Test
    public void testIncEdgeWeight() throws Exception {
        ProfileReport report = makeReport(new IdentityImpl("something"));
        AccessedObjectsDetailTest detail = new AccessedObjectsDetailTest();
        detail.addAccess(new String("obj1"));
        setAccessedObjectsDetailMethod.invoke(report, detail);
        listener.report(report);

        report = makeReport(new IdentityImpl("somethingElse"));
        detail = new AccessedObjectsDetailTest();
        detail.addAccess(new String("obj1"));
        detail.addAccess(new String("obj1"));
        setAccessedObjectsDetailMethod.invoke(report, detail);
        listener.report(report);

        Graph<LabelVertex, WeightedEdge> graph = builder.getAffinityGraph();
        System.out.println(graph);
        Assert.assertEquals(1, graph.getEdgeCount());
        Assert.assertEquals(2, graph.getVertexCount());

        for (WeightedEdge e : graph.getEdges()) {
            Assert.assertEquals(1, e.getWeight());
        }

        report = makeReport(new IdentityImpl("something"));
        detail = new AccessedObjectsDetailTest();
        detail.addAccess(new String("obj1"));
        setAccessedObjectsDetailMethod.invoke(report, detail);
        listener.report(report);

        graph = builder.getAffinityGraph();
        System.out.println("Second time: " + graph);
        Assert.assertEquals(1, graph.getEdgeCount());
        Assert.assertEquals(2, graph.getVertexCount());

        for (WeightedEdge e : graph.getEdges()) {
            Assert.assertEquals(2, e.getWeight());
        }

        report = makeReport(new IdentityImpl("something"));
        detail = new AccessedObjectsDetailTest();
        detail.addAccess(new String("obj1"));
        setAccessedObjectsDetailMethod.invoke(report, detail);
        listener.report(report);
View Full Code Here

Examples of com.sun.sgs.impl.auth.IdentityImpl

        AccessedObjectsDetailTest detail = new AccessedObjectsDetailTest();
        detail.addAccess(new String("obj1"));
        setAccessedObjectsDetailMethod.invoke(report, detail);
        listener.report(report);

        report = makeReport(new IdentityImpl("somethingElse"));

        detail = new AccessedObjectsDetailTest();
        detail.addAccess(new String("obj1"));
        setAccessedObjectsDetailMethod.invoke(report, detail);
        listener.report(report);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.