Questions Tagged With junithttps://answers.axonivy.com/tags/junit/?type=rssquestions tagged <span class="tag">junit</span>enWed, 11 May 2016 16:56:53 -0400Access IvyContext within a JUnit Testhttps://answers.axonivy.com/questions/1773/access-ivycontext-within-a-junit-test<p>I'm currently working on a JUnit Test that checks the values of Global Variables. Now the problem is, if I try to get the Global Variable Value using this line of code: <em>String var = Ivy.var().get("BASEDEF_PORTAL_SESSION_TIMEOUT");</em> the test immediately crashes. Is there a way to access the IvyContext in a JUnit test.</p>Joel17Wed, 11 May 2016 16:56:53 -0400https://answers.axonivy.com/questions/1773/access-ivycontext-within-a-junit-testjunitivyHow to start the Ivy Server in plain Java?https://answers.axonivy.com/questions/1187/how-to-start-the-ivy-server-in-plain-java<p>There are several questions regarding how to access to Ivy environment JUnit tests but there is no elegant solution so far.</p> <p>In Ivy Designer, if I start the Ivy Server and then start run JUnit tests, the Ivy Server will be automatically stopped. I'm trying to find a way to avoid this (and not sure if there is).</p> <p>I'm trying to implement a JUnit <code>TestRunner</code> which could start the Ivy Server programmatically but as of now, I don't know the way. What I could found is:</p> <p><code>IServer server = ServerFactory.createEclipseEmbeddedTestServer(); server.start(null); &lt;-- stuck here since I don't know how to instantiate IProgressMonitor</code></p> <p>My questions are:</p> <ul> <li>Is it possible to configure and run JUnit tests in designer along with the engine?</li> <li>How can we programmatically start a server?</li> </ul> <p>Thanks &amp; Best Regards</p>Genzer HawkerMon, 02 Mar 2015 11:11:00 -0500https://answers.axonivy.com/questions/1187/how-to-start-the-ivy-server-in-plain-javaenginetestjunitivy