<?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 MVN amp project JUNIT test fails with init error in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/mvn-amp-project-junit-test-fails-with-init-error/m-p/282097#M235227</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi there,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have used the DemoComponenet test as a basis to build a JUNIT test. However when I run the test I get:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt;java.lang.RuntimeException: Unable to create instanceof class org.springframework.test.context.junit4.SpringJUnit4ClassRunner&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;at com.tradeshift.test.remote.internal.Utils.createRunner(Utils.java:77)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;at com.tradeshift.test.remote.RemoteTestRunner.&amp;lt;init&amp;gt;(RemoteTestRunner.java:44)&lt;BR /&gt;&lt;BR /&gt;…..&lt;BR /&gt;Caused by: java.lang.reflect.InvocationTargetException: null&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:57)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&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;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am not sure where the unit test picks up the spring application context because it does not appear to be anywhere in the project. Although the DemoComponent test runs fine without it. There appears to be no test specific resources in the project created by the mvn plugin.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;@RunWith(RemoteTestRunner.class)&lt;BR /&gt;@Remote(runnerClass = SpringJUnit4ClassRunner.class)&lt;BR /&gt;@ContextConfiguration("classpath:alfresco/application-context.xml")&lt;BR /&gt;&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;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any help appreciated.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 02 Apr 2014 13:07:43 GMT</pubDate>
    <dc:creator>mxc</dc:creator>
    <dc:date>2014-04-02T13:07:43Z</dc:date>
    <item>
      <title>MVN amp project JUNIT test fails with init error</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/mvn-amp-project-junit-test-fails-with-init-error/m-p/282097#M235227</link>
      <description>Hi there,I have used the DemoComponenet test as a basis to build a JUNIT test. However when I run the test I get: java.lang.RuntimeException: Unable to create instanceof class org.springframework.test.context.junit4.SpringJUnit4ClassRunner&amp;nbsp;&amp;nbsp;&amp;nbsp;at com.tradeshift.test.remote.internal.Utils.createRunner(</description>
      <pubDate>Wed, 02 Apr 2014 13:07:43 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/mvn-amp-project-junit-test-fails-with-init-error/m-p/282097#M235227</guid>
      <dc:creator>mxc</dc:creator>
      <dc:date>2014-04-02T13:07:43Z</dc:date>
    </item>
    <item>
      <title>Re: MVN amp project JUNIT test fails with init error</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/mvn-amp-project-junit-test-fails-with-init-error/m-p/282098#M235228</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Here is a project with a working unit test I created recently:&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="https://github.com/jpotts/share-site-space-templates" rel="nofollow noopener noreferrer"&gt;https://github.com/jpotts/share-site-space-templates&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It was bootstrapped with the Alfresco Maven SDK.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Maybe comparing its structure and unit test with yours will be helpful.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;One thing I noticed is that the application-context.xml gets created automatically when you run mvn integration-test. But, as you noted, my unit test runs fine without it when running mvn install, so that's probably not your problem.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Jeff&lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Apr 2014 22:31:10 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/mvn-amp-project-junit-test-fails-with-init-error/m-p/282098#M235228</guid>
      <dc:creator>jpotts</dc:creator>
      <dc:date>2014-04-02T22:31:10Z</dc:date>
    </item>
    <item>
      <title>Re: MVN amp project JUNIT test fails with init error</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/mvn-amp-project-junit-test-fails-with-init-error/m-p/282099#M235229</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanls for the reply Jeff. I had a look at your code and couldn't get any clue as to why the test does not run. I changed the annotations at the top of the class from&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt;@RunWith(RemoteTestRunner.class)&lt;BR /&gt;@Remote(runnerClass = SpringJUnit4ClassRunner.class)&lt;BR /&gt;@ContextConfiguration("classpath:alfresco/application-context.xml")&lt;BR /&gt;&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;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;to&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;@RunWith(SpringJUnit4ClassRunner.class)&lt;BR /&gt;@ContextConfiguration("classpath:alfresco/application-context.xml")&lt;SPAN class="line-numbers-rows"&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;BR /&gt;&lt;SPAN&gt;At lest the tests are running now. I will have to find out about the RemoteTestRunner annotation and see what its all about. Odd that it runs without any issue with the DemoComponent test.&lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Apr 2014 15:02:10 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/mvn-amp-project-junit-test-fails-with-init-error/m-p/282099#M235229</guid>
      <dc:creator>mxc</dc:creator>
      <dc:date>2014-04-03T15:02:10Z</dc:date>
    </item>
  </channel>
</rss>

