Package com.sun.sgs.auth

Examples of com.sun.sgs.auth.Identity


    @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


    }
   
    @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

   
    @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

        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

        AssertionError error = null;
        ProfileReport report = SimpleTestListener.report;

        // Check to see if this is a report we care about by checking
        // the owner of this task.
        Identity owner = report.getTaskOwner();
        boolean update = owner.equals(positiveOwner);
        if (!update && !owner.equals(negativeOwner)) {
            return;
        }
       
        if (update) {
            try {
View Full Code Here

    public void run() {
        AssertionError error = null;
        ProfileReport report = SimpleTestListener.report;
        // Check to see if we expected the name to be in this report.
        Identity owner = report.getTaskOwner();
        boolean expected = owner.equals(positiveOwner);
        if (!expected && !owner.equals(negativeOwner)) {
            return;
        }
        boolean found = report.getReportedOperations().contains(name);
        try {
            assertEquals(expected, found);
View Full Code Here

        final Exchanger<AssertionError> errorExchanger =
                new Exchanger<AssertionError>();

        // The owner for our positive test.  The listener uses this owner
        // to find the ProfileReport for the task in this test.
        final Identity positiveOwner = new DummyIdentity("owner");
        final Identity negativeOwner = new DummyIdentity("other");
        SimpleTestListener test = new SimpleTestListener(
            new CounterReportRunnable(counter.getName(), negativeOwner,
                                      positiveOwner, errorExchanger, 1));
        profileCollector.addListener(test, true);
View Full Code Here

        final Exchanger<AssertionError> errorExchanger =
                new Exchanger<AssertionError>();

        // The owner for our positive test.  The listener uses this owner
        // to find the ProfileReport for the task in this test.
        final Identity positiveOwner = new DummyIdentity("counterlevel");
        final Identity negativeOwner = new DummyIdentity("counterlevelneg");
        SimpleTestListener test = new SimpleTestListener(
            new CounterReportRunnable(counter.getName(), negativeOwner,
                                      positiveOwner, errorExchanger, 1));
        profileCollector.addListener(test, true);
View Full Code Here

        final Exchanger<AssertionError> errorExchanger =
                new Exchanger<AssertionError>();

        // The owner for our positive test.  The listener uses this owner
        // to find the ProfileReport for the task in this test.
        final Identity positiveOwner = new DummyIdentity("counterinc");
        final Identity negativeOwner = new DummyIdentity("counterincneg");
        SimpleTestListener test = new SimpleTestListener(
            new CounterReportRunnable(counter.getName(),
                                      negativeOwner, positiveOwner,
                                      errorExchanger, incValue));
        profileCollector.addListener(test, true);
View Full Code Here

        final Exchanger<AssertionError> errorExchanger =
                new Exchanger<AssertionError>();

        // The owner for our positive test.  The listener uses this owner
        // to find the ProfileReport for the task in this test.
        final Identity positiveOwner = new DummyIdentity("countermult");
        final Identity negativeOwner = new DummyIdentity("countermultneg");
        SimpleTestListener test = new SimpleTestListener(
            new CounterReportRunnable(counter.getName(), negativeOwner,
                                      positiveOwner, errorExchanger, incValue));
        profileCollector.addListener(test, true);
View Full Code Here

TOP

Related Classes of com.sun.sgs.auth.Identity

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.