MeasurementThread implements Runnable { public void join() { try { if (logThread == null) { throw new NullPointerException( "Internal error : logThread is null in Logger.join()"); } logThread.join(); logThread = null; } catch (InterruptedException e) { e.printStackTrace(); } } MeasurementThread(ResultLogger l); void logResourcesUsage(); void run(); void start(int iInterval); void interrupt(); void join(); boolean isAlive(); boolean isRunning();  }
@Test(expected = NullPointerException.class) public void testJoinWithoutStart() throws FileNotFoundException { MeasurementThread m = new MeasurementThread(new ResultLogger( Platform.TMP_DIR, new TextGenerator(new FileOutputStream( new File(Platform.TMP_DIR + Platform.FILE_SEPARATOR + "tmp.txt"))),"C:\\Program Files\\JATK\\Salome-script\\Confile.xml")); m.join(); }