Package org.glassfish.jersey.test.spi

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


        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

                            .build();

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

                                .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

                                .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

            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

        }

        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

    private static Class<? extends TestContainerFactory> loadFactoryClass(final String factoryClassName) {
        Class<? extends TestContainerFactory> factoryClass;
        final Class<Object> loadedClass = AccessController.doPrivileged(ReflectionHelper.classForNamePA(factoryClassName, null));
        if (loadedClass == null) {
            throw new TestContainerException(String.format(
                    "Test container factory class '%s' cannot be loaded", factoryClassName));
        }
        try {
            return loadedClass.asSubclass(TestContainerFactory.class);
        } catch (final ClassCastException ex) {
            throw new TestContainerException(String.format(
                    "Class '%s' does not implement TestContainerFactory SPI.", factoryClassName), ex);
        }
    }
View Full Code Here

        private JettyTestContainer(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. Jetty HTTP container only supports deployment on root path.",
                        base.getRawPath()));
            }

            this.baseUri = base;
View Full Code Here

                        baseUri = UriBuilder.fromUri(baseUri).port(port).build();

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

TOP

Related Classes of org.glassfish.jersey.test.spi.TestContainerException

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.