DbUnit Tests with SilkCentral


I am trying to run a DbUnit test using SilkCentral on a remote virtual machine that acts as the execution server. The .class that I want to run is in the \p6621va\ucd\ucdmain_TEST\bin\es\bde\aps\ucdmain\ias\tests\AllTests.class directory and contains the test suite which in turn contains all the tests I want to run.

The first thing I need is to create a 'Source Control Profile', which I have defined it in the following way:

UNC path: \p6624va\UCD Working folder: c:\SilkTempSource

According to the documentation I must specify in 'UNC path' the absolute path in the virtual machine (this path is shared and I have checked access to it remotely from my computer). In addition, a local path must be specified in 'Working folder' in which the execution server will copy the source files.

Source Control Profile: link

The next step is to create the 'Test Container' and associate the 'Source control profile' previously created:

In 'Root node' I'm not sure which route I should specify. According to the documentation, the execution server retrieves the source files of the tests included in the container from the 'Source control profile'. The root node of the 'Source control profile' is set to the root node of the 'Test container'.

Test container: link

Finally, I create a test associated with the newly created 'Test container' and define its properties:

In the Classpath you must specify the path relative to the working folder defined in the 'Source Control Profile'

Classpath: ucdmain_TEST\bin\es\bde\aps\ucdmain\ias\tests

Test properties: link

The problem that returns me is the following:

com.segue.tm.plugins.testlaunch.junit.ju4support.AllTests (0 Failures, 1 Errors, 0 Warnings) 

Detected java version "1.8.0_60".

initializationError (0 Failures, 1 Errors, 0 Warnings) 

Error - No testclasses found in classpath c:\SilkTempSource\ucdmain_TEST\bin\es\bde\aps\ucdmain\ias\tests 
 java.lang.ClassNotFoundException: No testclasses found in classpath c:\SilkTempSource\ucdmain_TEST\bin\es\bde\aps\ucdmain\ias\tests 
 at java.lang.reflect.Constructor.newInstance(Constructor.java:422) 

~AllTests#initializationError: No testclasses found in classpath c:\SilkTempSource\ucdmain_TEST\bin\es\bde\aps\ucdmain\ias\tests 

So I understand that the copy of the source files to the local path from the UNC path: \p6624va\UCD to the working folder: c:\SilkTempSource declared in the 'Source Control Profile' is not being done well. At the moment I do not specify a 'Test class' since the error is in the access to the route.

I appreciate any input, thank you very much.

asked by César Rodríguez 03.01.2017 в 14:10

1 answer


Finally I have managed to solve it in the following way:

Source Control Profile:

Test container:

Junit Test:

The problem was in the specification of both the 'Classpath' and the 'Test class'. The route of the class I wanted to run was: \p6621va\ucd\ucdmain_TEST\bin\es\bde\aps\ucdmain\ias\tests\AllTests.class

In 'Test class' you must specify the full name of the JUnit test class, this means that you must specify the package that contains that class, which in my case was es.bde.aps.ucdmain.ias.tests.AllTests.class . Therefore in 'Classpath' you should only specify up to the \ bin directory as follows: .\ucdmain_TEST\bin;

In this way the complete path of access is composed as follows: c:\SilkTempSource\ucdmain_TEST\bin\es\bde\aps\ucdmain\ias\tests\AllTests.class , which corresponds to the local copy made by the server of execution of the source files. It is also necessary to indicate the dependencies that the test class has, which in my case are in the directory c:\SilkTempSource\ucdmain_TEST\lib

answered by 05.01.2017 / 12:07