Package net.jini.jeri

Examples of net.jini.jeri.ServerCapabilities


        ep = getServerEndpoint();
        if (!(ep instanceof ServerCapabilities)){
            throw new TestException(ep + " does not implement"
                + " ServerCapabilities.");
        }
        ServerCapabilities serverEndpoint = (ServerCapabilities) ep;
        //Obtain constraints
        InvocationConstraints conflictingConstraints =
            (InvocationConstraints) getConfigObject(
                InvocationConstraints.class, "conflictingConstraints");
        InvocationConstraints unsupportedConstraints =
            (InvocationConstraints) getConfigObject(
                InvocationConstraints.class, "unsupportedConstraints");
        boolean integritySupported = ((Boolean)getConfigObject(
            Boolean.class, "integritySupported")).booleanValue();
        //Verify conflicting constraints
        boolean exceptionThrown = false;
        try {
            serverEndpoint.checkConstraints(conflictingConstraints);
        } catch (UnsupportedConstraintException e){
            exceptionThrown = true;
        }
        if (!exceptionThrown) {
            throw new TestException("Conflicting constraints"
                + " did not generate an UnsupportedConstraintsException"
                + " for " + ep);
        }
        //Verify unsupported constraints
        exceptionThrown = false;
        try {
            serverEndpoint.checkConstraints(unsupportedConstraints);
        } catch (UnsupportedConstraintException e){
            exceptionThrown = true;
        }
        if (!exceptionThrown) {
            throw new TestException("Unsupported constraints"
                + " did not generate an UnsupportedConstraintsException"
                + " for " + ep);
        }
        if (integritySupported) {
            //Verify integrity
            boolean integrityReturned = false;
            InvocationConstraints returned = serverEndpoint
                .checkConstraints(
                    new InvocationConstraints(Integrity.YES,null));
            Iterator it = returned.requirements().iterator();
            while (it.hasNext()) {
                InvocationConstraint ic = (InvocationConstraint) it.next();
View Full Code Here

TOP

Related Classes of net.jini.jeri.ServerCapabilities

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.