<?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 Alfresco SDK Junit test cases are not working in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/alfresco-sdk-junit-test-cases-are-not-working/m-p/73951#M23727</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="text-align: center;"&gt;&lt;SPAN style="font-size: 15px;"&gt;Currently I'm trying to create a test environment in Junit. As an example I&amp;nbsp;used the &lt;STRONG&gt;DemoComponentTest.class&amp;nbsp;&lt;/STRONG&gt;to create my own Test class:&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="text-align: left;"&gt;&lt;/P&gt;&lt;PRE style="color: #a9b7c6; background-color: #2b2b2b; font-size: 9,0pt;"&gt;&lt;SPAN style="color: #cc7832;"&gt;import &lt;/SPAN&gt;com.tradeshift.test.remote.&lt;SPAN style="color: #bbb529;"&gt;Remote&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;import &lt;/SPAN&gt;com.tradeshift.test.remote.RemoteTestRunner&lt;SPAN style="color: #cc7832;"&gt;;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;import &lt;/SPAN&gt;org.alfresco.service.ServiceRegistry&lt;SPAN style="color: #cc7832;"&gt;;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;import &lt;/SPAN&gt;org.junit.Assert&lt;SPAN style="color: #cc7832;"&gt;;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;import &lt;/SPAN&gt;org.junit.&lt;SPAN style="color: #bbb529;"&gt;Test&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;import &lt;/SPAN&gt;org.junit.runner.&lt;SPAN style="color: #bbb529;"&gt;RunWith&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;import &lt;/SPAN&gt;org.springframework.beans.factory.annotation.&lt;SPAN style="color: #bbb529;"&gt;Autowired&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;import &lt;/SPAN&gt;org.springframework.test.context.&lt;SPAN style="color: #bbb529;"&gt;ContextConfiguration&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;import &lt;/SPAN&gt;org.springframework.test.context.junit4.SpringJUnit4ClassRunner&lt;SPAN style="color: #cc7832;"&gt;;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #bbb529;"&gt;@RunWith&lt;/SPAN&gt;(RemoteTestRunner.&lt;SPAN style="color: #cc7832;"&gt;class&lt;/SPAN&gt;)&lt;BR /&gt;&lt;SPAN style="color: #bbb529;"&gt;@Remote&lt;/SPAN&gt;(&lt;SPAN style="color: #d0d0ff;"&gt;runnerClass &lt;/SPAN&gt;= SpringJUnit4ClassRunner.&lt;SPAN style="color: #cc7832;"&gt;class&lt;/SPAN&gt;)&lt;BR /&gt;&lt;SPAN style="color: #bbb529;"&gt;@ContextConfiguration&lt;/SPAN&gt;(&lt;SPAN style="color: #d0d0ff;"&gt;locations &lt;/SPAN&gt;= {&lt;SPAN style="color: #6a8759;"&gt;"classpath:alfresco/application-context.xml"&lt;/SPAN&gt;})&lt;BR /&gt;&lt;SPAN style="color: #cc7832;"&gt;public class &lt;/SPAN&gt;DocumentManagementTest {&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; &lt;SPAN style="color: #bbb529;"&gt;@Autowired &lt;/SPAN&gt;ServiceRegistry &lt;SPAN style="color: #9876aa;"&gt;serviceRegistry&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #bbb529;"&gt;@Test&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #bbb529;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;public void &lt;/SPAN&gt;&lt;SPAN style="color: #ffc66d;"&gt;testWiring&lt;/SPAN&gt;() {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Assert.&lt;SPAN&gt;assertNotNull&lt;/SPAN&gt;(&lt;SPAN style="color: #9876aa;"&gt;serviceRegistry&lt;/SPAN&gt;)&lt;SPAN style="color: #cc7832;"&gt;;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;&amp;nbsp; &lt;/SPAN&gt;}&lt;BR /&gt;}&lt;/PRE&gt;&lt;P&gt;When my app is running and I run the test it gives me the following exceptions:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;junit.framework.AssertionFailedError: java.lang.IllegalStateException: Failed to load ApplicationContext at org.springframework.test.context.CacheAwareContextLoaderDelegate.loadContext(CacheAwareContextLoaderDelegate.java:103)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;........&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'patch.updateAdminUserWhenDefault' defined in URL [jar:file:/D:/alfresco-samples/sampleapp/target/amp-war/WEB-INF/lib/alfresco-repository-5.2.g.jar!/alfresco/patch/patch-services-context.xml]: Invocation of init method failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Invalid bean definition with name 'webscript.org.alfresco.slingshot.datalists.list.get' defined in file [D:\alfresco-samples\sampleapp\target\amp-war\WEB-INF\classes\alfresco\module\alfresco-share-services\module-context.xml]: Could not resolve parent bean definition 'declarativeSpreadsheetWebScript'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'declarativeSpreadsheetWebScript' is defined&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1514)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; at&amp;nbsp;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'declarativeSpreadsheetWebScript' is defined&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:575)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedLocalBeanDefinition(AbstractBeanFactory.java:1111)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedBeanDefinition(AbstractBeanFactory.java:892)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedBeanDefinition(AbstractBeanFactory.java:1166)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; ... 60 more&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;.....................&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; at com.tradeshift.test.remote.internal.InternalRemoteRunner.runChild(InternalRemoteRunner.java:162)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; at com.tradeshift.test.remote.internal.InternalRemoteRunner.runChild(InternalRemoteRunner.java:41)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; at java.util.concurrent.FutureTask.run(FutureTask.java:266)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; at java.lang.Thread.run(Thread.java:748)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In pom.xml:&lt;/P&gt;&lt;PRE style="color: #a9b7c6; background-color: #2b2b2b; font-size: 9,0pt;"&gt;&lt;SPAN style="color: #e8bf6a;"&gt;&amp;lt;parent&amp;gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #e8bf6a;"&gt;&amp;nbsp; &amp;lt;groupId&amp;gt;&lt;/SPAN&gt;org.alfresco.maven&lt;SPAN style="color: #e8bf6a;"&gt;&amp;lt;/groupId&amp;gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #e8bf6a;"&gt;&amp;nbsp; &amp;lt;artifactId&amp;gt;&lt;/SPAN&gt;alfresco-sdk-parent&lt;SPAN style="color: #e8bf6a;"&gt;&amp;lt;/artifactId&amp;gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #e8bf6a;"&gt;&amp;nbsp; &amp;lt;version&amp;gt;&lt;/SPAN&gt;2.2.0&lt;SPAN style="color: #e8bf6a;"&gt;&amp;lt;/version&amp;gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #e8bf6a;"&gt;&amp;lt;/parent&amp;gt;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;When I run the app I use:&lt;/P&gt;&lt;PRE style="color: #a9b7c6; background-color: #2b2b2b; font-size: 9,0pt;"&gt;&lt;SPAN style="color: #808080;"&gt;-Pamp-to-war&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 15 Feb 2018 13:49:59 GMT</pubDate>
    <dc:creator>calin_chiper</dc:creator>
    <dc:date>2018-02-15T13:49:59Z</dc:date>
    <item>
      <title>Alfresco SDK Junit test cases are not working</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/alfresco-sdk-junit-test-cases-are-not-working/m-p/73951#M23727</link>
      <description>Currently I'm trying to create a test environment in Junit. As an example I&amp;nbsp;used the DemoComponentTest.class&amp;nbsp;to create my own Test class:import com.tradeshift.test.remote.Remote;import com.tradeshift.test.remote.RemoteTestRunner;import org.alfresco.service.ServiceRegistry;import org.junit.Assert;imp</description>
      <pubDate>Thu, 15 Feb 2018 13:49:59 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/alfresco-sdk-junit-test-cases-are-not-working/m-p/73951#M23727</guid>
      <dc:creator>calin_chiper</dc:creator>
      <dc:date>2018-02-15T13:49:59Z</dc:date>
    </item>
    <item>
      <title>Re: Alfresco SDK Junit test cases are not working</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/alfresco-sdk-junit-test-cases-are-not-working/m-p/73952#M23728</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Extract:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;EM style="color: #727174; background-color: #ffffff; border: 0px;"&gt;Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'patch.updateAdminUserWhenDefault' defined in URL [jar:file:/D:/alfresco-samples/sampleapp/target/amp-war/WEB-INF/lib/alfresco-repository-5.2.g.jar!/alfresco/patch/patch-services-context.xml]: Invocation of init method failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Invalid bean definition with name 'webscript.org.alfresco.slingshot.datalists.list.get' defined in file [D:\alfresco-samples\sampleapp\target\amp-war\WEB-INF\classes\alfresco\module\alfresco-share-services\module-context.xml]: Could not resolve parent bean definition 'declarativeSpreadsheetWebScript'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'declarativeSpreadsheetWebScript' is defined&lt;/EM&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FYI&amp;nbsp;&lt;A _jive_internal="true" class="link-titled" href="https://community.alfresco.com/thread/214051-remote-unit-testing#comment-716388" title="https://community.alfresco.com/thread/214051-remote-unit-testing#comment-716388" rel="nofollow noopener noreferrer"&gt;https://community.alfresco.com/thread/214051-remote-unit-testing#comment-716388&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have you also tried using Alfresco Maven SDK v3.0.1 ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://github.com/Alfresco/alfresco-sdk" title="https://github.com/Alfresco/alfresco-sdk" rel="nofollow noopener noreferrer"&gt;GitHub - Alfresco/alfresco-sdk: The Alfresco SDK based on Apache Maven, includes support for rapid and standard developm…&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Jan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Feb 2018 09:01:38 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/alfresco-sdk-junit-test-cases-are-not-working/m-p/73952#M23728</guid>
      <dc:creator>janv</dc:creator>
      <dc:date>2018-02-16T09:01:38Z</dc:date>
    </item>
    <item>
      <title>Re: Alfresco SDK Junit test cases are not working</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/alfresco-sdk-junit-test-cases-are-not-working/m-p/73953#M23729</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, by extending the &lt;STRONG&gt;AbstractAlfrescoIT&amp;nbsp;&lt;/STRONG&gt;it works fine but It's possible to run unit tests without&amp;nbsp; having the app running.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Feb 2018 07:04:07 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/alfresco-sdk-junit-test-cases-are-not-working/m-p/73953#M23729</guid>
      <dc:creator>calin_chiper</dc:creator>
      <dc:date>2018-02-20T07:04:07Z</dc:date>
    </item>
  </channel>
</rss>

