<commit_before>/**
 *  Copyright 2005-2016 Red Hat, Inc.
 *
 *  Red Hat licenses this file to you under the Apache License, version
 *  2.0 (the "License"); you may not use this file except in compliance
 *  with the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
 *  implied.  See the License for the specific language governing
 *  permissions and limitations under the License.
 */
package org.jboss.fuse.vault.karaf;

import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.PrintStream;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.ops4j.pax.exam.Configuration;
import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.TestAddress;
import org.ops4j.pax.exam.TestProbeBuilder;
import org.ops4j.pax.exam.karaf.options.LogLevelOption;
import org.ops4j.pax.exam.options.MavenArtifactUrlReference;
import org.ops4j.pax.exam.spi.ExamReactor;
import org.ops4j.pax.exam.spi.StagedExamReactor;
import org.ops4j.pax.exam.spi.reactors.ReactorManager;

import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.Assert.fail;
import static org.ops4j.pax.exam.CoreOptions.maven;
import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
import static org.ops4j.pax.exam.CoreOptions.options;
import static org.ops4j.pax.exam.CoreOptions.systemTimeout;
import static org.ops4j.pax.exam.CoreOptions.vmOptions;
import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.karafDistributionConfiguration;
import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.logLevel;

public class StartupFailureIntegrationTest {

    public static class Dummy {
        @Configuration
        public Option[] config() throws IOException {
            final MavenArtifactUrlReference karafUrl = maven().groupId("org.apache.karaf")
                    .artifactId("apache-karaf-minimal").type("zip").versionAsInProject();

            return options(

                    karafDistributionConfiguration().frameworkUrl(karafUrl),

                    systemTimeout(10000),

                    vmOptions("-Dprop=VAULT::block1::key::1"),

                    mavenBundle("org.jboss.fuse.vault", "vault-karaf-core").versionAsInProject().start(),

                    logLevel(LogLevelOption.LogLevel.WARN));
        }

        @Test
        public void dummy() {
        }
    }

    private StagedExamReactor stagedReactor;
    private PrintStream stderr;

    @After
    public void destroyContainer() {
        if (stderr != null) {
            System.setErr(stderr);
        }

        if (stagedReactor == null) {
            return;
        }

        stagedReactor.afterClass();<commit_msg>Increase timeout in startup failure integration test<commit_after>/**
 *  Copyright 2005-2016 Red Hat, Inc.
 *
 *  Red Hat licenses this file to you under the Apache License, version
 *  2.0 (the "License"); you may not use this file except in compliance
 *  with the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
 *  implied.  See the License for the specific language governing
 *  permissions and limitations under the License.
 */
package org.jboss.fuse.vault.karaf;

import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.PrintStream;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.ops4j.pax.exam.Configuration;
import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.TestAddress;
import org.ops4j.pax.exam.TestProbeBuilder;
import org.ops4j.pax.exam.karaf.options.LogLevelOption;
import org.ops4j.pax.exam.options.MavenArtifactUrlReference;
import org.ops4j.pax.exam.spi.ExamReactor;
import org.ops4j.pax.exam.spi.StagedExamReactor;
import org.ops4j.pax.exam.spi.reactors.ReactorManager;

import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.Assert.fail;
import static org.ops4j.pax.exam.CoreOptions.maven;
import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
import static org.ops4j.pax.exam.CoreOptions.options;
import static org.ops4j.pax.exam.CoreOptions.systemTimeout;
import static org.ops4j.pax.exam.CoreOptions.vmOptions;
import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.karafDistributionConfiguration;
import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.logLevel;

public class StartupFailureIntegrationTest {

    public static class Dummy {
        @Configuration
        public Option[] config() throws IOException {
            final MavenArtifactUrlReference karafUrl = maven().groupId("org.apache.karaf")
                    .artifactId("apache-karaf-minimal").type("zip").versionAsInProject();

            return options(

                    karafDistributionConfiguration().frameworkUrl(karafUrl),

                    systemTimeout(60000),

                    vmOptions("-Dprop=VAULT::block1::key::1"),

                    mavenBundle("org.jboss.fuse.vault", "vault-karaf-core").versionAsInProject().start(),

                    logLevel(LogLevelOption.LogLevel.WARN));
        }

        @Test
        public void dummy() {
        }
    }

    private StagedExamReactor stagedReactor;
    private PrintStream stderr;

    @After
    public void destroyContainer() {
        if (stderr != null) {
            System.setErr(stderr);
        }

        if (stagedReactor == null) {
            return;
        }

        stagedReactor.afterClass();
{'fraction_non_alphanumeric': 0.09937678962438942, 'fraction_numerical': 0.011790466565605525, 'mean_word_length': 3.2566308243727597, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1700691', 'n_tokens_mistral': 1865, 'n_tokens_neox': 1782, 'n_words': 401}