Package org.jboss.arquillian.container.spi

Examples of org.jboss.arquillian.container.spi.ConfigurationException


   {
      int httpResponseCode = hconn.getResponseCode();
      // Supposes that <= 199 is not bad, but is it? See http://en.wikipedia.org/wiki/List_of_HTTP_status_codes
      if (httpResponseCode >= 400 && httpResponseCode < 500)
      {
         throw new ConfigurationException("Unable to connect to Tomcat manager. "
               + "The server command (" + command + ") failed with responseCode ("
               + httpResponseCode + ") and responseMessage (" + hconn.getResponseMessage() + ").\n\n"
               + "Please make sure that you provided correct credentials to an user which is able to access Tomcat manager application.\n"
               + "These credentials can be specified in the Arquillian container configuration as \"user\" and \"pass\" properties.\n"
               + "The user must have appripriate role specified in tomcat-users.xml file.\n");
View Full Code Here


     * @param message The exception message
     * @throws ConfigurationException Thrown if string is empty, null or it does not represent a path the a valid directory
     */
    public static void configurationDirectoryExists(final String string, final String message) throws ConfigurationException {
        if (string == null || string.length() == 0 || new File(string).isDirectory() == false) {
            throw new ConfigurationException(message);
        }
    }
View Full Code Here

    private String frameworkProperties;

    @Override
    public void validate() throws ConfigurationException {
        if (frameworkProperties == null)
            throw new ConfigurationException("Cannot obtain frameworkProperties");

        // Get the framework configuration
        File file = new File(frameworkProperties);
        try {
            FileInputStream input = new FileInputStream(file);
            Properties props = new Properties();
            props.load(input);
            for (String key : props.stringPropertyNames()) {
                frameworkConfiguration.put(key, props.getProperty(key));
            }
        } catch (IOException ex) {
            throw new ConfigurationException("Cannot read: " + file.getAbsolutePath());
        }

        // Get the {@link FrameworkFactory}
        Iterator<FrameworkFactory> factories = ServiceLoader.load(FrameworkFactory.class).iterator();
        if (!factories.hasNext())
            throw new ConfigurationException("Cannot obtain " + FrameworkFactory.class.getName() + " service");

        frameworkFactory = factories.next();
    }
View Full Code Here

     * @param message The exception message
     * @throws ConfigurationException Thrown if string is empty, null or it does not represent a path the a valid directory
     */
    public static void directoryExists(final String string, final String message) throws ConfigurationException {
        if (string == null || string.length() == 0 || new File(string).isDirectory() == false) {
            throw new ConfigurationException(message);
        }
    }
View Full Code Here

     */
    @Override
    public void validate() throws ConfigurationException {
        super.validate();
        if (serverJarFile == null || serverJarFile.length() == 0) {
            throw new ConfigurationException("\"serverJarFile\" must be specified");
        }
        final File file = new File(serverJarFile);
        if (!file.exists() || file.isDirectory()) {
            throw new ConfigurationException("Server JAR file must exist and not be a directory: "
                + file.getAbsolutePath());
        }
    }
View Full Code Here

   {
      int httpResponseCode = hconn.getResponseCode();
      // Supposes that <= 199 is not bad, but is it? See http://en.wikipedia.org/wiki/List_of_HTTP_status_codes
      if (httpResponseCode >= 400 && httpResponseCode < 500)
      {
         throw new ConfigurationException("Unable to connect to Tomcat manager. "
               + "The server command (" + command + ") failed with responseCode ("
               + httpResponseCode + ") and responseMessage (" + hconn.getResponseMessage() + ").\n\n"
               + "Please make sure that you provided correct credentials to an user which is able to access Tomcat manager application.\n"
               + "These credentials can be specified in the Arquillian container configuration as \"user\" and \"pass\" properties.\n"
               + "The user must have appripriate role specified in tomcat-users.xml file.\n");
View Full Code Here

                props.load(input);
                for (String key : props.stringPropertyNames()) {
                    frameworkConfiguration.put(key, props.getProperty(key));
                }
            } catch (IOException ex) {
                throw new ConfigurationException("Cannot read: " + file.getAbsolutePath());
            }
        }

        // Get the {@link FrameworkFactory}
        Iterator<FrameworkFactory> factories = ServiceLoader.load(FrameworkFactory.class).iterator();
View Full Code Here

    }

    @Override
    public void validate() throws ConfigurationException {
        if (username != null && password == null) {
            throw new ConfigurationException("username has been set, but no password given");
        }
    }
View Full Code Here

    }

    public void setup(AppEngineToolsConfiguration configuration) {
        final String sdkDir = configuration.getSdkDir();
        if (sdkDir == null)
            throw new ConfigurationException("AppEngine SDK root is null.");

        final String userId = configuration.getUserId();
        if (userId == null)
            throw new ConfigurationException("Null userId.");

        final String password = configuration.getPassword();
        if (password == null)
            throw new ConfigurationException("Null password.");

        SdkInfo.setSdkRoot(new File(sdkDir));

        this.configuration = configuration;
    }
View Full Code Here

TOP

Related Classes of org.jboss.arquillian.container.spi.ConfigurationException

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.