public void customize()

in src/main/java/org/apache/sling/testing/teleporter/client/DefaultPropertyBasedCustomizer.java [116:179]


    public void customize(TeleporterRule rule, String options) {
        final ClientSideTeleporter cst = (ClientSideTeleporter)rule;
        if (StringUtils.isBlank(baseUrl)) {
            fail("The mandatory system property " + PROPERTY_BASE_URL + " is not set!");
        }
        cst.setEnableLogging(enableLogging);
        cst.setPreventToUninstallBundle(preventToUninstallBundle);
        if (StringUtils.isNotBlank(testBundleDirectory)) {
            cst.setDirectoryForPersistingTestBundles(new File(testBundleDirectory));
        }
        cst.setBaseUrl(baseUrl);
        cst.setServerCredentials(serverUsername, serverPassword);
        cst.setTestReadyTimeoutSeconds(testReadyTimeout);
        if (StringUtils.isNotBlank(includeDependencyPrefixes)) {
            for (String includeDependencyPrefix : includeDependencyPrefixes.split(LIST_SEPARATOR)) {
                if (StringUtils.isNotBlank(includeDependencyPrefix)) {
                    cst.includeDependencyPrefix(includeDependencyPrefix);
                }
            }
        }
        if (StringUtils.isNotBlank(excludeDependencyPrefixes)) {
            for (String excludeDependencyPrefix : excludeDependencyPrefixes.split(LIST_SEPARATOR)) {
                if (StringUtils.isNotBlank(excludeDependencyPrefix)) {
                    cst.excludeDependencyPrefix(excludeDependencyPrefix);
                }
            }
        }
        if (StringUtils.isNotBlank(embedClassesDirectories)) {
            for (String embedClassesDirectory : embedClassesDirectories.split(LIST_SEPARATOR)) {
                if (StringUtils.isNotBlank(embedClassesDirectory)) {
                    try {
                        cst.embedClassesDirectory(new File(embedClassesDirectory));
                    } catch (ClassNotFoundException | IOException e) {
                        fail("Could not load class directory '" + embedClassesDirectory + "': " + e.getMessage());
                    }
                }
            }
        }
        if (StringUtils.isNotBlank(embedClasses)) {
            for (String embedClass : embedClasses.split(LIST_SEPARATOR)) {
                if (StringUtils.isNotBlank(embedClass)) {
                    try {
                        Class<?> clazz = this.getClass().getClassLoader().loadClass(embedClass);
                        cst.embedClass(clazz);
                    } catch (ClassNotFoundException e) {
                        fail("Could not load class with name '" + embedClass + "': " + e.getMessage());
                    }
                }
            }
        }
        if (StringUtils.isNotBlank(additionalBundleHeaders)) {
            for (String additionalBundleHeader : additionalBundleHeaders.split(LIST_SEPARATOR)) {
                if (StringUtils.isNotBlank(additionalBundleHeader)) {
                    // split up by name and value
                    int pos = additionalBundleHeader.indexOf(NAME_VALUE_SEPARATOR);
                    if (pos < 1 || pos >= additionalBundleHeader.length() -1) {
                        fail("Each entry given to property '" + PROPERTY_ADDITIONAL_BUNDLE_HEADERS + 
                             "' must have exactly the format <name>:<value>, but one entry is '" + additionalBundleHeader + "'.");
                    }
                    cst.addAdditionalBundleHeader(additionalBundleHeader.substring(0, pos), additionalBundleHeader.substring(pos+1));
                }
            }
        }
    }