There are several questions regarding how to access to Ivy environment JUnit tests but there is no elegant solution so far.

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).

I'm trying to implement a JUnit TestRunner which could start the Ivy Server programmatically but as of now, I don't know the way. What I could found is:

IServer server = ServerFactory.createEclipseEmbeddedTestServer(); server.start(null); <-- stuck here since I don't know how to instantiate IProgressMonitor

My questions are:

  • Is it possible to configure and run JUnit tests in designer along with the engine?
  • How can we programmatically start a server?

Thanks & Best Regards

asked 02.03.2015 at 11:11

Genzer%20Hawker's gravatar image

Genzer Hawker
(suspended)
accept rate: 66%


You can pass a new org.eclipse.core.runtime.NullProgressMonitor() to the mentioned method.

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:

  1. on phase pre-integration-test: start a server, deploy projects (e.g. by calling ant as tamas suggested)
  2. on phase integration-test: execute your junit test e.g. with maven-surefire
  3. on phase post-integration-test: stop the server
link

answered 06.03.2015 at 08:48

Reguel%20Wermelinger's gravatar image

Reguel Werme... ♦♦
9.4k31958
accept rate: 70%

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).

I suppose you already use some Continuous Integration to make sure your tests executed automatically. https://guidelines.axonivy.com/projects/guides/wiki/Continuous_integration

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.

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.

link

answered 05.03.2015 at 12:10

Tamas%20KIS's gravatar image

Tamas KIS
(suspended)
accept rate: 60%

Hi @Tamas, thanks for the email, I also thought about writing an Eclipse plugin but don't know here to start, your email is definitely helpful. The things is, I want to make sure there is nothing broken before checking in the source code, that's why I want to run the tests on the designer first instead of discovering bugs via the CI system.

(06.03.2015 at 03:00) Genzer Hawker Genzer%20Hawker's gravatar image

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×147
×44
×4
×2

Asked: 02.03.2015 at 11:11

Seen: 3,147 times

Last updated: 06.03.2015 at 08:48