// Path: atam4j/src/main/java/me/atam/atam4j/Atam4j.java
// public class Atam4j implements Managed {
// 
//     private final AcceptanceTestsState acceptanceTestsState = new AcceptanceTestsState();
//     private final AcceptanceTestsRunnerTaskScheduler acceptanceTestsRunnerTaskScheduler;
//     private final TestRunListener testRunListener;
//     private final JerseyEnvironment jerseyEnvironment;
// 
//     public Atam4j(JerseyEnvironment jerseyEnvironment,
//                   TestRunListener testRunListener,
//                   AcceptanceTestsRunnerTaskScheduler acceptanceTestsRunnerTaskScheduler) {
// 
//         this.jerseyEnvironment = jerseyEnvironment;
//         this.testRunListener = testRunListener;
//         this.acceptanceTestsRunnerTaskScheduler = acceptanceTestsRunnerTaskScheduler;
//     }
// 
// 
//     @Override
//     public void start() {
//         acceptanceTestsRunnerTaskScheduler.scheduleAcceptanceTestsRunnerTask(acceptanceTestsState);
//         jerseyEnvironment.register(new TestStatusResource(testRunListener));
//     }
// 
//     @Override
//     public void stop() {
//         acceptanceTestsRunnerTaskScheduler.stop();
//     }
// 
//     public static class Atam4jBuilder {
// 
//         private Optional<Class[]> testClasses = Optional.empty();
//         private long initialDelay = 60;
//         private long period = 300;
//         private TimeUnit unit = TimeUnit.SECONDS;
//         private JerseyEnvironment jerseyEnvironment;
//         private final List<RunListener> runListeners = new ArrayList<>();
// 
//         public Atam4jBuilder(JerseyEnvironment jerseyEnvironment) {
//             this.jerseyEnvironment = jerseyEnvironment;
//         }
// 
//         public Atam4jBuilder withTestClasses(Class... testClasses) {
//             this.testClasses = Optional.of(testClasses);
//             return this;
//         }
// 
//         public Atam4jBuilder withInitialDelay(long initialDelay) {
//             this.initialDelay = initialDelay;
//             return this;
//         }
// 
//         public Atam4jBuilder withPeriod(long period) {
//             this.period = period;
//             return this;
//         }
// 
//         public Atam4jBuilder withUnit(TimeUnit unit) {
//             this.unit = unit;
//             return this;
//         }
// 
//         public Atam4jBuilder withListener(RunListener listener) {
//             this.runListeners.add(listener);
//             return this;
//         }
// 
//         public Atam4j build() {
//             TestRunListener testRunListener = new TestRunListener();
//             List<RunListener> runListenersWithAtam4jListener = new ArrayList<>();
//             runListenersWithAtam4jListener.add(testRunListener);
//             runListenersWithAtam4jListener.addAll(this.runListeners);
//             return new Atam4j(jerseyEnvironment, testRunListener,
//                     new AcceptanceTestsRunnerTaskScheduler(
//                         findTestClasses(),
//                         initialDelay,
//                         period,
//                         unit,
//                         runListenersWithAtam4jListener));
//         }
// 
//         private Class[] findTestClasses() {
//             final Class[] classes = testClasses.orElseGet(() ->
//                     new Reflections(new ConfigurationBuilder()
//                             .setUrls(ClasspathHelper.forJavaClassPath())
//                             .setScanners(new SubTypesScanner(), new TypeAnnotationsScanner()))
//                             .getTypesAnnotatedWith(Monitor.class)
//                             .stream()
//                             .toArray(Class[]::new));
//             if(classes.length == 0) {
//                 throw new NoTestClassFoundException("Could not find any annotated test classes and no classes were provided via the Atam4jBuilder.");
//             }
//             return classes;
//         }
//     }
// }
// 
// Path: acceptance-tests/src/main/java/me/atam/atam4jsampleapp/resources/CustomListenerStatusResource.java
// @Path("/customlistenerstatus")
// @Produces("application/json")
// public class CustomListenerStatusResource {
//     private final CustomListenerStatus customListenerStatus;
// 
//     public CustomListenerStatusResource(CustomListenerStatus customListenerStatus) { this.customListenerStatus = customListenerStatus; }
// 
//     @GET
//     public CustomListenerStatus getAcceptanceTestRunListenerStatus() { return customListenerStatus; }
// }


import com.google.common.io.Resources;
import io.dropwizard.Application;
import io.dropwizard.setup.Environment;
import me.atam.atam4j.Atam4j;
import me.atam.atam4jsampleapp.resources.CustomListenerStatusResource;
import java.io.File;
import java.util.concurrent.TimeUnit;
package me.atam.atam4jsampleapp;



public class Atam4jTestApplication extends Application<ApplicationConfiguration> {

    public static void main(String[] args) throws Exception {
        if (args == null || args.length == 0) {
            args = new String[]{"server", new File(Resources.getResource("atam4j-config.yml").toURI()).getAbsolutePath()};
        }

        new Atam4jTestApplication().run(args);
    }

    @Override
    public void run(final ApplicationConfiguration configuration, final Environment environment) throws Exception {
        CustomListenerStatus customListenerStatus = new CustomListenerStatus();
// Path: atam4j/src/main/java/me/atam/atam4j/Atam4j.java
// public class Atam4j implements Managed {
// 
//     private final AcceptanceTestsState acceptanceTestsState = new AcceptanceTestsState();
//     private final AcceptanceTestsRunnerTaskScheduler acceptanceTestsRunnerTaskScheduler;
//     private final TestRunListener testRunListener;
//     private final JerseyEnvironment jerseyEnvironment;
// 
//     public Atam4j(JerseyEnvironment jerseyEnvironment,
//                   TestRunListener testRunListener,
//                   AcceptanceTestsRunnerTaskScheduler acceptanceTestsRunnerTaskScheduler) {
// 
//         this.jerseyEnvironment = jerseyEnvironment;
//         this.testRunListener = testRunListener;
//         this.acceptanceTestsRunnerTaskScheduler = acceptanceTestsRunnerTaskScheduler;
//     }
// 
// 
//     @Override
//     public void start() {
//         acceptanceTestsRunnerTaskScheduler.scheduleAcceptanceTestsRunnerTask(acceptanceTestsState);
//         jerseyEnvironment.register(new TestStatusResource(testRunListener));
//     }
// 
//     @Override
//     public void stop() {
//         acceptanceTestsRunnerTaskScheduler.stop();
//     }
// 
//     public static class Atam4jBuilder {
// 
//         private Optional<Class[]> testClasses = Optional.empty();
//         private long initialDelay = 60;
//         private long period = 300;
//         private TimeUnit unit = TimeUnit.SECONDS;
//         private JerseyEnvironment jerseyEnvironment;
//         private final List<RunListener> runListeners = new ArrayList<>();
// 
//         public Atam4jBuilder(JerseyEnvironment jerseyEnvironment) {
//             this.jerseyEnvironment = jerseyEnvironment;
//         }
// 
//         public Atam4jBuilder withTestClasses(Class... testClasses) {
//             this.testClasses = Optional.of(testClasses);
//             return this;
//         }
// 
//         public Atam4jBuilder withInitialDelay(long initialDelay) {
//             this.initialDelay = initialDelay;
//             return this;
//         }
// 
//         public Atam4jBuilder withPeriod(long period) {
//             this.period = period;
//             return this;
//         }
// 
//         public Atam4jBuilder withUnit(TimeUnit unit) {
//             this.unit = unit;
//             return this;
//         }
// 
//         public Atam4jBuilder withListener(RunListener listener) {
//             this.runListeners.add(listener);
//             return this;
//         }
// 
//         public Atam4j build() {
//             TestRunListener testRunListener = new TestRunListener();
//             List<RunListener> runListenersWithAtam4jListener = new ArrayList<>();
//             runListenersWithAtam4jListener.add(testRunListener);
//             runListenersWithAtam4jListener.addAll(this.runListeners);
//             return new Atam4j(jerseyEnvironment, testRunListener,
//                     new AcceptanceTestsRunnerTaskScheduler(
//                         findTestClasses(),
//                         initialDelay,
//                         period,
//                         unit,
//                         runListenersWithAtam4jListener));
//         }
// 
//         private Class[] findTestClasses() {
//             final Class[] classes = testClasses.orElseGet(() ->
//                     new Reflections(new ConfigurationBuilder()
//                             .setUrls(ClasspathHelper.forJavaClassPath())
//                             .setScanners(new SubTypesScanner(), new TypeAnnotationsScanner()))
//                             .getTypesAnnotatedWith(Monitor.class)
//                             .stream()
//                             .toArray(Class[]::new));
//             if(classes.length == 0) {
//                 throw new NoTestClassFoundException("Could not find any annotated test classes and no classes were provided via the Atam4jBuilder.");
//             }
//             return classes;
//         }
//     }
// }
// 
// Path: acceptance-tests/src/main/java/me/atam/atam4jsampleapp/resources/CustomListenerStatusResource.java
// @Path("/customlistenerstatus")
// @Produces("application/json")
// public class CustomListenerStatusResource {
//     private final CustomListenerStatus customListenerStatus;
// 
//     public CustomListenerStatusResource(CustomListenerStatus customListenerStatus) { this.customListenerStatus = customListenerStatus; }
// 
//     @GET
//     public CustomListenerStatus getAcceptanceTestRunListenerStatus() { return customListenerStatus; }
// }


// Path: acceptance-tests/src/main/java/me/atam/atam4jsampleapp/Atam4jTestApplication.java
import com.google.common.io.Resources;
import io.dropwizard.Application;
import io.dropwizard.setup.Environment;
import me.atam.atam4j.Atam4j;
import me.atam.atam4jsampleapp.resources.CustomListenerStatusResource;
import java.io.File;
import java.util.concurrent.TimeUnit;

package me.atam.atam4jsampleapp;



public class Atam4jTestApplication extends Application<ApplicationConfiguration> {

    public static void main(String[] args) throws Exception {
        if (args == null || args.length == 0) {
            args = new String[]{"server", new File(Resources.getResource("atam4j-config.yml").toURI()).getAbsolutePath()};
        }

        new Atam4jTestApplication().run(args);
    }

    @Override
    public void run(final ApplicationConfiguration configuration, final Environment environment) throws Exception {
        CustomListenerStatus customListenerStatus = new CustomListenerStatus();
        Atam4j atam4j = new Atam4j.Atam4jBuilder(environment.jersey())