/** * Test the extraction of the data from ResponseTimeDoubleRecords. * * @throws InterruptedException * If interrupted */ @Test public void testResponsetimeOnly() throws InterruptedException { final AnalysisControllerThread thread = new AnalysisControllerThread(this.controller); thread.start(); Thread.sleep(2000); thread.terminate(); Assert.assertEquals(3, this.sinkPlugin.getList().size()); // Test on the timestamp conversion (here as configured to milliseconds Assert.assertEquals(1369127, this.sinkPlugin.getList().get(0).getTime(), 0); Assert.assertEquals(1369128, this.sinkPlugin.getList().get(1).getTime(), 0); Assert.assertEquals(1369129, this.sinkPlugin.getList().get(2).getTime(), 0); // Test on the extracted values Assert.assertEquals(10341.94, this.sinkPlugin.getList().get(0).getDoubleValue(), 0); Assert.assertEquals(8341.00, this.sinkPlugin.getList().get(1).getDoubleValue(), 0); Assert.assertEquals(78.26, this.sinkPlugin.getList().get(2).getDoubleValue(), 0); } }
Assert.assertEquals(Double.valueOf(1500), Double.valueOf(sinkPlugin.getList().get(0).getDoubleValue())); Assert.assertEquals(Double.valueOf(3000), Double.valueOf(sinkPlugin.getList().get(1).getDoubleValue())); Assert.assertEquals(Double.valueOf(3250), Double.valueOf(sinkPlugin.getList().get(2).getDoubleValue())); Assert.assertEquals(Double.valueOf(2000), Double.valueOf(sinkPlugin.getList().get(3).getDoubleValue())); Assert.assertEquals(Double.valueOf(4000), Double.valueOf(sinkPlugin.getList().get(4).getDoubleValue())); Assert.assertEquals(Double.NaN, sinkPlugin.getList().get(5).getDoubleValue(), 0.0000001d); Assert.assertEquals(Double.NaN, sinkPlugin.getList().get(6).getDoubleValue(), 0.0000001d); Assert.assertEquals(Double.valueOf(6000), Double.valueOf(sinkPlugin.getList().get(7).getDoubleValue())); Assert.assertEquals(Double.valueOf(3000), Double.valueOf(sinkPlugin.getList().get(8).getDoubleValue())); Assert.assertEquals(Double.valueOf(5000), Double.valueOf(sinkPlugin.getList().get(9).getDoubleValue())); Assert.assertEquals(Double.NaN, sinkPlugin.getList().get(10).getDoubleValue(), 0.0000001d);
Assert.assertEquals(1500.0, sinkList.get(0).getDoubleValue(), EPSILON); Assert.assertEquals(1000.0, sinkList.get(1).getDoubleValue(), EPSILON); Assert.assertEquals(1000.0, sinkList.get(2).getDoubleValue(), EPSILON); this.assertAppNames(sinkList, 1, 2); Assert.assertEquals(3000.0, sinkList.get(3).getDoubleValue(), EPSILON); Assert.assertEquals(4000.0, sinkList.get(4).getDoubleValue(), EPSILON); Assert.assertEquals(5000.0, sinkList.get(5).getDoubleValue(), EPSILON); Assert.assertEquals(5000.0, sinkList.get(6).getDoubleValue(), EPSILON); this.assertAppNames(sinkList, 5, 6); Assert.assertEquals(Double.NaN, sinkList.get(7).getDoubleValue(), EPSILON); Assert.assertEquals(Double.NaN, sinkList.get(8).getDoubleValue(), EPSILON); Assert.assertEquals(Double.NaN, sinkList.get(9).getDoubleValue(), EPSILON); Assert.assertEquals(Double.NaN, sinkList.get(10).getDoubleValue(), EPSILON); this.assertAppNames(sinkList, 9, 10); Assert.assertEquals(6000.0, sinkList.get(11).getDoubleValue(), EPSILON); Assert.assertEquals(Double.NaN, sinkList.get(12).getDoubleValue(), EPSILON); Assert.assertEquals(Double.NaN, sinkList.get(13).getDoubleValue(), EPSILON); Assert.assertEquals(Double.NaN, sinkList.get(14).getDoubleValue(), EPSILON); this.assertAppNames(sinkList, 13, 14);
Assert.assertEquals(Double.NaN, sinkPlugin.getList().get(1).getDoubleValue(), 0.001d);
Assert.assertEquals(Double.NaN, sinkPlugin.getList().get(1).getDoubleValue(), 0.001d);