<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic How to write junit test with existing spring configuration in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/how-to-write-junit-test-with-existing-spring-configuration/m-p/176977#M130107</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Greeting Everyone,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I get a project which use activiti for years. There are a lot beans defined in spring xml files need to be loaded for process flow. Now, I like to build junit test for some process flows.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;From what I understand, ActivitiRule will only look up activiti.cfg.xml by default. It will not load bean from spring xml files.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Are there any configuration I can let ActivitRule to understand definition from Spring XML?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Further, I tried approach like below&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;@RunWith(SpringJUnit4ClassRunner.class)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;@ContextConfiguration(locations = "classpath:spring/applicationContext*.xml")&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It does help to load bean but I counter issue such as "Caused by: org.h2.jdbc.JdbcSQLException: Table "ACT_HI_PROCINST" already exists; SQL statement:"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I did some research, people say we can clean h2 db before test. But question is, how?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any advice, please.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Yong&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 30 Jun 2015 10:05:15 GMT</pubDate>
    <dc:creator>yongqiang</dc:creator>
    <dc:date>2015-06-30T10:05:15Z</dc:date>
    <item>
      <title>How to write junit test with existing spring configuration</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-write-junit-test-with-existing-spring-configuration/m-p/176977#M130107</link>
      <description>Greeting Everyone,I get a project which use activiti for years. There are a lot beans defined in spring xml files need to be loaded for process flow. Now, I like to build junit test for some process flows.From what I understand, ActivitiRule will only look up activiti.cfg.xml by default. It will not</description>
      <pubDate>Tue, 30 Jun 2015 10:05:15 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-write-junit-test-with-existing-spring-configuration/m-p/176977#M130107</guid>
      <dc:creator>yongqiang</dc:creator>
      <dc:date>2015-06-30T10:05:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to write junit test with existing spring configuration</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-write-junit-test-with-existing-spring-configuration/m-p/176978#M130108</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;No, the ActivitiRule does not support that.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But if it's a spring project, it's probably a better idea to run it with a Spring unit test runner, and inject the processEngine bean in the test.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Jun 2015 20:19:10 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-write-junit-test-with-existing-spring-configuration/m-p/176978#M130108</guid>
      <dc:creator>jbarrez</dc:creator>
      <dc:date>2015-06-30T20:19:10Z</dc:date>
    </item>
  </channel>
</rss>

