Package com.sun.sgs.impl.auth

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


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

    @Test
    public void testFourReports() throws Exception {
        Identity identA = new IdentityImpl("A");
        Identity identB = new IdentityImpl("B");
        Identity identC = new IdentityImpl("C");
        Identity identD = new IdentityImpl("D");

        LabelVertex vertA = new LabelVertex(identA);
        LabelVertex vertB = new LabelVertex(identB);
        LabelVertex vertC = new LabelVertex(identC);
        LabelVertex vertD = new LabelVertex(identD);
View Full Code Here


        Assert.assertEquals(1, graph.findEdge(vertC, vertD).getWeight());
    }

    @Test
    public void testThreeIdentMultOneObject() throws Exception {
        Identity identA = new IdentityImpl("A");
        Identity identB = new IdentityImpl("B");
        Identity identC = new IdentityImpl("C");
        ProfileReport report = makeReport(identA);
        AccessedObjectsDetailTest detail = new AccessedObjectsDetailTest();
        detail.addAccess(new String("obj1"));
        setAccessedObjectsDetailMethod.invoke(report, detail);
        listener.report(report);
View Full Code Here

    @Test
    public void testGetVertexNotThere() {
        // Needed for the bipartite version
        builder.getAffinityGraph();
        LabelVertex v = builder.getVertex(new IdentityImpl("None"));
        Assert.assertNull(v);
    }
View Full Code Here

        Assert.assertNull(v);
    }

    @Test
    public void testGetVertex() throws Exception {
        Identity identA = new IdentityImpl("A");
        Identity identB = new IdentityImpl("B");
        ProfileReport report = makeReport(identA);
        AccessedObjectsDetailTest detail = new AccessedObjectsDetailTest();
        detail.addAccess(new String("obj1"));
        setAccessedObjectsDetailMethod.invoke(report, detail);
        listener.report(report);
View Full Code Here

        node.shutdown(false);
        Properties p = new Properties();
        p.setProperty(AbstractAffinityGraphBuilder.PERIOD_COUNT_PROPERTY, "2");
        startNewNode(p);

        LabelVertex vertA = new LabelVertex(new IdentityImpl("A"));
        LabelVertex vertB = new LabelVertex(new IdentityImpl("B"));
        LabelVertex vertC = new LabelVertex(new IdentityImpl("C"));
        LabelVertex vertD = new LabelVertex(new IdentityImpl("D"));

        // Each update to the graph is followed by a pruning task run,
        // to simulate a pruning time period.
        testFourReports();
        Method getPruneTaskMethod =
View Full Code Here

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

    // The reports added in testFourReports, without the assertions.
    protected void addFourReports() throws Exception {
        Identity identA = new IdentityImpl("A");
        Identity identB = new IdentityImpl("B");
        Identity identC = new IdentityImpl("C");
        Identity identD = new IdentityImpl("D");
        ProfileReport report = makeReport(identA);
        AccessedObjectsDetailTest detail = new AccessedObjectsDetailTest();
        detail.addAccess(new String("obj1"));
        detail.addAccess(new String("obj2"));
        setAccessedObjectsDetailMethod.invoke(report, detail);
View Full Code Here

    public void testShutdownUpdateGraph() throws Exception {
        graphDriver.shutdown();
        AccessedObjectsDetailTest detail = new AccessedObjectsDetailTest();
        detail.addAccess(new String("obj1"));
        graphDriver.getGraphBuilder().
                updateGraph(new IdentityImpl("something"), detail);
    }
View Full Code Here

                getAffinityGroupFinder().findAffinityGroups();
    }

    @Test
    public void testListenerDisable() 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();
        Assert.assertEquals(1, graph.getEdgeCount());
        Assert.assertEquals(2, graph.getVertexCount());

        // Now, disable
        graphDriver.disable();

        // And add more stuff
        report = makeReport(new IdentityImpl("somethingDifferent"));
        detail = new AccessedObjectsDetailTest();
        detail.addAccess(new String("obj1"));
        setAccessedObjectsDetailMethod.invoke(report, detail);
        listener.report(report);
View Full Code Here

    @Test
    public void testRunImmediateTasks() throws Exception {
        // test with application identity
        runImmediateTest(taskOwner);
        // test with un-mapped identity
        Identity newOwner = new IdentityImpl("id");
        runImmediateTest(newOwner);
        // test with mapped identity
        mappingService.assignNode(TestTaskServiceImpl.class,
                                  newOwner);
        runImmediateTest(newOwner);
View Full Code Here

    @Test
    public void testRunPendingTasks() throws Exception {
        // test with application identity
        runPendingTest(taskOwner);
        // test with un-mapped identity
        Identity newOwner = new IdentityImpl("id");
        runPendingTest(newOwner);
        // test with mapped identity
        mappingService.assignNode(TestTaskServiceImpl.class, newOwner);
        runPendingTest(newOwner);
    }
View Full Code Here

TOP

Related Classes of com.sun.sgs.impl.auth.IdentityImpl

Copyright © 2018 www.massapicom. 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.