Examples of TestContainerException


Examples of com.sun.jersey.test.framework.spi.container.TestContainerException

            Servlet servletInstance;
            if( servletClass != null) {
                try {
                    servletInstance = (Servlet) servletClass.newInstance();
                } catch (InstantiationException ex) {
                    throw new TestContainerException(ex);
                } catch (IllegalAccessException ex) {
                    throw new TestContainerException(ex);
                }
                sa.setServletInstance(servletInstance);
            }

            for(Class<? extends EventListener> eventListener : eventListeners) {
                sa.addServletListener(eventListener.getName());
            }
        
            // Filter support
            if ( filters!=null ) {
                try {
                    for(WebAppDescriptor.FilterDescriptor d : this.filters) {
                        sa.addFilter(d.getFilterClass().newInstance(), d.getFilterName(), d.getInitParams());
                    }
                } catch (InstantiationException ex) {                   
                    throw new TestContainerException(ex);
                } catch (IllegalAccessException ex) {                   
                    throw new TestContainerException(ex);
                }
            }
           
            for(String contextParamName : contextParams.keySet()) {
                sa.addContextParameter(contextParamName, contextParams.get(contextParamName));
View Full Code Here

Examples of com.sun.jersey.test.framework.spi.container.TestContainerException

            try {
                Adapter adapter = ContainerFactory.createContainer(Adapter.class,
                        ad.getResourceConfig());
                this.selectorThread = create(this.baseUri, adapter);
            } catch (Exception ex) {
                throw new TestContainerException(ex);
            }
        }
View Full Code Here

Examples of com.sun.jersey.test.framework.spi.container.TestContainerException

        public void start() {
            try {
                LOGGER.info("Starting low level grizzly container");
                selectorThread.listen();
            } catch (InstantiationException ex) {
                throw new TestContainerException(ex);
            } catch (IOException ex) {
                throw new TestContainerException(ex);
            }
        }
View Full Code Here

Examples of org.glassfish.jersey.test.spi.TestContainerException

                    }
                } else {
                    try {
                        testContainerFactoryClass = Class.forName(tcfClassName).asSubclass(TestContainerFactory.class);
                    } catch (ClassNotFoundException ex) {
                        throw new TestContainerException(
                                "The default test container factory class name, "
                                        + tcfClassName
                                        + ", cannot be loaded", ex);
                    } catch (ClassCastException ex) {
                        throw new TestContainerException(
                                "The default test container factory class, "
                                        + tcfClassName
                                        + ", is not an instance of TestContainerFactory", ex);
                    }
                }
            }

            try {
                return testContainerFactoryClass.newInstance();
            } catch (Exception ex) {
                throw new TestContainerException(
                        "The default test container factory, "
                                + testContainerFactoryClass
                                + ", could not be instantiated", ex);
            }
        }
View Full Code Here

Examples of org.glassfish.jersey.test.spi.TestContainerException

        private SimpleTestContainer(final URI baseUri, final DeploymentContext context) {
            final URI base = UriBuilder.fromUri(baseUri).path(context.getContextPath()).build();

            if (!"/".equals(base.getRawPath())) {
                throw new TestContainerException(String.format(
                        "Cannot deploy on %s. Simple framework container only supports deployment on root path.",
                        base.getRawPath()));
            }

            this.baseUri = base;
View Full Code Here

Examples of org.glassfish.jersey.test.spi.TestContainerException

                            .build();

                    LOGGER.log(Level.INFO, "Started SimpleTestContainer at the base URI " + baseUri);
                }
            } catch (ProcessingException e) {
                throw new TestContainerException(e);
            }
        }
View Full Code Here

Examples of org.glassfish.jersey.test.spi.TestContainerException

                                .port(server.getListener("grizzly").getPort())
                                .build();
                        LOGGER.log(Level.INFO, "Started GrizzlyTestContainer at the base URI " + baseUri);
                    }
                } catch (final IOException ioe) {
                    throw new TestContainerException(ioe);
                }
            }
        }
View Full Code Here

Examples of org.glassfish.jersey.test.spi.TestContainerException

                                .port(server.getListener("grizzly").getPort())
                                .build();
                        LOGGER.log(Level.INFO, "Started GrizzlyWebTestContainer at the base URI " + baseUri);
                    }
                } catch (final IOException ioe) {
                    throw new TestContainerException(ioe);
                }
            }
        }
View Full Code Here

Examples of org.glassfish.jersey.test.spi.TestContainerException

            try {
                server = GrizzlyHttpServerFactory.createHttpServer(baseUri, (GrizzlyHttpContainer) null, false, null, false);
                context.deploy(server);
            } catch (final ProcessingException ex) {
                throw new TestContainerException(ex);
            }
        }
View Full Code Here

Examples of org.glassfish.jersey.test.spi.TestContainerException

        }

        try {
            return defaultTestContainerFactoryClass.newInstance();
        } catch (final Exception ex) {
            throw new TestContainerException(String.format(
                    "Could not instantiate test container factory '%s'", defaultTestContainerFactoryClass.getName()), ex);
        }
    }
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.