Skip to main content

i can't run tests in agent...

5 replies [Last post]
vaccani
Offline
Joined: 2009-09-14

its necessary the test files stay on the machine whose agent is running ?

i start the GUI agent panel perfectly .... the connection with de harness is ok....
but i can't run the tests.

Exception in thread "main" java.lang.NoClassDefFoundError: Teste1
Caused by: java.lang.ClassNotFoundException: Teste1
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
Could not find the main class: Teste1. Program will exit.

Thanks,
Vaccani

====================================================================
Directory layout:
====================================================================

drwxrwxrwx 2 vaccani up 4096 Sep 27 2007 lib
drwxrwxrwx 2 vaccani up 4096 Sep 27 2007 tests
-rw-r--r-- 1 vaccani up 662 Sep 26 12:53 testsuite.jtt

./lib:
total 11016
-rw-r--r-- 1 vaccani up 5105518 Sep 26 08:56 javatest.jar
-rw-r--r-- 1 vaccani up 504570 Sep 26 08:56 jh.jar

./tests:
total 8
-rw-r--r-- 1 vaccani up 549 Sep 26 13:20 Teste1.java

==================================================================
testsuite.jtt:
==================================================================
# Test Suite properties file for DemoTCK test suite
# with tag-style tests
name=testePedro
id=testePedro_1.0
finder=com.sun.javatest.finder.TagTestFinder
script=com.sun.javatest.lib.StdTestScript
interview=com.sun.javatest.interview.SimpleInterviewParameters

# No keywords
keywords=

==================================================================
tests/Teste1.java:
==================================================================

import java.io.PrintWriter;
import com.sun.javatest.Status;
import com.sun.javatest.Test;

/**
* @test
* @executeClass Teste1
* @sources Teste1.java
**/

public class Teste1 implements Test {
public static void main(String[] args) {
PrintWriter out = new PrintWriter(System.err, true);
Test t = new Teste1();
Status s = t.run(args, out, null);
s.exit();
}

public Status run(String[] args, PrintWriter out1, PrintWriter out2) {
Status result;
result = Status.passed("Helo Wold");
return result;
}
}

Message was edited by: vaccani

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
bkurotsu
Offline
Joined: 2004-12-13

Hi.

No, it's not necessary for the test to be on the machine being tested, that can be sent across the connection. But you do need the compiled test on the harness side.

The agent will request the class across the connection and the harness will send it across. I didn't see the compiled test in the list of files you sent.

Brian

vaccani
Offline
Joined: 2009-09-14

sorry Brian,

i don't write in the post my compiled tests classes structure but i have then in my project...
look this :

==================================================================
classes/Teste1.class:
==================================================================

==================================================================
classes/com/sun/javatest/Status.class:
==================================================================

==================================================================
classes/com/sun/javatest/Test.class:
==================================================================

thank you

vaccani
Offline
Joined: 2009-09-14

that's is my structure

.
|-- agente
| |-- lib
| | |-- javatest.jar
| | |-- jh.jar
| | `-- jt-junit.jar
| |-- map.txt
| `-- map.txt~
`-- testePedro
|-- classes
| |-- Teste1.class
| |-- Teste2.class
| `-- com
| `-- sun
| `-- javatest
| |-- Status.class
| `-- Test.class
|-- conf.jti
|-- lib
| |-- javatest.jar
| |-- jh.jar
| `-- jt-junit.jar
|-- tests
| |-- Teste1.java
| |-- Teste2.java
| |-- teste.html
| `-- testsuite.htmlxzxxxx
|-- testsuite.jtt
|-- testsuite.jtt~
`-- workP.jti

vaccani
Offline
Joined: 2009-09-14

someone can help me?

vaccani
Offline
Joined: 2009-09-14

hey ,

the problem was that when i start the agent i don't pass the correct classpath to the tests ...

thank you

vaccani