// Path: src/test/java/is/idega/idegaweb/egov/bpm/cases/testbase/EgovBPMBaseTest.java
// @RunWith(SpringJUnit4ClassRunner.class)
// @ContextConfiguration
// @TransactionConfiguration(transactionManager="transactionManager", defaultRollback=false)
// @Transactional
// public class EgovBPMBaseTest extends IdegaBaseTransactionalTest {
// 	
// 	@Test
// 	public void testfake() throws Exception {
// 		
// 	}
// }


import is.idega.idegaweb.egov.bpm.cases.testbase.EgovBPMBaseTest;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.List;
import org.jbpm.JbpmConfiguration;
import org.jbpm.JbpmContext;
import org.jbpm.JbpmException;
import org.jbpm.graph.def.ActionHandler;
import org.jbpm.graph.def.ProcessDefinition;
import org.jbpm.graph.exe.ExecutionContext;
import org.jbpm.graph.exe.ProcessInstance;
import org.jbpm.graph.exe.Token;
import org.jbpm.job.Timer;
import org.jbpm.scheduler.SchedulerService;
import org.jbpm.scheduler.db.DbSchedulerServiceFactory;
import org.jbpm.svc.Service;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.transaction.annotation.Transactional;
package is.idega.idegaweb.egov.bpm.scheduler;

/*
 * JBoss, Home of Professional Open Source
 * Copyright 2005, JBoss Inc., and individual contributors as indicated
 * by the @authors tag. See the copyright.txt in the distribution for a
 * full listing of individual contributors.
 *
 * This is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation; either version 2.1 of
 * the License, or (at your option) any later version.
 *
 * This software is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this software; if not, write to the Free
 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
 */



@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration
@Transactional
public class SchedulerTest extends EgovBPMBaseTest {

  public static class TestSchedulerServiceFactory extends DbSchedulerServiceFactory {
    private static final long serialVersionUID = 1L;
    @Override
	public Service openService() {
      return new TestSchedulerService();
    }
    @Override
	public void close() {
    }
  }
  
  @SuppressWarnings("unchecked")
  public static class TestSchedulerService implements SchedulerService {
	List createdTimers = new ArrayList();
    List cancelledTimersByName = new ArrayList();
    List cancelledTimersByProcessInstance = new ArrayList();
    
    private static final long serialVersionUID = 1L;
    public void createTimer(Timer timer) {
// Path: src/test/java/is/idega/idegaweb/egov/bpm/cases/testbase/EgovBPMBaseTest.java
// @RunWith(SpringJUnit4ClassRunner.class)
// @ContextConfiguration
// @TransactionConfiguration(transactionManager="transactionManager", defaultRollback=false)
// @Transactional
// public class EgovBPMBaseTest extends IdegaBaseTransactionalTest {
// 	
// 	@Test
// 	public void testfake() throws Exception {
// 		
// 	}
// }


// Path: src/test/java/is/idega/idegaweb/egov/bpm/scheduler/SchedulerTest.java
import is.idega.idegaweb.egov.bpm.cases.testbase.EgovBPMBaseTest;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.List;
import org.jbpm.JbpmConfiguration;
import org.jbpm.JbpmContext;
import org.jbpm.JbpmException;
import org.jbpm.graph.def.ActionHandler;
import org.jbpm.graph.def.ProcessDefinition;
import org.jbpm.graph.exe.ExecutionContext;
import org.jbpm.graph.exe.ProcessInstance;
import org.jbpm.graph.exe.Token;
import org.jbpm.job.Timer;
import org.jbpm.scheduler.SchedulerService;
import org.jbpm.scheduler.db.DbSchedulerServiceFactory;
import org.jbpm.svc.Service;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.transaction.annotation.Transactional;

package is.idega.idegaweb.egov.bpm.scheduler;

/*
 * JBoss, Home of Professional Open Source
 * Copyright 2005, JBoss Inc., and individual contributors as indicated
 * by the @authors tag. See the copyright.txt in the distribution for a
 * full listing of individual contributors.
 *
 * This is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation; either version 2.1 of
 * the License, or (at your option) any later version.
 *
 * This software is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this software; if not, write to the Free
 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
 */



@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration
@Transactional
public class SchedulerTest extends EgovBPMBaseTest {

  public static class TestSchedulerServiceFactory extends DbSchedulerServiceFactory {
    private static final long serialVersionUID = 1L;
    @Override
	public Service openService() {
      return new TestSchedulerService();
    }
    @Override
	public void close() {
    }
  }
  
  @SuppressWarnings("unchecked")
  public static class TestSchedulerService implements SchedulerService {
	List createdTimers = new ArrayList();
    List cancelledTimersByName = new ArrayList();
    List cancelledTimersByProcessInstance = new ArrayList();
    
    private static final long serialVersionUID = 1L;
    public void createTimer(Timer timer) {
      createdTimers.add(timer);