// Path: arquillian-chameleon-container-model/src/main/java/org/arquillian/container/chameleon/FileUtils.java
// public class FileUtils {
// 
//     public static InputStream loadConfiguration(String resourceName, boolean isDefault) {
//         InputStream stream = loadResource(resourceName);
//         if (stream == null) {
//             if (isDefault) {
//                 throw new IllegalStateException(
//                     "Could not find built-in configuration as file nor classloader resource: " + resourceName + ". " +
//                         "Make sure that this file exists in classpath resource or in the project folder.");
//             } else {
//                 throw new ConfigurationException(
//                     "Could not locate configured containerConfigurationFile as file" +
//                         " nor classloader resource: " + resourceName);
//             }
//         }
// 
//         return stream;
//     }
// 
//     private static InputStream loadResource(String resourceName) {
//         InputStream stream = loadClassPathResource(resourceName);
//         if (stream == null) {
//             stream = loadFileResource(resourceName);
//         }
//         return stream;
//     }
// 
//     private static InputStream loadFileResource(String resourceName) {
//         File file = new File(resourceName);
//         if (file.exists()) {
//             try {
//                 return new FileInputStream(file);
//             } catch (FileNotFoundException e) {
//                 // should not happen unless file has been deleted since we did
//                 // file.exists call
//                 throw new IllegalStateException("Configuration file could not be found, " + resourceName);
//             }
//         }
//         return null;
//     }
// 
//     private static InputStream loadClassPathResource(String resourceName) {
//         ClassLoader classLoader = Target.class.getClassLoader();
//         return classLoader.getResourceAsStream(resourceName);
//     }
// }
// 
// Path: arquillian-chameleon-container-model/src/main/java/org/arquillian/container/chameleon/Loader.java
// public class Loader {
// 
//     /*
//    Constructor constructor = new Constructor();
//    constructor.addTypeDescription(new TypeDescription(Container[].class, "tag:yaml.org,2002:" + Container[].class.getName()));
// 
//    Yaml yaml = new Yaml(constructor);
//    yaml.setBeanAccess(BeanAccess.FIELD);
// 
//    return yaml.loadAs(containers, Container[].class);
//     */
//     protected Container[] loadContainers(ClassLoader classloader, InputStream containers) throws Exception {
//         Class<?> constructorClass = classloader.loadClass("org.yaml.snakeyaml.constructor.Constructor");
//         Class<?> baseConstructorClass = classloader.loadClass("org.yaml.snakeyaml.constructor.BaseConstructor");
// 
//         Class<?> typeDescriptionClass = classloader.loadClass("org.yaml.snakeyaml.TypeDescription");
//         Class<?> yamlClass = classloader.loadClass("org.yaml.snakeyaml.Yaml");
//         Class<?> beanAccessClass = classloader.loadClass("org.yaml.snakeyaml.introspector.BeanAccess");
//         Constructor<?> typeDescriptionConst =
//             typeDescriptionClass.getConstructor(new Class[] {Class.class, String.class});
// 
//         Method addTypeDescription =
//             constructorClass.getMethod("addTypeDescription", new Class<?>[] {typeDescriptionClass});
// 
//         Method setBeanAccess = yamlClass.getDeclaredMethod("setBeanAccess", new Class<?>[] {beanAccessClass});
//         Method loadAs = yamlClass.getDeclaredMethod("loadAs", new Class<?>[] {InputStream.class, Class.class});
// 
//         Object constructor = constructorClass.newInstance();
// 
//         // Pre register type to avoid Yaml trying Class.forName on it's own classloader with our class.
//         addTypeDescription.invoke(constructor,
//             typeDescriptionConst.newInstance(Container[].class, "tag:yaml.org,2002:" + Container[].class.getName()));
// 
//         Object yaml =
//             yamlClass.getConstructor(new Class[] {baseConstructorClass}).newInstance(new Object[] {constructor});
// 
//         Object fieldBeanAccess = null;
//         for (Object beanAccess : beanAccessClass.getEnumConstants()) {
//             if ("FIELD".equals(beanAccess.toString())) {
//                 fieldBeanAccess = beanAccess;
//                 break;
//             }
//         }
// 
//         setBeanAccess.invoke(yaml, fieldBeanAccess);
// 
//         return (Container[]) loadAs.invoke(yaml, new Object[] {containers, Container[].class});
//     }
// 
//     public Container[] loadContainers(InputStream inputStream) throws Exception {
//         return this.loadContainers(Target.class.getClassLoader(), inputStream);
//     }
// }


import org.arquillian.container.chameleon.FileUtils;
import org.arquillian.container.chameleon.Loader;
import org.jboss.arquillian.container.spi.ConfigurationException;
        if (sections.length < 2 || sections.length > 3) {
            throw new ConfigurationException("Wrong target format [" + source + "] server:version:type");
        }
        target.server = sections[0].toLowerCase();
        target.version = sections[1];
        if (sections.length > 2) {
            for (Type type : Type.values()) {
                if (sections[2].toLowerCase().contains(type.name().toLowerCase())) {
                    target.type = type;
                    break;
                }
            }
            if (target.type == null) {
                throw new ConfigurationException(
                    "Unknown target type " + sections[2] + ". Supported " + Target.Type.values());
            }
        } else {
            target.type = Type.Default;
        }
        return target;
    }

    public Type getType() {
        return type;
    }

    public String getServer() {
        return server;
    }

// Path: arquillian-chameleon-container-model/src/main/java/org/arquillian/container/chameleon/FileUtils.java
// public class FileUtils {
// 
//     public static InputStream loadConfiguration(String resourceName, boolean isDefault) {
//         InputStream stream = loadResource(resourceName);
//         if (stream == null) {
//             if (isDefault) {
//                 throw new IllegalStateException(
//                     "Could not find built-in configuration as file nor classloader resource: " + resourceName + ". " +
//                         "Make sure that this file exists in classpath resource or in the project folder.");
//             } else {
//                 throw new ConfigurationException(
//                     "Could not locate configured containerConfigurationFile as file" +
//                         " nor classloader resource: " + resourceName);
//             }
//         }
// 
//         return stream;
//     }
// 
//     private static InputStream loadResource(String resourceName) {
//         InputStream stream = loadClassPathResource(resourceName);
//         if (stream == null) {
//             stream = loadFileResource(resourceName);
//         }
//         return stream;
//     }
// 
//     private static InputStream loadFileResource(String resourceName) {
//         File file = new File(resourceName);
//         if (file.exists()) {
//             try {
//                 return new FileInputStream(file);
//             } catch (FileNotFoundException e) {
//                 // should not happen unless file has been deleted since we did
//                 // file.exists call
//                 throw new IllegalStateException("Configuration file could not be found, " + resourceName);
//             }
//         }
//         return null;
//     }
// 
//     private static InputStream loadClassPathResource(String resourceName) {
//         ClassLoader classLoader = Target.class.getClassLoader();
//         return classLoader.getResourceAsStream(resourceName);
//     }
// }
// 
// Path: arquillian-chameleon-container-model/src/main/java/org/arquillian/container/chameleon/Loader.java
// public class Loader {
// 
//     /*
//    Constructor constructor = new Constructor();
//    constructor.addTypeDescription(new TypeDescription(Container[].class, "tag:yaml.org,2002:" + Container[].class.getName()));
// 
//    Yaml yaml = new Yaml(constructor);
//    yaml.setBeanAccess(BeanAccess.FIELD);
// 
//    return yaml.loadAs(containers, Container[].class);
//     */
//     protected Container[] loadContainers(ClassLoader classloader, InputStream containers) throws Exception {
//         Class<?> constructorClass = classloader.loadClass("org.yaml.snakeyaml.constructor.Constructor");
//         Class<?> baseConstructorClass = classloader.loadClass("org.yaml.snakeyaml.constructor.BaseConstructor");
// 
//         Class<?> typeDescriptionClass = classloader.loadClass("org.yaml.snakeyaml.TypeDescription");
//         Class<?> yamlClass = classloader.loadClass("org.yaml.snakeyaml.Yaml");
//         Class<?> beanAccessClass = classloader.loadClass("org.yaml.snakeyaml.introspector.BeanAccess");
//         Constructor<?> typeDescriptionConst =
//             typeDescriptionClass.getConstructor(new Class[] {Class.class, String.class});
// 
//         Method addTypeDescription =
//             constructorClass.getMethod("addTypeDescription", new Class<?>[] {typeDescriptionClass});
// 
//         Method setBeanAccess = yamlClass.getDeclaredMethod("setBeanAccess", new Class<?>[] {beanAccessClass});
//         Method loadAs = yamlClass.getDeclaredMethod("loadAs", new Class<?>[] {InputStream.class, Class.class});
// 
//         Object constructor = constructorClass.newInstance();
// 
//         // Pre register type to avoid Yaml trying Class.forName on it's own classloader with our class.
//         addTypeDescription.invoke(constructor,
//             typeDescriptionConst.newInstance(Container[].class, "tag:yaml.org,2002:" + Container[].class.getName()));
// 
//         Object yaml =
//             yamlClass.getConstructor(new Class[] {baseConstructorClass}).newInstance(new Object[] {constructor});
// 
//         Object fieldBeanAccess = null;
//         for (Object beanAccess : beanAccessClass.getEnumConstants()) {
//             if ("FIELD".equals(beanAccess.toString())) {
//                 fieldBeanAccess = beanAccess;
//                 break;
//             }
//         }
// 
//         setBeanAccess.invoke(yaml, fieldBeanAccess);
// 
//         return (Container[]) loadAs.invoke(yaml, new Object[] {containers, Container[].class});
//     }
// 
//     public Container[] loadContainers(InputStream inputStream) throws Exception {
//         return this.loadContainers(Target.class.getClassLoader(), inputStream);
//     }
// }


// Path: arquillian-chameleon-container-model/src/main/java/org/arquillian/container/chameleon/spi/model/Target.java
import org.arquillian.container.chameleon.FileUtils;
import org.arquillian.container.chameleon.Loader;
import org.jboss.arquillian.container.spi.ConfigurationException;

        if (sections.length < 2 || sections.length > 3) {
            throw new ConfigurationException("Wrong target format [" + source + "] server:version:type");
        }
        target.server = sections[0].toLowerCase();
        target.version = sections[1];
        if (sections.length > 2) {
            for (Type type : Type.values()) {
                if (sections[2].toLowerCase().contains(type.name().toLowerCase())) {
                    target.type = type;
                    break;
                }
            }
            if (target.type == null) {
                throw new ConfigurationException(
                    "Unknown target type " + sections[2] + ". Supported " + Target.Type.values());
            }
        } else {
            target.type = Type.Default;
        }
        return target;
    }

    public Type getType() {
        return type;
    }

    public String getServer() {
        return server;
    }

    public String getVersion() {