You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@streams.apache.org by sb...@apache.org on 2014/11/19 21:32:17 UTC
[1/2] incubator-streams git commit: STREAMS-216 | Fixed test errors
Repository: incubator-streams
Updated Branches:
refs/heads/master 3400ce2b7 -> 56011e4b6
STREAMS-216 | Fixed test errors
Project: http://git-wip-us.apache.org/repos/asf/incubator-streams/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-streams/commit/8368755f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-streams/tree/8368755f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-streams/diff/8368755f
Branch: refs/heads/master
Commit: 8368755f414dc96ad126a7e3758a559157756cd1
Parents: a20f01a
Author: Robert Douglas <rd...@w2ogroup.com>
Authored: Wed Nov 19 14:29:45 2014 -0600
Committer: Robert Douglas <rd...@w2ogroup.com>
Committed: Wed Nov 19 14:29:45 2014 -0600
----------------------------------------------------------------------
.../local/counters/StreamsTaskCounterTest.java | 21 +++++++++++---------
.../queues/ThroughputQueueMulitThreadTest.java | 5 ++++-
2 files changed, 16 insertions(+), 10 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/8368755f/streams-runtimes/streams-runtime-local/src/test/java/org/apache/streams/local/counters/StreamsTaskCounterTest.java
----------------------------------------------------------------------
diff --git a/streams-runtimes/streams-runtime-local/src/test/java/org/apache/streams/local/counters/StreamsTaskCounterTest.java b/streams-runtimes/streams-runtime-local/src/test/java/org/apache/streams/local/counters/StreamsTaskCounterTest.java
index da567fe..95fd610 100644
--- a/streams-runtimes/streams-runtime-local/src/test/java/org/apache/streams/local/counters/StreamsTaskCounterTest.java
+++ b/streams-runtimes/streams-runtime-local/src/test/java/org/apache/streams/local/counters/StreamsTaskCounterTest.java
@@ -19,6 +19,7 @@ package org.apache.streams.local.counters;
import com.carrotsearch.randomizedtesting.RandomizedTest;
import com.carrotsearch.randomizedtesting.annotations.Repeat;
+import org.joda.time.DateTime;
import org.junit.After;
import org.junit.Test;
@@ -32,6 +33,8 @@ import java.lang.management.ManagementFactory;
public class StreamsTaskCounterTest extends RandomizedTest {
private static final String MBEAN_ID = "test_id";
+ private static final String STREAM_ID = "test_stream";
+ private static long STREAM_START_TIME = (new DateTime()).getMillis();
/**
* Remove registered mbeans from previous tests
@@ -40,7 +43,7 @@ public class StreamsTaskCounterTest extends RandomizedTest {
@After
public void unregisterMXBean() throws Exception {
try {
- ManagementFactory.getPlatformMBeanServer().unregisterMBean(new ObjectName(String.format(StreamsTaskCounter.NAME_TEMPLATE, MBEAN_ID)));
+ ManagementFactory.getPlatformMBeanServer().unregisterMBean(new ObjectName(String.format(StreamsTaskCounter.NAME_TEMPLATE, MBEAN_ID, STREAM_ID, STREAM_START_TIME)));
} catch (InstanceNotFoundException ife) {
//No-op
}
@@ -52,7 +55,7 @@ public class StreamsTaskCounterTest extends RandomizedTest {
@Test
public void testConstructor() {
try {
- new StreamsTaskCounter(MBEAN_ID, null, -1);
+ new StreamsTaskCounter(MBEAN_ID, STREAM_ID, STREAM_START_TIME);
} catch (Throwable t) {
fail("Constructor threw error : "+t.getMessage());
}
@@ -65,7 +68,7 @@ public class StreamsTaskCounterTest extends RandomizedTest {
@Test
@Repeat(iterations = 3)
public void testEmitted() throws Exception {
- StreamsTaskCounter counter = new StreamsTaskCounter(MBEAN_ID, null, -1);
+ StreamsTaskCounter counter = new StreamsTaskCounter(MBEAN_ID, STREAM_ID, STREAM_START_TIME);
int numIncrements = randomIntBetween(1, 100000);
for(int i=0; i < numIncrements; ++i) {
counter.incrementEmittedCount();
@@ -74,7 +77,7 @@ public class StreamsTaskCounterTest extends RandomizedTest {
unregisterMXBean();
- counter = new StreamsTaskCounter(MBEAN_ID, null, -1);
+ counter = new StreamsTaskCounter(MBEAN_ID, STREAM_ID, STREAM_START_TIME);
numIncrements = randomIntBetween(1, 100000);
long total = 0;
for(int i=0; i < numIncrements; ++i) {
@@ -92,7 +95,7 @@ public class StreamsTaskCounterTest extends RandomizedTest {
@Test
@Repeat(iterations = 3)
public void testReceived() throws Exception {
- StreamsTaskCounter counter = new StreamsTaskCounter(MBEAN_ID, null, -1);
+ StreamsTaskCounter counter = new StreamsTaskCounter(MBEAN_ID, STREAM_ID, STREAM_START_TIME);
int numIncrements = randomIntBetween(1, 100000);
for(int i=0; i < numIncrements; ++i) {
counter.incrementReceivedCount();
@@ -101,7 +104,7 @@ public class StreamsTaskCounterTest extends RandomizedTest {
unregisterMXBean();
- counter = new StreamsTaskCounter(MBEAN_ID, null, -1);
+ counter = new StreamsTaskCounter(MBEAN_ID, STREAM_ID, STREAM_START_TIME);
numIncrements = randomIntBetween(1, 100000);
long total = 0;
for(int i=0; i < numIncrements; ++i) {
@@ -119,7 +122,7 @@ public class StreamsTaskCounterTest extends RandomizedTest {
@Test
@Repeat(iterations = 3)
public void testError() throws Exception {
- StreamsTaskCounter counter = new StreamsTaskCounter(MBEAN_ID, null, -1);
+ StreamsTaskCounter counter = new StreamsTaskCounter(MBEAN_ID, STREAM_ID, STREAM_START_TIME);
int numIncrements = randomIntBetween(1, 100000);
for(int i=0; i < numIncrements; ++i) {
counter.incrementErrorCount();
@@ -128,7 +131,7 @@ public class StreamsTaskCounterTest extends RandomizedTest {
unregisterMXBean();
- counter = new StreamsTaskCounter(MBEAN_ID, null, -1);
+ counter = new StreamsTaskCounter(MBEAN_ID, STREAM_ID, STREAM_START_TIME);
numIncrements = randomIntBetween(1, 100000);
long total = 0;
for(int i=0; i < numIncrements; ++i) {
@@ -146,7 +149,7 @@ public class StreamsTaskCounterTest extends RandomizedTest {
@Test
@Repeat(iterations = 3)
public void testErrorRate() throws Exception {
- StreamsTaskCounter counter = new StreamsTaskCounter(MBEAN_ID, null, -1);
+ StreamsTaskCounter counter = new StreamsTaskCounter(MBEAN_ID, STREAM_ID, STREAM_START_TIME);
assertEquals(0.0, counter.getErrorRate(), 0);
int failures = randomIntBetween(0, 100000);
int received = randomIntBetween(0, 100000);
http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/8368755f/streams-runtimes/streams-runtime-local/src/test/java/org/apache/streams/local/queues/ThroughputQueueMulitThreadTest.java
----------------------------------------------------------------------
diff --git a/streams-runtimes/streams-runtime-local/src/test/java/org/apache/streams/local/queues/ThroughputQueueMulitThreadTest.java b/streams-runtimes/streams-runtime-local/src/test/java/org/apache/streams/local/queues/ThroughputQueueMulitThreadTest.java
index 264a2a0..ccfff3f 100644
--- a/streams-runtimes/streams-runtime-local/src/test/java/org/apache/streams/local/queues/ThroughputQueueMulitThreadTest.java
+++ b/streams-runtimes/streams-runtime-local/src/test/java/org/apache/streams/local/queues/ThroughputQueueMulitThreadTest.java
@@ -20,6 +20,7 @@ package org.apache.streams.local.queues;
import com.carrotsearch.randomizedtesting.RandomizedTest;
import com.carrotsearch.randomizedtesting.annotations.Repeat;
import org.apache.streams.util.ComponentUtils;
+import org.joda.time.DateTime;
import org.junit.After;
import org.junit.Test;
import org.slf4j.Logger;
@@ -37,6 +38,8 @@ public class ThroughputQueueMulitThreadTest extends RandomizedTest {
private final static Logger LOGGER = LoggerFactory.getLogger(ThroughputQueueMulitThreadTest.class);
private static final String MBEAN_ID = "testQueue";
+ private static final String STREAM_ID = "test_stream";
+ private static long STREAM_START_TIME = (new DateTime()).getMillis();
/**
* Remove registered mbeans from previous tests
@@ -45,7 +48,7 @@ public class ThroughputQueueMulitThreadTest extends RandomizedTest {
@After
public void unregisterMXBean() throws Exception {
try {
- ManagementFactory.getPlatformMBeanServer().unregisterMBean(new ObjectName(String.format(ThroughputQueue.NAME_TEMPLATE, MBEAN_ID)));
+ ManagementFactory.getPlatformMBeanServer().unregisterMBean(new ObjectName(String.format(ThroughputQueue.NAME_TEMPLATE, MBEAN_ID, STREAM_ID, STREAM_START_TIME)));
} catch (InstanceNotFoundException ife) {
//No-op
}
[2/2] incubator-streams git commit: Merge commit
'8368755f414dc96ad126a7e3758a559157756cd1'
Posted by sb...@apache.org.
Merge commit '8368755f414dc96ad126a7e3758a559157756cd1'
Project: http://git-wip-us.apache.org/repos/asf/incubator-streams/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-streams/commit/56011e4b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-streams/tree/56011e4b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-streams/diff/56011e4b
Branch: refs/heads/master
Commit: 56011e4b60f12af03af4b5d22e961a77297048ce
Parents: 3400ce2 8368755
Author: sblackmon <sb...@apache.org>
Authored: Wed Nov 19 14:31:59 2014 -0600
Committer: sblackmon <sb...@apache.org>
Committed: Wed Nov 19 14:31:59 2014 -0600
----------------------------------------------------------------------
.../local/counters/StreamsTaskCounterTest.java | 21 +++++++++++---------
.../queues/ThroughputQueueMulitThreadTest.java | 5 ++++-
2 files changed, 16 insertions(+), 10 deletions(-)
----------------------------------------------------------------------