MeasurementThread implements Runnable { public void start(int iInterval) { if (iInterval <= 0) { throw new IllegalArgumentException(iInterval + " <= 0 in Log.start"); } interval = iInterval; logThread = new Thread(this); setRunning(true); listener=new MyListener( logger); listener.addMyListeners(); logThread.setName("MeasurmentThread"); logThread.start(); } MeasurementThread(ResultLogger l); void logResourcesUsage(); void run(); void start(int iInterval); void interrupt(); void join(); boolean isAlive(); boolean isRunning();  }
@Test(expected = IllegalArgumentException.class) public void testStartWithNegativeValue() 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.start(-1); }
@Test(expected = IllegalArgumentException.class) public void testStartWith0Value() 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.start(0); }