Package com.sun.jini.test.spec.jeri.transport.util

Examples of com.sun.jini.test.spec.jeri.transport.util.SETContext


    public void run() throws Exception {
        //Obtain a server endpoint
        ServerEndpoint se = getServerEndpoint();
        //Call enumerateListenEndpoints to start a listen operation
        //on the endpoint
        se.enumerateListenEndpoints(new SETContext());
        //Call enumerateListenEndpoints while the endpoint is in use
        //and verify that an IOException is thrown
        EIUTContext context = new EIUTContext();
        try {
            se.enumerateListenEndpoints(context);
View Full Code Here


                + " does not result in a NulPointerException");
        }

        //Verify ListenEndpoint.listen(null);
        endpoint = getServerEndpoint();
        SETContext context = new SETContext();
        endpoint.enumerateListenEndpoints(context);
        ArrayList endpoints = context.getEndpoints();
        log.finest(endpoints.size() + " endpoints returned");
        Iterator i = endpoints.iterator();
        while (i.hasNext()) {
            EndpointHolder holder = (EndpointHolder) i.next();
            ServerEndpoint.ListenEndpoint le = holder.getListenEndpoint();
            exceptionThrown = false;
            try {
                log.finest("Testing ListenEndpoint.listen(null)");
                le.listen(null);
            } catch (NullPointerException e) {
                holder.getListenHandle().close();
                log.finest("ListenEndpoint.listen(null) throws exception");
                exceptionThrown = true;
            }
            if (!exceptionThrown) {
                throw new TestException("Passing in null to"
                    + " ListenEndpoint.listen does not result in a"
                    + " NullPointerException");
            }
        }
        // wait to make sure resources are released before attempting
        // to reuse endpoint
        Thread.currentThread().sleep(1000 * 30);
        //Verify Endpoint.newRequest(null);
        endpoint = getServerEndpoint();
        context = new SETContext();
        Endpoint ep = endpoint.enumerateListenEndpoints(context);
        exceptionThrown = false;
        try {
            ep.newRequest(null);
        } catch (NullPointerException e) {
            exceptionThrown = true;
        }
        if (!exceptionThrown) {
            throw new TestException("Passing in null to"
                + " Endpoint.newRequest does not result in a"
                + " NullPointerException");
        }

        //Close listen operations
        endpoints = context.getEndpoints();
        i = endpoints.iterator();
        while (i.hasNext()) {
            ((EndpointHolder)i.next()).getListenHandle().close();
        }
        // wait to make sure resources are released before attempting
        // to reuse endpoint
        Thread.currentThread().sleep(1000 * 30);
        //Verify OutboundRequest.populateContext(null)
        endpoint = getServerEndpoint();
        context = new SETContext();
        ep = endpoint.enumerateListenEndpoints(context);
        OutboundRequestIterator it =
            ep.newRequest(InvocationConstraints.EMPTY);
        while (it.hasNext()) {
            exceptionThrown = false;
View Full Code Here

                new PrivilegedExceptionAction() {
                public Object run() throws Exception {
                    ServerEndpoint endpoint = (ServerEndpoint)
                        getInstance.invoke(c,new Object[]{new Integer(0)});
                    return endpoint.enumerateListenEndpoints(
                        new SETContext());
                }
            },null);
        } catch (SecurityException s) {
            exceptionThrown = true;
        }
View Full Code Here

     public void run() throws Exception {
        //obtain a ServerEndpoint and verify that the addListenEndpoint
        //is called on the ListenContext specified and the expected number
        //of ListenEndpoints are passed in to the context.
        SETContext lc = new SETContext();
        ServerEndpoint se = getServerEndpoint();
        Endpoint e = se.enumerateListenEndpoints(lc);
        boolean exceptionThrown = false;
        log.finest("Call to enumerateListeEndpoints returns " + e);
        Integer expected = (Integer) getConfigObject(Integer.class,
            "expectedListenEndpoints");
        ArrayList endpoints = lc.getEndpoints();
        if (expected.intValue() != endpoints.size()) {
            throw new TestException(
                "ServerEndpoint.enumerateListenEndpoints did not return"
                + "the expected number of ListenEndpoints.  Expected "
                + expected.intValue() + " but received "
View Full Code Here

    public void run() throws Exception {
        Endpoint endpoint = null;
        //Obtain endpoint
        ServerEndpoint serverEndpoint = getServerEndpoint();
        endpoint = serverEndpoint
            .enumerateListenEndpoints(new SETContext());
        //Obtain constraints
        InvocationConstraints conflictingConstraints =
            (InvocationConstraints) getConfigObject(
                InvocationConstraints.class, "conflictingConstraints");
        InvocationConstraints unsupportedConstraints =
View Full Code Here

TOP

Related Classes of com.sun.jini.test.spec.jeri.transport.util.SETContext

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.