ResultLogger { public void addResourcesInfoToDocumentLogger() throws PhoneException { if (getPhoneInterface() == null || actionsLogger.isStopJATK()) { setStopATK(true); this.interrupt(); } if (isResourceslogged) { Date d = new Date(); Map<String, PlotList> mapint = documentLogger.getMapint(); Set<String> cles = mapint.keySet(); Iterator<String> it = cles.iterator(); List<String> sampledKeys = new ArrayList<String>(); while (it.hasNext()) { String cle = (String) it.next(); PlotList plotlist = mapint.get(cle); if (plotlist.isSampled()) sampledKeys.add(cle); } if (getPhoneInterface() != null && logThread != null && logThread.isRunning()) { try { HashMap<String, Long> values = getPhoneInterface().getResources(sampledKeys); cles = values.keySet(); it = cles.iterator(); while (it.hasNext()) { String cle = (String) it.next(); float v = values.get(cle).floatValue(); documentLogger.addDataToList(cle, d.getTime(), v); } } catch (PhoneException e) { addInfotoActionLogger("Error JATK", "Monitor connection lost", new Date(), new Date()); getPhoneInterface().stopTestingMode(); getPhoneInterface().startTestingMode(); } } } } ResultLogger(String folderWhereResultsAreSaved,
			DocumentGenerator documentGenerator, String confilepath, boolean isResourceslogged);  ResultLogger(String folderWhereResultsAreSaved,
			DocumentGenerator documentGenerator, String confilepath); void generateGraphFile(); void generatepltFile(); void addInfotoActionLogger(String MsgType, String actionName, Date startTime,
			Date endTime); void writeActionLogFile(); void writeActionLogFile(String xmlfilepath); void addInfoToDocumentLogger(String s, int line, String currentScript); void addWarningToDocumentLogger(String s, int line, String currentScript); void addErrorToDocumentLogger(String s, int line, String currentScript); void addToDocumentLogger(float value, String doctype); void addResourcesInfoToDocumentLogger(); void addPerfListener(IMeasureListener listener); void removePerfListener(IMeasureListener listener); IMeasureListener[] getPerfListeners(); boolean saveScreenshot(String fileName, RenderedImage image); void setPhoneInterface(PhoneInterface phoneInterface); void setInterpreter(JATKInterpreter interpreter); void start(int iInterval); void interrupt(); void join(); boolean isAlive(); void dumpInStream(boolean isParseErrorHappened); PhoneInterface getPhoneInterface(); void setStopATK(boolean stopATK); boolean isStopATK(); DocumentLogger getDocumentLogger(); void setDocumentLogger(DocumentLogger documentLogger); ActionsLogger getActionsLogger();  }
@Test(expected = NullPointerException.class) public void testLogResourceUsageWithoutProvidingAPhoneInterface() throws FileNotFoundException, PhoneException { ResultLogger l = 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"); l.addResourcesInfoToDocumentLogger(); }