private String installTestBundle()

in src/main/java/org/apache/sling/testing/teleporter/client/ClientSideTeleporter.java [251:274]


    private String installTestBundle(TeleporterHttpClient httpClient) throws MalformedURLException, IOException {
        final String bundleSymbolicName = getClass().getSimpleName() + "." + classUnderTest.getSimpleName();
        log.info("Building bundle '{}'", bundleSymbolicName, baseUrl);
        try (final InputStream bundle = buildTestBundle(classUnderTest, embeddedClasses, bundleSymbolicName)) {
            // optionally persist the test bundle
            if (directoryForPersistingTestBundles != null) {
                directoryForPersistingTestBundles.mkdirs();
                File bundleFile = new File(directoryForPersistingTestBundles, bundleSymbolicName + ".jar");
                log.info("Persisting test bundle in '{}'", bundleFile);
                try (OutputStream output = new FileOutputStream(bundleFile)) {
                    IOUtils.copy(bundle, output);
                }
                try (InputStream bundleInput = new BufferedInputStream(new FileInputStream(bundleFile))) {
                    log.info("Installing bundle '{}' to {}", bundleSymbolicName, baseUrl);
                    httpClient.installBundle(bundleInput, bundleSymbolicName, webConsoleReadyTimeoutSeconds);
                }
            } else {
                log.info("Installing bundle '{}' to {}", bundleSymbolicName, baseUrl);
                httpClient.installBundle(bundle, bundleSymbolicName, webConsoleReadyTimeoutSeconds);
            }
            httpClient.verifyCorrectBundleState(bundleSymbolicName, webConsoleReadyTimeoutSeconds);
        };
        return bundleSymbolicName;
    }