@Test public void testNoJMeterMavenPluginJTL() { FileSystem projectFileSystem = mock(FileSystem.class); File testProjectFolder = new File("src/test/resources/notexistingfolder"); doReturn(testProjectFolder).when(projectFileSystem).baseDir(); Project project = spy(new Project("JMeterPostJobTest","","JMeterPostJobTest")); JMeterPostJobForTesting job = new JMeterPostJobForTesting(projectFileSystem); job.executeOn(project, new MockSensorContext()); Assert.assertNull(job.getGlobalSummary()); }
public void executeOn(Project project, SensorContext context) { String jtlPath = settings.getString(JMeterPluginConst.LOCAL_JTL_PATH_PROPERTY); String config = settings.getString(JMeterPluginConst.CONFIG_PROPERTY); if (StringUtils.isNotBlank(jtlPath) || StringUtils.isNotBlank(config)) { return; } LOG.debug("START JMeterPostJob"); try { GlobalSummary summary = getGlobalSummaryFromLocalJTL(project); if(summary!=null) { JMeterMAO.saveSummaryAsMetrics(summary, context); } } catch (Exception e) { LOG.error("Cannot analyse project '" + project.getName() + "'", e); } LOG.debug("END JMeterPostJob"); }
JMeterPostJob implements PostJob, CheckProject { public void executeOn(Project project, SensorContext context) { String jtlPath = settings.getString(JMeterPluginConst.LOCAL_JTL_PATH_PROPERTY); String config = settings.getString(JMeterPluginConst.CONFIG_PROPERTY); if (StringUtils.isNotBlank(jtlPath) || StringUtils.isNotBlank(config)) { return; } LOG.debug("START JMeterPostJob"); try { GlobalSummary summary = getGlobalSummaryFromLocalJTL(project); if(summary!=null) { JMeterMAO.saveSummaryAsMetrics(summary, context); } } catch (Exception e) { LOG.error("Cannot analyse project '" + project.getName() + "'", e); } LOG.debug("END JMeterPostJob"); } }
JMeterPostJob implements PostJob, CheckProject { public void executeOn(Project project, SensorContext context) { String jtlPath = settings.getString(JMeterPluginConst.LOCAL_JTL_PATH_PROPERTY); String config = settings.getString(JMeterPluginConst.CONFIG_PROPERTY); if (StringUtils.isNotBlank(jtlPath) || StringUtils.isNotBlank(config)) { return; } LOG.debug("START JMeterPostJob"); try { GlobalSummary summary = getGlobalSummaryFromLocalJTL(project); if(summary!=null) { JMeterMAO.saveSummaryAsMetrics(summary, context); } } catch (Exception e) { LOG.error("Cannot analyse project '" + project.getName() + "'", e); } LOG.debug("END JMeterPostJob"); } JMeterPostJob(Settings settings, FileSystem filesystem); }
JMeterPostJob implements PostJob, CheckProject { public void executeOn(Project project, SensorContext context) { String jtlPath = settings.getString(JMeterPluginConst.LOCAL_JTL_PATH_PROPERTY); String config = settings.getString(JMeterPluginConst.CONFIG_PROPERTY); if (StringUtils.isNotBlank(jtlPath) || StringUtils.isNotBlank(config)) { return; } LOG.debug("START JMeterPostJob"); try { GlobalSummary summary = getGlobalSummaryFromLocalJTL(project); if(summary!=null) { JMeterMAO.saveSummaryAsMetrics(summary, context); } } catch (Exception e) { LOG.error("Cannot analyse project '" + project.getName() + "'", e); } LOG.debug("END JMeterPostJob"); } JMeterPostJob(Settings settings, FileSystem filesystem); boolean shouldExecuteOnProject(Project project); void executeOn(Project project, SensorContext context); }
JMeterPostJob implements PostJob, CheckProject { public void executeOn(Project project, SensorContext context) { String jtlPath = settings.getString(JMeterPluginConst.LOCAL_JTL_PATH_PROPERTY); String config = settings.getString(JMeterPluginConst.CONFIG_PROPERTY); if (StringUtils.isNotBlank(jtlPath) || StringUtils.isNotBlank(config)) { return; } LOG.debug("START JMeterPostJob"); try { GlobalSummary summary = getGlobalSummaryFromLocalJTL(project); if(summary!=null) { JMeterMAO.saveSummaryAsMetrics(summary, context); } } catch (Exception e) { LOG.error("Cannot analyse project '" + project.getName() + "'", e); } LOG.debug("END JMeterPostJob"); } JMeterPostJob(Settings settings, FileSystem filesystem); boolean shouldExecuteOnProject(Project project); void executeOn(Project project, SensorContext context);  }