Example usage for org.springframework.beans.factory.xml XmlBeanDefinitionReader setDocumentReaderClass

List of usage examples for org.springframework.beans.factory.xml XmlBeanDefinitionReader setDocumentReaderClass

Introduction

In this page you can find the example usage for org.springframework.beans.factory.xml XmlBeanDefinitionReader setDocumentReaderClass.

Prototype

public void setDocumentReaderClass(Class<? extends BeanDefinitionDocumentReader> documentReaderClass) 

Source Link

Document

Specify the BeanDefinitionDocumentReader implementation to use, responsible for the actual reading of the XML bean definition document.

Usage

From source file:com.mitre.cockpits.cmscockpit.CmsCockpitConfigurationTest.java

@BeforeClass
public static void testsSetup() {
    Registry.setCurrentTenantByID("junit");
    final GenericApplicationContext context = new GenericApplicationContext();
    context.setResourceLoader(new DefaultResourceLoader(Registry.class.getClassLoader()));
    context.setClassLoader(Registry.class.getClassLoader());
    context.getBeanFactory().setBeanClassLoader(Registry.class.getClassLoader());
    context.setParent(Registry.getGlobalApplicationContext());
    final XmlBeanDefinitionReader xmlReader = new XmlBeanDefinitionReader(context);
    xmlReader.setBeanClassLoader(Registry.class.getClassLoader());
    xmlReader.setDocumentReaderClass(ScopeTenantIgnoreDocReader.class);
    xmlReader.loadBeanDefinitions(getSpringConfigurationLocations());
    context.refresh();/* ww w.ja va  2s .c  o m*/
    applicationContext = context;
}

From source file:com.acc.fulfilmentprocess.test.PaymentIntegrationTest.java

@BeforeClass
public static void prepare() throws Exception //NOPMD
{
    Registry.activateStandaloneMode();
    Utilities.setJUnitTenant();// w  w  w  . j  av  a  2s .c o m
    LOG.debug("Preparing...");

    final ApplicationContext appCtx = Registry.getGlobalApplicationContext();

    assertTrue("Application context of type " + appCtx.getClass() + " is not a subclass of "
            + ConfigurableApplicationContext.class, appCtx instanceof ConfigurableApplicationContext);

    final ConfigurableApplicationContext applicationContext = (ConfigurableApplicationContext) appCtx;
    final ConfigurableListableBeanFactory beanFactory = applicationContext.getBeanFactory();
    assertTrue("Bean Factory of type " + beanFactory.getClass() + " is not of type "
            + BeanDefinitionRegistry.class, beanFactory instanceof BeanDefinitionRegistry);
    final XmlBeanDefinitionReader xmlReader = new XmlBeanDefinitionReader((BeanDefinitionRegistry) beanFactory);
    xmlReader.setDocumentReaderClass(ScopeTenantIgnoreDocReader.class);
    xmlReader.loadBeanDefinitions(
            new ClassPathResource("/bncfulfilmentprocess/test/bncfulfilmentprocess-spring-test.xml"));
    xmlReader.loadBeanDefinitions(new ClassPathResource(
            "/bncfulfilmentprocess/test/bncfulfilmentprocess-spring-test-fraudcheck.xml"));
    xmlReader.loadBeanDefinitions(
            new ClassPathResource("/bncfulfilmentprocess/test/process/order-process-spring.xml"));
    modelService = (ModelService) getBean("modelService");
    processService = (DefaultBusinessProcessService) getBean("businessProcessService");
    definitonFactory = processService.getProcessDefinitionFactory();

    LOG.warn("Prepare Process Definition factory...");
    definitonFactory.add("classpath:/bncfulfilmentprocess/test/process/payment-process.xml");

    //setup command factory to mock
    final DefaultCommandFactoryRegistryImpl commandFactoryReg = appCtx
            .getBean(DefaultCommandFactoryRegistryImpl.class);
    commandFactoryReg
            .setCommandFactoryList(Arrays.asList((CommandFactory) appCtx.getBean("mockupCommandFactory")));

    taskServiceStub = appCtx.getBean(TaskServiceStub.class);
    productService = appCtx.getBean("defaultProductService", DefaultProductService.class);
    cartService = appCtx.getBean("defaultCartService", DefaultCartService.class);
    userService = appCtx.getBean("defaultUserService", DefaultUserService.class);
}

From source file:com.exxonmobile.ace.hybris.fulfilmentprocess.test.PaymentIntegrationTest.java

@BeforeClass
public static void prepare() throws Exception //NOPMD
{
    Registry.activateStandaloneMode();
    Utilities.setJUnitTenant();/*from w w w.j a va2  s . c o m*/
    LOG.debug("Preparing...");

    final ApplicationContext appCtx = Registry.getGlobalApplicationContext();

    assertTrue("Application context of type " + appCtx.getClass() + " is not a subclass of "
            + ConfigurableApplicationContext.class, appCtx instanceof ConfigurableApplicationContext);

    final ConfigurableApplicationContext applicationContext = (ConfigurableApplicationContext) appCtx;
    final ConfigurableListableBeanFactory beanFactory = applicationContext.getBeanFactory();
    assertTrue("Bean Factory of type " + beanFactory.getClass() + " is not of type "
            + BeanDefinitionRegistry.class, beanFactory instanceof BeanDefinitionRegistry);
    final XmlBeanDefinitionReader xmlReader = new XmlBeanDefinitionReader((BeanDefinitionRegistry) beanFactory);
    xmlReader.setDocumentReaderClass(ScopeTenantIgnoreDocReader.class);
    xmlReader.loadBeanDefinitions(new ClassPathResource(
            "/exxonmobilfulfilmentprocess/test/exxonmobilfulfilmentprocess-spring-test.xml"));
    xmlReader.loadBeanDefinitions(new ClassPathResource(
            "/exxonmobilfulfilmentprocess/test/exxonmobilfulfilmentprocess-spring-test-fraudcheck.xml"));
    xmlReader.loadBeanDefinitions(
            new ClassPathResource("/exxonmobilfulfilmentprocess/test/process/order-process-spring.xml"));
    modelService = (ModelService) getBean("modelService");
    processService = (DefaultBusinessProcessService) getBean("businessProcessService");
    definitonFactory = processService.getProcessDefinitionFactory();

    LOG.warn("Prepare Process Definition factory...");
    definitonFactory.add("classpath:/exxonmobilfulfilmentprocess/test/process/payment-process.xml");

    //setup command factory to mock
    final DefaultCommandFactoryRegistryImpl commandFactoryReg = appCtx
            .getBean(DefaultCommandFactoryRegistryImpl.class);
    commandFactoryReg
            .setCommandFactoryList(Arrays.asList((CommandFactory) appCtx.getBean("mockupCommandFactory")));

    taskServiceStub = appCtx.getBean(TaskServiceStub.class);
    productService = appCtx.getBean("defaultProductService", DefaultProductService.class);
    cartService = appCtx.getBean("defaultCartService", DefaultCartService.class);
    userService = appCtx.getBean("defaultUserService", DefaultUserService.class);
}

From source file:org.vinmonopolet.fulfilmentprocess.test.PaymentIntegrationTest.java

@BeforeClass
public static void prepare() throws Exception //NOPMD
{
    Registry.activateStandaloneMode();
    Utilities.setJUnitTenant();//from w  w w  .j  a va  2  s.co  m
    LOG.debug("Preparing...");

    final ApplicationContext appCtx = Registry.getGlobalApplicationContext();

    assertTrue("Application context of type " + appCtx.getClass() + " is not a subclass of "
            + ConfigurableApplicationContext.class, appCtx instanceof ConfigurableApplicationContext);

    final ConfigurableApplicationContext applicationContext = (ConfigurableApplicationContext) appCtx;
    final ConfigurableListableBeanFactory beanFactory = applicationContext.getBeanFactory();
    assertTrue("Bean Factory of type " + beanFactory.getClass() + " is not of type "
            + BeanDefinitionRegistry.class, beanFactory instanceof BeanDefinitionRegistry);
    final XmlBeanDefinitionReader xmlReader = new XmlBeanDefinitionReader((BeanDefinitionRegistry) beanFactory);
    xmlReader.setDocumentReaderClass(ScopeTenantIgnoreDocReader.class);
    xmlReader.loadBeanDefinitions(new ClassPathResource(
            "/vinmonopoletfulfilmentprocess/test/vinmonopoletfulfilmentprocess-spring-test.xml"));
    xmlReader.loadBeanDefinitions(new ClassPathResource(
            "/vinmonopoletfulfilmentprocess/test/vinmonopoletfulfilmentprocess-spring-test-fraudcheck.xml"));
    xmlReader.loadBeanDefinitions(
            new ClassPathResource("/vinmonopoletfulfilmentprocess/test/process/order-process-spring.xml"));
    modelService = (ModelService) getBean("modelService");
    processService = (DefaultBusinessProcessService) getBean("businessProcessService");
    definitonFactory = processService.getProcessDefinitionFactory();

    LOG.warn("Prepare Process Definition factory...");
    definitonFactory.add("classpath:/vinmonopoletfulfilmentprocess/test/process/payment-process.xml");

    //setup command factory to mock
    final DefaultCommandFactoryRegistryImpl commandFactoryReg = appCtx
            .getBean(DefaultCommandFactoryRegistryImpl.class);
    commandFactoryReg
            .setCommandFactoryList(Arrays.asList((CommandFactory) appCtx.getBean("mockupCommandFactory")));

    taskServiceStub = appCtx.getBean(TaskServiceStub.class);
    productService = appCtx.getBean("defaultProductService", DefaultProductService.class);
    cartService = appCtx.getBean("defaultCartService", DefaultCartService.class);
    userService = appCtx.getBean("defaultUserService", DefaultUserService.class);
}

From source file:org.training.fulfilmentprocess.test.PaymentIntegrationTest.java

@BeforeClass
public static void prepare() throws Exception //NOPMD
{
    Registry.activateStandaloneMode();
    Utilities.setJUnitTenant();//from  w  w  w .j  a  va2s.c  o  m
    LOG.debug("Preparing...");

    final ApplicationContext appCtx = Registry.getGlobalApplicationContext();

    assertTrue("Application context of type " + appCtx.getClass() + " is not a subclass of "
            + ConfigurableApplicationContext.class, appCtx instanceof ConfigurableApplicationContext);

    final ConfigurableApplicationContext applicationContext = (ConfigurableApplicationContext) appCtx;
    final ConfigurableListableBeanFactory beanFactory = applicationContext.getBeanFactory();
    assertTrue("Bean Factory of type " + beanFactory.getClass() + " is not of type "
            + BeanDefinitionRegistry.class, beanFactory instanceof BeanDefinitionRegistry);
    final XmlBeanDefinitionReader xmlReader = new XmlBeanDefinitionReader((BeanDefinitionRegistry) beanFactory);
    xmlReader.setDocumentReaderClass(ScopeTenantIgnoreDocReader.class);
    xmlReader.loadBeanDefinitions(
            new ClassPathResource("/trainingfulfilmentprocess/test/trainingfulfilmentprocess-spring-test.xml"));
    xmlReader.loadBeanDefinitions(new ClassPathResource(
            "/trainingfulfilmentprocess/test/trainingfulfilmentprocess-spring-test-fraudcheck.xml"));
    xmlReader.loadBeanDefinitions(
            new ClassPathResource("/trainingfulfilmentprocess/test/process/order-process-spring.xml"));
    modelService = (ModelService) getBean("modelService");
    processService = (DefaultBusinessProcessService) getBean("businessProcessService");
    definitonFactory = processService.getProcessDefinitionFactory();

    LOG.warn("Prepare Process Definition factory...");
    definitonFactory.add("classpath:/trainingfulfilmentprocess/test/process/payment-process.xml");

    //setup command factory to mock
    final DefaultCommandFactoryRegistryImpl commandFactoryReg = appCtx
            .getBean(DefaultCommandFactoryRegistryImpl.class);
    commandFactoryReg
            .setCommandFactoryList(Arrays.asList((CommandFactory) appCtx.getBean("mockupCommandFactory")));

    taskServiceStub = appCtx.getBean(TaskServiceStub.class);
    productService = appCtx.getBean("defaultProductService", DefaultProductService.class);
    cartService = appCtx.getBean("defaultCartService", DefaultCartService.class);
    userService = appCtx.getBean("defaultUserService", DefaultUserService.class);
}

From source file:com.mitre.fulfilmentprocess.test.PaymentIntegrationTest.java

@BeforeClass
public static void prepare() throws Exception //NOPMD
{
    Registry.activateStandaloneMode();
    Utilities.setJUnitTenant();//from w  ww  .j  av  a2  s . c  o  m
    LOG.debug("Preparing...");

    final ApplicationContext appCtx = Registry.getGlobalApplicationContext();

    assertTrue("Application context of type " + appCtx.getClass() + " is not a subclass of "
            + ConfigurableApplicationContext.class, appCtx instanceof ConfigurableApplicationContext);

    final ConfigurableApplicationContext applicationContext = (ConfigurableApplicationContext) appCtx;
    final ConfigurableListableBeanFactory beanFactory = applicationContext.getBeanFactory();
    assertTrue("Bean Factory of type " + beanFactory.getClass() + " is not of type "
            + BeanDefinitionRegistry.class, beanFactory instanceof BeanDefinitionRegistry);
    final XmlBeanDefinitionReader xmlReader = new XmlBeanDefinitionReader((BeanDefinitionRegistry) beanFactory);
    xmlReader.setDocumentReaderClass(ScopeTenantIgnoreDocReader.class);
    xmlReader.loadBeanDefinitions(
            new ClassPathResource("/mitrefulfilmentprocess/test/mitrefulfilmentprocess-spring-test.xml"));
    xmlReader.loadBeanDefinitions(new ClassPathResource(
            "/mitrefulfilmentprocess/test/mitrefulfilmentprocess-spring-test-fraudcheck.xml"));
    xmlReader.loadBeanDefinitions(
            new ClassPathResource("/mitrefulfilmentprocess/test/process/order-process-spring.xml"));
    modelService = (ModelService) getBean("modelService");
    processService = (DefaultBusinessProcessService) getBean("businessProcessService");
    definitonFactory = processService.getProcessDefinitionFactory();

    LOG.warn("Prepare Process Definition factory...");
    definitonFactory.add("classpath:/mitrefulfilmentprocess/test/process/payment-process.xml");

    //setup command factory to mock
    final DefaultCommandFactoryRegistryImpl commandFactoryReg = appCtx
            .getBean(DefaultCommandFactoryRegistryImpl.class);
    commandFactoryReg
            .setCommandFactoryList(Arrays.asList((CommandFactory) appCtx.getBean("mockupCommandFactory")));

    taskServiceStub = appCtx.getBean(TaskServiceStub.class);
    productService = appCtx.getBean("defaultProductService", DefaultProductService.class);
    cartService = appCtx.getBean("defaultCartService", DefaultCartService.class);
    userService = appCtx.getBean("defaultUserService", DefaultUserService.class);
}

From source file:com.acc.fulfilmentprocess.test.ProcessFlowTest.java

@BeforeClass
public static void prepare() throws Exception //NOPMD
{
    Registry.activateStandaloneMode();
    Utilities.setJUnitTenant();//from  w w w  .j  av  a  2  s.co  m
    LOG.debug("Preparing...");

    final ApplicationContext appCtx = Registry.getApplicationContext();

    //      final ConfigurationService configurationService = (ConfigurationService) appCtx.getBean("configurationService");
    //      configurationService.getConfiguration().setProperty("processengine.event.lockProcess", "true");

    assertTrue("Application context of type " + appCtx.getClass() + " is not a subclass of "
            + ConfigurableApplicationContext.class, appCtx instanceof ConfigurableApplicationContext);

    final ConfigurableApplicationContext applicationContext = (ConfigurableApplicationContext) appCtx;
    final ConfigurableListableBeanFactory beanFactory = applicationContext.getBeanFactory();
    assertTrue("Bean Factory of type " + beanFactory.getClass() + " is not of type "
            + BeanDefinitionRegistry.class, beanFactory instanceof BeanDefinitionRegistry);
    final XmlBeanDefinitionReader xmlReader = new XmlBeanDefinitionReader((BeanDefinitionRegistry) beanFactory);
    xmlReader.setDocumentReaderClass(ScopeTenantIgnoreDocReader.class);
    xmlReader.loadBeanDefinitions(
            new ClassPathResource("/bncfulfilmentprocess/test/bncfulfilmentprocess-spring-test.xml"));
    xmlReader.loadBeanDefinitions(
            new ClassPathResource("/bncfulfilmentprocess/test/process/order-process-spring.xml"));
    xmlReader.loadBeanDefinitions(
            new ClassPathResource("/bncfulfilmentprocess/test/process/consignment-process-spring.xml"));

    modelService = (ModelService) getBean("modelService");
    processService = (DefaultBusinessProcessService) getBean("businessProcessService");
    definitonFactory = processService.getProcessDefinitionFactory();

    LOG.warn("Prepare Process Definition factory...");
    definitonFactory.add("classpath:/bncfulfilmentprocess/test/process/order-process.xml");
    definitonFactory.add("classpath:/bncfulfilmentprocess/test/process/consignment-process.xml");
    LOG.warn("loaded 'order-process-test':" + definitonFactory.getProcessDefinition("order-process-test")
            + " in factory " + definitonFactory);

    //setup command factory to mock
    taskServiceStub = appCtx.getBean(TaskServiceStub.class);
    processService.setTaskService(taskServiceStub);

    final DefaultCommandFactoryRegistryImpl commandFactoryReg = appCtx
            .getBean(DefaultCommandFactoryRegistryImpl.class);
    commandFactoryReg
            .setCommandFactoryList(Arrays.asList((CommandFactory) appCtx.getBean("mockupCommandFactory")));

}

From source file:com.exxonmobile.ace.hybris.fulfilmentprocess.test.ProcessFlowTest.java

@BeforeClass
public static void prepare() throws Exception //NOPMD
{
    Registry.activateStandaloneMode();
    Utilities.setJUnitTenant();/*from   w w w . j a va  2s  .com*/
    LOG.debug("Preparing...");

    final ApplicationContext appCtx = Registry.getApplicationContext();

    //      final ConfigurationService configurationService = (ConfigurationService) appCtx.getBean("configurationService");
    //      configurationService.getConfiguration().setProperty("processengine.event.lockProcess", "true");

    assertTrue("Application context of type " + appCtx.getClass() + " is not a subclass of "
            + ConfigurableApplicationContext.class, appCtx instanceof ConfigurableApplicationContext);

    final ConfigurableApplicationContext applicationContext = (ConfigurableApplicationContext) appCtx;
    final ConfigurableListableBeanFactory beanFactory = applicationContext.getBeanFactory();
    assertTrue("Bean Factory of type " + beanFactory.getClass() + " is not of type "
            + BeanDefinitionRegistry.class, beanFactory instanceof BeanDefinitionRegistry);
    final XmlBeanDefinitionReader xmlReader = new XmlBeanDefinitionReader((BeanDefinitionRegistry) beanFactory);
    xmlReader.setDocumentReaderClass(ScopeTenantIgnoreDocReader.class);
    xmlReader.loadBeanDefinitions(new ClassPathResource(
            "/exxonmobilfulfilmentprocess/test/exxonmobilfulfilmentprocess-spring-test.xml"));
    xmlReader.loadBeanDefinitions(
            new ClassPathResource("/exxonmobilfulfilmentprocess/test/process/order-process-spring.xml"));
    xmlReader.loadBeanDefinitions(
            new ClassPathResource("/exxonmobilfulfilmentprocess/test/process/consignment-process-spring.xml"));

    modelService = (ModelService) getBean("modelService");
    processService = (DefaultBusinessProcessService) getBean("businessProcessService");
    definitonFactory = processService.getProcessDefinitionFactory();

    LOG.warn("Prepare Process Definition factory...");
    definitonFactory.add("classpath:/exxonmobilfulfilmentprocess/test/process/order-process.xml");
    definitonFactory.add("classpath:/exxonmobilfulfilmentprocess/test/process/consignment-process.xml");
    LOG.warn("loaded 'order-process-test':" + definitonFactory.getProcessDefinition("order-process-test")
            + " in factory " + definitonFactory);

    //setup command factory to mock
    taskServiceStub = appCtx.getBean(TaskServiceStub.class);
    processService.setTaskService(taskServiceStub);

    final DefaultCommandFactoryRegistryImpl commandFactoryReg = appCtx
            .getBean(DefaultCommandFactoryRegistryImpl.class);
    commandFactoryReg
            .setCommandFactoryList(Arrays.asList((CommandFactory) appCtx.getBean("mockupCommandFactory")));

}

From source file:com.mitre.fulfilmentprocess.test.ProcessFlowTest.java

@BeforeClass
public static void prepare() throws Exception //NOPMD
{
    Registry.activateStandaloneMode();
    Utilities.setJUnitTenant();/*w w w  .  j  a v  a 2 s  .c  o  m*/
    LOG.debug("Preparing...");

    final ApplicationContext appCtx = Registry.getApplicationContext();

    //      final ConfigurationService configurationService = (ConfigurationService) appCtx.getBean("configurationService");
    //      configurationService.getConfiguration().setProperty("processengine.event.lockProcess", "true");

    assertTrue("Application context of type " + appCtx.getClass() + " is not a subclass of "
            + ConfigurableApplicationContext.class, appCtx instanceof ConfigurableApplicationContext);

    final ConfigurableApplicationContext applicationContext = (ConfigurableApplicationContext) appCtx;
    final ConfigurableListableBeanFactory beanFactory = applicationContext.getBeanFactory();
    assertTrue("Bean Factory of type " + beanFactory.getClass() + " is not of type "
            + BeanDefinitionRegistry.class, beanFactory instanceof BeanDefinitionRegistry);
    final XmlBeanDefinitionReader xmlReader = new XmlBeanDefinitionReader((BeanDefinitionRegistry) beanFactory);
    xmlReader.setDocumentReaderClass(ScopeTenantIgnoreDocReader.class);
    xmlReader.loadBeanDefinitions(
            new ClassPathResource("/mitrefulfilmentprocess/test/mitrefulfilmentprocess-spring-test.xml"));
    xmlReader.loadBeanDefinitions(
            new ClassPathResource("/mitrefulfilmentprocess/test/process/order-process-spring.xml"));
    xmlReader.loadBeanDefinitions(
            new ClassPathResource("/mitrefulfilmentprocess/test/process/consignment-process-spring.xml"));

    modelService = (ModelService) getBean("modelService");
    processService = (DefaultBusinessProcessService) getBean("businessProcessService");
    definitonFactory = processService.getProcessDefinitionFactory();

    LOG.warn("Prepare Process Definition factory...");
    definitonFactory.add("classpath:/mitrefulfilmentprocess/test/process/order-process.xml");
    definitonFactory.add("classpath:/mitrefulfilmentprocess/test/process/consignment-process.xml");
    LOG.warn("loaded 'order-process-test':" + definitonFactory.getProcessDefinition("order-process-test")
            + " in factory " + definitonFactory);

    //setup command factory to mock
    taskServiceStub = appCtx.getBean(TaskServiceStub.class);
    processService.setTaskService(taskServiceStub);

    final DefaultCommandFactoryRegistryImpl commandFactoryReg = appCtx
            .getBean(DefaultCommandFactoryRegistryImpl.class);
    commandFactoryReg
            .setCommandFactoryList(Arrays.asList((CommandFactory) appCtx.getBean("mockupCommandFactory")));

}

From source file:org.vinmonopolet.fulfilmentprocess.test.ProcessFlowTest.java

@BeforeClass
public static void prepare() throws Exception //NOPMD
{
    Registry.activateStandaloneMode();
    Utilities.setJUnitTenant();//from  w  w  w .  ja  va  2s .  c o m
    LOG.debug("Preparing...");

    final ApplicationContext appCtx = Registry.getApplicationContext();

    //      final ConfigurationService configurationService = (ConfigurationService) appCtx.getBean("configurationService");
    //      configurationService.getConfiguration().setProperty("processengine.event.lockProcess", "true");

    assertTrue("Application context of type " + appCtx.getClass() + " is not a subclass of "
            + ConfigurableApplicationContext.class, appCtx instanceof ConfigurableApplicationContext);

    final ConfigurableApplicationContext applicationContext = (ConfigurableApplicationContext) appCtx;
    final ConfigurableListableBeanFactory beanFactory = applicationContext.getBeanFactory();
    assertTrue("Bean Factory of type " + beanFactory.getClass() + " is not of type "
            + BeanDefinitionRegistry.class, beanFactory instanceof BeanDefinitionRegistry);
    final XmlBeanDefinitionReader xmlReader = new XmlBeanDefinitionReader((BeanDefinitionRegistry) beanFactory);
    xmlReader.setDocumentReaderClass(ScopeTenantIgnoreDocReader.class);
    xmlReader.loadBeanDefinitions(new ClassPathResource(
            "/vinmonopoletfulfilmentprocess/test/vinmonopoletfulfilmentprocess-spring-test.xml"));
    xmlReader.loadBeanDefinitions(
            new ClassPathResource("/vinmonopoletfulfilmentprocess/test/process/order-process-spring.xml"));
    xmlReader.loadBeanDefinitions(new ClassPathResource(
            "/vinmonopoletfulfilmentprocess/test/process/consignment-process-spring.xml"));

    modelService = (ModelService) getBean("modelService");
    processService = (DefaultBusinessProcessService) getBean("businessProcessService");
    definitonFactory = processService.getProcessDefinitionFactory();

    LOG.warn("Prepare Process Definition factory...");
    definitonFactory.add("classpath:/vinmonopoletfulfilmentprocess/test/process/order-process.xml");
    definitonFactory.add("classpath:/vinmonopoletfulfilmentprocess/test/process/consignment-process.xml");
    LOG.warn("loaded 'order-process-test':" + definitonFactory.getProcessDefinition("order-process-test")
            + " in factory " + definitonFactory);

    //setup command factory to mock
    taskServiceStub = appCtx.getBean(TaskServiceStub.class);
    processService.setTaskService(taskServiceStub);

    final DefaultCommandFactoryRegistryImpl commandFactoryReg = appCtx
            .getBean(DefaultCommandFactoryRegistryImpl.class);
    commandFactoryReg
            .setCommandFactoryList(Arrays.asList((CommandFactory) appCtx.getBean("mockupCommandFactory")));

}