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/12/11 20:32:37 UTC
[2/3] incubator-streams git commit: logging and javadocs
logging and javadocs
Project: http://git-wip-us.apache.org/repos/asf/incubator-streams/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-streams/commit/cc23286d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-streams/tree/cc23286d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-streams/diff/cc23286d
Branch: refs/heads/master
Commit: cc23286da4d266e8d4e5662272915bdc4c899651
Parents: b52e765
Author: sblackmon <sb...@w2odigital.com>
Authored: Mon Dec 1 16:33:54 2014 -0600
Committer: sblackmon <sb...@w2odigital.com>
Committed: Mon Dec 1 16:33:54 2014 -0600
----------------------------------------------------------------------
.../streams/converter/TypeConverterUtil.java | 3 ++-
.../test/TypeConverterProcessorTest.java | 20 +++++++++++++++++++-
2 files changed, 21 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/cc23286d/streams-components/streams-converters/src/main/java/org/apache/streams/converter/TypeConverterUtil.java
----------------------------------------------------------------------
diff --git a/streams-components/streams-converters/src/main/java/org/apache/streams/converter/TypeConverterUtil.java b/streams-components/streams-converters/src/main/java/org/apache/streams/converter/TypeConverterUtil.java
index 2ff463b..e8ce48b 100644
--- a/streams-components/streams-converters/src/main/java/org/apache/streams/converter/TypeConverterUtil.java
+++ b/streams-components/streams-converters/src/main/java/org/apache/streams/converter/TypeConverterUtil.java
@@ -27,7 +27,8 @@ public class TypeConverterUtil {
try {
node = mapper.readValue((String)object, ObjectNode.class);
} catch (IOException e) {
- e.printStackTrace();
+ LOGGER.warn(e.getMessage());
+ LOGGER.warn(object.toString());
}
} else {
node = mapper.convertValue(object, ObjectNode.class);
http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/cc23286d/streams-components/streams-converters/src/test/java/org/apache/streams/converter/test/TypeConverterProcessorTest.java
----------------------------------------------------------------------
diff --git a/streams-components/streams-converters/src/test/java/org/apache/streams/converter/test/TypeConverterProcessorTest.java b/streams-components/streams-converters/src/test/java/org/apache/streams/converter/test/TypeConverterProcessorTest.java
index aa7df36..0abc23e 100644
--- a/streams-components/streams-converters/src/test/java/org/apache/streams/converter/test/TypeConverterProcessorTest.java
+++ b/streams-components/streams-converters/src/test/java/org/apache/streams/converter/test/TypeConverterProcessorTest.java
@@ -35,7 +35,7 @@ import java.util.List;
import static junit.framework.Assert.*;
/**
- * Test for
+ * Tests for
* @see {@link org.apache.streams.converter.TypeConverterProcessor}
*/
public class TypeConverterProcessorTest {
@@ -46,6 +46,9 @@ public class TypeConverterProcessorTest {
public static final String DATASIFT_FORMAT = "EEE, dd MMM yyyy HH:mm:ss Z";
+ /**
+ * Tests conversion from String to String
+ */
@Test
public void testTypeConverterStringToString() {
final String ID = "1";
@@ -62,6 +65,9 @@ public class TypeConverterProcessorTest {
assertEquals(ID, resultDatum.getId());
}
+ /**
+ * Tests conversion from String to ObjectNode
+ */
@Test
public void testTypeConverterStringToObjectNode() {
final String ID = "1";
@@ -78,6 +84,9 @@ public class TypeConverterProcessorTest {
assertEquals(ID, resultDatum.getId());
}
+ /**
+ * Tests conversion from ObjectNode to String
+ */
@Test
public void testTypeConverterObjectNodeToString() throws IOException {
final String ID = "1";
@@ -96,6 +105,9 @@ public class TypeConverterProcessorTest {
assertEquals(ID, resultDatum.getId());
}
+ /**
+ * Tests conversion from String to POJO (Activity)
+ */
@Test
public void testTypeConverterStringToActivity() {
final String ID = "1";
@@ -113,6 +125,9 @@ public class TypeConverterProcessorTest {
assertEquals(ID, resultDatum.getId());
}
+ /**
+ * Tests conversion from ObjectNode to POJO (Activity)
+ */
@Test
public void testTypeConverterObjectNodeToActivity() throws IOException {
final String ID = "1";
@@ -132,6 +147,9 @@ public class TypeConverterProcessorTest {
assertEquals(ID, resultDatum.getId());
}
+ /**
+ * Tests conversion from POJO (Activity) to String
+ */
@Test
public void testTypeConverterActivityToString() throws IOException {
final String ID = "1";