streams-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sblack...@apache.org
Subject svn commit: r1556893 [4/25] - in /incubator/streams/branches/sblackmon: ./ streams-config-graph/ streams-config-graph/src/ streams-config-graph/src/main/ streams-config-graph/src/main/java/ streams-config-graph/src/main/java/org/ streams-config-graph/s...
Date Thu, 09 Jan 2014 17:27:58 GMT
Added: incubator/streams/branches/sblackmon/streams-contrib/streams-provider-facebook/pom.xml
URL: http://svn.apache.org/viewvc/incubator/streams/branches/sblackmon/streams-contrib/streams-provider-facebook/pom.xml?rev=1556893&view=auto
==============================================================================
--- incubator/streams/branches/sblackmon/streams-contrib/streams-provider-facebook/pom.xml (added)
+++ incubator/streams/branches/sblackmon/streams-contrib/streams-provider-facebook/pom.xml Thu Jan  9 17:27:50 2014
@@ -0,0 +1,126 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>streams-contrib</artifactId>
+        <groupId>org.apache.streams</groupId>
+        <version>0.1-SNAPSHOT</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+    <artifactId>streams-provider-facebook</artifactId>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.streams</groupId>
+            <artifactId>streams-pojo</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>com.fasterxml.jackson.core</groupId>
+            <artifactId>jackson-core</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>commons-io</groupId>
+            <artifactId>commons-io</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.hamcrest</groupId>
+            <artifactId>hamcrest-core</artifactId>
+            <version>1.3</version>
+        </dependency>
+
+        <dependency>
+            <groupId>com.google.guava</groupId>
+            <artifactId>guava</artifactId>
+        </dependency>
+
+    </dependencies>
+
+    <build>
+        <sourceDirectory>src/main/java</sourceDirectory>
+        <testSourceDirectory>src/test/java</testSourceDirectory>
+        <resources>
+            <resource>
+                <directory>src/main/resources</directory>
+            </resource>
+        </resources>
+        <testResources>
+            <testResource>
+                <directory>src/test/resources</directory>
+            </testResource>
+        </testResources>
+        <plugins>
+            <plugin>
+                <groupId>org.codehaus.mojo</groupId>
+                <artifactId>build-helper-maven-plugin</artifactId>
+                <version>1.8</version>
+                <executions>
+                    <execution>
+                        <id>add-source</id>
+                        <phase>generate-sources</phase>
+                        <goals>
+                            <goal>add-source</goal>
+                        </goals>
+                        <configuration>
+                            <sources>
+                                <source>target/generated-sources/jsonschema2pojo</source>
+                            </sources>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>org.jsonschema2pojo</groupId>
+                <artifactId>jsonschema2pojo-maven-plugin</artifactId>
+                <configuration>
+                    <addCompileSourceRoot>true</addCompileSourceRoot>
+                    <generateBuilders>true</generateBuilders>
+                    <sourcePaths>
+                        <sourcePath>src/main/jsonschema/com/facebook/graph</sourcePath>
+                    </sourcePaths>
+                    <outputDirectory>target/generated-sources/jsonschema2pojo</outputDirectory>
+                    <targetPackage>com.facebook</targetPackage>
+                    <useLongIntegers>true</useLongIntegers>
+                    <useJodaDates>false</useJodaDates>
+                </configuration>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>generate</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>org.jvnet.jaxb2.maven2</groupId>
+                <artifactId>maven-jaxb2-plugin</artifactId>
+                <version>0.8.3</version>
+                <configuration>
+                    <schemaDirectory>../streams-provider-gnip/gnip-powertrack/src/main/xmlschema/</schemaDirectory>
+                    <generateDirectory>target/generated-sources/jaxb2</generateDirectory>
+                    <verbose>true</verbose>
+                    <debug>true</debug>
+                    <encoding>${project.build.sourceEncoding}</encoding>
+                    <forceRegenerate>true</forceRegenerate>
+                    <removeOldOutput>false</removeOldOutput>
+                    <generatePackage>org.apache.streams.pojo.xml</generatePackage>
+                </configuration>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>generate</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+</project>

Added: incubator/streams/branches/sblackmon/streams-contrib/streams-provider-facebook/src/main/java/com/facebook/api/FacebookPostActivitySerializer.java
URL: http://svn.apache.org/viewvc/incubator/streams/branches/sblackmon/streams-contrib/streams-provider-facebook/src/main/java/com/facebook/api/FacebookPostActivitySerializer.java?rev=1556893&view=auto
==============================================================================
--- incubator/streams/branches/sblackmon/streams-contrib/streams-provider-facebook/src/main/java/com/facebook/api/FacebookPostActivitySerializer.java (added)
+++ incubator/streams/branches/sblackmon/streams-contrib/streams-provider-facebook/src/main/java/com/facebook/api/FacebookPostActivitySerializer.java Thu Jan  9 17:27:50 2014
@@ -0,0 +1,294 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package com.facebook.api;
+
+
+import com.fasterxml.jackson.databind.JsonNode;
+import org.apache.commons.lang.NotImplementedException;
+import org.apache.streams.data.ActivitySerializer;
+import org.apache.streams.pojo.json.*;
+import org.joda.time.DateTime;
+
+import java.text.DateFormat;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.*;
+
+import static org.apache.streams.data.util.ActivityUtil.*;
+import static org.apache.streams.data.util.JsonUtil.jsonToJsonNode;
+
+/**
+ * Serializes activity posts
+ */
+public class FacebookPostActivitySerializer implements ActivitySerializer {
+
+    public static final String DATE_FORMAT = "yyyy-MM-dd'T'HH:mm:ssZ";
+    public static final String PROVIDER_NAME = "facebook";
+
+    @Override
+    public String serializationFormat() {
+        return "facebook_post_json_v1";
+    }
+
+    @Override
+    public String serialize(Activity deserialized) {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public Activity deserialize(String serialized) {
+        //Deserialize the JSON string into a Jackson JsonNode
+        JsonNode node = jsonToJsonNode(serialized);
+        Map.Entry<String, JsonNode> field = getObjectType(node);
+        Activity activity = new Activity();
+        setProvider(activity);
+        setObjectType(field, activity);
+        parseObject(activity, field.getValue());
+        fixObjectId(activity);
+        fixContentFromSummary(activity);
+        return activity;
+    }
+
+    @Override
+    public List<Activity> deserializeAll(String serializedList) {
+        //TODO Support
+        throw new NotImplementedException("Not currently supported by this deserializer");
+    }
+
+    private void fixContentFromSummary(Activity activity) {
+        //we MUST have a content field set, so choose the best option
+        if(activity.getContent() == null) {
+            activity.setContent(activity.getAdditionalProperties().containsKey("summary") ?
+                    (String) activity.getAdditionalProperties().get("summary") :
+                    activity.getObject().getSummary());
+        }
+    }
+
+    private void fixObjectId(Activity activity) {
+        //An artifact of schema generation, the default value is {link}
+        if(activity.getObject().getId().equals("{link}")) {
+            activity.getObject().setId(null);
+        }
+    }
+
+    private void setObjectType(Map.Entry<String, JsonNode> field, Activity activity) {
+        ActivityObject object = new ActivityObject();
+        activity.setObject(object);
+        object.setObjectType(field.getKey());
+    }
+
+    private void setProvider(Activity activity) {
+        Provider provider = new Provider();
+        provider.setId(getProviderId(PROVIDER_NAME));
+        provider.setDisplayName(PROVIDER_NAME);
+        activity.setProvider(provider);
+    }
+
+    private Map.Entry<String, JsonNode> getObjectType(JsonNode node) {
+        Iterator<Map.Entry<String, JsonNode>> fields = node.fields();
+        ensureMoreFields(fields);
+        Map.Entry<String, JsonNode> field = fields.next();
+        ensureNoMoreFields(fields);
+        return field;
+    }
+
+    private void parseObject(Activity activity, JsonNode jsonNode) {
+        for(Iterator<Map.Entry<String, JsonNode>> fields = jsonNode.fields(); fields.hasNext();) {
+            Map.Entry<String, JsonNode> field = fields.next();
+            String key = field.getKey();
+            JsonNode value = field.getValue();
+            mapField(activity, key, value);
+        }
+    }
+
+    private void mapField(Activity activity, String name, JsonNode value) {
+        if("application".equals(name)) {
+            addGenerator(activity, value);
+        } else if ("caption".equals(name)) {
+            addSummary(activity, value);
+        } else if ("comments".equals(name)) {
+            addAttachments(activity, value);
+        } else if ("created_time".equals(name)) {
+            addDate(activity, value);
+        } else if ("description".equals(name)) {
+            addObjectSummary(activity, value);
+        } else if ("from".equals(name)) {
+            addActor(activity, value);
+        } else if ("icon".equals(name)) {
+            addIcon(activity, value);
+        } else if ("id".equals(name)) {
+            addId(activity, value);
+        } else if ("is_hidden".equals(name)) {
+            addObjectHiddenExtension(activity, value);
+        } else if ("like_count".equals(name)) {
+            addLikeExtension(activity, value);
+        } else if ("link".equals(name)) {
+            addObjectLink(activity, value);
+        } else if ("message".equals(name)) {
+            activity.setContent(value.asText());
+        } else if ("name".equals(name)) {
+            addObjectName(activity, value);
+        } else if ("object_id".equals(name)) {
+            addObjectId(activity, value);
+        } else if ("picture".equals(name)) {
+            addObjectImage(activity, value);
+        } else if ("place".equals(name)) {
+            addLocationExtension(activity, value);
+        } else if ("shares".equals(name)) {
+            addRebroadcastExtension(activity, value);
+        } else if ("source".equals(name)) {
+            addObjectLink(activity, value);
+        } else if ("story".equals(name)) {
+            addTitle(activity, value);
+        }  else if ("updated_time".equals(name)) {
+            addObjectUpdated(activity, value);
+        }
+    }
+
+    private void addObjectUpdated(Activity activity, JsonNode value) {
+        activity.getObject().setUpdated(parseDate(value));
+    }
+
+    private void addSummary(Activity activity, JsonNode value) {
+        activity.setAdditionalProperty("summary", value.asText());
+    }
+
+    private void addTitle(Activity activity, JsonNode value) {
+        activity.setTitle(value.asText());
+    }
+
+    private void addLikeExtension(Activity activity, JsonNode value) {
+        Map<String, Object> extensions = ensureExtensions(activity);
+        extensions.put(LIKES_EXTENSION, value.asInt());
+    }
+
+    private void addLocationExtension(Activity activity, JsonNode value) {
+        Map<String, Object> extensions = ensureExtensions(activity);
+        if(value.has("location")) {
+            Map<String, Object> location = new HashMap<String, Object>();
+            JsonNode fbLocation = value.get("location");
+            if(fbLocation.has("country")) {
+                location.put(LOCATION_EXTENSION_COUNTRY, fbLocation.get("country"));
+            }
+            if(fbLocation.has("latitude") && fbLocation.has("longitude")) {
+                location.put(LOCATION_EXTENSION_COORDINATES, String.format("%s,%s", fbLocation.get("longitude"), fbLocation.get("latitude")));
+            }
+            extensions.put(LOCATION_EXTENSION, location);
+        }
+    }
+
+    private void addObjectImage(Activity activity, JsonNode value) {
+        Image image = new Image();
+        image.setUrl(value.asText());
+        activity.getObject().setImage(image);
+    }
+
+    private void addObjectId(Activity activity, JsonNode value) {
+        activity.getObject().setId(getObjectId("facebook", activity.getObject().getObjectType(), value.asText()));
+    }
+
+    private void addObjectName(Activity activity, JsonNode value) {
+        activity.getObject().setDisplayName(value.asText());
+    }
+
+    private void addId(Activity activity, JsonNode value) {
+        activity.setId(getActivityId(PROVIDER_NAME, value.asText()));
+    }
+
+    private void addObjectLink(Activity activity, JsonNode value) {
+        activity.getObject().setUrl(value.asText());
+    }
+
+    private void addRebroadcastExtension(Activity activity, JsonNode value) {
+        Map<String, Object> extensions = ensureExtensions(activity);
+        if(value.has("count")) {
+            extensions.put(REBROADCAST_EXTENSION, value.get("count").asInt());
+        }
+    }
+
+    private void addObjectHiddenExtension(Activity activity, JsonNode value) {
+        Map<String, Object> extensions = ensureExtensions(activity);
+        extensions.put("hidden", value.asBoolean());
+    }
+
+    private void addIcon(Activity activity, JsonNode value) {
+        Icon icon = new Icon();
+        //Apparently the Icon didn't map from the schema very well
+        icon.setAdditionalProperty("url", value.asText());
+        activity.setIcon(icon);
+    }
+
+    private void addActor(Activity activity, JsonNode value) {
+        Actor actor = new Actor();
+        if(value.has("name")) {
+            actor.setDisplayName(value.get("name").asText());
+        }
+        if(value.has("id")) {
+            actor.setId(getPersonId(PROVIDER_NAME, value.get("id").asText()));
+        }
+        activity.setActor(actor);
+    }
+
+    private void addObjectSummary(Activity activity, JsonNode value) {
+        activity.getObject().setSummary(value.asText());
+    }
+
+    private void addDate(Activity activity, JsonNode value) {
+        activity.setPublished(parseDate(value));
+    }
+
+    private void addGenerator(Activity activity, JsonNode value) {
+        Generator generator = new Generator();
+        if(value.has("id")) {
+            generator.setId(getObjectId(PROVIDER_NAME, "generator", value.get("id").asText()));
+        }
+        if(value.has("name")) {
+            generator.setDisplayName(value.get("name").asText());
+        }
+        if(value.has("namespace")) {
+            generator.setSummary(value.get("namespace").asText());
+        }
+        activity.setGenerator(generator);
+    }
+
+    private void addAttachments(Activity activity, JsonNode value) {
+        //No direct mapping at this time
+    }
+
+    private static void ensureMoreFields(Iterator<Map.Entry<String, JsonNode>> fields) {
+        if(!fields.hasNext()) {
+            throw new IllegalStateException("Facebook activity must have one and only one root element");
+        }
+    }
+    private static void ensureNoMoreFields(Iterator<Map.Entry<String, JsonNode>> fields) {
+        if(fields.hasNext()) {
+            throw new IllegalStateException("Facebook activity must have one and only one root element");
+        }
+    }
+
+    private static Date parseDate(JsonNode value) {
+        DateFormat fmt = new SimpleDateFormat(DATE_FORMAT);
+        try {
+            return
+                    fmt.parse(value.asText());
+        } catch (ParseException e) {
+            throw new RuntimeException("Unable to parse date " + value.asText());
+        }
+    }
+}

Added: incubator/streams/branches/sblackmon/streams-contrib/streams-provider-facebook/src/main/java/com/facebook/feed/FacebookPublicFeedXmlActivitySerializer.java
URL: http://svn.apache.org/viewvc/incubator/streams/branches/sblackmon/streams-contrib/streams-provider-facebook/src/main/java/com/facebook/feed/FacebookPublicFeedXmlActivitySerializer.java?rev=1556893&view=auto
==============================================================================
--- incubator/streams/branches/sblackmon/streams-contrib/streams-provider-facebook/src/main/java/com/facebook/feed/FacebookPublicFeedXmlActivitySerializer.java (added)
+++ incubator/streams/branches/sblackmon/streams-contrib/streams-provider-facebook/src/main/java/com/facebook/feed/FacebookPublicFeedXmlActivitySerializer.java Thu Jan  9 17:27:50 2014
@@ -0,0 +1,11 @@
+package com.facebook.feed;
+
+/**
+ * Created with IntelliJ IDEA.
+ * User: sblackmon
+ * Date: 10/2/13
+ * Time: 6:32 PM
+ * To change this template use File | Settings | File Templates.
+ */
+public class FacebookPublicFeedXmlActivitySerializer {
+}

Added: incubator/streams/branches/sblackmon/streams-contrib/streams-provider-facebook/src/main/jsonschema/com/facebook/graph/Post.json
URL: http://svn.apache.org/viewvc/incubator/streams/branches/sblackmon/streams-contrib/streams-provider-facebook/src/main/jsonschema/com/facebook/graph/Post.json?rev=1556893&view=auto
==============================================================================
--- incubator/streams/branches/sblackmon/streams-contrib/streams-provider-facebook/src/main/jsonschema/com/facebook/graph/Post.json (added)
+++ incubator/streams/branches/sblackmon/streams-contrib/streams-provider-facebook/src/main/jsonschema/com/facebook/graph/Post.json Thu Jan  9 17:27:50 2014
@@ -0,0 +1,192 @@
+{
+    "type": "object",
+    "$schema": "http://json-schema.org/draft-03/schema",
+    "id": "#",
+    "javaType": "com.facebook.Post",
+    "properties": {
+        "id": {
+            "type": "string"
+        },
+        "from": {
+            "type": "object",
+            "properties": {
+                "id": {
+                    "type": "string"
+                },
+                "name": {
+                    "type": "string"
+                }
+            }
+        },
+        "to": {
+            "type": "object",
+            "properties": {
+                "data": {
+                    "type": "array",
+                    "items": {
+                        "type": "object",
+                        "properties": {
+                            "id": {
+                                "type": "string"
+                            },
+                            "name": {
+                                "type": "string"
+                            }
+                        }
+                    }
+                }
+            }
+        },
+        "message": {
+            "type": "string"
+        },
+        "message_tags": {
+            "type": "object",
+            "properties": {
+                "data": {
+                    "type": "array",
+                    "items": {
+                        "type": "object",
+                        "properties": {
+                            "id": {
+                                "type": "string"
+                            },
+                            "name": {
+                                "type": "string"
+                            }
+                        }
+                    }
+                }
+            }
+        },
+        "picture": {
+            "type": "string"
+        },
+        "link": {
+            "type": "string"
+        },
+        "name": {
+            "type": "string"
+        },
+        "caption": {
+            "type": "boolean"
+        },
+        "description": {
+            "type": "string"
+        },
+        "source": {
+            "type": "string"
+        },
+        "icon": {
+            "type": "string"
+        },
+        "actions": {
+            "type": "array",
+            "items": {
+                "type": "object",
+                "properties": {
+                    "name": {
+                        "type": "string"
+                    },
+                    "link": {
+                        "type": "string"
+                    }
+                }
+            }
+        },
+        "comments": {
+            "type": "array",
+            "items": {
+                "type": "object",
+                "properties": {
+                    "id": {
+                        "type": "string"
+                    },
+                    "from": {
+                        "type": "string"
+                    },
+                    "message": {
+                        "type": "string"
+                    },
+                    "created_time": {
+                        "type": "string"
+                    }
+                }
+            }
+        },
+        "likes": {
+            "type": "array",
+            "items": {
+                "type": "object",
+                "properties": {
+                    "name": {
+                        "type": "string"
+                    },
+                    "link": {
+                        "type": "string"
+                    }
+                }
+            }
+        },
+        "type": {
+            "type": "string"
+        },
+        "place": {
+            "type": "object",
+            "properties": {
+                "name": {
+                    "type": "string"
+                },
+                "id": {
+                    "type": "string"
+                }
+            }
+        },
+        "story": {
+            "type": "string"
+        },
+        "shares": {
+            "type": "int"
+        },
+        "object_id": {
+            "type": "int"
+        },
+        "application": {
+            "type": "object",
+            "properties": {
+                "name": {
+                    "type": "string"
+                },
+                "id": {
+                    "type": "string"
+                }
+            }
+        },
+        "created_time": {
+            "type": "string"
+        },
+        "updated_time": {
+            "type": "string"
+        },
+        "include_hidden": {
+            "type": "boolean"
+        },
+        "status_type": {
+            "type": "string"
+        },
+        "properties": {
+            "type": "array",
+            "items": {
+                "type": "object",
+                "properties": {
+                    "name": {
+                        "type": "string"
+                    },
+                    "text": {
+                        "type": "string"
+                    }
+                }
+            }
+        }
+    }
+}
\ No newline at end of file

Added: incubator/streams/branches/sblackmon/streams-contrib/streams-provider-facebook/src/test/java/org/apache/streams/facebook/test/FacebookPostActivitySerializerTest.java
URL: http://svn.apache.org/viewvc/incubator/streams/branches/sblackmon/streams-contrib/streams-provider-facebook/src/test/java/org/apache/streams/facebook/test/FacebookPostActivitySerializerTest.java?rev=1556893&view=auto
==============================================================================
--- incubator/streams/branches/sblackmon/streams-contrib/streams-provider-facebook/src/test/java/org/apache/streams/facebook/test/FacebookPostActivitySerializerTest.java (added)
+++ incubator/streams/branches/sblackmon/streams-contrib/streams-provider-facebook/src/test/java/org/apache/streams/facebook/test/FacebookPostActivitySerializerTest.java Thu Jan  9 17:27:50 2014
@@ -0,0 +1,214 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.streams.facebook.test;
+
+import com.facebook.api.FacebookPostActivitySerializer;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.DeserializationFeature;
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import org.apache.streams.data.ActivitySerializer;
+import org.apache.streams.data.util.JsonUtil;
+import org.apache.streams.pojo.json.Activity;
+import org.junit.Before;
+import org.junit.Test;
+
+import java.io.IOException;
+import java.util.*;
+import java.util.regex.Pattern;
+
+import static java.util.regex.Pattern.matches;
+import static org.hamcrest.CoreMatchers.*;
+import static org.junit.Assert.assertThat;
+
+public class FacebookPostActivitySerializerTest {
+    Node fields;
+    JsonNode json;
+    ActivitySerializer serializer = new FacebookPostActivitySerializer();
+    ObjectMapper mapper;
+
+    @Before
+    public void setup() throws IOException {
+        json = JsonUtil.getFromFile("classpath:org/apache/streams/data/Facebook.json");
+        fields = discover(json);
+
+        mapper = new ObjectMapper();
+        mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, Boolean.FALSE);
+        mapper.configure(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY, Boolean.TRUE);
+        mapper.configure(DeserializationFeature.ACCEPT_EMPTY_STRING_AS_NULL_OBJECT, Boolean.TRUE);
+    }
+
+    @Test
+    public void loadData() throws Exception {
+        for (JsonNode item : json) {
+            Activity activity = serializer.deserialize(getString(item));
+            assertThat(activity, is(not(nullValue())));
+            assertThat(activity.getActor(), is(not(nullValue())));
+            assertThat(matches("id:facebook:people:[a-zA-Z0-9]*", activity.getActor().getId()), is(true));
+            assertThat(activity.getActor().getDisplayName(), is(not(nullValue())));
+            assertThat(activity.getObject(), is(not(nullValue())));
+            if(activity.getObject().getId() != null) {
+                assertThat(matches("id:facebook:[a-z]*s:[a-zA-Z0-9]*", activity.getObject().getId()), is(true));
+            }
+            assertThat(activity.getObject().getObjectType(), is(not(nullValue())));
+            assertThat(activity.getContent(), is(not(nullValue())));
+            assertThat(activity.getProvider().getId(), is(equalTo("id:providers:facebook")));
+            System.out.println(activity.getPublished());
+        }
+    }
+
+
+
+
+    public Node discover(JsonNode node) {
+        Node root = new Node(null, "root");
+        if (node == null || !node.isArray()) {
+            throw new RuntimeException("No data");
+        } else {
+            for (JsonNode item : node) {
+                mapNode(root, item);
+            }
+        }
+        //printTree(root, "");
+        //printUniqueFields(root);
+        return root;
+    }
+
+
+    private String getString(JsonNode jsonNode)  {
+        try {
+            return new ObjectMapper().writeValueAsString(jsonNode);
+        } catch (JsonProcessingException e) {
+            throw new RuntimeException(e);
+        }
+    }
+    private void printUniqueFields(Node root) {
+        Map<String, Set<String>> fieldsByType = new HashMap<String, Set<String>>();
+        fieldsByType.put("objectType", new HashSet<String>());
+        for(Node child : root.getChildren().values()) {
+           for(Node grandChild : child.getChildren().values()) {
+               fieldsByType.get("objectType").add(grandChild.getName());
+               addUniqueValues(grandChild, fieldsByType);
+           }
+        }
+        for(Map.Entry<String, Set<String>> entry : fieldsByType.entrySet()) {
+            System.out.println(entry.getKey());
+            List<String> value = new ArrayList<String>(entry.getValue());
+            Collections.sort(value);
+            for(String val : value) {
+                System.out.println("      " + val);
+            }
+            System.out.println();
+            System.out.println();
+        }
+    }
+
+    private void addUniqueValues(Node child, Map<String, Set<String>> fieldsByType) {
+        if(!fieldsByType.containsKey(child.getName()) && !isNumber(child.getName())) {
+            fieldsByType.put(child.getName(), new HashSet<String>());
+        }
+        for(Map.Entry<String, Node> gc : child.getChildren().entrySet()) {
+            if(!isNumber(gc.getKey()))
+                fieldsByType.get(child.getName()).add(gc.getKey());
+            addUniqueValues(gc.getValue(), fieldsByType);
+        }
+    }
+
+    private boolean isNumber(String key) {
+        Pattern p = Pattern.compile("[0-9]*");
+        return p.matcher(key.trim()).matches();
+    }
+
+    private void printTree(Node node, String spacer) {
+        System.out.println(String.format("%s %s (%s)", spacer, node.getName(), node.getType()));
+        List<Node> children = new ArrayList<Node>(node.getChildren().values());
+        Collections.sort(children);
+        for(Node child : children) {
+            printTree(child, spacer + "      ");
+        }
+    }
+
+    private void mapNode(Node parent, JsonNode jsonNode) {
+        for (Iterator<Map.Entry<String, JsonNode>> iter = jsonNode.fields(); iter.hasNext(); ) {
+            Map.Entry<String, JsonNode> property = iter.next();
+            Node current;
+            String key = property.getKey();
+            JsonNode value = property.getValue();
+            if (!parent.getChildren().containsKey(key)) {
+                current = new Node(null, key);
+                current.setType(value.getNodeType().toString());
+                parent.getChildren().put(key, current);
+            } else {
+                current = parent.getChildren().get(key);
+            }
+            if(!value.isArray() && value.isObject()){
+                mapNode(current, value);
+            }
+        }
+    }
+
+    private static class Node implements Comparable<Node>{
+        Node parent;
+        String name;
+        String type;
+        Map<String, Node> children = new HashMap<String, Node>();
+
+        private Node(Node parent, String name) {
+            this.parent = parent;
+            this.name = name;
+        }
+
+        private Node getParent() {
+            return parent;
+        }
+
+        private void setParent(Node parent) {
+            this.parent = parent;
+        }
+
+        private String getName() {
+            return name;
+        }
+
+        private void setName(String name) {
+            this.name = name;
+        }
+
+        private Map<String, Node> getChildren() {
+            return children;
+        }
+
+        private void setChildren(Map<String, Node> children) {
+            this.children = children;
+        }
+
+        private String getType() {
+            return type;
+        }
+
+        private void setType(String type) {
+            this.type = type;
+        }
+
+        @Override
+        public int compareTo(Node node) {
+            return this.name.compareTo(node.name);
+        }
+    }
+
+}

Added: incubator/streams/branches/sblackmon/streams-contrib/streams-provider-facebook/src/test/java/org/apache/streams/facebook/test/FacebookPostSerDeTest.java
URL: http://svn.apache.org/viewvc/incubator/streams/branches/sblackmon/streams-contrib/streams-provider-facebook/src/test/java/org/apache/streams/facebook/test/FacebookPostSerDeTest.java?rev=1556893&view=auto
==============================================================================
--- incubator/streams/branches/sblackmon/streams-contrib/streams-provider-facebook/src/test/java/org/apache/streams/facebook/test/FacebookPostSerDeTest.java (added)
+++ incubator/streams/branches/sblackmon/streams-contrib/streams-provider-facebook/src/test/java/org/apache/streams/facebook/test/FacebookPostSerDeTest.java Thu Jan  9 17:27:50 2014
@@ -0,0 +1,65 @@
+package org.apache.streams.facebook.test;
+
+import com.fasterxml.jackson.databind.DeserializationFeature;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.google.common.base.Joiner;
+import org.apache.commons.io.IOUtils;
+import org.apache.commons.io.input.BoundedInputStream;
+import com.facebook.Post;
+import org.junit.Assert;
+import org.junit.Test;
+import org.junit.Ignore;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.InputStream;
+
+/**
+* Created with IntelliJ IDEA.
+* User: sblackmon
+* Date: 8/20/13
+* Time: 5:57 PM
+* To change this template use File | Settings | File Templates.
+*/
+public class FacebookPostSerDeTest {
+
+    private final static Logger LOGGER = LoggerFactory.getLogger(FacebookPostSerDeTest.class);
+    //private ActivitySerializer serializer = new TwitterJsonActivitySerializer();
+    private ObjectMapper mapper = new ObjectMapper();
+
+    @Ignore
+    @Test
+    public void Tests()
+    {
+        mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, Boolean.TRUE);
+        mapper.configure(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY, Boolean.TRUE);
+        mapper.configure(DeserializationFeature.ACCEPT_EMPTY_STRING_AS_NULL_OBJECT, Boolean.TRUE);
+
+        InputStream is = FacebookPostSerDeTest.class.getResourceAsStream("/testpost.json");
+        Joiner joiner = Joiner.on(" ").skipNulls();
+        is = new BoundedInputStream(is, 10000);
+        String json;
+
+        try {
+            json = joiner.join(IOUtils.readLines(is));
+            LOGGER.debug(json);
+
+            Post ser = mapper.readValue(json, Post.class);
+
+            String de = mapper.writeValueAsString(ser);
+
+            LOGGER.debug(de);
+
+            Post serde = mapper.readValue(de, Post.class);
+
+            Assert.assertEquals(ser, serde);
+
+            LOGGER.debug(mapper.writeValueAsString(serde));
+
+        } catch( Exception e ) {
+            System.out.println(e);
+            e.printStackTrace();
+            Assert.fail();
+        }
+    }
+}

Added: incubator/streams/branches/sblackmon/streams-contrib/streams-provider-facebook/src/test/resources/org/apache/streams/data/Facebook.json
URL: http://svn.apache.org/viewvc/incubator/streams/branches/sblackmon/streams-contrib/streams-provider-facebook/src/test/resources/org/apache/streams/data/Facebook.json?rev=1556893&view=auto
==============================================================================
--- incubator/streams/branches/sblackmon/streams-contrib/streams-provider-facebook/src/test/resources/org/apache/streams/data/Facebook.json (added)
+++ incubator/streams/branches/sblackmon/streams-contrib/streams-provider-facebook/src/test/resources/org/apache/streams/data/Facebook.json Thu Jan  9 17:27:50 2014
@@ -0,0 +1,251 @@
+[{"note":{"from":{"name":"Lauren Kay Bruce","id":"1795508919"},"application":{"name":"Facebook for iPhone","namespace":"fbiphone","id":"6628568379"},"id":"1795508919_4602522719840","created_time":"2013-08-27T23:36:39+0000","type":"status","updated_time":"2013-08-28T00:40:42+0000","privacy":{"value":""},"message":"Can Axe please make a deodorant for her, now."}},
+{"comment":{"like_count":0,"user_likes":false,"can_remove":false,"from":{"name":"Emmanuel Fernandez Garnica","id":"100000114951549"},"id":"603849322999439_5966940","created_time":"2013-08-28T00:48:32+0000","message":"Que linea para delgada jaja"}},
+{"note":{"from":{"name":"Tevri Bagus P","id":"100002109812180"},"application":{"name":"Facebook for Every Phone","id":"139682082719810"},"id":"100002109812180_519296974817292","created_time":"2013-08-28T00:29:32+0000","type":"status","updated_time":"2013-08-28T00:29:32+0000","privacy":{"value":""},"message":"Yang ax btuh cnta mu seperti cnta ax yg besar buat kamu,\nyang ax syang mu seperti rsa syang ax buat kamu yg tulus,,\nax ga btuh yg lain selain itu doank,,"}},
+{"note":{"comments":{"data":[{"like_count":7,"user_likes":false,"can_remove":false,"from":{"name":"Patrik PipoPupy Tre?o","id":"100000141145825"},"id":"578610008862349_92416511","created_time":"2013-08-28T00:07:12+0000","message":"Uz ma zacinate jebat ...."},{"like_count":1,"user_likes":false,"can_remove":false,"from":{"name":"Duc Anh Le","id":"100004707488552"},"id":"578610008862349_92416523","created_time":"2013-08-28T00:11:33+0000","message":"J� bych toho Balea u? pustil k vod? ..."},{"like_count":0,"user_likes":false,"can_remove":false,"from":{"name":"Luko Eles","id":"100004483267342"},"id":"578610008862349_92416559","created_time":"2013-08-28T00:26:02+0000","message":"T�to spr�va je 2 dni star� :D :D"},{"like_count":0,"user_likes":false,"can_remove":false,"from":{"name":"David Doktor","id":"100000140869004"},"id":"578610008862349_92416547","created_time":"2013-08-28T00:21:38+0000","message":"Kde berete tyhle zpr�vy?"},{"like_count":0,"user_likes":false,
 "can_remove":false,"from":{"name":"Ondra's Berryss�n","id":"100004401523860"},"id":"578610008862349_92416556","created_time":"2013-08-28T00:25:05+0000","message":"Kone?n? snad!! :)"}],"paging":{"cursors":{"after":"MQ==","before":"NQ=="}}},"from":{"name":"Real-madrid.cz (Official)","category":"Website","id":"165574650165889"},"id":"165574650165889_578610008862349","created_time":"2013-08-28T00:05:51+0000","type":"status","updated_time":"2013-08-28T00:28:55+0000","privacy":{"value":""},"message":"Nejnov?j?� zpr�vy (Sky Sports Italia): Bale p?ijde za 87 milion? eur, Ronaldo z?stane nejdra??� v historii. Uvid�me, uvid�me. Bylo u? t� s�gy dost.","likes":{"data":[{"name":"Luciferus Milanovi?","id":"1423483222"},{"name":"Miroslav ?mok","id":"100000821972410"},{"name":"Denis Pichler","id":"100000222507112"},{"name":"Radek Han�k","id":"1231293572"},{"name":"Lukas Filcik","id":"100003190828171"},{"name":"Radek Tr??a Truhl�?","id":"100000263879
 140"},{"name":"F�fa Michi","id":"100001942913726"},{"name":"Radim Macoszek","id":"100000411026577"},{"name":"Jan Han�sek","id":"100000467022164"},{"name":"Luk�?ek Pa?il","id":"1304584616"},{"name":"Maros Hric","id":"1794470539"},{"name":"Stanley Uli?ka-Ronaldo Hrica","id":"1180391866"},{"name":"Tom�? Svoboda","id":"1652694973"},{"name":"Dusan Gbelec","id":"100001729069935"},{"name":"Veronica Hrozov�","id":"100000021889547"},{"name":"Jakub Gelnar","id":"100000634354601"},{"name":"Milan Luk�?","id":"100000894167126"},{"name":"Hanina Vr�nov�","id":"100003307243536"},{"name":"Tom�? M�?o Medve?","id":"100000007192762"}],"paging":{"cursors":{"after":"MTAwMDAwMDA3MTkyNzYy","before":"MTQyMzQ4MzIyMg=="}}}}},
+{"comment":{"like_count":7,"user_likes":false,"can_remove":false,"from":{"name":"Patrik PipoPupy Tre?o","id":"100000141145825"},"id":"578610008862349_92416511","created_time":"2013-08-28T00:07:12+0000","message":"Uz ma zacinate jebat ...."}},
+{"comment":{"like_count":1,"user_likes":false,"can_remove":false,"from":{"name":"Duc Anh Le","id":"100004707488552"},"id":"578610008862349_92416523","created_time":"2013-08-28T00:11:33+0000","message":"J� bych toho Balea u? pustil k vod? ..."}},
+{"comment":{"like_count":0,"user_likes":false,"can_remove":false,"from":{"name":"Luko Eles","id":"100004483267342"},"id":"578610008862349_92416559","created_time":"2013-08-28T00:26:02+0000","message":"T�to spr�va je 2 dni star� :D :D"}},
+{"comment":{"like_count":0,"user_likes":false,"can_remove":false,"from":{"name":"David Doktor","id":"100000140869004"},"id":"578610008862349_92416547","created_time":"2013-08-28T00:21:38+0000","message":"Kde berete tyhle zpr�vy?"}},
+{"comment":{"like_count":0,"user_likes":false,"can_remove":false,"from":{"name":"Ondra's Berryss�n","id":"100004401523860"},"id":"578610008862349_92416556","created_time":"2013-08-28T00:25:05+0000","message":"Kone?n? snad!! :)"}},
+{"photo":{"name":"Timeline Photos","story":"Marco Aur�lio Aur�lio shared FanatiCorinthians's photo.","from":{"name":"Marco Aur�lio Aur�lio","id":"100000629625325"},"application":{"name":"Links","id":"2309869772"},"icon":"http://static.ak.fbcdn.net/rsrc.php/v2/yD/r/aS8ecmYRys0.gif","story_tags":{"0":[{"name":"Marco Aur�lio Aur�lio","id":"100000629625325","type":"user","length":21,"offset":0}],"29":[{"name":"FanatiCorinthians","id":"178543808920097","type":"page","length":17,"offset":29}]},"id":"100000629625325_628414700522845","created_time":"2013-08-28T00:47:52+0000","type":"photo","caption":"Recomendo: V�rus Corinthiano\r\nRecomendo: � o Time Do Povo, � o Coring�o\r\nRecomendo: CorinthiAMO","updated_time":"2013-08-28T00:47:52+0000","privacy":{"value":""},"link":"http://www.facebook.com/photo.php?fbid=468742883233520&set=a.178546862253125.39468.178543808920097&type=1","object_id":"468742883233520","message":"bic de ponta grossa , kkk
 kkkkkkkk","properties":[{"href":"http://www.facebook.com/FanatiCorinthiansOficial?ref=stream","name":"By","text":"FanatiCorinthians"}],"picture":"http://photos-f.ak.fbcdn.net/hphotos-ak-ash3/1236687_468742883233520_1910998772_s.jpg"}},
+{"note":{"from":{"name":"Wellington Flores","id":"100004401480520"},"application":{"name":"Facebook for Android","namespace":"fbandroid","id":"350685531728"},"id":"100004401480520_222258177930897","created_time":"2013-08-28T00:47:39+0000","type":"status","updated_time":"2013-08-28T00:47:39+0000","privacy":{"value":""},"message":"Em Pensaar ..!!     Quee por apenas um diaa .  !    Iria ser assim  pra senpre.. .. !  \nSomoss convidados...!!  Aa entrar eem uma viidaa .. !!  Ee ninguem entraa  de bic�o ...!!"}},
+{"video":{"name":"Best inspirational love quotes","from":{"name":"Sajjad Khan","id":"100000877841588"},"application":{"name":"Share_bookmarklet","id":"5085647995"},"icon":"http://static.ak.fbcdn.net/rsrc.php/v2/yj/r/v2OnaTyTQZE.gif","id":"100000877841588_590446897661233","created_time":"2013-08-28T00:47:24+0000","type":"video","caption":"www.youtube.com","updated_time":"2013-08-28T00:47:24+0000","privacy":{"value":""},"description":"Best quotes and saying about love embed in beautiful roses photos, inspiration love quotes and pictures, best quotes about love, cute love quotes. Visit: htt...","link":"http://www.youtube.com/watch?v=e3VPZepU6V0&sns=fb","source":"http://www.youtube.com/v/e3VPZepU6V0?version=3&autohide=1&autoplay=1","message":"its for you bic\r\n","picture":"http://external.ak.fbcdn.net/safe_image.php?d=AQDFvLV-yo-lT-CO&w=130&h=130&url=http%3A%2F%2Fi1.ytimg.com%2Fvi%2Fe3VPZepU6V0%2Fhqdefault.jpg%3Ffeature%3Dog"}},
+{"note":{"from":{"name":"Um Dia de F�ria","category":"Community","id":"201691339996455"},"id":"201691339996455_210984119067177","created_time":"2013-08-28T00:46:35+0000","type":"status","updated_time":"2013-08-28T00:46:35+0000","privacy":{"value":""},"message":"Um dia de F�ria 17 - A Magrela da Oric� e a Bala Perdida\n-------------------------------------------------------------------\n\nEra o s�bado do desfile das campe�s do Carnaval de 1994, ainda tinha uma ressaca do Carnaval para curtir no Largo do Bic�o. Meu amigo Junior MCGyver havia me chamado para ir a Br�s de Pina para ficar com umas meninas e eu fui, claro. Mas chegando l� s� tinha uma e ele n�o quis compartilhar, com a promessa de que o que era meu estava guardado. Mais de uma hora depois e j� cansado de espera-lo a dar uns pegas na madame, voltamos para a Vila da Penha, onde nos encontramos com os demais delinquentes da �poca: Gustavo, Alisson, Luciano, Galdino 
 e por a� vai.\nAo chegarmos na festa, ele me apresentou a famosa Magrela da Oric� que eu nem preciso citar o nome. Quando eu me deparei com situa��o, confesso que me senti, no m�nimo, surpreso, pois nunca havia conhecido na vida uma menina t�o magra quanto aquela. Ela j� tratou de se apresentar e passou a me chamar de fofo e mostrou total interesse em mim e passou a me perseguir durante toda a festa. Estava me sentindo a verdadeira v�tima de um psicopata Serial Killer. Quanto mais eu despistava, mais ela me encontrava. O grande problema � que na adolesc�ncia, quanto mais o tempo passa mais voc� bebe e quanto mais voc� bebe mais gostosa voc� come�a a achar as mulheres, qualquer uma delas. \nN�o sei hoje, mas nos anos 90 era muito comum ter carros cheio de batidas no caput, e voc� pagava uma miserinha por uma garrafa e enchia a cara a noite inteira, sendo que voc� nunca bebia sozinho, pois os amigos s
 empre aparecia com um copinho descart�vel para ser arregrado.\nE ao bater das doze badaladas noturnas, a carruagem virou ab�bora e as minhas resist�ncias viraram p�. A Magrela pegou na minha m�o e disse: � agora!!!! Me aproximei e mais uma vez consegui resistir aos seus poderes hipn�ticos,,, s� n�o sabia at� quando. Passava desfilando com ela e todos me homenageavam pela coragem e bravura e ela come�ou a ficar impaciente e disse que se eu n�o queria, bastava falar,,,, mas fui um fraco e ao mesmo tempo um cavalheiro, pois n�o poderia deixar a menina magoada. Ent�o bolei um plano mirabolante. O Alan e a sua irm� estavam indo embora, ent�o falei pra ela que far�amos companhia para os dois e depois selar�amos o esperado beijo da noite. Era o local perfeito pra n�o ser flagrado por toda sociedade Viladapenhana ou ent�o o momento mais prop�cio para sair correndo.\nFoi quando rolou um t
 umulto violento e uma correria danada,,, todos desembestados e eu sem saber o que estava acontecendo,,, ouvi tiros, gritos e a sensa��o mais louca que eu j� senti na minha vida, tentei correr mais levei uma porrada na nuca, ouvi som de trinca-ferro e os olhos come�aram a triplicar as imagens. O som ficou mais lento, como se reduzisse a rota��o do disco de vinil. Olhava para os lados e via pessoas ainda correndo. Tentei dar o pr�ximo passo, mas n�o tinha mais for�a nas pernas. Senti o ch�o chegando muito vagarosamente, coloquei meus bra�os para amortecer a queda e ao tocar o asfalto, como num passe de m�gica, tudo voltou ao normal. Eu ainda tentei rastejar para fugir do tiroteio, mas um transeunte me segurou e me informou aquilo que eu n�o queria pensar: Eu havia levado um tiro e sangrava muito. Fui virado pra cima e vi as pessoas se amontoarem em cima de mim. Rasgaram minha blusa para arejar, tiraram meus t�nis pa
 ra arejar, e por sinal at� hoje eu n�o os vi de volta, um Nike novinho, do Alisson... \nO boato dos baleados se espalhou e os carniceiros dos meus amigos vieram correndo pra ver quem era o bandido alvejado e se deparam comigo deitado sobre um mar de sangue. Todos se apavoraram e o Alisson, no seu melhor estilo capoeira, furou o cord�o de isolamento e veio ficar comigo. Eu estava com um medo fodido de morrer, olhava pro lado e via o sangue escorrer pela rua abaixo. A �nica viatura de pol�cia que havia no local,  levou um baleado na garganta e um gr�vida alvejada de rasp�o na barriga. E eu fiquei l�, esperando a minha hora chegar. Foi quando um santo taxista se ofereceu pra me levar ao hospital. Ao tentar levantar, eu nunca poderia imaginar que a minha cabe�a pesava tanto, acho que a bala rompeu alguns ligamentos de sustenta��o dos m�sculos do pesco�o. \nEntrei no carro com muito sacrif�cio e sentia vertigens incont
 rol�veis, iria desfalecer ou mesmo falecer a qualquer momento, o problema � que a luz branca n�o veio, ent�o pensei: Fudeu, vou pro inferno. O Alisson tentava me animar, me fazia cantar Legi�o Urbana: Que Legi�o Urbana � o caralho,,, estou morrendo cara, voc� n�o est� vendo???.... E os olhos temiam em fechar. O hospital Get�lio Vargas nunca foi t�o longe,,, levamos uma eternidade para chegar,,,, essa era a sensa��o. Ao chegar no hospital, n�o tinha leito, me deitaram numa maca met�lica fria, sem camisa e com hipotermia, por causa da perda de sangue. Fui operado ali mesmo, extra�ram a bala, embalaram numa gaze e me deram. Me senti uma mam�e no parto ao ter seu filho nos bra�os. Olhei pra bala e disse: Filha da Puta,,, quase me matou.\nE pra fechar a noite com chave de ouro, o Alisson me pergunta: \n- E a magra, pegou?\n- N�o, escapei,,,, ufa... santa bala perdida!!!!"}},
+{"note":{"from":{"name":"Dakoda Mandujano","id":"100002494114668"},"application":{"name":"Mobile","id":"2915120374"},"id":"100002494114668_501954526564347","created_time":"2013-08-28T00:45:48+0000","type":"status","updated_time":"2013-08-28T00:47:43+0000","privacy":{"value":""},"message":"i need my Bic sucked right now lol"}},
+{"note":{"from":{"name":"Gi?t M?c M�a H�","id":"100006547540821"},"id":"100006547540821_1389297757965129","created_time":"2013-08-28T00:41:31+0000","type":"status","updated_time":"2013-08-28T00:41:31+0000","privacy":{"value":""},"message":"Ch?c ch?n h?n anh to�n m?c t�m \nB� kh�ng tin ch?m th? v�i l?n \nM?t l� ???c th?y cho m??i ?i?m \nHai l� tim b� b? ... b�ng khu�ng\nAnh l�m th? to�n b?ng vi?t bic \nL�m quen ch?a bi?t vi?t b?ng g� \nS?c nh? ng�y x?a c�n l? m?c \nS�n tr??ng t�m ??m m?t c�y si\n\nB�i h�t n�o \"s?i th??ng s?i nh?\" \nC�n th? anh \"gi?t nh? gi?t th??ng\" \nM?t h�m anh bi?n th�nh quy?n v? \nT�nh nguy?n y�u gi?t m?c t�m ?ang bu?n"}},
+{"note":{"from":{"name":"Trang T�mat?","id":"100002216264738"},"application":{"name":"Facebook for iPhone","namespace":"fbiphone","id":"6628568379"},"id":"100002216264738_499056076844930","created_time":"2013-08-28T00:40:48+0000","type":"status","updated_time":"2013-08-28T00:40:48+0000","privacy":{"value":""},"message":"Tinh m? s??ng ?i t?p e r� bic\n...c�i c?m gi�c t?p xong ng ??t h?t m? h�i r�i lao xe vun v�t => m�t r??i iii\n=> th?t l� th�ch >:'D<"}},
+{"note":{"from":{"name":"Richly Awthentic","id":"100001409130885"},"id":"100001409130885_589039464486353","created_time":"2013-08-28T00:34:26+0000","type":"status","updated_time":"2013-08-28T00:34:26+0000","privacy":{"value":""},"message":"fire in the HOLE!..*stirkes BIC*"}},
+{"note":{"from":{"name":"Black Friday Cyber Monday on Sale","category":"Product/service","id":"1376926415869828"},"id":"1376926415869828_1382427048653098","created_time":"2013-08-28T00:34:10+0000","type":"status","updated_time":"2013-08-28T00:34:10+0000","privacy":{"value":""},"message":"BIC Sport Adjustable Stand Up Paddle Blade\n\nCHECK TO FIND LOW PRICE >> http://tinyurl.com/gbkj4qsx/B009VYHJRI\n\nBIC Sport Adjustable Stand Up Paddle Blade The four Most Well-known Jugglers At any time - Find out From Them, YOU Could Be Subsequent! Have you at any time dreamed of remaining the future legend in juggling? I have. So I wrote this manual on the four most famed jugglers, and their insider secrets to turning out to be the legends they had been. Understand from all those insider secrets, and you can be the following legend in juggling! BIC Sport Adjustable Stand Up Paddle Blade.  The Journey Privilege of Motorized Paragliding Paragliding experts already have the liberty to fly like birds
  on their have at their own prices and travel as much as they can. They appreciate the privilege of touring or crossing nations. BIC Sport Adjustable Stand Up Paddle Blade.  Lacrosse Drills - Shooting Drills From Cornell Lacrosse These are great lacrosse drills for increasing the capturing skills of your lacrosse players. Lacrosse coaches can make their teams much more powerful at scoring additional plans with these easy drills. These drills came in an job interview with Coach Tambroni from Cornell Lacrosse."}},
+{"note":{"from":{"name":"Cyber Monday Black Friday Online","category":"Product/service","id":"565321923532890"},"id":"565321923532890_568015023263580","created_time":"2013-08-28T00:33:37+0000","type":"status","updated_time":"2013-08-28T00:33:37+0000","privacy":{"value":""},"message":"BIC Beach Kayak Paddle (1 Piece)\n\nCONTINUE TO SEE LOW PRICE >> http://tinyurl.com/rerqq91g/B004XFVOWG\n\nBIC Beach Kayak Paddle (1 Piece) Yukon one thousand - The Longest Canoe and Kayak Race The Yukon a thousand is the longest canoe and kayak race in the earth. Racers contend with seven to eight days of steady paddling with only a few hrs of rest each individual night time. BIC Beach Kayak Paddle (1 Piece).  Athletics - Bringing Americans With each other Sports have touched and have achieved out to each and every side of American existence. Due to the greater availability of medium made use of to observe and share these activities, (Tv set and the Internet), sporting activities encounters and reminis
 cences have been shared a lot more and with hundreds of thousands of Americans in 1 variety or another. We have found dramatic wins, losses, championships, terrific plays, and not so terrific performs. People adore sports activities and the athletics that perform them and really like to share and communicate about these good moments. BIC Beach Kayak Paddle (1 Piece).  The Decline of Cannabis Details Hashish has been the most morally grey topic place for a long time and the information and facts you acquire on the subject can be really far from the reality. Certainly in most nations spherical the planet Hashish is Unlawful, however individuals are even now working with it so there really should be a bank of details about it."}},
+{"note":{"from":{"name":"Gabriel Paul Pierce-Lackey","id":"100003952643883"},"id":"100003952643883_293782680763484","created_time":"2013-08-28T00:30:39+0000","type":"status","updated_time":"2013-08-28T00:38:29+0000","privacy":{"value":""},"message":"If you snag lighters, I hate you"}},
+{"note":{"from":{"name":"Udin Zeoss","id":"100004916228419"},"application":{"name":"Mobile","id":"2915120374"},"id":"100004916228419_193897570784116","created_time":"2013-08-28T00:30:09+0000","type":"status","updated_time":"2013-08-28T00:30:09+0000","privacy":{"value":""},"place":{"name":"PaBriK paNg UjuNg Na ?? BiC-PurwakarTa","location":{"city":"Cikampek","latitude":-6.440615,"zip":"","country":"Indonesia","street":"","longitude":107.4492325},"id":"469609653049663"},"message":"Santai dl sblm gwe"}},
+{"note":{"from":{"name":"Andrel Barbour Doing Her","id":"100000828229524"},"application":{"name":"Mobile","id":"2915120374"},"id":"100000828229524_567828116588124","created_time":"2013-08-28T00:29:53+0000","type":"status","updated_time":"2013-08-28T00:48:36+0000","privacy":{"value":""},"message":"ALL GLORY....I DNT CARE...OR GIVE A FLYIN FLOCK WHAT NOBODY ELSE DO OR SAY AS LONG MY GLORY NAME ANIT IN IT....1 BIRD DNT KILL A STONE...AND I THAT BIC BIRD AND GOING OR WORRYIN ABOUT NOTHING N MY LIL BRO..EVERETTE..BKA...DANK VOICE...SAY IT AGAIN...I ANIT WORRYIN ABOUT NOTHING....OW OW OW OW OW OW...JUST BRING THE SMOKES I GOT THE WRAP...BRING THE ALCOHOL...I GOT THE CUPS...BRING THE BARBQUE I GOT THE PLATES...FOLKS...SPOONS AND NAPKINS...CANT GET NO MATTER THEN THAT....LMAO..."}},
+{"note":{"from":{"name":"Blackie Ibrahim","id":"100001611878761"},"application":{"name":"Mobile","id":"2915120374"},"id":"100001611878761_569548039775587","created_time":"2013-08-28T00:29:26+0000","type":"status","updated_time":"2013-08-28T00:29:26+0000","privacy":{"value":""},"message":"THIS ARE DAYZ 2  BE REMEMBRED!!!!\n\n  I miss d days when we went to\nschool, lined up & D headmistress &\nteachers inspect our nails & uniform\n& den we match to our classrooms.\n? D days of Natco Biscuit, Iced\nColored water tied in nylon we called\nit \"kulaid\"\n? D days of pehpeh mint\n? D days of WAN POT,correction corner(paddy nor piss dae!)\n? Hay, i remember those days when\none block coin na money,when\ngroundnut was 50 leone.&\nsweet was 2,3,4 for 50 Leone\n? days of messing game,forl shit(police,find me d thief), police and thief\n? D days of mummy & daddy play\n? days when we use to build houses\nwith sand, play borlorgie game, \nskipping, street ball stop! U don remember!\n?those days 
 wen we used to fly kite\non streets, wen boys used to use d\nMilk cups to make cars & their\ndaddy's hanger as d steering\n?those days when rubber band(fark) was\nstock exchange\n?days when mortal kombat,street fighter,snake and the monkey shadow,power rangers, spider man were our\nfavourite movies\n? D days of Pepsi soft drinks & milo and maltina advert on black and white tv\n? when we say ''ar stiff,nor stiff o. Wan cup wata! '' and slapping our colleagues saying 'fresh leg o'\n? Those days when bic pen\nwas d best\nD days wen we used to drink water\nfrom d tap even suck out d water if its\nnot coming out\n? D days when SLBS will show\nrainbow color for 30 mins then\nnational anthem before they resume\nprogram @ 4pm\n? D days wen silectto were d best footwares\n?Days wen we all sing ''neneh binta dae sell chi gum, chocolate,die mint,sweet!\nI'm really\nproud to have experienced\nall this. If u r nt smiling it means u\nwere nt born in my generation.\nAdd yours and pass the fun arou
 nd, hey heee haahaaaaaa opopinaaaazzzzz"}},
+{"note":{"from":{"name":"William George","id":"100003820913189"},"application":{"name":"Facebook for Android","namespace":"fbandroid","id":"350685531728"},"id":"100003820913189_320249768112384","created_time":"2013-08-28T00:29:14+0000","type":"status","updated_time":"2013-08-28T00:29:14+0000","privacy":{"value":""},"message":"Felling bad today have no meds for my diabetes because I am broke I need some help I have some u of l tee shirts and hats u of k all so all brand new will sell cheap all so bic  lighters if anyone can help me out hmu on fb any help would be great I feel like I am desperate so ty"}},
+{"photo":{"from":{"name":"Thami de Oliveira","id":"100003470164026"},"icon":"http://static.ak.fbcdn.net/rsrc.php/v2/yz/r/StEh3RhPvjk.gif","id":"100003470164026_390972087695127","created_time":"2013-08-28T00:29:07+0000","type":"photo","updated_time":"2013-08-28T00:44:13+0000","privacy":{"value":""},"link":"http://www.facebook.com/photo.php?fbid=390971777695158&set=pcb.390972087695127&type=1&relevant_count=2","object_id":"390971777695158","message":"MENINAS QUE TIVEREM INTERESSE NESSE VESTIDO TEM NA COR BRANCO,PRETO,AMARELO,AZUL BIC,ROSA PINK E AZUL PISCINA , COMENTA COM A COR QUE FOR QUERER PRA EU PODER FAZER A ENCOMENDA, S� VOU TRAZER DE QUEM COMENTAR !!!","picture":"http://photos-a.xx.fbcdn.net/hphotos-ash3/1234956_390971777695158_1843537076_t.jpg"}},
+{"note":{"from":{"name":"Black Friday Cyber Monday on Sale","category":"Product/service","id":"1376926415869828"},"id":"1376926415869828_1382424758653327","created_time":"2013-08-28T00:28:52+0000","type":"status","updated_time":"2013-08-28T00:28:52+0000","privacy":{"value":""},"message":"BIC Sport ACE-TEC Stand-Up Paddleboard\n\nCONTINUE FOR SPECIAL PRICE >> http://tinyurl.com/gbkj4qsx/B005SH9TNO\n\nBIC Sport ACE-TEC Stand-Up Paddleboard Types of Geocaching Caches The satisfaction achieved when enjoying geocaching usually lies on the discovery of what a cache incorporates. This serves as the reward for all the terrain that a cacher has successfully conquered. Caches come in different varieties and usually include a logbook (for greater caches) or log paper (for more compact caches). BIC Sport ACE-TEC Stand-Up Paddleboard.  Leisure at Relatives Reunions Looking for a risk-free outside game that can be performed by folks of all ages and qualities? Then search no further than cornhole.
  Cornhole is a addictive activity that is easy to master and a ton of enjoyable to play. BIC Sport ACE-TEC Stand-Up Paddleboard.  How to Prevent Soaked Ft When Going for walks in the Uk Most of my hiking and strolling usually takes position in the British isles. Locations to stroll this kind of as the Lake District, Scotland and Snowdonia are my favourite spots. These locations are wonderful."}},

[... 227 lines stripped ...]
Added: incubator/streams/branches/sblackmon/streams-contrib/streams-provider-facebook/src/test/resources/testpost.json
URL: http://svn.apache.org/viewvc/incubator/streams/branches/sblackmon/streams-contrib/streams-provider-facebook/src/test/resources/testpost.json?rev=1556893&view=auto
==============================================================================
--- incubator/streams/branches/sblackmon/streams-contrib/streams-provider-facebook/src/test/resources/testpost.json (added)
+++ incubator/streams/branches/sblackmon/streams-contrib/streams-provider-facebook/src/test/resources/testpost.json Thu Jan  9 17:27:50 2014
@@ -0,0 +1,162 @@
+{
+    "id": "19292868552_10150189643478553",
+    "from": {
+        "category": "Product/service",
+        "name": "Facebook Developers",
+        "id": "19292868552"
+    },
+    "picture": "https://fbexternal-a.akamaihd.net/app_full_proxy.php?app=9953271133&v=3&size=z&cksum=e15ac22d55f6a9501d3b3ac64c5fb763&src=http%3A%2F%2Fimg.bitpixels.com%2Fgetthumbnail%3Fcode%3D78793%26size%3D120%26url%3Dhttp%3A%2F%2Fdevelopers.facebook.com%2Fblog%2F",
+    "link": "http://developers.facebook.com/blog/post/497",
+    "name": "Developer Roadmap Update: Moving to OAuth 2.0 + HTTPS",
+    "description": "\nWe continue to make Platform more secure for users. Earlier this year, we introduced the ability for users to browse Facebook over HTTPS. As a result, we provided ?Secure Canvas URL? and ?Secure Tab URL? fields in the Developer App for developers to serve their apps through an H",
+    "properties": [
+        {
+            "name": "source",
+            "text": "Official Facebook Developer Blog",
+            "href": "http://apps.facebook.com/blognetworks/blog/official_facebook_developer_blog"
+        },
+        {
+            "name": "link",
+            "text": "Full Article...",
+            "href": "http://developers.facebook.com/blog/post/497"
+        }
+    ],
+    "icon": "https://fbcdn-photos-g-a.akamaihd.net/hphotos-ak-prn1/851582_10151414659411134_455889750_n.gif",
+    "actions": [
+        {
+            "name": "Comment",
+            "link": "https://www.facebook.com/19292868552/posts/10150189643478553"
+        },
+        {
+            "name": "Like",
+            "link": "https://www.facebook.com/19292868552/posts/10150189643478553"
+        },
+        {
+            "name": "Share",
+            "link": "http://networkedblogs.com/hGWk3?a=share"
+        }
+    ],
+    "privacy": {
+        "value": ""
+    },
+    "type": "link",
+    "status_type": "app_created_story",
+    "application": {
+        "name": "NetworkedBlogs",
+        "namespace": "blognetworks",
+        "id": "9953271133"
+    },
+    "created_time": "2011-05-10T18:35:38+0000",
+    "updated_time": "2013-10-01T07:00:37+0000",
+    "likes": {
+        "data": [
+            {
+                "id": "100006210073538",
+                "name": "Coba Michigo"
+            },
+            {
+                "id": "1282493734",
+                "name": "Tu?rul Alpdo?an"
+            },
+            {
+                "id": "100000412097163",
+                "name": "Khoa Lê"
+            },
+            {
+                "id": "100006459861243",
+                "name": "Cay Bautista"
+            },
+            {
+                "id": "1583193931",
+                "name": "Shikai Luo"
+            },
+            {
+                "id": "100000263093717",
+                "name": "Taheer Ali"
+            },
+            {
+                "id": "100000580222065",
+                "name": "Rui Miguel Botelho"
+            },
+            {
+                "id": "1046172886",
+                "name": "Petr Messner"
+            },
+            {
+                "id": "1082231972",
+                "name": "Kevin D Chang"
+            },
+            {
+                "id": "584859241",
+                "name": "Marco Re"
+            },
+            {
+                "id": "100000529975565",
+                "name": "Keith Lantz"
+            },
+            {
+                "id": "100001132836113",
+                "name": "Mehmet Yildirim"
+            },
+            {
+                "id": "100000957586565",
+                "name": "Aryfour Rahaman Repon"
+            },
+            {
+                "id": "100003371262883",
+                "name": "Fox Atari"
+            },
+            {
+                "id": "100001339517062",
+                "name": "Davut AyTa?"
+            },
+            {
+                "id": "100003864266319",
+                "name": "Elking Yasser"
+            },
+            {
+                "id": "100004789388632",
+                "name": "Så?hëê? Ahmé?"
+            },
+            {
+                "id": "100003244374863",
+                "name": "Bá Ki?n"
+            },
+            {
+                "id": "100006195824074",
+                "name": "Sofyan Firdaus Jempoler's"
+            },
+            {
+                "id": "100005363404988",
+                "name": "Aehr Love"
+            },
+            {
+                "id": "100005937755561",
+                "name": "Xhovani Shkreli"
+            },
+            {
+                "id": "100000843539139",
+                "name": "Little LampVengeance For'stamfordBridge"
+            },
+            {
+                "id": "100003439303139",
+                "name": "Shubham Malhotra"
+            },
+            {
+                "id": "652867253",
+                "name": "Noomomo Naruk"
+            },
+            {
+                "id": "1042034561",
+                "name": "Berkay Y?ld?z"
+            }
+        ],
+        "paging": {
+            "cursors": {
+                "after": "MTA0MjAzNDU2MQ==",
+                "before": "MTAwMDA2MjEwMDczNTM4"
+            },
+            "next": "https://graph.facebook.com/19292868552_10150189643478553/likes?limit=25&after=MTA0MjAzNDU2MQ=="
+        }
+    }
+}
\ No newline at end of file

Added: incubator/streams/branches/sblackmon/streams-contrib/streams-provider-gnip/gnip-edc-facebook/pom.xml
URL: http://svn.apache.org/viewvc/incubator/streams/branches/sblackmon/streams-contrib/streams-provider-gnip/gnip-edc-facebook/pom.xml?rev=1556893&view=auto
==============================================================================
--- incubator/streams/branches/sblackmon/streams-contrib/streams-provider-gnip/gnip-edc-facebook/pom.xml (added)
+++ incubator/streams/branches/sblackmon/streams-contrib/streams-provider-gnip/gnip-edc-facebook/pom.xml Thu Jan  9 17:27:50 2014
@@ -0,0 +1,128 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>streams-provider-gnip</artifactId>
+        <groupId>org.apache.streams</groupId>
+        <version>0.1-SNAPSHOT</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>gnip-edc-facebook</artifactId>
+
+    <dependencies>
+
+        <dependency>
+            <groupId>com.google.guava</groupId>
+            <artifactId>guava</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.fasterxml.jackson.core</groupId>
+            <artifactId>jackson-core</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.fasterxml.jackson.core</groupId>
+            <artifactId>jackson-annotations</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.jsonschema2pojo</groupId>
+            <artifactId>jsonschema2pojo-core</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.streams</groupId>
+            <artifactId>streams-core</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.streams</groupId>
+            <artifactId>streams-pojo</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.streams</groupId>
+            <artifactId>streams-provider-facebook</artifactId>
+            <version>0.1-SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.streams</groupId>
+            <artifactId>gnip-powertrack</artifactId>
+            <version>0.1-SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>com.fasterxml</groupId>
+            <artifactId>aalto-xml</artifactId>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <sourceDirectory>src/main/java</sourceDirectory>
+        <testSourceDirectory>src/test/java</testSourceDirectory>
+        <resources>
+            <resource>
+                <directory>src/main/resources</directory>
+            </resource>
+        </resources>
+        <testResources>
+            <testResource>
+                <directory>src/test/resources</directory>
+            </testResource>
+        </testResources>
+        <plugins>
+            <plugin>
+                <groupId>org.codehaus.mojo</groupId>
+                <artifactId>build-helper-maven-plugin</artifactId>
+                <version>1.8</version>
+                <executions>
+                    <execution>
+                        <id>add-source-jaxb2</id>
+                        <phase>generate-sources</phase>
+                        <goals>
+                            <goal>add-source</goal>
+                        </goals>
+                        <configuration>
+                            <sources>
+                                <source>target/generated-sources/jaxb2</source>
+                            </sources>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>org.jvnet.jaxb2.maven2</groupId>
+                <artifactId>maven-jaxb2-plugin</artifactId>
+                <configuration>
+                    <schemaDirectory>src/main/xmlschema/com/facebook/</schemaDirectory>
+                    <generateDirectory>target/generated-sources/jaxb2</generateDirectory>
+                    <verbose>true</verbose>
+                    <debug>true</debug>
+                    <encoding>${project.build.sourceEncoding}</encoding>
+                    <forceRegenerate>true</forceRegenerate>
+                    <removeOldOutput>false</removeOldOutput>
+                    <generatePackage>com.facebook.api</generatePackage>
+                    <plugins>
+                        <plugin>
+                            <groupId>org.jvnet.jaxb2_commons</groupId>
+                            <artifactId>jaxb2-basics</artifactId>
+                            <version>0.6.5</version>
+                        </plugin>
+                    </plugins>
+                </configuration>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>generate</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+
+    </build>
+</project>
\ No newline at end of file

Added: incubator/streams/branches/sblackmon/streams-contrib/streams-provider-gnip/gnip-edc-facebook/src/test/java/org/apache/streams/gnip/facebook/test/FacebookEDCAsActivityTest.java
URL: http://svn.apache.org/viewvc/incubator/streams/branches/sblackmon/streams-contrib/streams-provider-gnip/gnip-edc-facebook/src/test/java/org/apache/streams/gnip/facebook/test/FacebookEDCAsActivityTest.java?rev=1556893&view=auto
==============================================================================
--- incubator/streams/branches/sblackmon/streams-contrib/streams-provider-gnip/gnip-edc-facebook/src/test/java/org/apache/streams/gnip/facebook/test/FacebookEDCAsActivityTest.java (added)
+++ incubator/streams/branches/sblackmon/streams-contrib/streams-provider-gnip/gnip-edc-facebook/src/test/java/org/apache/streams/gnip/facebook/test/FacebookEDCAsActivityTest.java Thu Jan  9 17:27:50 2014
@@ -0,0 +1,103 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.streams.gnip.facebook.test;
+
+//import org.codehaus.jackson.map.ObjectMapper;
+
+import com.fasterxml.jackson.databind.DeserializationFeature;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.dataformat.xml.XmlMapper;
+import org.apache.commons.lang.StringUtils;
+import org.apache.streams.gnip.powertrack.GnipActivityFixer;
+import org.apache.streams.pojo.json.Activity;
+import org.json.JSONObject;
+import org.junit.Assert;
+import org.junit.Ignore;
+import org.junit.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.BufferedReader;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+
+//import com.fasterxml.jackson.xml.XmlMapper;
+//import com.gnip.xmlpojo.generated.FacebookEDC;
+
+/**
+ * Created with IntelliJ IDEA.
+ * User: rebanks
+ * Date: 8/21/13
+ * Time: 11:53 AM
+ * To change this template use File | Settings | File Templates.
+ */
+public class FacebookEDCAsActivityTest {
+
+    private final static Logger LOGGER = LoggerFactory.getLogger(FacebookEDCAsActivityTest.class);
+
+    private ObjectMapper jsonMapper = new ObjectMapper();
+    XmlMapper xmlMapper = new XmlMapper();
+
+    @Ignore
+    @Test
+    public void Tests()   throws Exception
+    {
+        InputStream is = FacebookEDCAsActivityTest.class.getResourceAsStream("/FacebookEDC.xml");
+        if(is == null) System.out.println("null");
+        InputStreamReader isr = new InputStreamReader(is);
+        BufferedReader br = new BufferedReader(isr);
+        xmlMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, Boolean.FALSE);
+        xmlMapper.configure(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY, Boolean.TRUE);
+        xmlMapper.configure(DeserializationFeature.ACCEPT_EMPTY_STRING_AS_NULL_OBJECT, Boolean.TRUE);
+        jsonMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, Boolean.FALSE);
+        jsonMapper.configure(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY, Boolean.TRUE);
+        jsonMapper.configure(DeserializationFeature.ACCEPT_EMPTY_STRING_AS_NULL_OBJECT, Boolean.TRUE);
+
+        try {
+            while (br.ready()) {
+                String line = br.readLine();
+                if(!StringUtils.isEmpty(line))
+                {
+                    LOGGER.debug(line);
+                    Object activityObject = xmlMapper.readValue(line, Object.class);
+
+                    String jsonString = jsonMapper.writeValueAsString(activityObject);
+
+                    JSONObject jsonObject = new JSONObject(jsonString);
+
+                    JSONObject fixedObject = GnipActivityFixer.fix(jsonObject);
+
+                    Activity activity = null;
+                    try {
+                        activity = jsonMapper.readValue(fixedObject.toString(), Activity.class);
+                    } catch( Exception e ) {
+                        LOGGER.error(jsonObject.toString());
+                        LOGGER.error(fixedObject.toString());
+                        e.printStackTrace();
+                        Assert.fail();
+                    }
+                    //LOGGER.info(activity);
+                }
+            }
+        } catch( Exception e ) {
+            LOGGER.error(e.getMessage());
+            Assert.fail();
+        }
+    }
+}

Added: incubator/streams/branches/sblackmon/streams-contrib/streams-provider-gnip/gnip-edc-facebook/src/test/java/org/apache/streams/gnip/facebook/test/FacebookEDCSerDeTest.java
URL: http://svn.apache.org/viewvc/incubator/streams/branches/sblackmon/streams-contrib/streams-provider-gnip/gnip-edc-facebook/src/test/java/org/apache/streams/gnip/facebook/test/FacebookEDCSerDeTest.java?rev=1556893&view=auto
==============================================================================
--- incubator/streams/branches/sblackmon/streams-contrib/streams-provider-gnip/gnip-edc-facebook/src/test/java/org/apache/streams/gnip/facebook/test/FacebookEDCSerDeTest.java (added)
+++ incubator/streams/branches/sblackmon/streams-contrib/streams-provider-gnip/gnip-edc-facebook/src/test/java/org/apache/streams/gnip/facebook/test/FacebookEDCSerDeTest.java Thu Jan  9 17:27:50 2014
@@ -0,0 +1,59 @@
+package org.apache.streams.gnip.facebook.test;
+
+import com.fasterxml.jackson.databind.DeserializationFeature;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.dataformat.xml.XmlMapper;
+import com.gnip.api.Entry;
+import org.junit.Assert;
+import org.junit.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.BufferedReader;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+
+/**
+ * Created with IntelliJ IDEA.
+ * User: rebanks
+ * Date: 8/21/13
+ * Time: 11:53 AM
+ * To change this template use File | Settings | File Templates.
+ */
+public class FacebookEDCSerDeTest {
+
+    private final static Logger LOGGER = LoggerFactory.getLogger(FacebookEDCSerDeTest.class);
+
+    XmlMapper xmlMapper = new XmlMapper();
+
+    @Test
+    public void Tests()   throws Exception
+    {
+        xmlMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, Boolean.FALSE);
+        xmlMapper.configure(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY, Boolean.TRUE);
+        xmlMapper.configure(DeserializationFeature.ACCEPT_EMPTY_STRING_AS_NULL_OBJECT, Boolean.TRUE);
+
+        InputStream is = FacebookEDCSerDeTest.class.getResourceAsStream("/FacebookEDC.xml");
+        if(is == null) System.out.println("null");
+        InputStreamReader isr = new InputStreamReader(is);
+        BufferedReader br = new BufferedReader(isr);
+        xmlMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, Boolean.FALSE);
+        xmlMapper.configure(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY, Boolean.TRUE);
+        xmlMapper.configure(DeserializationFeature.ACCEPT_EMPTY_STRING_AS_NULL_OBJECT, Boolean.TRUE);
+
+        try {
+            while (br.ready()) {
+                String line = br.readLine();
+                LOGGER.debug(line);
+
+                Entry xmlObject = xmlMapper.readValue(line, Entry.class);
+
+                String xml = xmlMapper.writeValueAsString(xmlObject);
+
+            }
+        } catch( Exception e ) {
+            LOGGER.error(e.getMessage());
+            Assert.fail();
+        }
+    }
+}



Mime
View raw message