<?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 Re: How to use BaseAlfrescoSpringTest in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/how-to-use-basealfrescospringtest/m-p/81648#M54653</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;When those unit tests are run, they launch an embedded Alfresco repository using the 'custom-repository.properties' config file.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;There, you can specify a db schema and data folder for the embedded repository.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;You can use your existing repository to run your tests in, or you can create a new repository exclusively for unit tests.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;However, if you use an existing db schema, you must ensure that the 'dir.root' property in custom-repository.properties points to the folder that matches your existing schema.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;E.g. in an out-of-the-box Alfresco installation on windows, dir.root is set to the absolute path '&amp;lt;installation-path&amp;gt;/alf_data'.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;But the custom-repository.properties file of the SDK CustomAspect unit test defines dir.root as the relative path './alf-data' (that is relative to your execution path, e.g. your eclipse project folder).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The error you get is caused by a mismatch between your db schema and your alf_data folder. To solve it, you must change the dir.root property in your unit test to point to the folder that matches your db schema.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 24 May 2007 07:30:16 GMT</pubDate>
    <dc:creator>frederick</dc:creator>
    <dc:date>2007-05-24T07:30:16Z</dc:date>
    <item>
      <title>How to use BaseAlfrescoSpringTest</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-use-basealfrescospringtest/m-p/81646#M54651</link>
      <description>Hi All,I am developing a custom action and would like to add a Unit test to it especially to ease the devlopment cycle.As a starting point I used the SDK custom aspect project, which contains a Unit test, but that unit test won't run.Can someone please shed some light on this?I started the org.alfre</description>
      <pubDate>Tue, 22 May 2007 14:45:40 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-use-basealfrescospringtest/m-p/81646#M54651</guid>
      <dc:creator>legolas</dc:creator>
      <dc:date>2007-05-22T14:45:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to use BaseAlfrescoSpringTest</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-use-basealfrescospringtest/m-p/81647#M54652</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Is there nobody out there who can shed some light on this problem or did I post in the wrong forum?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hope someone can help, it really eases the development cycle of custom actions if they can be tested outside of a running appserver that needs to be restarted each time the code has changed.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 May 2007 06:36:12 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-use-basealfrescospringtest/m-p/81647#M54652</guid>
      <dc:creator>legolas</dc:creator>
      <dc:date>2007-05-24T06:36:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to use BaseAlfrescoSpringTest</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-use-basealfrescospringtest/m-p/81648#M54653</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;When those unit tests are run, they launch an embedded Alfresco repository using the 'custom-repository.properties' config file.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;There, you can specify a db schema and data folder for the embedded repository.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;You can use your existing repository to run your tests in, or you can create a new repository exclusively for unit tests.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;However, if you use an existing db schema, you must ensure that the 'dir.root' property in custom-repository.properties points to the folder that matches your existing schema.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;E.g. in an out-of-the-box Alfresco installation on windows, dir.root is set to the absolute path '&amp;lt;installation-path&amp;gt;/alf_data'.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;But the custom-repository.properties file of the SDK CustomAspect unit test defines dir.root as the relative path './alf-data' (that is relative to your execution path, e.g. your eclipse project folder).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The error you get is caused by a mismatch between your db schema and your alf_data folder. To solve it, you must change the dir.root property in your unit test to point to the folder that matches your db schema.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 May 2007 07:30:16 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-use-basealfrescospringtest/m-p/81648#M54653</guid>
      <dc:creator>frederick</dc:creator>
      <dc:date>2007-05-24T07:30:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to use BaseAlfrescoSpringTest</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-use-basealfrescospringtest/m-p/81649#M54654</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;However, if you use an existing db schema, you must ensure that the 'dir.root' property in custom-repository.properties points to the folder that matches your existing schema.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt;In my case the dir.root property points to ./alf_data&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;How do I see if it matches my existing db schema?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 May 2007 08:27:49 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-use-basealfrescospringtest/m-p/81649#M54654</guid>
      <dc:creator>avro</dc:creator>
      <dc:date>2007-05-24T08:27:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to use BaseAlfrescoSpringTest</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-use-basealfrescospringtest/m-p/81650#M54655</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thank you for your clarification Frederick.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I have changed the custom-repository.properties to reflect the following, and now the unit test runs fine.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;#&lt;BR /&gt;# Sample custom content and index data location&lt;BR /&gt;#&lt;BR /&gt;&lt;BR /&gt;dir.root=./alf_data&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;#db.username=alfresco&lt;BR /&gt;#db.password=alfresco&lt;BR /&gt;&lt;BR /&gt;#&lt;BR /&gt;# MySQL connection (This is default and requires mysql-connector-java-3.1.12-bin.jar, which ships with the Alfresco server)&lt;BR /&gt;#&lt;BR /&gt;db.driver=org.gjt.mm.mysql.Driver&lt;BR /&gt;db.url=jdbc:mysql://localhost/alfresco_test&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;Next thing is to make the unit tests independent of any existing environment, meaning building the database before starting the actual test and destroying it again afterwards.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks again,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Marcel&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 May 2007 06:48:25 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-use-basealfrescospringtest/m-p/81650#M54655</guid>
      <dc:creator>legolas</dc:creator>
      <dc:date>2007-05-25T06:48:25Z</dc:date>
    </item>
  </channel>
</rss>

