Examples of IllegalArgumentContext


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

public class IllegalArgumentExceptionTest extends AbstractEndpointTest {

    public void run() throws Exception {
        //Obtain a serverEndpoint instance
        ServerEndpoint se = getServerEndpoint();
        IllegalArgumentContext context = new IllegalArgumentContext(null);
        //Call enumerateListenEndpoints and extract cookies
        se.enumerateListenEndpoints(context);
        ArrayList cookies = context.getCookies();
        //Obtain a different server endpoint
        se = (ServerEndpoint) getConfigObject(ServerEndpoint.class,
            "diffEndpoint");
        boolean exceptionThrown = false;
        try {
            se.enumerateListenEndpoints(
                new IllegalArgumentContext(cookies));
        } catch (IllegalArgumentException e) {
            exceptionThrown = true;
        }
        if (!exceptionThrown) {
            throw new TestException("The ServerEndpoint"
                + " implementation does not throw an"
                + " IllegalArgumentException when an invalid"
                + " ListenCookie is returned by the ListenContext");
        }
        //Close listen operation
        ArrayList endpoints = context.getEndpoints();
        Iterator it = endpoints.iterator();
        while (it.hasNext()) {
            ((EndpointHolder) it.next()).getListenHandle().close();
        }
        // wait to make sure resources are released before attempting
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.