Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Overholt2009-08-11 15:34:33 +0000
committerAndrew Overholt2009-08-11 15:34:33 +0000
commitd7ff177e92e641590c38bfb48579158b8a52a5ae (patch)
tree5a3f567b8d9beba635d1b39c71d112814fe9ba2b /systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/tests/aggregates/CountAggregateTest.java
parent5500323611c3d73e6a0795f9e23443b1cb1164a4 (diff)
downloadorg.eclipse.linuxtools-d7ff177e92e641590c38bfb48579158b8a52a5ae.tar.gz
org.eclipse.linuxtools-d7ff177e92e641590c38bfb48579158b8a52a5ae.tar.xz
org.eclipse.linuxtools-d7ff177e92e641590c38bfb48579158b8a52a5ae.zip
Branch for 0.3
Diffstat (limited to 'systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/tests/aggregates/CountAggregateTest.java')
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/tests/aggregates/CountAggregateTest.java66
1 files changed, 66 insertions, 0 deletions
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/tests/aggregates/CountAggregateTest.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/tests/aggregates/CountAggregateTest.java
new file mode 100644
index 0000000000..051ffc4c68
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/tests/aggregates/CountAggregateTest.java
@@ -0,0 +1,66 @@
+/*******************************************************************************
+ * Copyright (c) 2006 IBM Corporation.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - Jeff Briggs, Henry Hughes, Ryan Morse
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests.aggregates;
+
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.aggregates.CountAggregate;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests.MockDataSet;
+
+import junit.framework.TestCase;
+
+public class CountAggregateTest extends TestCase {
+ public CountAggregateTest(String name) {
+ super(name);
+ }
+
+ protected void setUp() throws Exception {
+ super.setUp();
+ }
+
+ public void testAggregate() {
+ CountAggregate aa = new CountAggregate();
+ Number num;
+
+ num = aa.aggregate(null);
+ assertNull(num);
+
+ num = aa.aggregate(new Number[] {});
+ assertNull(num);
+
+ num = aa.aggregate(MockDataSet.buildIntegerArray(new int[] {0,0,0}));
+ assertEquals(3, num.intValue());
+
+ num = aa.aggregate(MockDataSet.buildIntegerArray(new int[] {-1,0}));
+ assertEquals(2, num.intValue());
+
+ num = aa.aggregate(MockDataSet.buildIntegerArray(new int[] {0,0,1,2,3}));
+ assertEquals(5, num.intValue());
+
+
+ num = aa.aggregate(MockDataSet.buildDoubleArray(new double[] {0,0,0}));
+ assertEquals(3, num.doubleValue(), 0.0);
+
+ num = aa.aggregate(MockDataSet.buildDoubleArray(new double[] {-1,1}));
+ assertEquals(2, num.doubleValue(), 0.0);
+
+ num = aa.aggregate(MockDataSet.buildDoubleArray(new double[] {0,0,1,4,5}));
+ assertEquals(5, num.doubleValue(), 0.0);
+ }
+
+ public void testGetID() {
+ CountAggregate aa = new CountAggregate();
+ assertTrue(CountAggregate.ID.equals(aa.getID()));
+ }
+
+ protected void tearDown() throws Exception {
+ super.tearDown();
+ }
+}

Back to the top