<?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 use BaseAlfrescoSpringTest in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/how-to-use-basealfrescospringtest/m-p/81646#M54651</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi All,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am developing a custom action and would like to add a Unit test to it especially to ease the devlopment cycle.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;As a starting point I used the SDK custom aspect project, which contains a Unit test, but that unit test won't run.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Can someone please shed some light on this?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I started the &lt;/SPAN&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;org.alfresco.sample.ContentHitsAspectTest&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;SPAN&gt; class from eclipse, but it gave me the following results:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;16:41:47,821 ERROR [transform.magick.AbstractImageMagickContentTransformer] ImageMagickContentTransformer not available: Failed to execute command: imconvert "C:\DOCUME~1\md80469\LOCALS~1\Temp\Alfresco\ImageMagickContentTransformer_init_source_23436.gif"&amp;nbsp; "C:\DOCUME~1\md80469\LOCALS~1\Temp\Alfresco\ImageMagickContentTransformer_init_target_23437.png"&lt;BR /&gt;16:41:49,977 WARN&amp;nbsp; [remoting.rmi.RmiRegistryFactoryBean] Could not detect RMI registry - creating new one&lt;BR /&gt;16:41:52,805 WARN&amp;nbsp; [alfresco.util.OpenOfficeConnectionTester] A connection to OpenOffice could not be established.&lt;BR /&gt;16:42:01,617 WARN&amp;nbsp; [repo.admin.ConfigurationChecker] The Alfresco 'dir.root' property is set to a relative path './alf_data'.&amp;nbsp; 'dir.root' should be overridden to point to a specific folder.&lt;BR /&gt;16:42:01,617 INFO&amp;nbsp; [repo.admin.ConfigurationChecker] The Alfresco root data directory ('dir.root') is: .\alf_data&lt;BR /&gt;16:42:01,805 ERROR [repo.admin.ConfigurationChecker] CONTENT INTEGRITY ERROR: Indexes not found for 5 stores.&lt;BR /&gt;16:42:01,805 INFO&amp;nbsp; [repo.admin.ConfigurationChecker] You may set 'index.recovery.mode=FULL' if you need to rebuild the indexes.&lt;BR /&gt;16:42:01,805 ERROR [repo.admin.ConfigurationChecker] CONTENT INTEGRITY ERROR: System content not found in content store.&lt;BR /&gt;16:42:01,805 ERROR [repo.admin.ConfigurationChecker] Ensure that the 'dir.root' property is pointing to the correct data location.&lt;BR /&gt;java.lang.ExceptionInInitializerError&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;at java.lang.reflect.Constructor.newInstance(Constructor.java:494)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;at junit.framework.TestSuite.createTest(TestSuite.java:131)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;at junit.framework.TestSuite.addTestMethod(TestSuite.java:114)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;at junit.framework.TestSuite.&amp;lt;init&amp;gt;(TestSuite.java:75)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestLoader.getTest(JUnit3TestLoader.java:102)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestLoader.loadTests(JUnit3TestLoader.java:59)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:445)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)&lt;BR /&gt;Caused by: org.alfresco.error.AlfrescoRuntimeException: Ensure that the 'dir.root' property is pointing to the correct data location.&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;at org.alfresco.repo.admin.ConfigurationChecker.check(ConfigurationChecker.java:313)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;at org.alfresco.repo.admin.ConfigurationChecker.access$000(ConfigurationChecker.java:74)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;at org.alfresco.repo.admin.ConfigurationChecker$1.doWork(ConfigurationChecker.java:180)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;at org.alfresco.repo.transaction.TransactionUtil.executeInTransaction(TransactionUtil.java:176)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;at org.alfresco.repo.transaction.TransactionUtil.executeInUserTransaction(TransactionUtil.java:82)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;at org.alfresco.repo.admin.ConfigurationChecker.onBootstrap(ConfigurationChecker.java:184)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;at org.alfresco.util.AbstractLifecycleBean.onApplicationEvent(AbstractLifecycleBean.java:62)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:45)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:225)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:323)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;at org.springframework.context.support.ClassPathXmlApplicationContext.&amp;lt;init&amp;gt;(ClassPathXmlApplicationContext.java:87)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;at org.springframework.context.support.ClassPathXmlApplicationContext.&amp;lt;init&amp;gt;(ClassPathXmlApplicationContext.java:72)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;at org.alfresco.util.ApplicationContextHelper.getApplicationContext(ApplicationContextHelper.java:48)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;at org.alfresco.sample.ContentHitsAspectTest.&amp;lt;clinit&amp;gt;(ContentHitsAspectTest.java:55)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;… 13 more&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/S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&gt;Thanks.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Mracel&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 22 May 2007 14:45:40 GMT</pubDate>
    <dc:creator>legolas</dc:creator>
    <dc:date>2007-05-22T14:45:40Z</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>

