@Test public void testCreateMessage() { int[] patchesPerTool = {1, 5, 10, 15, 20}; Date now = new Date(); String message = notifier.createMessage(100, 15, 51, patchesPerTool, now); String testMessage = "Summary email from Repairnator. \n\n" + "This summary contains the operations of Repairnator between " + notifier.lastNotificationTime.getTime().toString() + " and " + now.toString() + ".\n\n" + "Number of analyzed builds: 100\n" + "Number of repair attempts made: 15\n" + "Total number of builds with patches: 51\n" + "Total number of patches found by Tool0: 1\n" + "Total number of patches found by Tool1: 5\n" + "Total number of patches found by Tool2: 10\n" + "Total number of patches found by Tool3: 15\n" + "Total number of patches found by Tool4: 20\n"; assertTrue(message.equals(testMessage)); }
protected String createMessage(int nrAnalyzedBuilds, int nrRepairAttempts, int nrOfBuildsWithPatches, int[] nrOfPatchesPerTool, Date now) { String message = "Summary email from Repairnator. \n\n"; message += "This summary contains the operations of Repairnator between " + this.lastNotificationTime.getTime().toString(); message += " and "; message += now.toString() + ".\n\n"; message += "Number of analyzed builds: " + nrAnalyzedBuilds + "\n"; message += "Number of repair attempts made: " + nrRepairAttempts + "\n"; message += "Total number of builds with patches: " + nrOfBuildsWithPatches + "\n"; for (int i = 0; i < repairTools.length; i++) { message += "Total number of patches found by " + repairTools[i] + ": " + nrOfPatchesPerTool[i] + "\n"; } return message; }
TimedSummaryNotifier implements Runnable { protected String createMessage(int nrAnalyzedBuilds, int nrRepairAttempts, int nrOfBuildsWithPatches, int[] nrOfPatchesPerTool, Date now) { String message = "Summary email from Repairnator. \n\n"; message += "This summary contains the operations of Repairnator between " + this.lastNotificationTime.getTime().toString(); message += " and "; message += now.toString() + ".\n\n"; message += "Number of analyzed builds: " + nrAnalyzedBuilds + "\n"; message += "Number of repair attempts made: " + nrRepairAttempts + "\n"; message += "Total number of builds with patches: " + nrOfBuildsWithPatches + "\n"; for (int i = 0; i < repairTools.length; i++) { message += "Total number of patches found by " + repairTools[i] + ": " + nrOfPatchesPerTool[i] + "\n"; } return message; } }
TimedSummaryNotifier implements Runnable { protected String createMessage(int nrAnalyzedBuilds, int nrRepairAttempts, int nrOfBuildsWithPatches, int[] nrOfPatchesPerTool, Date now) { String message = "Summary email from Repairnator. \n\n"; message += "This summary contains the operations of Repairnator between " + this.lastNotificationTime.getTime().toString(); message += " and "; message += now.toString() + ".\n\n"; message += "Number of analyzed builds: " + nrAnalyzedBuilds + "\n"; message += "Number of repair attempts made: " + nrRepairAttempts + "\n"; message += "Total number of builds with patches: " + nrOfBuildsWithPatches + "\n"; for (int i = 0; i < repairTools.length; i++) { message += "Total number of patches found by " + repairTools[i] + ": " + nrOfPatchesPerTool[i] + "\n"; } return message; } TimedSummaryNotifier(List<NotifierEngine> engines, Duration interval,
            String[] tools, String mongodbHost, String mongodbName, Date notificationTime);  TimedSummaryNotifier(List<NotifierEngine> engines, Duration interval, String[] tools,
            String mongdbHost, String mongodbName); }
TimedSummaryNotifier implements Runnable { protected String createMessage(int nrAnalyzedBuilds, int nrRepairAttempts, int nrOfBuildsWithPatches, int[] nrOfPatchesPerTool, Date now) { String message = "Summary email from Repairnator. \n\n"; message += "This summary contains the operations of Repairnator between " + this.lastNotificationTime.getTime().toString(); message += " and "; message += now.toString() + ".\n\n"; message += "Number of analyzed builds: " + nrAnalyzedBuilds + "\n"; message += "Number of repair attempts made: " + nrRepairAttempts + "\n"; message += "Total number of builds with patches: " + nrOfBuildsWithPatches + "\n"; for (int i = 0; i < repairTools.length; i++) { message += "Total number of patches found by " + repairTools[i] + ": " + nrOfPatchesPerTool[i] + "\n"; } return message; } TimedSummaryNotifier(List<NotifierEngine> engines, Duration interval,
            String[] tools, String mongodbHost, String mongodbName, Date notificationTime);  TimedSummaryNotifier(List<NotifierEngine> engines, Duration interval, String[] tools,
            String mongdbHost, String mongodbName); @Override void run(); }
TimedSummaryNotifier implements Runnable { protected String createMessage(int nrAnalyzedBuilds, int nrRepairAttempts, int nrOfBuildsWithPatches, int[] nrOfPatchesPerTool, Date now) { String message = "Summary email from Repairnator. \n\n"; message += "This summary contains the operations of Repairnator between " + this.lastNotificationTime.getTime().toString(); message += " and "; message += now.toString() + ".\n\n"; message += "Number of analyzed builds: " + nrAnalyzedBuilds + "\n"; message += "Number of repair attempts made: " + nrRepairAttempts + "\n"; message += "Total number of builds with patches: " + nrOfBuildsWithPatches + "\n"; for (int i = 0; i < repairTools.length; i++) { message += "Total number of patches found by " + repairTools[i] + ": " + nrOfPatchesPerTool[i] + "\n"; } return message; } TimedSummaryNotifier(List<NotifierEngine> engines, Duration interval,
            String[] tools, String mongodbHost, String mongodbName, Date notificationTime);  TimedSummaryNotifier(List<NotifierEngine> engines, Duration interval, String[] tools,
            String mongdbHost, String mongodbName); @Override void run();  }