예제 #1
0
 /**
  * Test method for {@link
  * de.uniluebeck.itm.spyglass.plugin.simpleglobalinformation.StatisticalOperation#addValue(float)}
  * .
  */
 @Test
 public final void testAddValueAVG() {
   final StatisticalOperation statisticalOperation =
       new StatisticalOperation(10, STATISTICAL_OPERATIONS.AVG);
   statisticalOperation.addValue(1);
   assertEquals(2, statisticalOperation.addValue(3), 0.0);
 }
예제 #2
0
 /** @throws java.lang.Exception */
 @BeforeClass
 public static void setUpBeforeClass() throws Exception {
   so = new StatisticalOperation(4, STATISTICAL_OPERATIONS.SUM);
   so.addValue(1);
   so.addValue(4);
   so.addValue(7);
   so.addValue(5);
   so.addValue(9);
 }
예제 #3
0
 /**
  * Test method for {@link
  * de.uniluebeck.itm.spyglass.plugin.simpleglobalinformation.StatisticalOperation#addValue(float)}
  * .
  */
 @Test
 public final void testAddValueMEDIAN2() {
   final StatisticalOperation statisticalOperation =
       new StatisticalOperation(10, STATISTICAL_OPERATIONS.MEDIAN);
   statisticalOperation.addValue(1);
   statisticalOperation.addValue(4);
   statisticalOperation.addValue(7);
   statisticalOperation.addValue(5);
   assertEquals(4, statisticalOperation.addValue(3), 0.0);
 }
예제 #4
0
 /**
  * Test method for {@link
  * de.uniluebeck.itm.spyglass.plugin.simpleglobalinformation.StatisticalOperation#getValue(de.uniluebeck.itm.spyglass.plugin.simpleglobalinformation.StatisticalInformationEvaluator.STATISTICAL_OPERATIONS)}
  * .
  */
 @Test
 public final void testGetValueMEDIAN3() {
   final StatisticalOperation so = new StatisticalOperation(4, STATISTICAL_OPERATIONS.MAX);
   so.addValue(10);
   so.addValue(4);
   so.addValue(7);
   so.addValue(5);
   so.addValue(9);
   so.addValue(3);
   assertEquals((float) 5, so.getValue(STATISTICAL_OPERATIONS.MEDIAN), 0.0);
 }
예제 #5
0
 /**
  * Test method for {@link
  * de.uniluebeck.itm.spyglass.plugin.simpleglobalinformation.StatisticalOperation#getValue(de.uniluebeck.itm.spyglass.plugin.simpleglobalinformation.StatisticalInformationEvaluator.STATISTICAL_OPERATIONS)}
  * .
  */
 @Test
 public final void testGetValueAVG2() {
   final StatisticalOperation so = new StatisticalOperation(4, STATISTICAL_OPERATIONS.SUM);
   so.addValue(1);
   so.addValue(4);
   so.addValue(7);
   so.addValue(5);
   so.addValue(9);
   so.addValue(3);
   assertEquals((float) (24 / 4), so.getValue(STATISTICAL_OPERATIONS.AVG), 0.0);
 }
예제 #6
0
 /**
  * Test method for {@link
  * de.uniluebeck.itm.spyglass.plugin.simpleglobalinformation.StatisticalOperation#addValue(float)}
  * .
  */
 @Test
 public final void testAddValueMEDIAN3() {
   final StatisticalOperation statisticalOperation =
       new StatisticalOperation(10, STATISTICAL_OPERATIONS.MEDIAN);
   statisticalOperation.addValue(1);
   statisticalOperation.addValue(1);
   statisticalOperation.addValue(5);
   statisticalOperation.addValue(6);
   statisticalOperation.addValue(20);
   statisticalOperation.addValue(1000);
   statisticalOperation.addValue(5); // this is the first item which counts again
   statisticalOperation.addValue(1);
   statisticalOperation.addValue(9);
   statisticalOperation.addValue(2);
   statisticalOperation.addValue(7);
   statisticalOperation.addValue(8);
   statisticalOperation.addValue(1);
   statisticalOperation.addValue(4);
   statisticalOperation.addValue(7);
   assertEquals(5, statisticalOperation.addValue(6), 0.0);
 }
예제 #7
0
 /**
  * Test method for {@link
  * de.uniluebeck.itm.spyglass.plugin.simpleglobalinformation.StatisticalOperation#addValue(float)}
  * .
  */
 @Test
 public final void testAddValueSUM2() {
   final StatisticalOperation statisticalOperation =
       new StatisticalOperation(10, STATISTICAL_OPERATIONS.SUM);
   statisticalOperation.addValue(1);
   statisticalOperation.addValue(2);
   statisticalOperation.addValue(3);
   statisticalOperation.addValue(4);
   statisticalOperation.addValue(5);
   statisticalOperation.addValue(6);
   statisticalOperation.addValue(7);
   statisticalOperation.addValue(8);
   statisticalOperation.addValue(9);
   statisticalOperation.addValue(10);
   assertEquals(66, statisticalOperation.addValue(11), 0.0);
 }