// Path: cdiqi-core/src/main/java/cz/symbiont_it/cdiqi/api/QuartzSchedulerManager.java
// public interface QuartzSchedulerManager {
// 
// 	public static final String QUARTZ_PROPERTY_FILE_NAME = "cdiqi-quartz.properties";
// 	
// 	/**
// 	 * Perform init.
// 	 * 
// 	 * @throws SchedulerException
// 	 */
// 	public void init() throws SchedulerException;
// 
// 	/**
// 	 * @return <code>true</code> if initialized, <code>false</code> otherwise
// 	 */
// 	public boolean isInitialized();
// 
// 	/**
// 	 * Start underlying quartz scheduler. If not initialized perform init first.
// 	 * 
// 	 * @throws SchedulerException
// 	 */
// 	public void start() throws SchedulerException;
// 
// 	/**
// 	 * Pause underlying quartz scheduler.
// 	 * 
// 	 * @throws SchedulerException
// 	 */
// 	public void standby() throws SchedulerException;
// 
// 	/**
// 	 * Deletes all scheduling data.
// 	 * 
// 	 * @throws SchedulerException
// 	 */
// 	public void clear() throws SchedulerException;
// 
// 	/**
// 	 * Schedule new job.
// 	 * 
// 	 * @param jobDetail
// 	 * @param trigger
// 	 * @throws SchedulerException
// 	 */
// 	public void schedule(JobDetail jobDetail, Trigger trigger)
// 			throws SchedulerException;
// 
// }
// 
// Path: cdiqi-weld/src/test/java/cz/symbiont_it/cdiqi/tests/CdiqiTestUtil.java
// public final class CdiqiTestUtil {
// 
// 	private CdiqiTestUtil() {
// 	}
// 
// 	/**
// 	 * @return default test archive
// 	 */
// 	public static WebArchive createTestArchive() {
// 
// 		WebArchive archive = ShrinkWrap.create(WebArchive.class, "test.war");
// 
// 		// API
// 		archive.addPackage(QuartzSchedulerManager.class.getPackage());
// 		// SPI
// 		archive.addPackage(BoundRequestJobListener.class.getPackage());
// 		// Core impl
// 		archive.addPackage(QuartzSchedulerManagerImpl.class.getPackage());
// 		// Weld impl
// 		archive.addPackage(WeldBoundRequestJobListener.class.getPackage());
// 		
// 		archive.addClass(ResultStore.class);
// 		archive.addAsLibraries(DependencyResolvers
// 				.use(MavenDependencyResolver.class)
// 				.artifact("org.quartz-scheduler:quartz:2.0.2")
// 				.artifact("org.slf4j:slf4j-log4j12:1.6.1")
// 				.resolveAs(GenericArchive.class));
// 		archive.addAsResource(new File(
// 				"src/test/resources/cdiqi-quartz.properties"));
// 		archive.addAsResource(new File("src/test/resources/log4j.properties"));
// 		archive.setWebXML(new File("src/test/webapp/WEB-INF/web.xml"));
// 		archive.addAsWebInfResource(new File("src/test/resources/beans.xml"));
// 		// archive.addAsWebInfResource(EmptyAsset.INSTANCE,
// 		// ArchivePaths.create("beans.xml"));
// 		// ARQ will replace in the end
// 		// archive.setManifest(new
// 		// File("src/test/webapp/META-INF/MANIFEST.MF"));
// 		return archive;
// 	}
// 
// }


import static org.quartz.JobBuilder.newJob;
import static org.quartz.SimpleScheduleBuilder.repeatSecondlyForTotalCount;
import static org.quartz.TriggerBuilder.newTrigger;
import java.text.ParseException;
import javax.inject.Inject;
import junit.framework.Assert;
import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.shrinkwrap.api.spec.WebArchive;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.quartz.CronScheduleBuilder;
import org.quartz.JobDetail;
import org.quartz.SchedulerException;
import org.quartz.Trigger;
import cz.symbiont_it.cdiqi.api.QuartzSchedulerManager;
import cz.symbiont_it.cdiqi.tests.CdiqiTestUtil;
package cz.symbiont_it.cdiqi.tests.performance;







/**
 * Simple performance test. Useful when testing <a
 * href="https://issues.jboss.org/browse/WELD-920">WELD-920</a> memory leak.
 * 
 * This test is ignored by default.
 * 
 * @author Martin Kouba
 */
@RunWith(Arquillian.class)
public class PerformanceTest {

	static final int JOB_EXEC_COUNT = 500;

	@Inject
	private QuartzSchedulerManager quartzManager;

	@Inject
	private PerformanceResultStore resultStore;

	@Deployment
	public static WebArchive createTestArchive() {
		return CdiqiTestUtil.createTestArchive().addPackage(
				PerformanceTest.class.getPackage().getName());
	}

	/**
	 * 
	 * @throws SchedulerException
	 * @throws InterruptedException
	 * @throws ParseException
	 */
	@Ignore
	@Test
// Path: cdiqi-core/src/main/java/cz/symbiont_it/cdiqi/api/QuartzSchedulerManager.java
// public interface QuartzSchedulerManager {
// 
// 	public static final String QUARTZ_PROPERTY_FILE_NAME = "cdiqi-quartz.properties";
// 	
// 	/**
// 	 * Perform init.
// 	 * 
// 	 * @throws SchedulerException
// 	 */
// 	public void init() throws SchedulerException;
// 
// 	/**
// 	 * @return <code>true</code> if initialized, <code>false</code> otherwise
// 	 */
// 	public boolean isInitialized();
// 
// 	/**
// 	 * Start underlying quartz scheduler. If not initialized perform init first.
// 	 * 
// 	 * @throws SchedulerException
// 	 */
// 	public void start() throws SchedulerException;
// 
// 	/**
// 	 * Pause underlying quartz scheduler.
// 	 * 
// 	 * @throws SchedulerException
// 	 */
// 	public void standby() throws SchedulerException;
// 
// 	/**
// 	 * Deletes all scheduling data.
// 	 * 
// 	 * @throws SchedulerException
// 	 */
// 	public void clear() throws SchedulerException;
// 
// 	/**
// 	 * Schedule new job.
// 	 * 
// 	 * @param jobDetail
// 	 * @param trigger
// 	 * @throws SchedulerException
// 	 */
// 	public void schedule(JobDetail jobDetail, Trigger trigger)
// 			throws SchedulerException;
// 
// }
// 
// Path: cdiqi-weld/src/test/java/cz/symbiont_it/cdiqi/tests/CdiqiTestUtil.java
// public final class CdiqiTestUtil {
// 
// 	private CdiqiTestUtil() {
// 	}
// 
// 	/**
// 	 * @return default test archive
// 	 */
// 	public static WebArchive createTestArchive() {
// 
// 		WebArchive archive = ShrinkWrap.create(WebArchive.class, "test.war");
// 
// 		// API
// 		archive.addPackage(QuartzSchedulerManager.class.getPackage());
// 		// SPI
// 		archive.addPackage(BoundRequestJobListener.class.getPackage());
// 		// Core impl
// 		archive.addPackage(QuartzSchedulerManagerImpl.class.getPackage());
// 		// Weld impl
// 		archive.addPackage(WeldBoundRequestJobListener.class.getPackage());
// 		
// 		archive.addClass(ResultStore.class);
// 		archive.addAsLibraries(DependencyResolvers
// 				.use(MavenDependencyResolver.class)
// 				.artifact("org.quartz-scheduler:quartz:2.0.2")
// 				.artifact("org.slf4j:slf4j-log4j12:1.6.1")
// 				.resolveAs(GenericArchive.class));
// 		archive.addAsResource(new File(
// 				"src/test/resources/cdiqi-quartz.properties"));
// 		archive.addAsResource(new File("src/test/resources/log4j.properties"));
// 		archive.setWebXML(new File("src/test/webapp/WEB-INF/web.xml"));
// 		archive.addAsWebInfResource(new File("src/test/resources/beans.xml"));
// 		// archive.addAsWebInfResource(EmptyAsset.INSTANCE,
// 		// ArchivePaths.create("beans.xml"));
// 		// ARQ will replace in the end
// 		// archive.setManifest(new
// 		// File("src/test/webapp/META-INF/MANIFEST.MF"));
// 		return archive;
// 	}
// 
// }


// Path: cdiqi-weld/src/test/java/cz/symbiont_it/cdiqi/tests/performance/PerformanceTest.java
import static org.quartz.JobBuilder.newJob;
import static org.quartz.SimpleScheduleBuilder.repeatSecondlyForTotalCount;
import static org.quartz.TriggerBuilder.newTrigger;
import java.text.ParseException;
import javax.inject.Inject;
import junit.framework.Assert;
import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.shrinkwrap.api.spec.WebArchive;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.quartz.CronScheduleBuilder;
import org.quartz.JobDetail;
import org.quartz.SchedulerException;
import org.quartz.Trigger;
import cz.symbiont_it.cdiqi.api.QuartzSchedulerManager;
import cz.symbiont_it.cdiqi.tests.CdiqiTestUtil;

package cz.symbiont_it.cdiqi.tests.performance;







/**
 * Simple performance test. Useful when testing <a
 * href="https://issues.jboss.org/browse/WELD-920">WELD-920</a> memory leak.
 * 
 * This test is ignored by default.
 * 
 * @author Martin Kouba
 */
@RunWith(Arquillian.class)
public class PerformanceTest {

	static final int JOB_EXEC_COUNT = 500;

	@Inject
	private QuartzSchedulerManager quartzManager;

	@Inject
	private PerformanceResultStore resultStore;

	@Deployment
	public static WebArchive createTestArchive() {
		return CdiqiTestUtil.createTestArchive().addPackage(
				PerformanceTest.class.getPackage().getName());
	}

	/**
	 * 
	 * @throws SchedulerException
	 * @throws InterruptedException
	 * @throws ParseException
	 */
	@Ignore
	@Test
	public void testScheduler() throws SchedulerException,