junit4 functions

Posted by lamisse on Stack Overflow See other posts from Stack Overflow or by lamisse
Published on 2010-03-03T12:13:47Z Indexed on 2010/03/08 15:21 UTC
Read the original article Hit count: 473

Filed under:
|
|
|

how to create generic functions that could be called from each java test? In my function startappli I have :

public class startappli{

public void testMain (String[] args) 
 {

  String[] logInfos = new String[3];
  logInfos[0] = (String) args[0];
  logInfos[1] = (String) args[1];
 }
  @BeforeClass
    public static void setupOnce() {
        final Thread thread = new Thread() {
            public void run() {

             entrypointtoGUI.main(new String[]{"arg0 ", "arg1"});

            }
        };
        try {
            thread.start();
        } catch (Exception ex) {

        }
    }

}

in the toto.java , I call the function as follow : startappli.testmain(loginfo) it doesn't work help ?

© Stack Overflow or respective owner

Related posts about java

Related posts about unit-testing