<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>Answers to: How to start the Ivy Server in plain Java?</title><link>https://answers.axonivy.com/questions/1187/how-to-start-the-ivy-server-in-plain-java</link><description>&lt;p&gt;There are several questions regarding how to access to Ivy environment JUnit tests but there is no elegant solution so far.&lt;/p&gt;
&lt;p&gt;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).&lt;/p&gt;
&lt;p&gt;I'm trying to implement a JUnit &lt;code&gt;TestRunner&lt;/code&gt; which could start the Ivy Server programmatically but as of now, I don't know the way. What I could found is:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;IServer server = ServerFactory.createEclipseEmbeddedTestServer();
server.start(null); &amp;lt;-- stuck here since I don't know how to instantiate IProgressMonitor&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;My questions are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Is it possible to configure and run JUnit tests in designer along with the engine?&lt;/li&gt;
&lt;li&gt;How can we programmatically start a server?&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Thanks &amp;amp; Best Regards&lt;/p&gt;</description><atom:link href="https://answers.axonivy.com/questions/1187/how-to-start-the-ivy-server-in-plain-java" rel="self"></atom:link><language>en</language><lastBuildDate>Fri, 06 Mar 2015 08:48:35 -0500</lastBuildDate><item><title>Answer by Reguel Wermelinger</title><link>https://answers.axonivy.com/questions/1187/how-to-start-the-ivy-server-in-plain-java/1213</link><description>&lt;p&gt;You can pass a &lt;strong&gt;new org.eclipse.core.runtime.NullProgressMonitor()&lt;/strong&gt; to the mentioned method.&lt;/p&gt;
&lt;p&gt;But anyway I also think that Tamas is right. Normally its better to start a real server with e.g. with Maven. The maven script could then be used to test locally or remote on the ci-server. So you really know if the test will run on ci or not as you execute the same logic: &lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;on phase pre-integration-test: start a server, deploy projects (e.g. by calling ant as tamas suggested)&lt;/li&gt;
&lt;li&gt;on phase integration-test: execute your junit test e.g. with maven-surefire&lt;/li&gt;
&lt;li&gt;on phase post-integration-test: stop the server&lt;/li&gt;
&lt;/ol&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Reguel Wermelinger</dc:creator><pubDate>Fri, 06 Mar 2015 08:48:35 -0500</pubDate><guid>https://answers.axonivy.com/questions/1187/how-to-start-the-ivy-server-in-plain-java/1213</guid></item><item><title>Answer by Tamas KIS</title><link>https://answers.axonivy.com/questions/1187/how-to-start-the-ivy-server-in-plain-java/1206</link><description>&lt;p&gt;i'm wondering about reasons why to test anything in Designer. Likely you want to make sure that the solution works for the customer (on a server Engine).&lt;/p&gt;
&lt;p&gt;I suppose you already use some Continuous Integration to make sure your tests executed automatically. &lt;a href="https://guidelines.axonivy.com/projects/guides/wiki/Continuous_integration"&gt;https://guidelines.axonivy.com/projects/guides/wiki/Continuous_integration&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;With Ant or Maven scripts you can control when an Engine is started and stopped. In between you may execute any number of (JUnit) Tests.&lt;/p&gt;
&lt;p&gt;In case you really want to test the Designer itself, e.g. you write Eclipse plugin to Ivy, then see my private mail with attached Eclipse based Test cases.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Tamas KIS</dc:creator><pubDate>Thu, 05 Mar 2015 12:10:51 -0500</pubDate><guid>https://answers.axonivy.com/questions/1187/how-to-start-the-ivy-server-in-plain-java/1206</guid></item></channel></rss>