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 2015/07/01 21:05:23 UTC
[1/4] incubator-streams git commit: changed tests without resources
to ITs ITs do not run by default,
must run verify -skipTests=false added retrieval and expansion of zip files
containing test resources location of zip files can be overridden with -test
Repository: incubator-streams
Updated Branches:
refs/heads/master bcf3d3114 -> d982a877b
http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/3f45b23e/streams-contrib/streams-provider-twitter/src/test/java/org/apache/streams/twitter/test/TwitterObjectMapperIT.java
----------------------------------------------------------------------
diff --git a/streams-contrib/streams-provider-twitter/src/test/java/org/apache/streams/twitter/test/TwitterObjectMapperIT.java b/streams-contrib/streams-provider-twitter/src/test/java/org/apache/streams/twitter/test/TwitterObjectMapperIT.java
new file mode 100644
index 0000000..50acb3b
--- /dev/null
+++ b/streams-contrib/streams-provider-twitter/src/test/java/org/apache/streams/twitter/test/TwitterObjectMapperIT.java
@@ -0,0 +1,132 @@
+/*
+ * 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.twitter.test;
+
+import com.fasterxml.jackson.databind.DeserializationFeature;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.node.ObjectNode;
+import com.google.common.base.Optional;
+import com.google.common.collect.Lists;
+import org.apache.commons.lang.StringUtils;
+import org.apache.streams.jackson.StreamsJacksonMapper;
+import org.apache.streams.twitter.converter.StreamsTwitterMapper;
+import org.apache.streams.twitter.converter.TwitterDocumentClassifier;
+import org.apache.streams.twitter.pojo.Delete;
+import org.apache.streams.twitter.pojo.Retweet;
+import org.apache.streams.twitter.pojo.Tweet;
+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 static org.hamcrest.CoreMatchers.*;
+import static org.hamcrest.Matchers.greaterThan;
+import static org.junit.Assert.assertThat;
+
+/**
+* Tests serialization / deserialization of twitter jsons
+*/
+public class TwitterObjectMapperIT {
+
+ private final static Logger LOGGER = LoggerFactory.getLogger(TwitterObjectMapperIT.class);
+
+ private ObjectMapper mapper = StreamsJacksonMapper.getInstance(Lists.newArrayList(StreamsTwitterMapper.TWITTER_FORMAT));
+
+ @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 = TwitterObjectMapperIT.class.getResourceAsStream("/testtweets.txt");
+ InputStreamReader isr = new InputStreamReader(is);
+ BufferedReader br = new BufferedReader(isr);
+
+ int tweetlinks = 0;
+ int retweetlinks = 0;
+
+ try {
+ while (br.ready()) {
+ String line = br.readLine();
+ if(!StringUtils.isEmpty(line))
+ {
+ LOGGER.info("raw: {}", line);
+
+ Class detected = new TwitterDocumentClassifier().detectClasses(line).get(0);
+
+ ObjectNode event = (ObjectNode) mapper.readTree(line);
+
+ assertThat(event, is(not(nullValue())));
+
+ if( detected == Tweet.class ) {
+
+ Tweet tweet = mapper.convertValue(event, Tweet.class);
+
+ assertThat(tweet, is(not(nullValue())));
+ assertThat(tweet.getCreatedAt(), is(not(nullValue())));
+ assertThat(tweet.getText(), is(not(nullValue())));
+ assertThat(tweet.getUser(), is(not(nullValue())));
+
+ tweetlinks += Optional.fromNullable(tweet.getEntities().getUrls().size()).or(0);
+
+ } else if( detected == Retweet.class ) {
+
+ Retweet retweet = mapper.convertValue(event, Retweet.class);
+
+ assertThat(retweet.getRetweetedStatus(), is(not(nullValue())));
+ assertThat(retweet.getRetweetedStatus().getCreatedAt(), is(not(nullValue())));
+ assertThat(retweet.getRetweetedStatus().getText(), is(not(nullValue())));
+ assertThat(retweet.getRetweetedStatus().getUser(), is(not(nullValue())));
+ assertThat(retweet.getRetweetedStatus().getUser().getId(), is(not(nullValue())));
+ assertThat(retweet.getRetweetedStatus().getUser().getCreatedAt(), is(not(nullValue())));
+
+ retweetlinks += Optional.fromNullable(retweet.getRetweetedStatus().getEntities().getUrls().size()).or(0);
+
+ } else if( detected == Delete.class ) {
+
+ Delete delete = mapper.convertValue(event, Delete.class);
+
+ assertThat(delete.getDelete(), is(not(nullValue())));
+ assertThat(delete.getDelete().getStatus(), is(not(nullValue())));
+ assertThat(delete.getDelete().getStatus().getId(), is(not(nullValue())));
+ assertThat(delete.getDelete().getStatus().getUserId(), is(not(nullValue())));
+
+ } else {
+ Assert.fail();
+ }
+
+ }
+ }
+ } catch( Exception e ) {
+ System.out.println(e);
+ e.printStackTrace();
+ Assert.fail();
+ }
+
+ assertThat(tweetlinks, is(greaterThan(0)));
+ assertThat(retweetlinks, is(greaterThan(0)));
+
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/3f45b23e/streams-contrib/streams-provider-twitter/src/test/java/org/apache/streams/twitter/test/TwitterObjectMapperTest.java
----------------------------------------------------------------------
diff --git a/streams-contrib/streams-provider-twitter/src/test/java/org/apache/streams/twitter/test/TwitterObjectMapperTest.java b/streams-contrib/streams-provider-twitter/src/test/java/org/apache/streams/twitter/test/TwitterObjectMapperTest.java
deleted file mode 100644
index e114457..0000000
--- a/streams-contrib/streams-provider-twitter/src/test/java/org/apache/streams/twitter/test/TwitterObjectMapperTest.java
+++ /dev/null
@@ -1,137 +0,0 @@
-/*
- * 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.twitter.test;
-
-import com.fasterxml.jackson.databind.DeserializationFeature;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.node.ObjectNode;
-import com.google.common.base.Optional;
-import com.google.common.collect.Lists;
-import org.apache.commons.lang.StringUtils;
-import org.apache.streams.jackson.StreamsJacksonMapper;
-import org.apache.streams.twitter.converter.StreamsTwitterMapper;
-import org.apache.streams.twitter.converter.TwitterDocumentClassifier;
-import org.apache.streams.twitter.pojo.Delete;
-import org.apache.streams.twitter.pojo.Retweet;
-import org.apache.streams.twitter.pojo.Tweet;
-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 static org.hamcrest.CoreMatchers.*;
-import static org.hamcrest.Matchers.greaterThan;
-import static org.junit.Assert.assertThat;
-
-/**
-* Created with IntelliJ IDEA.
-* User: sblackmon
-* Date: 8/20/13
-* Time: 5:57 PM
-* To change this template use File | Settings | File Templates.
-*/
-@Ignore("ignore until test resources are available.")
-public class TwitterObjectMapperTest {
-
- private final static Logger LOGGER = LoggerFactory.getLogger(TwitterObjectMapperTest.class);
-
- private ObjectMapper mapper = StreamsJacksonMapper.getInstance(Lists.newArrayList(StreamsTwitterMapper.TWITTER_FORMAT));
-
- @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 = TwitterObjectMapperTest.class.getResourceAsStream("/testtweets.txt");
- InputStreamReader isr = new InputStreamReader(is);
- BufferedReader br = new BufferedReader(isr);
-
- int tweetlinks = 0;
- int retweetlinks = 0;
-
- try {
- while (br.ready()) {
- String line = br.readLine();
- if(!StringUtils.isEmpty(line))
- {
- LOGGER.info("raw: {}", line);
-
- Class detected = new TwitterDocumentClassifier().detectClasses(line).get(0);
-
- ObjectNode event = (ObjectNode) mapper.readTree(line);
-
- assertThat(event, is(not(nullValue())));
-
- if( detected == Tweet.class ) {
-
- Tweet tweet = mapper.convertValue(event, Tweet.class);
-
- assertThat(tweet, is(not(nullValue())));
- assertThat(tweet.getCreatedAt(), is(not(nullValue())));
- assertThat(tweet.getText(), is(not(nullValue())));
- assertThat(tweet.getUser(), is(not(nullValue())));
-
- tweetlinks += Optional.fromNullable(tweet.getEntities().getUrls().size()).or(0);
-
- } else if( detected == Retweet.class ) {
-
- Retweet retweet = mapper.convertValue(event, Retweet.class);
-
- assertThat(retweet.getRetweetedStatus(), is(not(nullValue())));
- assertThat(retweet.getRetweetedStatus().getCreatedAt(), is(not(nullValue())));
- assertThat(retweet.getRetweetedStatus().getText(), is(not(nullValue())));
- assertThat(retweet.getRetweetedStatus().getUser(), is(not(nullValue())));
- assertThat(retweet.getRetweetedStatus().getUser().getId(), is(not(nullValue())));
- assertThat(retweet.getRetweetedStatus().getUser().getCreatedAt(), is(not(nullValue())));
-
- retweetlinks += Optional.fromNullable(retweet.getRetweetedStatus().getEntities().getUrls().size()).or(0);
-
- } else if( detected == Delete.class ) {
-
- Delete delete = mapper.convertValue(event, Delete.class);
-
- assertThat(delete.getDelete(), is(not(nullValue())));
- assertThat(delete.getDelete().getStatus(), is(not(nullValue())));
- assertThat(delete.getDelete().getStatus().getId(), is(not(nullValue())));
- assertThat(delete.getDelete().getStatus().getUserId(), is(not(nullValue())));
-
- } else {
- Assert.fail();
- }
-
- }
- }
- } catch( Exception e ) {
- System.out.println(e);
- e.printStackTrace();
- Assert.fail();
- }
-
- assertThat(tweetlinks, is(greaterThan(0)));
- assertThat(retweetlinks, is(greaterThan(0)));
-
- }
-}
[2/4] incubator-streams git commit: changed tests without resources
to ITs ITs do not run by default,
must run verify -skipTests=false added retrieval and expansion of zip files
containing test resources location of zip files can be overridden with -test
Posted by sb...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/3f45b23e/streams-contrib/streams-provider-google/google-gplus/src/test/java/com/google/gplus/processor/GooglePlusActivitySerDeIT.java
----------------------------------------------------------------------
diff --git a/streams-contrib/streams-provider-google/google-gplus/src/test/java/com/google/gplus/processor/GooglePlusActivitySerDeIT.java b/streams-contrib/streams-provider-google/google-gplus/src/test/java/com/google/gplus/processor/GooglePlusActivitySerDeIT.java
new file mode 100644
index 0000000..bc6c33a
--- /dev/null
+++ b/streams-contrib/streams-provider-google/google-gplus/src/test/java/com/google/gplus/processor/GooglePlusActivitySerDeIT.java
@@ -0,0 +1,116 @@
+/*
+ * 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
+ * with the License. You may obtain a copy of the License at
+ *
+ * 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.google.gplus.processor;
+
+import com.fasterxml.jackson.databind.*;
+import com.fasterxml.jackson.databind.module.SimpleModule;
+import com.google.gplus.serializer.util.GPlusActivityDeserializer;
+import com.google.gplus.serializer.util.GooglePlusActivityUtil;
+import org.apache.commons.lang.StringUtils;
+import org.apache.streams.jackson.StreamsJacksonMapper;
+import org.apache.streams.pojo.json.Activity;
+import org.apache.streams.pojo.json.Actor;
+import org.apache.streams.pojo.json.Provider;
+import org.junit.Before;
+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 java.util.Map;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+/**
+ * Tests conversion of gplus inputs to Activity
+ */
+public class GooglePlusActivitySerDeIT {
+ private final static Logger LOGGER = LoggerFactory.getLogger(GooglePlusActivitySerDeIT.class);
+ private ObjectMapper objectMapper;
+ private GooglePlusActivityUtil googlePlusActivityUtil;
+
+ @Before
+ public void setup() {
+ objectMapper = StreamsJacksonMapper.getInstance();
+ SimpleModule simpleModule = new SimpleModule();
+ simpleModule.addDeserializer(com.google.api.services.plus.model.Activity.class, new GPlusActivityDeserializer());
+ objectMapper.registerModule(simpleModule);
+ objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
+
+ googlePlusActivityUtil = new GooglePlusActivityUtil();
+ }
+
+ @Test
+ public void TestActivityObjects() {
+ InputStream is = GooglePlusActivitySerDeIT.class.getResourceAsStream("/google_plus_activity_jsons.txt");
+ InputStreamReader isr = new InputStreamReader(is);
+ BufferedReader br = new BufferedReader(isr);
+
+ try {
+ while (br.ready()) {
+ String line = br.readLine();
+ if (!StringUtils.isEmpty(line)) {
+ LOGGER.info("raw: {}", line);
+ Activity activity = new Activity();
+
+ com.google.api.services.plus.model.Activity gPlusActivity = objectMapper.readValue(line, com.google.api.services.plus.model.Activity.class);
+
+ googlePlusActivityUtil.updateActivity(gPlusActivity, activity);
+ LOGGER.info("activity: {}", activity);
+
+ assertNotNull(activity);
+ assert(activity.getId().contains("id:googleplus:post"));
+ assertEquals(activity.getVerb(), "post");
+
+ Provider provider = activity.getProvider();
+ assertEquals(provider.getId(), "id:providers:googleplus");
+ assertEquals(provider.getDisplayName(), "GooglePlus");
+
+ Actor actor = activity.getActor();
+ assertNotNull(actor.getImage());
+ assert(actor.getId().contains("id:googleplus:"));
+ assertNotNull(actor.getUrl());
+
+ assertNotNull(activity.getPublished());
+ assertNotNull(activity.getTitle());
+ assertNotNull(activity.getUrl());
+
+ Map<String, Object> extensions = (Map<String, Object>)activity.getAdditionalProperties().get("extensions");
+ assertNotNull(extensions);
+ assertNotNull(extensions.get("googlePlus"));
+
+ if(activity.getContent() != null) {
+ assertNotNull(extensions.get("rebroadcasts"));
+ assertNotNull(extensions.get("keywords"));
+ assertNotNull(extensions.get("likes"));
+ assert (((Map<String, Object>) extensions.get("rebroadcasts")).containsKey("count"));
+ assert (((Map<String, Object>) extensions.get("likes")).containsKey("count"));
+ }
+ }
+ }
+ } catch (Exception e) {
+ LOGGER.error("Exception while testing serializability: {}", e);
+ }
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/3f45b23e/streams-contrib/streams-provider-google/google-gplus/src/test/java/com/google/gplus/processor/GooglePlusActivitySerDeTest.java
----------------------------------------------------------------------
diff --git a/streams-contrib/streams-provider-google/google-gplus/src/test/java/com/google/gplus/processor/GooglePlusActivitySerDeTest.java b/streams-contrib/streams-provider-google/google-gplus/src/test/java/com/google/gplus/processor/GooglePlusActivitySerDeTest.java
deleted file mode 100644
index d692241..0000000
--- a/streams-contrib/streams-provider-google/google-gplus/src/test/java/com/google/gplus/processor/GooglePlusActivitySerDeTest.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- * 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
- * with the License. You may obtain a copy of the License at
- *
- * 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.google.gplus.processor;
-
-import com.fasterxml.jackson.databind.*;
-import com.fasterxml.jackson.databind.module.SimpleModule;
-import com.google.gplus.serializer.util.GPlusActivityDeserializer;
-import com.google.gplus.serializer.util.GooglePlusActivityUtil;
-import org.apache.commons.lang.StringUtils;
-import org.apache.streams.jackson.StreamsJacksonMapper;
-import org.apache.streams.pojo.json.Activity;
-import org.apache.streams.pojo.json.Actor;
-import org.apache.streams.pojo.json.Provider;
-import org.junit.Before;
-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 java.util.Map;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-
-/**
- * Tests conversion of gplus inputs to Activity
- */
-@Ignore("ignore until test resources are available.")
-public class GooglePlusActivitySerDeTest {
- private final static Logger LOGGER = LoggerFactory.getLogger(GooglePlusActivitySerDeTest.class);
- private ObjectMapper objectMapper;
- private GooglePlusActivityUtil googlePlusActivityUtil;
-
- @Before
- public void setup() {
- objectMapper = StreamsJacksonMapper.getInstance();
- SimpleModule simpleModule = new SimpleModule();
- simpleModule.addDeserializer(com.google.api.services.plus.model.Activity.class, new GPlusActivityDeserializer());
- objectMapper.registerModule(simpleModule);
- objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
-
- googlePlusActivityUtil = new GooglePlusActivityUtil();
- }
-
- @Test
- public void TestActivityObjects() {
- InputStream is = GooglePlusActivitySerDeTest.class.getResourceAsStream("/google_plus_activity_jsons.txt");
- InputStreamReader isr = new InputStreamReader(is);
- BufferedReader br = new BufferedReader(isr);
-
- try {
- while (br.ready()) {
- String line = br.readLine();
- if (!StringUtils.isEmpty(line)) {
- LOGGER.info("raw: {}", line);
- Activity activity = new Activity();
-
- com.google.api.services.plus.model.Activity gPlusActivity = objectMapper.readValue(line, com.google.api.services.plus.model.Activity.class);
-
- googlePlusActivityUtil.updateActivity(gPlusActivity, activity);
- LOGGER.info("activity: {}", activity);
-
- assertNotNull(activity);
- assert(activity.getId().contains("id:googleplus:post"));
- assertEquals(activity.getVerb(), "post");
-
- Provider provider = activity.getProvider();
- assertEquals(provider.getId(), "id:providers:googleplus");
- assertEquals(provider.getDisplayName(), "GooglePlus");
-
- Actor actor = activity.getActor();
- assertNotNull(actor.getImage());
- assert(actor.getId().contains("id:googleplus:"));
- assertNotNull(actor.getUrl());
-
- assertNotNull(activity.getPublished());
- assertNotNull(activity.getTitle());
- assertNotNull(activity.getUrl());
-
- Map<String, Object> extensions = (Map<String, Object>)activity.getAdditionalProperties().get("extensions");
- assertNotNull(extensions);
- assertNotNull(extensions.get("googlePlus"));
-
- if(activity.getContent() != null) {
- assertNotNull(extensions.get("rebroadcasts"));
- assertNotNull(extensions.get("keywords"));
- assertNotNull(extensions.get("likes"));
- assert (((Map<String, Object>) extensions.get("rebroadcasts")).containsKey("count"));
- assert (((Map<String, Object>) extensions.get("likes")).containsKey("count"));
- }
- }
- }
- } catch (Exception e) {
- LOGGER.error("Exception while testing serializability: {}", e);
- }
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/3f45b23e/streams-contrib/streams-provider-instagram/pom.xml
----------------------------------------------------------------------
diff --git a/streams-contrib/streams-provider-instagram/pom.xml b/streams-contrib/streams-provider-instagram/pom.xml
index 180b10b..a7c5ed7 100644
--- a/streams-contrib/streams-provider-instagram/pom.xml
+++ b/streams-contrib/streams-provider-instagram/pom.xml
@@ -29,6 +29,11 @@
<description>Instagram Provider</description>
+ <properties>
+ <skipITs>true</skipITs>
+ <testDataBaseURl>http://streams.peoplepattern.com.s3.amazonaws.com/test-data/</testDataBaseURl>
+ </properties>
+
<dependencies>
<dependency>
<groupId>com.typesafe</groupId>
@@ -161,6 +166,33 @@
</execution>
</executions>
</plugin>
+ <plugin>
+ <groupId>com.googlecode.maven-download-plugin</groupId>
+ <artifactId>download-maven-plugin</artifactId>
+ <version>1.2.1</version>
+ <executions>
+ <execution>
+ <id>download-it-data</id>
+ <phase>pre-integration-test</phase>
+ <goals>
+ <goal>wget</goal>
+ </goals>
+ <configuration>
+ <url>${testDataBaseURl}/${artifactId}.zip</url>
+ <unpack>true</unpack>
+ <outputDirectory>${project.build.directory}/test-classes</outputDirectory>
+ <!--<md5>df65b5642f33676313ebe4d5b69a3fff</md5>-->
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-failsafe-plugin</artifactId>
+ <configuration>
+ <skipTests>${skipITs}</skipTests>
+ </configuration>
+ </plugin>
</plugins>
</build>
</project>
http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/3f45b23e/streams-contrib/streams-provider-instagram/src/test/java/org/apache/streams/twitter/test/InstagramActivitySerDeIT.java
----------------------------------------------------------------------
diff --git a/streams-contrib/streams-provider-instagram/src/test/java/org/apache/streams/twitter/test/InstagramActivitySerDeIT.java b/streams-contrib/streams-provider-instagram/src/test/java/org/apache/streams/twitter/test/InstagramActivitySerDeIT.java
new file mode 100644
index 0000000..732b18a
--- /dev/null
+++ b/streams-contrib/streams-provider-instagram/src/test/java/org/apache/streams/twitter/test/InstagramActivitySerDeIT.java
@@ -0,0 +1,134 @@
+/*
+ * 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.twitter.test;
+
+import org.apache.commons.lang.StringUtils;
+import org.apache.streams.instagram.serializer.util.InstagramDeserializer;
+import org.apache.streams.pojo.json.Activity;
+import org.jinstagram.entity.users.basicinfo.UserInfoData;
+import org.jinstagram.entity.users.feed.MediaFeedData;
+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 java.util.Map;
+
+import static org.apache.streams.instagram.serializer.util.InstagramActivityUtil.updateActivity;
+import static org.hamcrest.CoreMatchers.*;
+import static org.junit.Assert.assertThat;
+
+/**
+ * Tests conversion of instagram inputs to Activity
+ */
+public class InstagramActivitySerDeIT {
+
+ private final static Logger LOGGER = LoggerFactory.getLogger(InstagramActivitySerDeIT.class);
+
+ @Test
+ public void TestMediaFeedObjects() {
+ InstagramDeserializer instagramDeserializer = new InstagramDeserializer("");
+ InputStream is = InstagramActivitySerDeIT.class.getResourceAsStream("/testMediaFeedObjects.txt");
+ InputStreamReader isr = new InputStreamReader(is);
+ BufferedReader br = new BufferedReader(isr);
+
+ try {
+ while (br.ready()) {
+ String line = br.readLine();
+ if(!StringUtils.isEmpty(line))
+ {
+ LOGGER.info("raw: {}", line);
+
+ MediaFeedData mediaFeedData = instagramDeserializer.createObjectFromResponse(MediaFeedData.class, line);
+
+ Activity activity = new Activity();
+
+ LOGGER.info("activity: {}", activity.toString());
+
+ updateActivity(mediaFeedData, activity);
+ assertThat(activity, is(not(nullValue())));
+
+ assertThat(activity.getId(), is(not(nullValue())));
+ assertThat(activity.getActor(), is(not(nullValue())));
+ assertThat(activity.getActor().getId(), is(not(nullValue())));
+ assertThat(activity.getVerb(), is(not(nullValue())));
+ assertThat(activity.getProvider(), is(not(nullValue())));
+ }
+ }
+ } catch( Exception e ) {
+ System.out.println(e);
+ e.printStackTrace();
+ Assert.fail();
+ }
+ }
+
+ @Test
+ public void TestUserInfoData() {
+ InstagramDeserializer instagramDeserializer = new InstagramDeserializer("");
+ InputStream is = InstagramActivitySerDeIT.class.getResourceAsStream("/testUserInfoData.txt");
+ InputStreamReader isr = new InputStreamReader(is);
+ BufferedReader br = new BufferedReader(isr);
+
+ try {
+ while (br.ready()) {
+ String line = br.readLine();
+ if(!StringUtils.isEmpty(line))
+ {
+ LOGGER.info("raw: {}", line);
+
+ UserInfoData userInfoData = instagramDeserializer.createObjectFromResponse(UserInfoData.class, line);
+
+ Activity activity = new Activity();
+
+ LOGGER.info("activity: {}", activity.toString());
+
+ updateActivity(userInfoData, activity);
+ assertThat(activity, is(not(nullValue())));
+
+ assertThat(activity.getId(), is(nullValue()));
+ assertThat(activity.getActor(), is(not(nullValue())));
+ assertThat(activity.getActor().getImage(), is(not(nullValue())));
+ assertThat(activity.getActor().getDisplayName(), is(not(nullValue())));
+ assertThat(activity.getActor().getSummary(), is(not(nullValue())));
+
+ Map<String, Object> extensions = (Map<String, Object>)activity.getActor().getAdditionalProperties().get("extensions");
+ assertThat(extensions, is(not(nullValue())));
+ assertThat(extensions.get("follows"), is(not(nullValue())));
+ assertThat(extensions.get("followers"), is(not(nullValue())));
+ assertThat(extensions.get("screenName"), is(not(nullValue())));
+ assertThat(extensions.get("posts"), is(not(nullValue())));
+
+ assertThat(activity.getActor().getAdditionalProperties().get("handle"), is(not(nullValue())));
+ assertThat(activity.getActor().getId(), is(not(nullValue())));
+ assertThat(activity.getActor().getUrl(), is(not(nullValue())));
+ assertThat(activity.getVerb(), is(not(nullValue())));
+ assertThat(activity.getProvider(), is(not(nullValue())));
+ }
+ }
+ } catch( Exception e ) {
+ System.out.println(e);
+ e.printStackTrace();
+ Assert.fail();
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/3f45b23e/streams-contrib/streams-provider-instagram/src/test/java/org/apache/streams/twitter/test/InstagramActivitySerDeTest.java
----------------------------------------------------------------------
diff --git a/streams-contrib/streams-provider-instagram/src/test/java/org/apache/streams/twitter/test/InstagramActivitySerDeTest.java b/streams-contrib/streams-provider-instagram/src/test/java/org/apache/streams/twitter/test/InstagramActivitySerDeTest.java
deleted file mode 100644
index cc3a560..0000000
--- a/streams-contrib/streams-provider-instagram/src/test/java/org/apache/streams/twitter/test/InstagramActivitySerDeTest.java
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
- * 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.twitter.test;
-
-import org.apache.commons.lang.StringUtils;
-import org.apache.streams.instagram.serializer.util.InstagramDeserializer;
-import org.apache.streams.pojo.json.Activity;
-import org.jinstagram.entity.users.basicinfo.UserInfoData;
-import org.jinstagram.entity.users.feed.MediaFeedData;
-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 java.util.Map;
-
-import static org.apache.streams.instagram.serializer.util.InstagramActivityUtil.updateActivity;
-import static org.hamcrest.CoreMatchers.*;
-import static org.junit.Assert.assertThat;
-
-/**
- * Tests conversion of instagram inputs to Activity
- */
-@Ignore("ignore until test resources are available.")
-public class InstagramActivitySerDeTest {
-
- private final static Logger LOGGER = LoggerFactory.getLogger(InstagramActivitySerDeTest.class);
-
- @Test
- public void TestMediaFeedObjects() {
- InstagramDeserializer instagramDeserializer = new InstagramDeserializer("");
- InputStream is = InstagramActivitySerDeTest.class.getResourceAsStream("/testMediaFeedObjects.txt");
- InputStreamReader isr = new InputStreamReader(is);
- BufferedReader br = new BufferedReader(isr);
-
- try {
- while (br.ready()) {
- String line = br.readLine();
- if(!StringUtils.isEmpty(line))
- {
- LOGGER.info("raw: {}", line);
-
- MediaFeedData mediaFeedData = instagramDeserializer.createObjectFromResponse(MediaFeedData.class, line);
-
- Activity activity = new Activity();
-
- LOGGER.info("activity: {}", activity.toString());
-
- updateActivity(mediaFeedData, activity);
- assertThat(activity, is(not(nullValue())));
-
- assertThat(activity.getId(), is(not(nullValue())));
- assertThat(activity.getActor(), is(not(nullValue())));
- assertThat(activity.getActor().getId(), is(not(nullValue())));
- assertThat(activity.getVerb(), is(not(nullValue())));
- assertThat(activity.getProvider(), is(not(nullValue())));
- }
- }
- } catch( Exception e ) {
- System.out.println(e);
- e.printStackTrace();
- Assert.fail();
- }
- }
-
- @Test
- public void TestUserInfoData() {
- InstagramDeserializer instagramDeserializer = new InstagramDeserializer("");
- InputStream is = InstagramActivitySerDeTest.class.getResourceAsStream("/testUserInfoData.txt");
- InputStreamReader isr = new InputStreamReader(is);
- BufferedReader br = new BufferedReader(isr);
-
- try {
- while (br.ready()) {
- String line = br.readLine();
- if(!StringUtils.isEmpty(line))
- {
- LOGGER.info("raw: {}", line);
-
- UserInfoData userInfoData = instagramDeserializer.createObjectFromResponse(UserInfoData.class, line);
-
- Activity activity = new Activity();
-
- LOGGER.info("activity: {}", activity.toString());
-
- updateActivity(userInfoData, activity);
- assertThat(activity, is(not(nullValue())));
-
- assertThat(activity.getId(), is(nullValue()));
- assertThat(activity.getActor(), is(not(nullValue())));
- assertThat(activity.getActor().getImage(), is(not(nullValue())));
- assertThat(activity.getActor().getDisplayName(), is(not(nullValue())));
- assertThat(activity.getActor().getSummary(), is(not(nullValue())));
-
- Map<String, Object> extensions = (Map<String, Object>)activity.getActor().getAdditionalProperties().get("extensions");
- assertThat(extensions, is(not(nullValue())));
- assertThat(extensions.get("follows"), is(not(nullValue())));
- assertThat(extensions.get("followers"), is(not(nullValue())));
- assertThat(extensions.get("screenName"), is(not(nullValue())));
- assertThat(extensions.get("posts"), is(not(nullValue())));
-
- assertThat(activity.getActor().getAdditionalProperties().get("handle"), is(not(nullValue())));
- assertThat(activity.getActor().getId(), is(not(nullValue())));
- assertThat(activity.getActor().getUrl(), is(not(nullValue())));
- assertThat(activity.getVerb(), is(not(nullValue())));
- assertThat(activity.getProvider(), is(not(nullValue())));
- }
- }
- } catch( Exception e ) {
- System.out.println(e);
- e.printStackTrace();
- Assert.fail();
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/3f45b23e/streams-contrib/streams-provider-moreover/pom.xml
----------------------------------------------------------------------
diff --git a/streams-contrib/streams-provider-moreover/pom.xml b/streams-contrib/streams-provider-moreover/pom.xml
index 33ef97d..868cfc8 100644
--- a/streams-contrib/streams-provider-moreover/pom.xml
+++ b/streams-contrib/streams-provider-moreover/pom.xml
@@ -29,6 +29,11 @@
<description>Moreover Provider</description>
+ <properties>
+ <skipITs>true</skipITs>
+ <testDataBaseURl>http://streams.peoplepattern.com.s3.amazonaws.com/test-data/</testDataBaseURl>
+ </properties>
+
<dependencies>
<dependency>
<groupId>com.typesafe</groupId>
@@ -175,6 +180,33 @@
</execution>
</executions>
</plugin>
+ <plugin>
+ <groupId>com.googlecode.maven-download-plugin</groupId>
+ <artifactId>download-maven-plugin</artifactId>
+ <version>1.2.1</version>
+ <executions>
+ <execution>
+ <id>download-it-data</id>
+ <phase>pre-integration-test</phase>
+ <goals>
+ <goal>wget</goal>
+ </goals>
+ <configuration>
+ <url>${testDataBaseURl}/${artifactId}.zip</url>
+ <unpack>true</unpack>
+ <outputDirectory>${project.build.directory}/test-classes</outputDirectory>
+ <!--<md5>df65b5642f33676313ebe4d5b69a3fff</md5>-->
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-failsafe-plugin</artifactId>
+ <configuration>
+ <skipTests>${skipITs}</skipTests>
+ </configuration>
+ </plugin>
</plugins>
</build>
</project>
http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/3f45b23e/streams-contrib/streams-provider-moreover/src/test/java/org/apache/streams/data/MoreoverJsonActivitySerializerIT.java
----------------------------------------------------------------------
diff --git a/streams-contrib/streams-provider-moreover/src/test/java/org/apache/streams/data/MoreoverJsonActivitySerializerIT.java b/streams-contrib/streams-provider-moreover/src/test/java/org/apache/streams/data/MoreoverJsonActivitySerializerIT.java
new file mode 100644
index 0000000..ea83777
--- /dev/null
+++ b/streams-contrib/streams-provider-moreover/src/test/java/org/apache/streams/data/MoreoverJsonActivitySerializerIT.java
@@ -0,0 +1,79 @@
+/*
+ * 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.data;
+
+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.commons.io.IOUtils;
+import org.apache.streams.data.util.JsonUtil;
+import org.junit.Before;
+import org.junit.Ignore;
+import org.junit.Test;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.StringWriter;
+import java.net.URL;
+import java.nio.charset.Charset;
+
+import static org.apache.streams.data.util.MoreoverTestUtil.test;
+
+/**
+ * Tests ability to serialize moreover json Strings
+ */
+public class MoreoverJsonActivitySerializerIT {
+ JsonNode json;
+ ActivitySerializer serializer = new MoreoverJsonActivitySerializer();
+ ObjectMapper mapper;
+
+ @Before
+ public void setup() throws Exception {
+
+ StringWriter writer = new StringWriter();
+ InputStream resourceAsStream = this.getClass().getResourceAsStream("/moreover.json");
+ IOUtils.copy(resourceAsStream, writer, Charset.forName("UTF-8"));
+
+ 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);
+
+ json = mapper.readValue(writer.toString(), JsonNode.class);
+ }
+
+ @Test
+ public void loadData() throws Exception {
+ for (JsonNode item : json) {
+ test(serializer.deserialize(getString(item)));
+ }
+ }
+
+
+ private String getString(JsonNode jsonNode) {
+ try {
+ return new ObjectMapper().writeValueAsString(jsonNode);
+ } catch (JsonProcessingException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/3f45b23e/streams-contrib/streams-provider-moreover/src/test/java/org/apache/streams/data/MoreoverJsonActivitySerializerTest.java
----------------------------------------------------------------------
diff --git a/streams-contrib/streams-provider-moreover/src/test/java/org/apache/streams/data/MoreoverJsonActivitySerializerTest.java b/streams-contrib/streams-provider-moreover/src/test/java/org/apache/streams/data/MoreoverJsonActivitySerializerTest.java
deleted file mode 100644
index ef4fb48..0000000
--- a/streams-contrib/streams-provider-moreover/src/test/java/org/apache/streams/data/MoreoverJsonActivitySerializerTest.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * 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.data;
-
-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.util.JsonUtil;
-import org.junit.Before;
-import org.junit.Ignore;
-import org.junit.Test;
-
-import java.io.IOException;
-
-import static org.apache.streams.data.util.MoreoverTestUtil.test;
-
-/**
- * Tests ability to serialize moreover json Strings
- */
-@Ignore("ignore until test resources are available.")
-public class MoreoverJsonActivitySerializerTest {
- JsonNode json;
- ActivitySerializer serializer = new MoreoverJsonActivitySerializer();
- ObjectMapper mapper;
-
- @Before
- public void setup() throws IOException {
- json = JsonUtil.getFromFile("classpath:org/apache/streams/data/moreover.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) {
- test(serializer.deserialize(getString(item)));
- }
- }
-
-
- private String getString(JsonNode jsonNode) {
- try {
- return new ObjectMapper().writeValueAsString(jsonNode);
- } catch (JsonProcessingException e) {
- throw new RuntimeException(e);
- }
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/3f45b23e/streams-contrib/streams-provider-moreover/src/test/java/org/apache/streams/data/MoreoverXmlActivitySerializerIT.java
----------------------------------------------------------------------
diff --git a/streams-contrib/streams-provider-moreover/src/test/java/org/apache/streams/data/MoreoverXmlActivitySerializerIT.java b/streams-contrib/streams-provider-moreover/src/test/java/org/apache/streams/data/MoreoverXmlActivitySerializerIT.java
new file mode 100644
index 0000000..da660cd
--- /dev/null
+++ b/streams-contrib/streams-provider-moreover/src/test/java/org/apache/streams/data/MoreoverXmlActivitySerializerIT.java
@@ -0,0 +1,65 @@
+/*
+ * 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.data;
+
+
+import com.google.common.collect.Lists;
+import org.apache.commons.io.IOUtils;
+import org.apache.streams.pojo.json.Activity;
+import org.junit.Before;
+import org.junit.Ignore;
+import org.junit.Test;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.StringWriter;
+import java.nio.charset.Charset;
+import java.util.List;
+
+import static org.apache.streams.data.util.MoreoverTestUtil.test;
+
+/**
+ * Tests ability to serialize moreover xml Strings
+ */
+public class MoreoverXmlActivitySerializerIT {
+ ActivitySerializer serializer;
+ private String xml;
+
+ @Before
+ public void setup() throws IOException {
+ serializer = new MoreoverXmlActivitySerializer();
+ xml = loadXml();
+ }
+
+ @Test
+ public void loadData() throws Exception {
+ List<Activity> activities = serializer.deserializeAll(Lists.newArrayList(xml));
+ for (Activity activity : activities) {
+ test(activity);
+ }
+ }
+
+ private String loadXml() throws IOException {
+ StringWriter writer = new StringWriter();
+ InputStream resourceAsStream = this.getClass().getResourceAsStream("/moreover.xml");
+ IOUtils.copy(resourceAsStream, writer, Charset.forName("UTF-8"));
+ return writer.toString();
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/3f45b23e/streams-contrib/streams-provider-moreover/src/test/java/org/apache/streams/data/MoreoverXmlActivitySerializerTest.java
----------------------------------------------------------------------
diff --git a/streams-contrib/streams-provider-moreover/src/test/java/org/apache/streams/data/MoreoverXmlActivitySerializerTest.java b/streams-contrib/streams-provider-moreover/src/test/java/org/apache/streams/data/MoreoverXmlActivitySerializerTest.java
deleted file mode 100644
index 6d771f2..0000000
--- a/streams-contrib/streams-provider-moreover/src/test/java/org/apache/streams/data/MoreoverXmlActivitySerializerTest.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * 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.data;
-
-
-import com.google.common.collect.Lists;
-import org.apache.commons.io.IOUtils;
-import org.apache.streams.pojo.json.Activity;
-import org.junit.Before;
-import org.junit.Ignore;
-import org.junit.Test;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.StringWriter;
-import java.nio.charset.Charset;
-import java.util.List;
-
-import static org.apache.streams.data.util.MoreoverTestUtil.test;
-
-/**
- * Tests ability to serialize moreover xml Strings
- */
-@Ignore("ignore until test resources are available.")
-public class MoreoverXmlActivitySerializerTest {
- ActivitySerializer serializer;
- private String xml;
-
- @Before
- public void setup() throws IOException {
- serializer = new MoreoverXmlActivitySerializer();
- xml = loadXml();
- }
-
- @Test
- public void loadData() throws Exception {
- List<Activity> activities = serializer.deserializeAll(Lists.newArrayList(xml));
- for (Activity activity : activities) {
- test(activity);
- }
- }
-
- private String loadXml() throws IOException {
- StringWriter writer = new StringWriter();
- InputStream resourceAsStream = this.getClass().getResourceAsStream("moreover.xml");
- IOUtils.copy(resourceAsStream, writer, Charset.forName("UTF-8"));
- return writer.toString();
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/3f45b23e/streams-contrib/streams-provider-rss/pom.xml
----------------------------------------------------------------------
diff --git a/streams-contrib/streams-provider-rss/pom.xml b/streams-contrib/streams-provider-rss/pom.xml
index 98965e0..50f0a3f 100644
--- a/streams-contrib/streams-provider-rss/pom.xml
+++ b/streams-contrib/streams-provider-rss/pom.xml
@@ -29,6 +29,11 @@
<description>RSS Provider</description>
+ <properties>
+ <skipITs>true</skipITs>
+ <testDataBaseURl>http://streams.peoplepattern.com.s3.amazonaws.com/test-data/</testDataBaseURl>
+ </properties>
+
<dependencies>
<dependency>
<groupId>com.typesafe</groupId>
@@ -155,6 +160,33 @@
</execution>
</executions>
</plugin>
+ <plugin>
+ <groupId>com.googlecode.maven-download-plugin</groupId>
+ <artifactId>download-maven-plugin</artifactId>
+ <version>1.2.1</version>
+ <executions>
+ <execution>
+ <id>download-it-data</id>
+ <phase>pre-integration-test</phase>
+ <goals>
+ <goal>wget</goal>
+ </goals>
+ <configuration>
+ <url>${testDataBaseURl}/${artifactId}.zip</url>
+ <unpack>true</unpack>
+ <outputDirectory>${project.build.directory}/test-classes</outputDirectory>
+ <!--<md5>df65b5642f33676313ebe4d5b69a3fff</md5>-->
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-failsafe-plugin</artifactId>
+ <configuration>
+ <skipTests>${skipITs}</skipTests>
+ </configuration>
+ </plugin>
</plugins>
</build>
</project>
http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/3f45b23e/streams-contrib/streams-provider-rss/src/test/java/org/apache/streams/rss/provider/RssStreamProviderTaskIT.java
----------------------------------------------------------------------
diff --git a/streams-contrib/streams-provider-rss/src/test/java/org/apache/streams/rss/provider/RssStreamProviderTaskIT.java b/streams-contrib/streams-provider-rss/src/test/java/org/apache/streams/rss/provider/RssStreamProviderTaskIT.java
new file mode 100644
index 0000000..a838c78
--- /dev/null
+++ b/streams-contrib/streams-provider-rss/src/test/java/org/apache/streams/rss/provider/RssStreamProviderTaskIT.java
@@ -0,0 +1,149 @@
+/*
+ * 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.rss.provider;
+
+import org.apache.streams.core.StreamsDatum;
+import org.joda.time.DateTime;
+import org.joda.time.DateTimeZone;
+import org.junit.Before;
+import org.junit.Ignore;
+import org.junit.Test;
+
+import java.net.URL;
+import java.util.Set;
+import java.util.concurrent.BlockingQueue;
+import java.util.concurrent.LinkedBlockingQueue;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+/**
+ * Unit tests for {@link org.apache.streams.rss.provider.RssStreamProviderTask}
+ */
+public class RssStreamProviderTaskIT {
+
+
+ @Before
+ public void clearPreviouslySeen() {
+ //some test runners run in parallel so needs to be synchronized
+ //if tests are run in parallel test will have undetermined results.
+ synchronized (RssStreamProviderTask.PREVIOUSLY_SEEN) {
+ RssStreamProviderTask.PREVIOUSLY_SEEN.clear();
+ }
+ }
+
+ /**
+ * Test that a task can read a valid rss from a url and queue the data
+ * @throws Exception
+ */
+ @Test
+ public void testNonPerpetualNoTimeFramePull() throws Exception {
+ com.healthmarketscience.common.util.resource.Handler.init();
+ BlockingQueue<StreamsDatum> queue = new LinkedBlockingQueue<>();
+ RssStreamProviderTask task = new RssStreamProviderTask(queue, "fake url");
+ Set<String> batch = task.queueFeedEntries(new URL("resource:///test_rss_xml/economist1.xml"));
+ assertEquals("Expected batch size to be the same as amount of queued datums", batch.size(), queue.size());
+ RssStreamProviderTask.PREVIOUSLY_SEEN.put("fake url", batch);
+ //Test that it will out previously seen articles
+ queue.clear();
+ batch = task.queueFeedEntries(new URL("resource:///test_rss_xml/economist1.xml"));
+ assertEquals("Expected batch size to be the same as amount of queued datums", batch.size(), queue.size());
+ }
+
+ /**
+ * Test that perpetual streams will not output previously seen articles
+ * @throws Exception
+ */
+ @Test
+ public void testPerpetualNoTimeFramePull() throws Exception {
+ com.healthmarketscience.common.util.resource.Handler.init();
+ BlockingQueue<StreamsDatum> queue = new LinkedBlockingQueue<>();
+ RssStreamProviderTask task = new RssStreamProviderTask(queue, "fake url", new DateTime().minusYears(1), 10000, true);
+ Set<String> batch = task.queueFeedEntries(new URL("resource:///test_rss_xml/economist1.xml"));
+ assertEquals("Expected batch size to be the same as amount of queued datums", batch.size(), queue.size());
+ RssStreamProviderTask.PREVIOUSLY_SEEN.put("fake url", batch);
+ //Test that it will not out previously seen articles
+ queue.clear();
+ batch = task.queueFeedEntries(new URL("resource:///test_rss_xml/economist1.xml"));
+ assertEquals("Expected queue size to be 0", 0, queue.size());
+ assertEquals("Expected batch size to be 20", 20, batch.size());
+ RssStreamProviderTask.PREVIOUSLY_SEEN.put("fake url", batch);
+ //Test that not seen urls aren't blocked.
+ queue.clear();
+ batch = task.queueFeedEntries(new URL("resource:///test_rss_xml/economist2.xml"));
+ assertEquals(batch.size(), queue.size());
+ assertEquals("Expected queue size to be 25", 25, queue.size());
+ assertEquals("Expected batch size to be 25", 25, batch.size());
+ }
+
+ /**
+ * Test that you can task will only output aritcles after a certain published time
+ * @throws Exception
+ */
+ @Test
+ public void testNonPerpetualTimeFramedPull() throws Exception{
+ com.healthmarketscience.common.util.resource.Handler.init();
+ BlockingQueue<StreamsDatum> queue = new LinkedBlockingQueue<>();
+ DateTime publishedSince = new DateTime().withYear(2014).withDayOfMonth(5).withMonthOfYear(9).withZone(DateTimeZone.UTC);
+ RssStreamProviderTask task = new RssStreamProviderTask(queue, "fake url", publishedSince, 10000, false);
+ Set<String> batch = task.queueFeedEntries(new URL("resource:///test_rss_xml/economist1.xml"));
+ assertEquals( 15, queue.size());
+ assertEquals( 20 , batch.size());
+ assertTrue( queue.size() < batch.size());
+ RssStreamProviderTask.PREVIOUSLY_SEEN.put("fake url", batch);
+ //Test that it will out previously seen articles
+ queue.clear();
+ batch = task.queueFeedEntries(new URL("resource:///test_rss_xml/economist1.xml"));
+ assertEquals( 15, queue.size());
+ assertEquals( 20 , batch.size());
+ assertTrue( queue.size() < batch.size());
+ }
+
+ /**
+ * Test that task will only output articles after a certain published time that it has not seen before.
+ * @throws Exception
+ */
+ @Test
+ public void testPerpetualTimeFramedPull() throws Exception {
+ com.healthmarketscience.common.util.resource.Handler.init();
+ BlockingQueue<StreamsDatum> queue = new LinkedBlockingQueue<>();
+ DateTime publishedSince = new DateTime().withYear(2014).withDayOfMonth(5).withMonthOfYear(9).withZone(DateTimeZone.UTC);
+ RssStreamProviderTask task = new RssStreamProviderTask(queue, "fake url", publishedSince, 10000, true);
+ Set<String> batch = task.queueFeedEntries(new URL("resource:///test_rss_xml/economist1.xml"));
+ assertEquals( 15, queue.size());
+ assertEquals( 20 , batch.size());
+ assertTrue( queue.size() < batch.size());
+ RssStreamProviderTask.PREVIOUSLY_SEEN.put("fake url", batch);
+ //Test that it will not out put previously seen articles
+ queue.clear();
+ batch = task.queueFeedEntries(new URL("resource:///test_rss_xml/economist1.xml"));
+ assertEquals( 0, queue.size());
+ assertEquals( 20 , batch.size());
+ assertTrue( queue.size() < batch.size());
+ RssStreamProviderTask.PREVIOUSLY_SEEN.put("fake url", batch);
+
+ batch = task.queueFeedEntries(new URL("resource:///test_rss_xml/economist2.xml"));
+ assertTrue( queue.size() < batch.size());
+ assertEquals("Expected queue size to be 0", 3, queue.size());
+ assertEquals("Expected batch size to be 0", 25, batch.size());
+ }
+
+
+
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/3f45b23e/streams-contrib/streams-provider-rss/src/test/java/org/apache/streams/rss/provider/RssStreamProviderTaskTest.java
----------------------------------------------------------------------
diff --git a/streams-contrib/streams-provider-rss/src/test/java/org/apache/streams/rss/provider/RssStreamProviderTaskTest.java b/streams-contrib/streams-provider-rss/src/test/java/org/apache/streams/rss/provider/RssStreamProviderTaskTest.java
deleted file mode 100644
index 5534d03..0000000
--- a/streams-contrib/streams-provider-rss/src/test/java/org/apache/streams/rss/provider/RssStreamProviderTaskTest.java
+++ /dev/null
@@ -1,150 +0,0 @@
-/*
- * 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.rss.provider;
-
-import org.apache.streams.core.StreamsDatum;
-import org.joda.time.DateTime;
-import org.joda.time.DateTimeZone;
-import org.junit.Before;
-import org.junit.Ignore;
-import org.junit.Test;
-
-import java.net.URL;
-import java.util.Set;
-import java.util.concurrent.BlockingQueue;
-import java.util.concurrent.LinkedBlockingQueue;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-/**
- * Unit tests for {@link org.apache.streams.rss.provider.RssStreamProviderTask}
- */
-@Ignore("ignore until test resources are available.")
-public class RssStreamProviderTaskTest {
-
-
- @Before
- public void clearPreviouslySeen() {
- //some test runners run in parallel so needs to be synchronized
- //if tests are run in parallel test will have undetermined results.
- synchronized (RssStreamProviderTask.PREVIOUSLY_SEEN) {
- RssStreamProviderTask.PREVIOUSLY_SEEN.clear();
- }
- }
-
- /**
- * Test that a task can read a valid rss from a url and queue the data
- * @throws Exception
- */
- @Test
- public void testNonPerpetualNoTimeFramePull() throws Exception {
- com.healthmarketscience.common.util.resource.Handler.init();
- BlockingQueue<StreamsDatum> queue = new LinkedBlockingQueue<>();
- RssStreamProviderTask task = new RssStreamProviderTask(queue, "fake url");
- Set<String> batch = task.queueFeedEntries(new URL("resource:///test_rss_xml/economist1.xml"));
- assertEquals("Expected batch size to be the same as amount of queued datums", batch.size(), queue.size());
- RssStreamProviderTask.PREVIOUSLY_SEEN.put("fake url", batch);
- //Test that it will out previously seen articles
- queue.clear();
- batch = task.queueFeedEntries(new URL("resource:///test_rss_xml/economist1.xml"));
- assertEquals("Expected batch size to be the same as amount of queued datums", batch.size(), queue.size());
- }
-
- /**
- * Test that perpetual streams will not output previously seen articles
- * @throws Exception
- */
- @Test
- public void testPerpetualNoTimeFramePull() throws Exception {
- com.healthmarketscience.common.util.resource.Handler.init();
- BlockingQueue<StreamsDatum> queue = new LinkedBlockingQueue<>();
- RssStreamProviderTask task = new RssStreamProviderTask(queue, "fake url", new DateTime().minusYears(1), 10000, true);
- Set<String> batch = task.queueFeedEntries(new URL("resource:///test_rss_xml/economist1.xml"));
- assertEquals("Expected batch size to be the same as amount of queued datums", batch.size(), queue.size());
- RssStreamProviderTask.PREVIOUSLY_SEEN.put("fake url", batch);
- //Test that it will not out previously seen articles
- queue.clear();
- batch = task.queueFeedEntries(new URL("resource:///test_rss_xml/economist1.xml"));
- assertEquals("Expected queue size to be 0", 0, queue.size());
- assertEquals("Expected batch size to be 20", 20, batch.size());
- RssStreamProviderTask.PREVIOUSLY_SEEN.put("fake url", batch);
- //Test that not seen urls aren't blocked.
- queue.clear();
- batch = task.queueFeedEntries(new URL("resource:///test_rss_xml/economist2.xml"));
- assertEquals(batch.size(), queue.size());
- assertEquals("Expected queue size to be 25", 25, queue.size());
- assertEquals("Expected batch size to be 25", 25, batch.size());
- }
-
- /**
- * Test that you can task will only output aritcles after a certain published time
- * @throws Exception
- */
- @Test
- public void testNonPerpetualTimeFramedPull() throws Exception{
- com.healthmarketscience.common.util.resource.Handler.init();
- BlockingQueue<StreamsDatum> queue = new LinkedBlockingQueue<>();
- DateTime publishedSince = new DateTime().withYear(2014).withDayOfMonth(5).withMonthOfYear(9).withZone(DateTimeZone.UTC);
- RssStreamProviderTask task = new RssStreamProviderTask(queue, "fake url", publishedSince, 10000, false);
- Set<String> batch = task.queueFeedEntries(new URL("resource:///test_rss_xml/economist1.xml"));
- assertEquals( 15, queue.size());
- assertEquals( 20 , batch.size());
- assertTrue( queue.size() < batch.size());
- RssStreamProviderTask.PREVIOUSLY_SEEN.put("fake url", batch);
- //Test that it will out previously seen articles
- queue.clear();
- batch = task.queueFeedEntries(new URL("resource:///test_rss_xml/economist1.xml"));
- assertEquals( 15, queue.size());
- assertEquals( 20 , batch.size());
- assertTrue( queue.size() < batch.size());
- }
-
- /**
- * Test that task will only output articles after a certain published time that it has not seen before.
- * @throws Exception
- */
- @Test
- public void testPerpetualTimeFramedPull() throws Exception {
- com.healthmarketscience.common.util.resource.Handler.init();
- BlockingQueue<StreamsDatum> queue = new LinkedBlockingQueue<>();
- DateTime publishedSince = new DateTime().withYear(2014).withDayOfMonth(5).withMonthOfYear(9).withZone(DateTimeZone.UTC);
- RssStreamProviderTask task = new RssStreamProviderTask(queue, "fake url", publishedSince, 10000, true);
- Set<String> batch = task.queueFeedEntries(new URL("resource:///test_rss_xml/economist1.xml"));
- assertEquals( 15, queue.size());
- assertEquals( 20 , batch.size());
- assertTrue( queue.size() < batch.size());
- RssStreamProviderTask.PREVIOUSLY_SEEN.put("fake url", batch);
- //Test that it will not out put previously seen articles
- queue.clear();
- batch = task.queueFeedEntries(new URL("resource:///test_rss_xml/economist1.xml"));
- assertEquals( 0, queue.size());
- assertEquals( 20 , batch.size());
- assertTrue( queue.size() < batch.size());
- RssStreamProviderTask.PREVIOUSLY_SEEN.put("fake url", batch);
-
- batch = task.queueFeedEntries(new URL("resource:///test_rss_xml/economist2.xml"));
- assertTrue( queue.size() < batch.size());
- assertEquals("Expected queue size to be 0", 3, queue.size());
- assertEquals("Expected batch size to be 0", 25, batch.size());
- }
-
-
-
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/3f45b23e/streams-contrib/streams-provider-rss/src/test/java/org/apache/streams/rss/test/SyndEntryActivitySerializerIT.java
----------------------------------------------------------------------
diff --git a/streams-contrib/streams-provider-rss/src/test/java/org/apache/streams/rss/test/SyndEntryActivitySerializerIT.java b/streams-contrib/streams-provider-rss/src/test/java/org/apache/streams/rss/test/SyndEntryActivitySerializerIT.java
new file mode 100644
index 0000000..f818c33
--- /dev/null
+++ b/streams-contrib/streams-provider-rss/src/test/java/org/apache/streams/rss/test/SyndEntryActivitySerializerIT.java
@@ -0,0 +1,123 @@
+/*
+ * 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.rss.test;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.node.ObjectNode;
+import com.google.common.collect.Lists;
+import org.apache.streams.jackson.StreamsJacksonMapper;
+import org.apache.streams.pojo.json.Activity;
+import org.apache.streams.pojo.json.Actor;
+import org.apache.streams.pojo.json.Author;
+import org.apache.streams.pojo.json.Provider;
+import org.apache.streams.rss.serializer.SyndEntryActivitySerializer;
+import org.joda.time.DateTime;
+import org.joda.time.DateTimeZone;
+import org.junit.Ignore;
+import org.junit.Test;
+
+import java.net.URL;
+import java.util.List;
+import java.util.Scanner;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+/**
+ * Tests ability to convert SyndEntry ObjectNode form to {@link org.apache.streams.rss.processor.RssTypeConverter} form
+ */
+public class SyndEntryActivitySerializerIT {
+
+ private static ObjectMapper mapper = StreamsJacksonMapper.getInstance();
+
+ @Test
+ public void testJsonData() throws Exception {
+ Scanner scanner = new Scanner(this.getClass().getResourceAsStream("/TestSyndEntryJson.txt"));
+ List<Activity> activities = Lists.newLinkedList();
+ List<ObjectNode> objects = Lists.newLinkedList();
+
+ SyndEntryActivitySerializer serializer = new SyndEntryActivitySerializer();
+
+ while(scanner.hasNext()) {
+ String line = scanner.nextLine();
+ System.out.println(line);
+ ObjectNode node = (ObjectNode) mapper.readTree(line);
+
+ objects.add(node);
+ activities.add(serializer.deserialize(node));
+ }
+
+ assertEquals(11, activities.size());
+
+ for(int x = 0; x < activities.size(); x ++) {
+ ObjectNode n = objects.get(x);
+ Activity a = activities.get(x);
+
+ testActor(n.get("author").asText(), a.getActor());
+ testAuthor(n.get("author").asText(), a.getObject().getAuthor());
+ testProvider("id:providers:rss", "RSS", a.getProvider());
+ testProviderUrl(a.getProvider());
+ testVerb("post", a.getVerb());
+ testPublished(n.get("publishedDate").asText(), a.getPublished());
+ testUrl(n.get("uri").asText(), n.get("link").asText(), a);
+ }
+ }
+
+ public void testVerb(String expected, String verb) {
+ assertEquals(expected, verb);
+ }
+
+ public void testPublished(String expected, DateTime published) {
+ assertEquals(new DateTime(expected, DateTimeZone.UTC), published);
+ }
+
+ public void testActor(String expected, Actor actor) {
+ assertEquals("id:rss:null" + ":" + expected, actor.getId());
+ assertEquals(expected, actor.getDisplayName());
+ }
+
+ public void testAuthor(String expected, Author author) {
+ assertEquals(expected, author.getDisplayName());
+ assertEquals(expected, author.getId());
+ }
+
+ public void testProvider(String expectedId, String expectedDisplay, Provider provider) {
+ assertEquals(expectedId, provider.getId());
+ assertEquals(expectedDisplay, provider.getDisplayName());
+ }
+
+ public void testProviderUrl(Provider provider) {
+ URL url = null;
+
+ try {
+ url = new URL(provider.getUrl());
+ url.toURI();
+ } catch(Exception e) {
+ System.out.println("Threw an exception while trying to validate URL: " + provider.getUrl());
+ }
+
+ assertNotNull(url);
+ }
+
+ public void testUrl(String expectedURI, String expectedLink, Activity activity) {
+ assertTrue((expectedURI == activity.getUrl() || expectedLink == activity.getUrl()));
+ assertTrue((expectedURI == activity.getObject().getUrl() || expectedLink == activity.getObject().getUrl()));
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/3f45b23e/streams-contrib/streams-provider-rss/src/test/java/org/apache/streams/rss/test/SyndEntryActivitySerizlizerTest.java
----------------------------------------------------------------------
diff --git a/streams-contrib/streams-provider-rss/src/test/java/org/apache/streams/rss/test/SyndEntryActivitySerizlizerTest.java b/streams-contrib/streams-provider-rss/src/test/java/org/apache/streams/rss/test/SyndEntryActivitySerizlizerTest.java
deleted file mode 100644
index 4337451..0000000
--- a/streams-contrib/streams-provider-rss/src/test/java/org/apache/streams/rss/test/SyndEntryActivitySerizlizerTest.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
- * 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.rss.test;
-
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.node.ObjectNode;
-import com.google.common.collect.Lists;
-import org.apache.streams.jackson.StreamsJacksonMapper;
-import org.apache.streams.pojo.json.Activity;
-import org.apache.streams.pojo.json.Actor;
-import org.apache.streams.pojo.json.Author;
-import org.apache.streams.pojo.json.Provider;
-import org.apache.streams.rss.serializer.SyndEntryActivitySerializer;
-import org.joda.time.DateTime;
-import org.joda.time.DateTimeZone;
-import org.junit.Ignore;
-import org.junit.Test;
-
-import java.net.URL;
-import java.util.List;
-import java.util.Scanner;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-
-/**
- * Tests ability to convert SyndEntry ObjectNode form to {@link org.apache.streams.rss.processor.RssTypeConverter} form
- */
-@Ignore("ignore until test resources are available.")
-public class SyndEntryActivitySerizlizerTest {
-
- private static ObjectMapper mapper = StreamsJacksonMapper.getInstance();
-
- @Test
- public void testJsonData() throws Exception {
- Scanner scanner = new Scanner(this.getClass().getResourceAsStream("/TestSyndEntryJson.txt"));
- List<Activity> activities = Lists.newLinkedList();
- List<ObjectNode> objects = Lists.newLinkedList();
-
- SyndEntryActivitySerializer serializer = new SyndEntryActivitySerializer();
-
- while(scanner.hasNext()) {
- String line = scanner.nextLine();
- System.out.println(line);
- ObjectNode node = (ObjectNode) mapper.readTree(line);
-
- objects.add(node);
- activities.add(serializer.deserialize(node));
- }
-
- assertEquals(11, activities.size());
-
- for(int x = 0; x < activities.size(); x ++) {
- ObjectNode n = objects.get(x);
- Activity a = activities.get(x);
-
- testActor(n.get("author").asText(), a.getActor());
- testAuthor(n.get("author").asText(), a.getObject().getAuthor());
- testProvider("id:providers:rss", "RSS", a.getProvider());
- testProviderUrl(a.getProvider());
- testVerb("post", a.getVerb());
- testPublished(n.get("publishedDate").asText(), a.getPublished());
- testUrl(n.get("uri").asText(), n.get("link").asText(), a);
- }
- }
-
- public void testVerb(String expected, String verb) {
- assertEquals(expected, verb);
- }
-
- public void testPublished(String expected, DateTime published) {
- assertEquals(new DateTime(expected, DateTimeZone.UTC), published);
- }
-
- public void testActor(String expected, Actor actor) {
- assertEquals("id:rss:null" + ":" + expected, actor.getId());
- assertEquals(expected, actor.getDisplayName());
- }
-
- public void testAuthor(String expected, Author author) {
- assertEquals(expected, author.getDisplayName());
- assertEquals(expected, author.getId());
- }
-
- public void testProvider(String expectedId, String expectedDisplay, Provider provider) {
- assertEquals(expectedId, provider.getId());
- assertEquals(expectedDisplay, provider.getDisplayName());
- }
-
- public void testProviderUrl(Provider provider) {
- URL url = null;
-
- try {
- url = new URL(provider.getUrl());
- url.toURI();
- } catch(Exception e) {
- System.out.println("Threw an exception while trying to validate URL: " + provider.getUrl());
- }
-
- assertNotNull(url);
- }
-
- public void testUrl(String expectedURI, String expectedLink, Activity activity) {
- assertTrue((expectedURI == activity.getUrl() || expectedLink == activity.getUrl()));
- assertTrue((expectedURI == activity.getObject().getUrl() || expectedLink == activity.getObject().getUrl()));
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/3f45b23e/streams-contrib/streams-provider-sysomos/pom.xml
----------------------------------------------------------------------
diff --git a/streams-contrib/streams-provider-sysomos/pom.xml b/streams-contrib/streams-provider-sysomos/pom.xml
index c99f006..5ce4561 100644
--- a/streams-contrib/streams-provider-sysomos/pom.xml
+++ b/streams-contrib/streams-provider-sysomos/pom.xml
@@ -29,6 +29,11 @@
<description>Sysomos Provider</description>
+ <properties>
+ <skipITs>true</skipITs>
+ <testDataBaseURl>http://streams.peoplepattern.com.s3.amazonaws.com/test-data/</testDataBaseURl>
+ </properties>
+
<dependencies>
<dependency>
<groupId>com.typesafe</groupId>
@@ -166,6 +171,33 @@
</execution>
</executions>
</plugin>
+ <plugin>
+ <groupId>com.googlecode.maven-download-plugin</groupId>
+ <artifactId>download-maven-plugin</artifactId>
+ <version>1.2.1</version>
+ <executions>
+ <execution>
+ <id>download-it-data</id>
+ <phase>pre-integration-test</phase>
+ <goals>
+ <goal>wget</goal>
+ </goals>
+ <configuration>
+ <url>${testDataBaseURl}/${artifactId}.zip</url>
+ <unpack>true</unpack>
+ <outputDirectory>${project.build.directory}/test-classes</outputDirectory>
+ <!--<md5>df65b5642f33676313ebe4d5b69a3fff</md5>-->
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-failsafe-plugin</artifactId>
+ <configuration>
+ <skipTests>${skipITs}</skipTests>
+ </configuration>
+ </plugin>
</plugins>
</build>
http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/3f45b23e/streams-contrib/streams-provider-sysomos/src/test/java/com/sysomos/test/SysomosJsonSerDeIT.java
----------------------------------------------------------------------
diff --git a/streams-contrib/streams-provider-sysomos/src/test/java/com/sysomos/test/SysomosJsonSerDeIT.java b/streams-contrib/streams-provider-sysomos/src/test/java/com/sysomos/test/SysomosJsonSerDeIT.java
new file mode 100644
index 0000000..e3b4848
--- /dev/null
+++ b/streams-contrib/streams-provider-sysomos/src/test/java/com/sysomos/test/SysomosJsonSerDeIT.java
@@ -0,0 +1,69 @@
+/*
+ * 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.sysomos.test;
+
+import com.fasterxml.jackson.databind.DeserializationFeature;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.sysomos.json.Sysomos;
+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;
+
+/**
+ * Tests ability to convert String json form to {@link com.sysomos.json.Sysomos} form
+ */
+public class SysomosJsonSerDeIT {
+
+ private final static Logger LOGGER = LoggerFactory.getLogger(SysomosJsonSerDeIT.class);
+
+ private ObjectMapper mapper = new ObjectMapper();
+
+ @Test
+ public void Test()
+ {
+ 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);
+
+ InputStream is = SysomosJsonSerDeIT.class.getResourceAsStream("/sysomos_jsons.txt");
+ InputStreamReader isr = new InputStreamReader(is);
+ BufferedReader br = new BufferedReader(isr);
+
+ try {
+ while (br.ready()) {
+ String line = br.readLine();
+ LOGGER.debug(line);
+
+ Sysomos ser = mapper.readValue(line, Sysomos.class);
+
+ String des = mapper.writeValueAsString(ser);
+ LOGGER.debug(des);
+ }
+ } catch( Exception e ) {
+ e.printStackTrace();
+ Assert.fail();
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/3f45b23e/streams-contrib/streams-provider-sysomos/src/test/java/com/sysomos/test/SysomosJsonSerDeTest.java
----------------------------------------------------------------------
diff --git a/streams-contrib/streams-provider-sysomos/src/test/java/com/sysomos/test/SysomosJsonSerDeTest.java b/streams-contrib/streams-provider-sysomos/src/test/java/com/sysomos/test/SysomosJsonSerDeTest.java
deleted file mode 100644
index de3cc6b..0000000
--- a/streams-contrib/streams-provider-sysomos/src/test/java/com/sysomos/test/SysomosJsonSerDeTest.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * 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.sysomos.test;
-
-import com.fasterxml.jackson.databind.DeserializationFeature;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.sysomos.json.Sysomos;
-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;
-
-/**
- * Tests ability to convert String json form to {@link com.sysomos.json.Sysomos} form
- */
-@Ignore("ignore until test resources are available.")
-public class SysomosJsonSerDeTest {
-
- private final static Logger LOGGER = LoggerFactory.getLogger(SysomosJsonSerDeTest.class);
-
- private ObjectMapper mapper = new ObjectMapper();
-
- @Test
- public void Test()
- {
- 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);
-
- InputStream is = SysomosJsonSerDeTest.class.getResourceAsStream("/sysomos_jsons.txt");
- InputStreamReader isr = new InputStreamReader(is);
- BufferedReader br = new BufferedReader(isr);
-
- try {
- while (br.ready()) {
- String line = br.readLine();
- LOGGER.debug(line);
-
- Sysomos ser = mapper.readValue(line, Sysomos.class);
-
- String des = mapper.writeValueAsString(ser);
- LOGGER.debug(des);
- }
- } catch( Exception e ) {
- e.printStackTrace();
- Assert.fail();
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/3f45b23e/streams-contrib/streams-provider-sysomos/src/test/java/com/sysomos/test/SysomosXmlSerDeIT.java
----------------------------------------------------------------------
diff --git a/streams-contrib/streams-provider-sysomos/src/test/java/com/sysomos/test/SysomosXmlSerDeIT.java b/streams-contrib/streams-provider-sysomos/src/test/java/com/sysomos/test/SysomosXmlSerDeIT.java
new file mode 100644
index 0000000..b9ee2e1
--- /dev/null
+++ b/streams-contrib/streams-provider-sysomos/src/test/java/com/sysomos/test/SysomosXmlSerDeIT.java
@@ -0,0 +1,100 @@
+/*
+ * 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.sysomos.test;
+
+import com.fasterxml.aalto.stax.InputFactoryImpl;
+import com.fasterxml.aalto.stax.OutputFactoryImpl;
+import com.fasterxml.jackson.databind.DeserializationFeature;
+import com.fasterxml.jackson.dataformat.xml.JacksonXmlModule;
+import com.fasterxml.jackson.dataformat.xml.XmlFactory;
+import com.fasterxml.jackson.dataformat.xml.XmlMapper;
+import com.sysomos.xml.BeatApi;
+import org.junit.Assert;
+import org.junit.Before;
+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;
+
+/**
+ * Tests ability to convert String xml form to {@link com.sysomos.xml.BeatApi} form
+ */
+public class SysomosXmlSerDeIT {
+
+ private final static Logger LOGGER = LoggerFactory.getLogger(SysomosXmlSerDeIT.class);
+
+ private XmlMapper xmlMapper;
+
+ @Before
+ public void Before() {
+
+ XmlFactory f = new XmlFactory(new InputFactoryImpl(),
+ new OutputFactoryImpl());
+
+ JacksonXmlModule module = new JacksonXmlModule();
+
+ module.setDefaultUseWrapper(false);
+
+ xmlMapper = new XmlMapper(f, module);
+
+ xmlMapper
+ .configure(
+ DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY,
+ Boolean.TRUE);
+ xmlMapper
+ .configure(
+ DeserializationFeature.ACCEPT_EMPTY_STRING_AS_NULL_OBJECT,
+ Boolean.TRUE);
+ xmlMapper
+ .configure(
+ DeserializationFeature.USE_JAVA_ARRAY_FOR_JSON_ARRAY,
+ Boolean.TRUE);
+ xmlMapper.configure(
+ DeserializationFeature.READ_ENUMS_USING_TO_STRING,
+ Boolean.TRUE);
+
+ }
+
+ @Test
+ public void Test()
+ {
+ InputStream is = SysomosXmlSerDeIT.class.getResourceAsStream("/sysomos_xmls.txt");
+ InputStreamReader isr = new InputStreamReader(is);
+ BufferedReader br = new BufferedReader(isr);
+
+ try {
+ while (br.ready()) {
+ String line = br.readLine();
+ LOGGER.debug(line);
+
+ BeatApi ser = xmlMapper.readValue(line, BeatApi.class);
+
+ String des = xmlMapper.writeValueAsString(ser);
+ LOGGER.debug(des);
+ }
+ } catch( Exception e ) {
+ e.printStackTrace();
+ Assert.fail();
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/3f45b23e/streams-contrib/streams-provider-sysomos/src/test/java/com/sysomos/test/SysomosXmlSerDeTest.java
----------------------------------------------------------------------
diff --git a/streams-contrib/streams-provider-sysomos/src/test/java/com/sysomos/test/SysomosXmlSerDeTest.java b/streams-contrib/streams-provider-sysomos/src/test/java/com/sysomos/test/SysomosXmlSerDeTest.java
deleted file mode 100644
index 4d3b6b6..0000000
--- a/streams-contrib/streams-provider-sysomos/src/test/java/com/sysomos/test/SysomosXmlSerDeTest.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * 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.sysomos.test;
-
-import com.fasterxml.aalto.stax.InputFactoryImpl;
-import com.fasterxml.aalto.stax.OutputFactoryImpl;
-import com.fasterxml.jackson.databind.DeserializationFeature;
-import com.fasterxml.jackson.dataformat.xml.JacksonXmlModule;
-import com.fasterxml.jackson.dataformat.xml.XmlFactory;
-import com.fasterxml.jackson.dataformat.xml.XmlMapper;
-import com.sysomos.xml.BeatApi;
-import org.junit.Assert;
-import org.junit.Before;
-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;
-
-/**
- * Tests ability to convert String xml form to {@link com.sysomos.xml.BeatApi} form
- */
-@Ignore("ignore until test resources are available.")
-public class SysomosXmlSerDeTest {
-
- private final static Logger LOGGER = LoggerFactory.getLogger(SysomosXmlSerDeTest.class);
-
- private XmlMapper xmlMapper;
-
- @Before
- public void Before() {
-
- XmlFactory f = new XmlFactory(new InputFactoryImpl(),
- new OutputFactoryImpl());
-
- JacksonXmlModule module = new JacksonXmlModule();
-
- module.setDefaultUseWrapper(false);
-
- xmlMapper = new XmlMapper(f, module);
-
- xmlMapper
- .configure(
- DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY,
- Boolean.TRUE);
- xmlMapper
- .configure(
- DeserializationFeature.ACCEPT_EMPTY_STRING_AS_NULL_OBJECT,
- Boolean.TRUE);
- xmlMapper
- .configure(
- DeserializationFeature.USE_JAVA_ARRAY_FOR_JSON_ARRAY,
- Boolean.TRUE);
- xmlMapper.configure(
- DeserializationFeature.READ_ENUMS_USING_TO_STRING,
- Boolean.TRUE);
-
- }
-
- @Test
- public void Test()
- {
- InputStream is = SysomosXmlSerDeTest.class.getResourceAsStream("/sysomos_xmls.txt");
- InputStreamReader isr = new InputStreamReader(is);
- BufferedReader br = new BufferedReader(isr);
-
- try {
- while (br.ready()) {
- String line = br.readLine();
- LOGGER.debug(line);
-
- BeatApi ser = xmlMapper.readValue(line, BeatApi.class);
-
- String des = xmlMapper.writeValueAsString(ser);
- LOGGER.debug(des);
- }
- } catch( Exception e ) {
- e.printStackTrace();
- Assert.fail();
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/3f45b23e/streams-contrib/streams-provider-twitter/pom.xml
----------------------------------------------------------------------
diff --git a/streams-contrib/streams-provider-twitter/pom.xml b/streams-contrib/streams-provider-twitter/pom.xml
index 3959030..cbe50ec 100644
--- a/streams-contrib/streams-provider-twitter/pom.xml
+++ b/streams-contrib/streams-provider-twitter/pom.xml
@@ -26,6 +26,11 @@
<artifactId>streams-provider-twitter</artifactId>
+ <properties>
+ <skipITs>true</skipITs>
+ <testDataBaseURl>http://streams.peoplepattern.com.s3.amazonaws.com/test-data/</testDataBaseURl>
+ </properties>
+
<dependencies>
<dependency>
<groupId>com.typesafe</groupId>
@@ -176,6 +181,33 @@
</execution>
</executions>
</plugin>
+ <plugin>
+ <groupId>com.googlecode.maven-download-plugin</groupId>
+ <artifactId>download-maven-plugin</artifactId>
+ <version>1.2.1</version>
+ <executions>
+ <execution>
+ <id>download-it-data</id>
+ <phase>pre-integration-test</phase>
+ <goals>
+ <goal>wget</goal>
+ </goals>
+ <configuration>
+ <url>${testDataBaseURl}/${artifactId}.zip</url>
+ <unpack>true</unpack>
+ <outputDirectory>${project.build.directory}/test-classes</outputDirectory>
+ <!--<md5>df65b5642f33676313ebe4d5b69a3fff</md5>-->
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-failsafe-plugin</artifactId>
+ <configuration>
+ <skipTests>${skipITs}</skipTests>
+ </configuration>
+ </plugin>
</plugins>
</build>
</project>
[4/4] incubator-streams git commit: Merge branch 'STREAMS-332'
Posted by sb...@apache.org.
Merge branch 'STREAMS-332'
* STREAMS-332:
changed tests without resources to ITs ITs do not run by default, must run verify -skipTests=false added retrieval and expansion of zip files containing test resources location of zip files can be overridden with -testDataBaseURL
Conflicts:
streams-contrib/streams-provider-datasift/pom.xml
streams-contrib/streams-provider-google/google-gplus/pom.xml
streams-contrib/streams-provider-instagram/pom.xml
streams-contrib/streams-provider-moreover/pom.xml
streams-contrib/streams-provider-sysomos/pom.xml
streams-contrib/streams-provider-twitter/pom.xml
Project: http://git-wip-us.apache.org/repos/asf/incubator-streams/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-streams/commit/d982a877
Tree: http://git-wip-us.apache.org/repos/asf/incubator-streams/tree/d982a877
Diff: http://git-wip-us.apache.org/repos/asf/incubator-streams/diff/d982a877
Branch: refs/heads/master
Commit: d982a877b99fa9d1f5a0764423923d2ad5a068cd
Parents: bcf3d31 3f45b23
Author: Steve Blackmon (@steveblackmon) <sb...@apache.org>
Authored: Wed Jul 1 14:05:17 2015 -0500
Committer: Steve Blackmon (@steveblackmon) <sb...@apache.org>
Committed: Wed Jul 1 14:05:17 2015 -0500
----------------------------------------------------------------------
.../streams-provider-datasift/pom.xml | 35 +++++
.../DatasiftActivitySerializerIT.java | 110 ++++++++++++++
.../DatasiftActivitySerializerTest.java | 111 --------------
.../DatasiftInstagramActivitySerializerIT.java | 57 +++++++
...DatasiftInstagramActivitySerializerTest.java | 58 -------
...DatasiftInteractionActivitySerializerIT.java | 62 ++++++++
...tasiftInteractionActivitySerializerTest.java | 63 --------
.../DatasiftTwitterActivitySerializerIT.java | 57 +++++++
.../DatasiftTwitterActivitySerializerTest.java | 58 -------
.../streams-provider-facebook/pom.xml | 32 ++++
.../test/FacebookActivityActorSerDeIT.java | 67 +++++++++
.../test/FacebookActivityActorSerDeTest.java | 68 ---------
.../facebook/test/FacebookActivitySerDeIT.java | 75 ++++++++++
.../test/FacebookActivitySerDeTest.java | 76 ----------
.../facebook/test/FacebookPageSerDeIT.java | 78 ++++++++++
.../facebook/test/FacebookPageSerDeTest.java | 79 ----------
.../facebook/test/FacebookPostSerDeIT.java | 99 ++++++++++++
.../facebook/test/FacebookPostSerDeTest.java | 100 -------------
.../google-gplus/pom.xml | 34 ++++-
.../google/gplus/GooglePlusCommentSerDeIT.java | 117 +++++++++++++++
.../gplus/GooglePlusCommentSerDeTest.java | 118 ---------------
.../google/gplus/GooglePlusPersonSerDeIT.java | 101 +++++++++++++
.../google/gplus/GooglePlusPersonSerDeTest.java | 102 -------------
.../processor/GooglePlusActivitySerDeIT.java | 116 ++++++++++++++
.../processor/GooglePlusActivitySerDeTest.java | 117 ---------------
.../streams-provider-instagram/pom.xml | 34 ++++-
.../twitter/test/InstagramActivitySerDeIT.java | 134 +++++++++++++++++
.../test/InstagramActivitySerDeTest.java | 135 -----------------
.../streams-provider-moreover/pom.xml | 34 ++++-
.../data/MoreoverJsonActivitySerializerIT.java | 79 ++++++++++
.../MoreoverJsonActivitySerializerTest.java | 69 ---------
.../data/MoreoverXmlActivitySerializerIT.java | 65 ++++++++
.../data/MoreoverXmlActivitySerializerTest.java | 66 --------
streams-contrib/streams-provider-rss/pom.xml | 32 ++++
.../rss/provider/RssStreamProviderTaskIT.java | 149 ++++++++++++++++++
.../rss/provider/RssStreamProviderTaskTest.java | 150 -------------------
.../rss/test/SyndEntryActivitySerializerIT.java | 123 +++++++++++++++
.../test/SyndEntryActivitySerizlizerTest.java | 124 ---------------
.../streams-provider-sysomos/pom.xml | 36 ++++-
.../com/sysomos/test/SysomosJsonSerDeIT.java | 69 +++++++++
.../com/sysomos/test/SysomosJsonSerDeTest.java | 70 ---------
.../com/sysomos/test/SysomosXmlSerDeIT.java | 100 +++++++++++++
.../com/sysomos/test/SysomosXmlSerDeTest.java | 101 -------------
.../streams-provider-twitter/pom.xml | 32 ++++
.../twitter/test/TwitterObjectMapperIT.java | 132 ++++++++++++++++
.../twitter/test/TwitterObjectMapperTest.java | 137 -----------------
46 files changed, 2054 insertions(+), 1807 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/d982a877/streams-contrib/streams-provider-datasift/pom.xml
----------------------------------------------------------------------
diff --cc streams-contrib/streams-provider-datasift/pom.xml
index 4225995,0af5eb7..8cd8bed
--- a/streams-contrib/streams-provider-datasift/pom.xml
+++ b/streams-contrib/streams-provider-datasift/pom.xml
@@@ -29,6 -29,18 +29,12 @@@
<description>Datasift Provider</description>
+ <properties>
+ <skipITs>true</skipITs>
+ <testDataBaseURl>http://streams.peoplepattern.com.s3.amazonaws.com/test-data/</testDataBaseURl>
+ </properties>
+
- <repositories>
- <repository>
- <id>boundary-site</id>
- <url>http://maven.boundary.com/artifactory/repo</url>
- </repository>
- </repositories>
+
<dependencies>
<dependency>
<groupId>com.typesafe</groupId>
@@@ -192,9 -187,32 +198,38 @@@
</executions>
</plugin>
<plugin>
+ <groupId>com.googlecode.maven-download-plugin</groupId>
+ <artifactId>download-maven-plugin</artifactId>
+ <version>1.2.1</version>
+ <executions>
+ <execution>
+ <id>download-it-data</id>
+ <phase>pre-integration-test</phase>
+ <goals>
+ <goal>wget</goal>
+ </goals>
+ <configuration>
+ <url>${testDataBaseURl}/${artifactId}.zip</url>
+ <unpack>true</unpack>
+ <outputDirectory>${project.build.directory}/test-classes</outputDirectory>
+ <!--<md5>df65b5642f33676313ebe4d5b69a3fff</md5>-->
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-failsafe-plugin</artifactId>
+ <configuration>
+ <skipTests>${skipITs}</skipTests>
+ </configuration>
+ </plugin>
++ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-resources-plugin</artifactId>
+ </plugin>
++
</plugins>
++
</build>
</project>
http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/d982a877/streams-contrib/streams-provider-facebook/pom.xml
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/d982a877/streams-contrib/streams-provider-google/google-gplus/pom.xml
----------------------------------------------------------------------
diff --cc streams-contrib/streams-provider-google/google-gplus/pom.xml
index e0f21dd,ff8f392..d80cfd0
--- a/streams-contrib/streams-provider-google/google-gplus/pom.xml
+++ b/streams-contrib/streams-provider-google/google-gplus/pom.xml
@@@ -200,9 -195,32 +205,36 @@@
</executions>
</plugin>
<plugin>
+ <groupId>com.googlecode.maven-download-plugin</groupId>
+ <artifactId>download-maven-plugin</artifactId>
+ <version>1.2.1</version>
+ <executions>
+ <execution>
+ <id>download-it-data</id>
+ <phase>pre-integration-test</phase>
+ <goals>
+ <goal>wget</goal>
+ </goals>
+ <configuration>
+ <url>${testDataBaseURl}/${artifactId}.zip</url>
+ <unpack>true</unpack>
+ <outputDirectory>${project.build.directory}/test-classes</outputDirectory>
+ <!--<md5>df65b5642f33676313ebe4d5b69a3fff</md5>-->
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
<groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-resources-plugin</artifactId>
+ <artifactId>maven-failsafe-plugin</artifactId>
+ <configuration>
+ <skipTests>${skipITs}</skipTests>
+ </configuration>
</plugin>
++<plugin>
++ <groupId>org.apache.maven.plugins</groupId>
++ <artifactId>maven-resources-plugin</artifactId>
++</plugin>
</plugins>
</build>
</project>
http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/d982a877/streams-contrib/streams-provider-instagram/pom.xml
----------------------------------------------------------------------
diff --cc streams-contrib/streams-provider-instagram/pom.xml
index d653900,a7c5ed7..7503514
--- a/streams-contrib/streams-provider-instagram/pom.xml
+++ b/streams-contrib/streams-provider-instagram/pom.xml
@@@ -162,9 -167,32 +167,36 @@@
</executions>
</plugin>
<plugin>
+ <groupId>com.googlecode.maven-download-plugin</groupId>
+ <artifactId>download-maven-plugin</artifactId>
+ <version>1.2.1</version>
+ <executions>
+ <execution>
+ <id>download-it-data</id>
+ <phase>pre-integration-test</phase>
+ <goals>
+ <goal>wget</goal>
+ </goals>
+ <configuration>
+ <url>${testDataBaseURl}/${artifactId}.zip</url>
+ <unpack>true</unpack>
+ <outputDirectory>${project.build.directory}/test-classes</outputDirectory>
+ <!--<md5>df65b5642f33676313ebe4d5b69a3fff</md5>-->
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
<groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-resources-plugin</artifactId>
+ <artifactId>maven-failsafe-plugin</artifactId>
+ <configuration>
+ <skipTests>${skipITs}</skipTests>
+ </configuration>
</plugin>
++<plugin>
++ <groupId>org.apache.maven.plugins</groupId>
++ <artifactId>maven-resources-plugin</artifactId>
++</plugin>
</plugins>
</build>
</project>
http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/d982a877/streams-contrib/streams-provider-moreover/pom.xml
----------------------------------------------------------------------
diff --cc streams-contrib/streams-provider-moreover/pom.xml
index 8281c57,868cfc8..785b624
--- a/streams-contrib/streams-provider-moreover/pom.xml
+++ b/streams-contrib/streams-provider-moreover/pom.xml
@@@ -176,9 -181,32 +181,36 @@@
</executions>
</plugin>
<plugin>
+ <groupId>com.googlecode.maven-download-plugin</groupId>
+ <artifactId>download-maven-plugin</artifactId>
+ <version>1.2.1</version>
+ <executions>
+ <execution>
+ <id>download-it-data</id>
+ <phase>pre-integration-test</phase>
+ <goals>
+ <goal>wget</goal>
+ </goals>
+ <configuration>
+ <url>${testDataBaseURl}/${artifactId}.zip</url>
+ <unpack>true</unpack>
+ <outputDirectory>${project.build.directory}/test-classes</outputDirectory>
+ <!--<md5>df65b5642f33676313ebe4d5b69a3fff</md5>-->
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
<groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-resources-plugin</artifactId>
+ <artifactId>maven-failsafe-plugin</artifactId>
+ <configuration>
+ <skipTests>${skipITs}</skipTests>
+ </configuration>
</plugin>
++<plugin>
++ <groupId>org.apache.maven.plugins</groupId>
++ <artifactId>maven-resources-plugin</artifactId>
++</plugin>
</plugins>
</build>
</project>
http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/d982a877/streams-contrib/streams-provider-rss/pom.xml
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/d982a877/streams-contrib/streams-provider-sysomos/pom.xml
----------------------------------------------------------------------
diff --cc streams-contrib/streams-provider-sysomos/pom.xml
index 785b6bb,5ce4561..9531150
--- a/streams-contrib/streams-provider-sysomos/pom.xml
+++ b/streams-contrib/streams-provider-sysomos/pom.xml
@@@ -167,9 -172,32 +172,36 @@@
</executions>
</plugin>
<plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-resources-plugin</artifactId>
+ <groupId>com.googlecode.maven-download-plugin</groupId>
+ <artifactId>download-maven-plugin</artifactId>
+ <version>1.2.1</version>
+ <executions>
+ <execution>
+ <id>download-it-data</id>
+ <phase>pre-integration-test</phase>
+ <goals>
+ <goal>wget</goal>
+ </goals>
+ <configuration>
+ <url>${testDataBaseURl}/${artifactId}.zip</url>
+ <unpack>true</unpack>
+ <outputDirectory>${project.build.directory}/test-classes</outputDirectory>
+ <!--<md5>df65b5642f33676313ebe4d5b69a3fff</md5>-->
+ </configuration>
+ </execution>
+ </executions>
</plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-failsafe-plugin</artifactId>
+ <configuration>
+ <skipTests>${skipITs}</skipTests>
+ </configuration>
+ </plugin>
++ <plugin>
++ <groupId>org.apache.maven.plugins</groupId>
++ <artifactId>maven-resources-plugin</artifactId>
++ </plugin>
</plugins>
</build>
http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/d982a877/streams-contrib/streams-provider-twitter/pom.xml
----------------------------------------------------------------------
diff --cc streams-contrib/streams-provider-twitter/pom.xml
index e3e1252,cbe50ec..c15ea27
--- a/streams-contrib/streams-provider-twitter/pom.xml
+++ b/streams-contrib/streams-provider-twitter/pom.xml
@@@ -176,8 -182,31 +181,35 @@@
</executions>
</plugin>
<plugin>
+ <groupId>com.googlecode.maven-download-plugin</groupId>
+ <artifactId>download-maven-plugin</artifactId>
+ <version>1.2.1</version>
+ <executions>
+ <execution>
+ <id>download-it-data</id>
+ <phase>pre-integration-test</phase>
+ <goals>
+ <goal>wget</goal>
+ </goals>
+ <configuration>
+ <url>${testDataBaseURl}/${artifactId}.zip</url>
+ <unpack>true</unpack>
+ <outputDirectory>${project.build.directory}/test-classes</outputDirectory>
+ <!--<md5>df65b5642f33676313ebe4d5b69a3fff</md5>-->
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
<groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-failsafe-plugin</artifactId>
+ <configuration>
+ <skipTests>${skipITs}</skipTests>
+ </configuration>
++ </plugin>
++ <plugin>
++ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-resources-plugin</artifactId>
</plugin>
</plugins>
</build>
[3/4] incubator-streams git commit: changed tests without resources
to ITs ITs do not run by default,
must run verify -skipTests=false added retrieval and expansion of zip files
containing test resources location of zip files can be overridden with -test
Posted by sb...@apache.org.
changed tests without resources to ITs
ITs do not run by default, must run verify -skipTests=false
added retrieval and expansion of zip files containing test resources
location of zip files can be overridden with -testDataBaseURL
Project: http://git-wip-us.apache.org/repos/asf/incubator-streams/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-streams/commit/3f45b23e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-streams/tree/3f45b23e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-streams/diff/3f45b23e
Branch: refs/heads/master
Commit: 3f45b23ebb63aeddb1badc2100599292a7b52170
Parents: 6a05779
Author: Steve Blackmon (@steveblackmon) <sb...@apache.org>
Authored: Tue May 26 13:38:09 2015 -0500
Committer: Steve Blackmon (@steveblackmon) <sb...@apache.org>
Committed: Tue May 26 13:38:09 2015 -0500
----------------------------------------------------------------------
.../streams-provider-datasift/pom.xml | 32 ++++
.../DatasiftActivitySerializerIT.java | 110 ++++++++++++++
.../DatasiftActivitySerializerTest.java | 111 --------------
.../DatasiftInstagramActivitySerializerIT.java | 57 +++++++
...DatasiftInstagramActivitySerializerTest.java | 58 -------
...DatasiftInteractionActivitySerializerIT.java | 62 ++++++++
...tasiftInteractionActivitySerializerTest.java | 63 --------
.../DatasiftTwitterActivitySerializerIT.java | 57 +++++++
.../DatasiftTwitterActivitySerializerTest.java | 58 -------
.../streams-provider-facebook/pom.xml | 32 ++++
.../test/FacebookActivityActorSerDeIT.java | 67 +++++++++
.../test/FacebookActivityActorSerDeTest.java | 68 ---------
.../facebook/test/FacebookActivitySerDeIT.java | 75 ++++++++++
.../test/FacebookActivitySerDeTest.java | 76 ----------
.../facebook/test/FacebookPageSerDeIT.java | 78 ++++++++++
.../facebook/test/FacebookPageSerDeTest.java | 79 ----------
.../facebook/test/FacebookPostSerDeIT.java | 99 ++++++++++++
.../facebook/test/FacebookPostSerDeTest.java | 100 -------------
.../google-gplus/pom.xml | 32 ++++
.../google/gplus/GooglePlusCommentSerDeIT.java | 117 +++++++++++++++
.../gplus/GooglePlusCommentSerDeTest.java | 118 ---------------
.../google/gplus/GooglePlusPersonSerDeIT.java | 101 +++++++++++++
.../google/gplus/GooglePlusPersonSerDeTest.java | 102 -------------
.../processor/GooglePlusActivitySerDeIT.java | 116 ++++++++++++++
.../processor/GooglePlusActivitySerDeTest.java | 117 ---------------
.../streams-provider-instagram/pom.xml | 32 ++++
.../twitter/test/InstagramActivitySerDeIT.java | 134 +++++++++++++++++
.../test/InstagramActivitySerDeTest.java | 135 -----------------
.../streams-provider-moreover/pom.xml | 32 ++++
.../data/MoreoverJsonActivitySerializerIT.java | 79 ++++++++++
.../MoreoverJsonActivitySerializerTest.java | 69 ---------
.../data/MoreoverXmlActivitySerializerIT.java | 65 ++++++++
.../data/MoreoverXmlActivitySerializerTest.java | 66 --------
streams-contrib/streams-provider-rss/pom.xml | 32 ++++
.../rss/provider/RssStreamProviderTaskIT.java | 149 ++++++++++++++++++
.../rss/provider/RssStreamProviderTaskTest.java | 150 -------------------
.../rss/test/SyndEntryActivitySerializerIT.java | 123 +++++++++++++++
.../test/SyndEntryActivitySerizlizerTest.java | 124 ---------------
.../streams-provider-sysomos/pom.xml | 32 ++++
.../com/sysomos/test/SysomosJsonSerDeIT.java | 69 +++++++++
.../com/sysomos/test/SysomosJsonSerDeTest.java | 70 ---------
.../com/sysomos/test/SysomosXmlSerDeIT.java | 100 +++++++++++++
.../com/sysomos/test/SysomosXmlSerDeTest.java | 101 -------------
.../streams-provider-twitter/pom.xml | 32 ++++
.../twitter/test/TwitterObjectMapperIT.java | 132 ++++++++++++++++
.../twitter/test/TwitterObjectMapperTest.java | 137 -----------------
46 files changed, 2046 insertions(+), 1802 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/3f45b23e/streams-contrib/streams-provider-datasift/pom.xml
----------------------------------------------------------------------
diff --git a/streams-contrib/streams-provider-datasift/pom.xml b/streams-contrib/streams-provider-datasift/pom.xml
index aa1efda..0af5eb7 100644
--- a/streams-contrib/streams-provider-datasift/pom.xml
+++ b/streams-contrib/streams-provider-datasift/pom.xml
@@ -29,6 +29,11 @@
<description>Datasift Provider</description>
+ <properties>
+ <skipITs>true</skipITs>
+ <testDataBaseURl>http://streams.peoplepattern.com.s3.amazonaws.com/test-data/</testDataBaseURl>
+ </properties>
+
<repositories>
<repository>
<id>boundary-site</id>
@@ -181,6 +186,33 @@
</execution>
</executions>
</plugin>
+ <plugin>
+ <groupId>com.googlecode.maven-download-plugin</groupId>
+ <artifactId>download-maven-plugin</artifactId>
+ <version>1.2.1</version>
+ <executions>
+ <execution>
+ <id>download-it-data</id>
+ <phase>pre-integration-test</phase>
+ <goals>
+ <goal>wget</goal>
+ </goals>
+ <configuration>
+ <url>${testDataBaseURl}/${artifactId}.zip</url>
+ <unpack>true</unpack>
+ <outputDirectory>${project.build.directory}/test-classes</outputDirectory>
+ <!--<md5>df65b5642f33676313ebe4d5b69a3fff</md5>-->
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-failsafe-plugin</artifactId>
+ <configuration>
+ <skipTests>${skipITs}</skipTests>
+ </configuration>
+ </plugin>
</plugins>
</build>
</project>
http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/3f45b23e/streams-contrib/streams-provider-datasift/src/test/java17/org/apache/streams/datasift/serializer/DatasiftActivitySerializerIT.java
----------------------------------------------------------------------
diff --git a/streams-contrib/streams-provider-datasift/src/test/java17/org/apache/streams/datasift/serializer/DatasiftActivitySerializerIT.java b/streams-contrib/streams-provider-datasift/src/test/java17/org/apache/streams/datasift/serializer/DatasiftActivitySerializerIT.java
new file mode 100644
index 0000000..69c49fd
--- /dev/null
+++ b/streams-contrib/streams-provider-datasift/src/test/java17/org/apache/streams/datasift/serializer/DatasiftActivitySerializerIT.java
@@ -0,0 +1,110 @@
+/*
+ * 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.datasift.serializer;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.google.common.collect.Lists;
+import org.apache.commons.lang.StringUtils;
+import org.apache.streams.data.ActivitySerializer;
+import org.apache.streams.datasift.Datasift;
+import org.apache.streams.datasift.util.StreamsDatasiftMapper;
+import org.apache.streams.jackson.StreamsJacksonMapper;
+import org.apache.streams.pojo.json.Activity;
+import org.apache.streams.pojo.json.Actor;
+import org.apache.streams.util.files.StreamsScannerUtil;
+import org.junit.Before;
+import org.junit.Ignore;
+import org.junit.Test;
+
+import java.util.Scanner;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+/**
+ * Tests serialization and conversion of Datasift inputs
+ */
+public class DatasiftActivitySerializerIT {
+
+ protected ActivitySerializer SERIALIZER;
+
+ protected static ObjectMapper MAPPER = StreamsJacksonMapper.getInstance(Lists.newArrayList(StreamsDatasiftMapper.DATASIFT_FORMAT));
+
+ @Before
+ public void initSerializer() {
+ SERIALIZER = new DatasiftActivitySerializer();
+ }
+
+ @Test
+ public void testConversion() throws Exception {
+
+ Scanner scanner = StreamsScannerUtil.getInstance("/rand_sample_datasift_json.txt");
+
+ String line = null;
+ while(scanner.hasNextLine()) {
+ try {
+ line = scanner.nextLine();
+ Datasift item = MAPPER.readValue(line, Datasift.class);
+ testConversion(item);
+ String json = MAPPER.writeValueAsString(item);
+ testDeserNoNull(json);
+ testDeserNoAddProps(json);
+ } catch (Exception e) {
+ System.err.println(line);
+ throw e;
+ }
+ }
+ }
+
+ /**
+ * Test that the minimum number of things that an activity has
+ * @param item
+ */
+ protected void testConversion(Datasift item) throws Exception {
+ Activity activity = SERIALIZER.deserialize(item);
+ assertNotNull("activity.id", activity.getId());
+ assertNotNull("activity.published", activity.getPublished());
+ assertNotNull("activity.provider", activity.getProvider());
+ assertNotNull("activity.url", activity.getUrl());
+ assertNotNull("activity.verb", activity.getVerb());
+ Actor actor = activity.getActor();
+ assertNotNull("activity.actor", actor);
+ }
+
+ /**
+ * Test that null fields are not present
+ * @param json
+ */
+ protected void testDeserNoNull(String json) throws Exception {
+ int nulls = StringUtils.countMatches(json, ":null");
+ assertEquals(0l, (long)nulls);
+
+ }
+
+ /**
+ * Test that null fields are not present
+ * @param json
+ */
+ protected void testDeserNoAddProps(String json) throws Exception {
+ int nulls = StringUtils.countMatches(json, "additionalProperties:{");
+ assertEquals(0l, (long)nulls);
+
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/3f45b23e/streams-contrib/streams-provider-datasift/src/test/java17/org/apache/streams/datasift/serializer/DatasiftActivitySerializerTest.java
----------------------------------------------------------------------
diff --git a/streams-contrib/streams-provider-datasift/src/test/java17/org/apache/streams/datasift/serializer/DatasiftActivitySerializerTest.java b/streams-contrib/streams-provider-datasift/src/test/java17/org/apache/streams/datasift/serializer/DatasiftActivitySerializerTest.java
deleted file mode 100644
index 56ce262..0000000
--- a/streams-contrib/streams-provider-datasift/src/test/java17/org/apache/streams/datasift/serializer/DatasiftActivitySerializerTest.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * 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.datasift.serializer;
-
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.google.common.collect.Lists;
-import org.apache.commons.lang.StringUtils;
-import org.apache.streams.data.ActivitySerializer;
-import org.apache.streams.datasift.Datasift;
-import org.apache.streams.datasift.util.StreamsDatasiftMapper;
-import org.apache.streams.jackson.StreamsJacksonMapper;
-import org.apache.streams.pojo.json.Activity;
-import org.apache.streams.pojo.json.Actor;
-import org.apache.streams.util.files.StreamsScannerUtil;
-import org.junit.Before;
-import org.junit.Ignore;
-import org.junit.Test;
-
-import java.util.Scanner;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-
-/**
- * Tests serialization and conversion of Datasift inputs
- */
-@Ignore("ignore until test resources are available.")
-public class DatasiftActivitySerializerTest {
-
- protected ActivitySerializer SERIALIZER;
-
- protected static ObjectMapper MAPPER = StreamsJacksonMapper.getInstance(Lists.newArrayList(StreamsDatasiftMapper.DATASIFT_FORMAT));
-
- @Before
- public void initSerializer() {
- SERIALIZER = new DatasiftActivitySerializer();
- }
-
- @Test
- public void testConversion() throws Exception {
-
- Scanner scanner = StreamsScannerUtil.getInstance("/rand_sample_datasift_json.txt");
-
- String line = null;
- while(scanner.hasNextLine()) {
- try {
- line = scanner.nextLine();
- Datasift item = MAPPER.readValue(line, Datasift.class);
- testConversion(item);
- String json = MAPPER.writeValueAsString(item);
- testDeserNoNull(json);
- testDeserNoAddProps(json);
- } catch (Exception e) {
- System.err.println(line);
- throw e;
- }
- }
- }
-
- /**
- * Test that the minimum number of things that an activity has
- * @param item
- */
- protected void testConversion(Datasift item) throws Exception {
- Activity activity = SERIALIZER.deserialize(item);
- assertNotNull("activity.id", activity.getId());
- assertNotNull("activity.published", activity.getPublished());
- assertNotNull("activity.provider", activity.getProvider());
- assertNotNull("activity.url", activity.getUrl());
- assertNotNull("activity.verb", activity.getVerb());
- Actor actor = activity.getActor();
- assertNotNull("activity.actor", actor);
- }
-
- /**
- * Test that null fields are not present
- * @param json
- */
- protected void testDeserNoNull(String json) throws Exception {
- int nulls = StringUtils.countMatches(json, ":null");
- assertEquals(0l, (long)nulls);
-
- }
-
- /**
- * Test that null fields are not present
- * @param json
- */
- protected void testDeserNoAddProps(String json) throws Exception {
- int nulls = StringUtils.countMatches(json, "additionalProperties:{");
- assertEquals(0l, (long)nulls);
-
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/3f45b23e/streams-contrib/streams-provider-datasift/src/test/java17/org/apache/streams/datasift/serializer/DatasiftInstagramActivitySerializerIT.java
----------------------------------------------------------------------
diff --git a/streams-contrib/streams-provider-datasift/src/test/java17/org/apache/streams/datasift/serializer/DatasiftInstagramActivitySerializerIT.java b/streams-contrib/streams-provider-datasift/src/test/java17/org/apache/streams/datasift/serializer/DatasiftInstagramActivitySerializerIT.java
new file mode 100644
index 0000000..aa57454
--- /dev/null
+++ b/streams-contrib/streams-provider-datasift/src/test/java17/org/apache/streams/datasift/serializer/DatasiftInstagramActivitySerializerIT.java
@@ -0,0 +1,57 @@
+/*
+ * 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.datasift.serializer;
+
+import org.apache.streams.datasift.Datasift;
+import org.apache.streams.util.files.StreamsScannerUtil;
+import org.junit.Before;
+import org.junit.Ignore;
+import org.junit.Test;
+
+import java.util.Scanner;
+
+/**
+ * Tests serialization and conversion of Datasift inputs
+ */
+public class DatasiftInstagramActivitySerializerIT extends DatasiftActivitySerializerIT {
+
+ @Before
+ @Override
+ public void initSerializer() {
+ SERIALIZER = new DatasiftInstagramActivitySerializer();
+ }
+
+ @Test
+ @Override
+ public void testConversion() throws Exception {
+
+ Scanner scanner = StreamsScannerUtil.getInstance("/instagram_datasift_json.txt");
+
+ String line = null;
+ while(scanner.hasNextLine()) {
+ line = scanner.nextLine();
+ Datasift item = MAPPER.readValue(line, Datasift.class);
+ testConversion(item);
+ String json = MAPPER.writeValueAsString(item);
+ testDeserNoNull(json);
+ testDeserNoAddProps(json);
+ }
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/3f45b23e/streams-contrib/streams-provider-datasift/src/test/java17/org/apache/streams/datasift/serializer/DatasiftInstagramActivitySerializerTest.java
----------------------------------------------------------------------
diff --git a/streams-contrib/streams-provider-datasift/src/test/java17/org/apache/streams/datasift/serializer/DatasiftInstagramActivitySerializerTest.java b/streams-contrib/streams-provider-datasift/src/test/java17/org/apache/streams/datasift/serializer/DatasiftInstagramActivitySerializerTest.java
deleted file mode 100644
index eb74622..0000000
--- a/streams-contrib/streams-provider-datasift/src/test/java17/org/apache/streams/datasift/serializer/DatasiftInstagramActivitySerializerTest.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * 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.datasift.serializer;
-
-import org.apache.streams.datasift.Datasift;
-import org.apache.streams.util.files.StreamsScannerUtil;
-import org.junit.Before;
-import org.junit.Ignore;
-import org.junit.Test;
-
-import java.util.Scanner;
-
-/**
- * Tests serialization and conversion of Datasift inputs
- */
-@Ignore("ignore until test resources are available.")
-public class DatasiftInstagramActivitySerializerTest extends DatasiftActivitySerializerTest {
-
- @Before
- @Override
- public void initSerializer() {
- SERIALIZER = new DatasiftInstagramActivitySerializer();
- }
-
- @Test
- @Override
- public void testConversion() throws Exception {
-
- Scanner scanner = StreamsScannerUtil.getInstance("/instagram_datasift_json.txt");
-
- String line = null;
- while(scanner.hasNextLine()) {
- line = scanner.nextLine();
- Datasift item = MAPPER.readValue(line, Datasift.class);
- testConversion(item);
- String json = MAPPER.writeValueAsString(item);
- testDeserNoNull(json);
- testDeserNoAddProps(json);
- }
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/3f45b23e/streams-contrib/streams-provider-datasift/src/test/java17/org/apache/streams/datasift/serializer/DatasiftInteractionActivitySerializerIT.java
----------------------------------------------------------------------
diff --git a/streams-contrib/streams-provider-datasift/src/test/java17/org/apache/streams/datasift/serializer/DatasiftInteractionActivitySerializerIT.java b/streams-contrib/streams-provider-datasift/src/test/java17/org/apache/streams/datasift/serializer/DatasiftInteractionActivitySerializerIT.java
new file mode 100644
index 0000000..40a1e95
--- /dev/null
+++ b/streams-contrib/streams-provider-datasift/src/test/java17/org/apache/streams/datasift/serializer/DatasiftInteractionActivitySerializerIT.java
@@ -0,0 +1,62 @@
+/*
+ * 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.datasift.serializer;
+
+import org.apache.streams.datasift.Datasift;
+import org.apache.streams.util.files.StreamsScannerUtil;
+import org.junit.Before;
+import org.junit.Ignore;
+import org.junit.Test;
+
+import java.util.Scanner;
+
+/**
+ * Tests serialization and conversion of Datasift inputs
+ */
+public class DatasiftInteractionActivitySerializerIT extends DatasiftActivitySerializerIT {
+
+ @Before
+ @Override
+ public void initSerializer() {
+ SERIALIZER = new DatasiftInteractionActivitySerializer();
+ }
+
+ @Test
+ @Override
+ public void testConversion() throws Exception {
+
+ Scanner scanner = StreamsScannerUtil.getInstance("/rand_sample_datasift_json.txt");
+
+ String line = null;
+ while(scanner.hasNextLine()) {
+ try {
+ line = scanner.nextLine();
+ Datasift item = MAPPER.readValue(line, Datasift.class);
+ testConversion(item);
+ String json = MAPPER.writeValueAsString(item);
+ testDeserNoNull(json);
+ testDeserNoAddProps(json);
+ } catch (Exception e) {
+ System.err.println(line);
+ throw e;
+ }
+ }
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/3f45b23e/streams-contrib/streams-provider-datasift/src/test/java17/org/apache/streams/datasift/serializer/DatasiftInteractionActivitySerializerTest.java
----------------------------------------------------------------------
diff --git a/streams-contrib/streams-provider-datasift/src/test/java17/org/apache/streams/datasift/serializer/DatasiftInteractionActivitySerializerTest.java b/streams-contrib/streams-provider-datasift/src/test/java17/org/apache/streams/datasift/serializer/DatasiftInteractionActivitySerializerTest.java
deleted file mode 100644
index 2865aa6..0000000
--- a/streams-contrib/streams-provider-datasift/src/test/java17/org/apache/streams/datasift/serializer/DatasiftInteractionActivitySerializerTest.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * 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.datasift.serializer;
-
-import org.apache.streams.datasift.Datasift;
-import org.apache.streams.util.files.StreamsScannerUtil;
-import org.junit.Before;
-import org.junit.Ignore;
-import org.junit.Test;
-
-import java.util.Scanner;
-
-/**
- * Tests serialization and conversion of Datasift inputs
- */
-@Ignore("ignore until test resources are available.")
-public class DatasiftInteractionActivitySerializerTest extends DatasiftActivitySerializerTest {
-
- @Before
- @Override
- public void initSerializer() {
- SERIALIZER = new DatasiftInteractionActivitySerializer();
- }
-
- @Test
- @Override
- public void testConversion() throws Exception {
-
- Scanner scanner = StreamsScannerUtil.getInstance("/rand_sample_datasift_json.txt");
-
- String line = null;
- while(scanner.hasNextLine()) {
- try {
- line = scanner.nextLine();
- Datasift item = MAPPER.readValue(line, Datasift.class);
- testConversion(item);
- String json = MAPPER.writeValueAsString(item);
- testDeserNoNull(json);
- testDeserNoAddProps(json);
- } catch (Exception e) {
- System.err.println(line);
- throw e;
- }
- }
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/3f45b23e/streams-contrib/streams-provider-datasift/src/test/java17/org/apache/streams/datasift/serializer/DatasiftTwitterActivitySerializerIT.java
----------------------------------------------------------------------
diff --git a/streams-contrib/streams-provider-datasift/src/test/java17/org/apache/streams/datasift/serializer/DatasiftTwitterActivitySerializerIT.java b/streams-contrib/streams-provider-datasift/src/test/java17/org/apache/streams/datasift/serializer/DatasiftTwitterActivitySerializerIT.java
new file mode 100644
index 0000000..42241f1
--- /dev/null
+++ b/streams-contrib/streams-provider-datasift/src/test/java17/org/apache/streams/datasift/serializer/DatasiftTwitterActivitySerializerIT.java
@@ -0,0 +1,57 @@
+/*
+ * 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.datasift.serializer;
+
+import org.apache.streams.datasift.Datasift;
+import org.apache.streams.util.files.StreamsScannerUtil;
+import org.junit.Before;
+import org.junit.Ignore;
+import org.junit.Test;
+
+import java.util.Scanner;
+
+/**
+ * Tests serialization and conversion of Datasift inputs
+ */
+public class DatasiftTwitterActivitySerializerIT extends DatasiftActivitySerializerIT {
+
+ @Before
+ @Override
+ public void initSerializer() {
+ SERIALIZER = new DatasiftTwitterActivitySerializer();
+ }
+
+ @Test
+ @Override
+ public void testConversion() throws Exception {
+
+ Scanner scanner = StreamsScannerUtil.getInstance("/twitter_datasift_json.txt");
+
+ String line = null;
+ while(scanner.hasNextLine()) {
+ line = scanner.nextLine();
+ Datasift item = MAPPER.readValue(line, Datasift.class);
+ testConversion(item);
+ String json = MAPPER.writeValueAsString(item);
+ testDeserNoNull(json);
+ testDeserNoAddProps(json);
+ }
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/3f45b23e/streams-contrib/streams-provider-datasift/src/test/java17/org/apache/streams/datasift/serializer/DatasiftTwitterActivitySerializerTest.java
----------------------------------------------------------------------
diff --git a/streams-contrib/streams-provider-datasift/src/test/java17/org/apache/streams/datasift/serializer/DatasiftTwitterActivitySerializerTest.java b/streams-contrib/streams-provider-datasift/src/test/java17/org/apache/streams/datasift/serializer/DatasiftTwitterActivitySerializerTest.java
deleted file mode 100644
index 219706a..0000000
--- a/streams-contrib/streams-provider-datasift/src/test/java17/org/apache/streams/datasift/serializer/DatasiftTwitterActivitySerializerTest.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * 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.datasift.serializer;
-
-import org.apache.streams.datasift.Datasift;
-import org.apache.streams.util.files.StreamsScannerUtil;
-import org.junit.Before;
-import org.junit.Ignore;
-import org.junit.Test;
-
-import java.util.Scanner;
-
-/**
- * Tests serialization and conversion of Datasift inputs
- */
-@Ignore("ignore until test resources are available.")
-public class DatasiftTwitterActivitySerializerTest extends DatasiftActivitySerializerTest {
-
- @Before
- @Override
- public void initSerializer() {
- SERIALIZER = new DatasiftTwitterActivitySerializer();
- }
-
- @Test
- @Override
- public void testConversion() throws Exception {
-
- Scanner scanner = StreamsScannerUtil.getInstance("/twitter_datasift_json.txt");
-
- String line = null;
- while(scanner.hasNextLine()) {
- line = scanner.nextLine();
- Datasift item = MAPPER.readValue(line, Datasift.class);
- testConversion(item);
- String json = MAPPER.writeValueAsString(item);
- testDeserNoNull(json);
- testDeserNoAddProps(json);
- }
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/3f45b23e/streams-contrib/streams-provider-facebook/pom.xml
----------------------------------------------------------------------
diff --git a/streams-contrib/streams-provider-facebook/pom.xml b/streams-contrib/streams-provider-facebook/pom.xml
index c8140bb..74e5abd 100644
--- a/streams-contrib/streams-provider-facebook/pom.xml
+++ b/streams-contrib/streams-provider-facebook/pom.xml
@@ -31,6 +31,11 @@
<description>Facebook Provider</description>
+ <properties>
+ <skipITs>true</skipITs>
+ <testDataBaseURl>http://streams.peoplepattern.com.s3.amazonaws.com/test-data/</testDataBaseURl>
+ </properties>
+
<dependencies>
<dependency>
@@ -172,6 +177,33 @@
</execution>
</executions>
</plugin>
+ <plugin>
+ <groupId>com.googlecode.maven-download-plugin</groupId>
+ <artifactId>download-maven-plugin</artifactId>
+ <version>1.2.1</version>
+ <executions>
+ <execution>
+ <id>download-it-data</id>
+ <phase>pre-integration-test</phase>
+ <goals>
+ <goal>wget</goal>
+ </goals>
+ <configuration>
+ <url>${testDataBaseURl}/${artifactId}.zip</url>
+ <unpack>true</unpack>
+ <outputDirectory>${project.build.directory}/test-classes</outputDirectory>
+ <!--<md5>df65b5642f33676313ebe4d5b69a3fff</md5>-->
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-failsafe-plugin</artifactId>
+ <configuration>
+ <skipTests>${skipITs}</skipTests>
+ </configuration>
+ </plugin>
</plugins>
</build>
</project>
http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/3f45b23e/streams-contrib/streams-provider-facebook/src/test/java/org/apache/streams/facebook/test/FacebookActivityActorSerDeIT.java
----------------------------------------------------------------------
diff --git a/streams-contrib/streams-provider-facebook/src/test/java/org/apache/streams/facebook/test/FacebookActivityActorSerDeIT.java b/streams-contrib/streams-provider-facebook/src/test/java/org/apache/streams/facebook/test/FacebookActivityActorSerDeIT.java
new file mode 100644
index 0000000..18b6489
--- /dev/null
+++ b/streams-contrib/streams-provider-facebook/src/test/java/org/apache/streams/facebook/test/FacebookActivityActorSerDeIT.java
@@ -0,0 +1,67 @@
+/*
+ * 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.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 org.apache.streams.facebook.Page;
+import org.apache.streams.facebook.api.FacebookPageActivitySerializer;
+import org.apache.streams.jackson.StreamsJacksonMapper;
+import org.apache.streams.pojo.json.Activity;
+import org.junit.Ignore;
+import org.junit.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.InputStream;
+
+/**
+ * Tests conversion of Facebook Page inputs to Actor
+ */
+public class FacebookActivityActorSerDeIT {
+
+ private final static Logger LOGGER = LoggerFactory.getLogger(FacebookActivityActorSerDeIT.class);
+ private FacebookPageActivitySerializer serializer = new FacebookPageActivitySerializer();
+ private ObjectMapper mapper = StreamsJacksonMapper.getInstance();
+
+ @Test
+ public void Tests() throws Exception
+ {
+ 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 = FacebookActivityActorSerDeIT.class.getResourceAsStream("/testpage.json");
+ Joiner joiner = Joiner.on(" ").skipNulls();
+ is = new BoundedInputStream(is, 10000);
+ String json;
+
+ json = joiner.join(IOUtils.readLines(is));
+ LOGGER.debug(json);
+
+ Page page = mapper.readValue(json, Page.class);
+
+ Activity activity = serializer.deserialize(page);
+
+ LOGGER.debug(mapper.writeValueAsString(activity));
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/3f45b23e/streams-contrib/streams-provider-facebook/src/test/java/org/apache/streams/facebook/test/FacebookActivityActorSerDeTest.java
----------------------------------------------------------------------
diff --git a/streams-contrib/streams-provider-facebook/src/test/java/org/apache/streams/facebook/test/FacebookActivityActorSerDeTest.java b/streams-contrib/streams-provider-facebook/src/test/java/org/apache/streams/facebook/test/FacebookActivityActorSerDeTest.java
deleted file mode 100644
index 4320fb7..0000000
--- a/streams-contrib/streams-provider-facebook/src/test/java/org/apache/streams/facebook/test/FacebookActivityActorSerDeTest.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * 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.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 org.apache.streams.facebook.Page;
-import org.apache.streams.facebook.api.FacebookPageActivitySerializer;
-import org.apache.streams.jackson.StreamsJacksonMapper;
-import org.apache.streams.pojo.json.Activity;
-import org.junit.Ignore;
-import org.junit.Test;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.InputStream;
-
-/**
- * Tests conversion of Facebook Page inputs to Actor
- */
-@Ignore("ignore until test resources are available.")
-public class FacebookActivityActorSerDeTest {
-
- private final static Logger LOGGER = LoggerFactory.getLogger(FacebookActivityActorSerDeTest.class);
- private FacebookPageActivitySerializer serializer = new FacebookPageActivitySerializer();
- private ObjectMapper mapper = StreamsJacksonMapper.getInstance();
-
- @Test
- public void Tests() throws Exception
- {
- 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 = FacebookActivityActorSerDeTest.class.getResourceAsStream("/testpage.json");
- Joiner joiner = Joiner.on(" ").skipNulls();
- is = new BoundedInputStream(is, 10000);
- String json;
-
- json = joiner.join(IOUtils.readLines(is));
- LOGGER.debug(json);
-
- Page page = mapper.readValue(json, Page.class);
-
- Activity activity = serializer.deserialize(page);
-
- LOGGER.debug(mapper.writeValueAsString(activity));
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/3f45b23e/streams-contrib/streams-provider-facebook/src/test/java/org/apache/streams/facebook/test/FacebookActivitySerDeIT.java
----------------------------------------------------------------------
diff --git a/streams-contrib/streams-provider-facebook/src/test/java/org/apache/streams/facebook/test/FacebookActivitySerDeIT.java b/streams-contrib/streams-provider-facebook/src/test/java/org/apache/streams/facebook/test/FacebookActivitySerDeIT.java
new file mode 100644
index 0000000..9f3d208
--- /dev/null
+++ b/streams-contrib/streams-provider-facebook/src/test/java/org/apache/streams/facebook/test/FacebookActivitySerDeIT.java
@@ -0,0 +1,75 @@
+/*
+ * 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 org.apache.streams.facebook.api.FacebookPostActivitySerializer;
+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 org.apache.streams.facebook.Post;
+import org.apache.streams.jackson.StreamsJacksonMapper;
+import org.apache.streams.pojo.json.Activity;
+import org.junit.Assert;
+import org.junit.Ignore;
+import org.junit.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.InputStream;
+
+/**
+ * Tests conversion of Facebook Post inputs to Activity
+ */
+public class FacebookActivitySerDeIT {
+
+ private final static Logger LOGGER = LoggerFactory.getLogger(FacebookActivitySerDeIT.class);
+ private FacebookPostActivitySerializer serializer = new FacebookPostActivitySerializer();
+ private ObjectMapper mapper = StreamsJacksonMapper.getInstance();
+
+ @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 = FacebookActivitySerDeIT.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 post = mapper.readValue(json, Post.class);
+
+ Activity activity = serializer.deserialize(post);
+
+ LOGGER.debug(mapper.writeValueAsString(activity));
+
+ } catch( Exception e ) {
+ System.out.println(e);
+ e.printStackTrace();
+ Assert.fail();
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/3f45b23e/streams-contrib/streams-provider-facebook/src/test/java/org/apache/streams/facebook/test/FacebookActivitySerDeTest.java
----------------------------------------------------------------------
diff --git a/streams-contrib/streams-provider-facebook/src/test/java/org/apache/streams/facebook/test/FacebookActivitySerDeTest.java b/streams-contrib/streams-provider-facebook/src/test/java/org/apache/streams/facebook/test/FacebookActivitySerDeTest.java
deleted file mode 100644
index 1def090..0000000
--- a/streams-contrib/streams-provider-facebook/src/test/java/org/apache/streams/facebook/test/FacebookActivitySerDeTest.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * 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 org.apache.streams.facebook.api.FacebookPostActivitySerializer;
-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 org.apache.streams.facebook.Post;
-import org.apache.streams.jackson.StreamsJacksonMapper;
-import org.apache.streams.pojo.json.Activity;
-import org.junit.Assert;
-import org.junit.Ignore;
-import org.junit.Test;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.InputStream;
-
-/**
- * Tests conversion of Facebook Post inputs to Activity
- */
-@Ignore("ignore until test resources are available.")
-public class FacebookActivitySerDeTest {
-
- private final static Logger LOGGER = LoggerFactory.getLogger(FacebookActivitySerDeTest.class);
- private FacebookPostActivitySerializer serializer = new FacebookPostActivitySerializer();
- private ObjectMapper mapper = StreamsJacksonMapper.getInstance();
-
- @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 = FacebookActivitySerDeTest.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 post = mapper.readValue(json, Post.class);
-
- Activity activity = serializer.deserialize(post);
-
- LOGGER.debug(mapper.writeValueAsString(activity));
-
- } catch( Exception e ) {
- System.out.println(e);
- e.printStackTrace();
- Assert.fail();
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/3f45b23e/streams-contrib/streams-provider-facebook/src/test/java/org/apache/streams/facebook/test/FacebookPageSerDeIT.java
----------------------------------------------------------------------
diff --git a/streams-contrib/streams-provider-facebook/src/test/java/org/apache/streams/facebook/test/FacebookPageSerDeIT.java b/streams-contrib/streams-provider-facebook/src/test/java/org/apache/streams/facebook/test/FacebookPageSerDeIT.java
new file mode 100644
index 0000000..4cdf263
--- /dev/null
+++ b/streams-contrib/streams-provider-facebook/src/test/java/org/apache/streams/facebook/test/FacebookPageSerDeIT.java
@@ -0,0 +1,78 @@
+/*
+ * 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.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 org.apache.streams.facebook.Page;
+import org.apache.streams.jackson.StreamsJacksonMapper;
+import org.junit.Assert;
+import org.junit.Ignore;
+import org.junit.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.InputStream;
+
+/**
+ * Tests serialization of Facebook Page inputs
+ */
+public class FacebookPageSerDeIT {
+
+ private final static Logger LOGGER = LoggerFactory.getLogger(FacebookPageSerDeIT.class);
+ private ObjectMapper mapper = StreamsJacksonMapper.getInstance();
+
+ @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 = FacebookPageSerDeIT.class.getResourceAsStream("/testpage.json");
+ Joiner joiner = Joiner.on(" ").skipNulls();
+ is = new BoundedInputStream(is, 10000);
+ String json;
+
+ try {
+ json = joiner.join(IOUtils.readLines(is));
+ LOGGER.debug(json);
+
+ Page ser = mapper.readValue(json, Page.class);
+
+ String de = mapper.writeValueAsString(ser);
+
+ LOGGER.debug(de);
+
+ Page serde = mapper.readValue(de, Page.class);
+
+ Assert.assertEquals(ser, serde);
+
+ LOGGER.debug(mapper.writeValueAsString(serde));
+
+ } catch( Exception e ) {
+ System.out.println(e);
+ e.printStackTrace();
+ Assert.fail();
+ }
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/3f45b23e/streams-contrib/streams-provider-facebook/src/test/java/org/apache/streams/facebook/test/FacebookPageSerDeTest.java
----------------------------------------------------------------------
diff --git a/streams-contrib/streams-provider-facebook/src/test/java/org/apache/streams/facebook/test/FacebookPageSerDeTest.java b/streams-contrib/streams-provider-facebook/src/test/java/org/apache/streams/facebook/test/FacebookPageSerDeTest.java
deleted file mode 100644
index a359169..0000000
--- a/streams-contrib/streams-provider-facebook/src/test/java/org/apache/streams/facebook/test/FacebookPageSerDeTest.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * 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.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 org.apache.streams.facebook.Page;
-import org.apache.streams.jackson.StreamsJacksonMapper;
-import org.junit.Assert;
-import org.junit.Ignore;
-import org.junit.Test;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.InputStream;
-
-/**
- * Tests serialization of Facebook Page inputs
- */
-@Ignore("ignore until test resources are available.")
-public class FacebookPageSerDeTest {
-
- private final static Logger LOGGER = LoggerFactory.getLogger(FacebookPostSerDeTest.class);
- private ObjectMapper mapper = StreamsJacksonMapper.getInstance();
-
- @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("/testpage.json");
- Joiner joiner = Joiner.on(" ").skipNulls();
- is = new BoundedInputStream(is, 10000);
- String json;
-
- try {
- json = joiner.join(IOUtils.readLines(is));
- LOGGER.debug(json);
-
- Page ser = mapper.readValue(json, Page.class);
-
- String de = mapper.writeValueAsString(ser);
-
- LOGGER.debug(de);
-
- Page serde = mapper.readValue(de, Page.class);
-
- Assert.assertEquals(ser, serde);
-
- LOGGER.debug(mapper.writeValueAsString(serde));
-
- } catch( Exception e ) {
- System.out.println(e);
- e.printStackTrace();
- Assert.fail();
- }
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/3f45b23e/streams-contrib/streams-provider-facebook/src/test/java/org/apache/streams/facebook/test/FacebookPostSerDeIT.java
----------------------------------------------------------------------
diff --git a/streams-contrib/streams-provider-facebook/src/test/java/org/apache/streams/facebook/test/FacebookPostSerDeIT.java b/streams-contrib/streams-provider-facebook/src/test/java/org/apache/streams/facebook/test/FacebookPostSerDeIT.java
new file mode 100644
index 0000000..5758ef2
--- /dev/null
+++ b/streams-contrib/streams-provider-facebook/src/test/java/org/apache/streams/facebook/test/FacebookPostSerDeIT.java
@@ -0,0 +1,99 @@
+/*
+ * 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.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 org.apache.streams.facebook.Post;
+import org.apache.streams.facebook.serializer.FacebookActivityUtil;
+import org.apache.streams.jackson.StreamsJacksonMapper;
+import org.apache.streams.pojo.json.Activity;
+import org.junit.Assert;
+import org.junit.Test;
+import org.junit.Ignore;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.InputStream;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+/**
+ * Tests serialization of Facebook Post inputs
+ */
+public class FacebookPostSerDeIT {
+
+ private final static Logger LOGGER = LoggerFactory.getLogger(FacebookPostSerDeIT.class);
+ private ObjectMapper mapper = StreamsJacksonMapper.getInstance();
+
+ @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 = FacebookPostSerDeIT.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));
+
+ Activity activity = new Activity();
+ FacebookActivityUtil.updateActivity(ser, activity);
+
+ assertNotNull(activity);
+ assertNotNull(activity.getActor().getId());
+ assertNotNull(activity.getActor().getDisplayName());
+ assertNotNull(activity.getId());
+ assert(activity.getVerb().equals("post"));
+ assertNotNull(activity.getObject());
+ assertNotNull(activity.getUpdated());
+ assertNotNull(activity.getPublished());
+ assertEquals(activity.getProvider().getId(), "id:providers:facebook");
+ assertEquals(activity.getProvider().getDisplayName(), "Facebook");
+ assertEquals(activity.getLinks().size(), 1);
+ assertNotNull(activity.getAdditionalProperties().get("extensions"));
+
+ } catch( Exception e ) {
+ System.out.println(e);
+ e.printStackTrace();
+ Assert.fail();
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/3f45b23e/streams-contrib/streams-provider-facebook/src/test/java/org/apache/streams/facebook/test/FacebookPostSerDeTest.java
----------------------------------------------------------------------
diff --git a/streams-contrib/streams-provider-facebook/src/test/java/org/apache/streams/facebook/test/FacebookPostSerDeTest.java b/streams-contrib/streams-provider-facebook/src/test/java/org/apache/streams/facebook/test/FacebookPostSerDeTest.java
deleted file mode 100644
index 535b89d..0000000
--- a/streams-contrib/streams-provider-facebook/src/test/java/org/apache/streams/facebook/test/FacebookPostSerDeTest.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * 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.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 org.apache.streams.facebook.Post;
-import org.apache.streams.facebook.serializer.FacebookActivityUtil;
-import org.apache.streams.jackson.StreamsJacksonMapper;
-import org.apache.streams.pojo.json.Activity;
-import org.junit.Assert;
-import org.junit.Test;
-import org.junit.Ignore;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.InputStream;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-
-/**
- * Tests serialization of Facebook Post inputs
- */
-@Ignore("ignore until test resources are available.")
-public class FacebookPostSerDeTest {
-
- private final static Logger LOGGER = LoggerFactory.getLogger(FacebookPostSerDeTest.class);
- private ObjectMapper mapper = StreamsJacksonMapper.getInstance();
-
- @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));
-
- Activity activity = new Activity();
- FacebookActivityUtil.updateActivity(ser, activity);
-
- assertNotNull(activity);
- assertNotNull(activity.getActor().getId());
- assertNotNull(activity.getActor().getDisplayName());
- assertNotNull(activity.getId());
- assert(activity.getVerb().equals("post"));
- assertNotNull(activity.getObject());
- assertNotNull(activity.getUpdated());
- assertNotNull(activity.getPublished());
- assertEquals(activity.getProvider().getId(), "id:providers:facebook");
- assertEquals(activity.getProvider().getDisplayName(), "Facebook");
- assertEquals(activity.getLinks().size(), 1);
- assertNotNull(activity.getAdditionalProperties().get("extensions"));
-
- } catch( Exception e ) {
- System.out.println(e);
- e.printStackTrace();
- Assert.fail();
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/3f45b23e/streams-contrib/streams-provider-google/google-gplus/pom.xml
----------------------------------------------------------------------
diff --git a/streams-contrib/streams-provider-google/google-gplus/pom.xml b/streams-contrib/streams-provider-google/google-gplus/pom.xml
index fa0dac4..ff8f392 100644
--- a/streams-contrib/streams-provider-google/google-gplus/pom.xml
+++ b/streams-contrib/streams-provider-google/google-gplus/pom.xml
@@ -29,6 +29,11 @@
<description>Google+ Provider</description>
+ <properties>
+ <skipITs>true</skipITs>
+ <testDataBaseURl>http://streams.peoplepattern.com.s3.amazonaws.com/test-data/</testDataBaseURl>
+ </properties>
+
<repositories>
<repository>
<id>typesafe</id>
@@ -189,6 +194,33 @@
</execution>
</executions>
</plugin>
+ <plugin>
+ <groupId>com.googlecode.maven-download-plugin</groupId>
+ <artifactId>download-maven-plugin</artifactId>
+ <version>1.2.1</version>
+ <executions>
+ <execution>
+ <id>download-it-data</id>
+ <phase>pre-integration-test</phase>
+ <goals>
+ <goal>wget</goal>
+ </goals>
+ <configuration>
+ <url>${testDataBaseURl}/${artifactId}.zip</url>
+ <unpack>true</unpack>
+ <outputDirectory>${project.build.directory}/test-classes</outputDirectory>
+ <!--<md5>df65b5642f33676313ebe4d5b69a3fff</md5>-->
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-failsafe-plugin</artifactId>
+ <configuration>
+ <skipTests>${skipITs}</skipTests>
+ </configuration>
+ </plugin>
</plugins>
</build>
</project>
http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/3f45b23e/streams-contrib/streams-provider-google/google-gplus/src/test/java/com/google/gplus/GooglePlusCommentSerDeIT.java
----------------------------------------------------------------------
diff --git a/streams-contrib/streams-provider-google/google-gplus/src/test/java/com/google/gplus/GooglePlusCommentSerDeIT.java b/streams-contrib/streams-provider-google/google-gplus/src/test/java/com/google/gplus/GooglePlusCommentSerDeIT.java
new file mode 100644
index 0000000..df15251
--- /dev/null
+++ b/streams-contrib/streams-provider-google/google-gplus/src/test/java/com/google/gplus/GooglePlusCommentSerDeIT.java
@@ -0,0 +1,117 @@
+/*
+ * 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
+ * with the License. You may obtain a copy of the License at
+ *
+ * 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.google.gplus;
+
+import com.fasterxml.jackson.databind.DeserializationFeature;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.module.SimpleModule;
+import com.google.api.client.util.Lists;
+import com.google.api.services.plus.model.Comment;
+import com.google.gplus.serializer.util.GPlusCommentDeserializer;
+import com.google.gplus.serializer.util.GooglePlusActivityUtil;
+import org.apache.commons.lang.StringUtils;
+import org.apache.streams.jackson.StreamsJacksonMapper;
+import org.apache.streams.pojo.json.Activity;
+import org.junit.*;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.BufferedReader;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.util.ArrayList;
+import java.util.List;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+
+/**
+ * Tests conversion of gplus inputs to Activity
+ */
+public class GooglePlusCommentSerDeIT {
+ private final static Logger LOGGER = LoggerFactory.getLogger(GooglePlusCommentSerDeIT.class);
+ private ObjectMapper objectMapper;
+ private GooglePlusActivityUtil googlePlusActivityUtil;
+
+ @Before
+ public void setup() {
+ objectMapper = StreamsJacksonMapper.getInstance();
+ SimpleModule simpleModule = new SimpleModule();
+ simpleModule.addDeserializer(Comment.class, new GPlusCommentDeserializer());
+ objectMapper.registerModule(simpleModule);
+ objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
+
+ googlePlusActivityUtil = new GooglePlusActivityUtil();
+ }
+
+ @org.junit.Test
+ public void testCommentObjects() {
+ InputStream is = GooglePlusCommentSerDeIT.class.getResourceAsStream("/google_plus_comments_jsons.txt");
+ InputStreamReader isr = new InputStreamReader(is);
+ BufferedReader br = new BufferedReader(isr);
+
+ Activity activity = new Activity();
+ List<Comment> comments = Lists.newArrayList();
+
+ try {
+ while (br.ready()) {
+ String line = br.readLine();
+ if (!StringUtils.isEmpty(line)) {
+ LOGGER.info("raw: {}", line);
+ Comment comment = objectMapper.readValue(line, Comment.class);
+
+ LOGGER.info("comment: {}", comment);
+
+ assertNotNull(comment);
+ assertNotNull(comment.getEtag());
+ assertNotNull(comment.getId());
+ assertNotNull(comment.getInReplyTo());
+ assertNotNull(comment.getObject());
+ assertNotNull(comment.getPlusoners());
+ assertNotNull(comment.getPublished());
+ assertNotNull(comment.getUpdated());
+ assertNotNull(comment.getSelfLink());
+ assertEquals(comment.getVerb(), "post");
+
+ comments.add(comment);
+ }
+ }
+
+ assertEquals(comments.size(), 3);
+
+ googlePlusActivityUtil.updateActivity(comments, activity);
+ assertNotNull(activity);
+ assertNotNull(activity.getObject());
+ assertEquals(activity.getObject().getAttachments().size(), 3);
+ } catch (Exception e) {
+ LOGGER.error("Exception while testing serializability: {}", e);
+ }
+ }
+
+ @org.junit.Test
+ public void testEmptyComments() {
+ Activity activity = new Activity();
+
+ googlePlusActivityUtil.updateActivity(new ArrayList<Comment>(), activity);
+
+ assertNull(activity.getObject());
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/3f45b23e/streams-contrib/streams-provider-google/google-gplus/src/test/java/com/google/gplus/GooglePlusCommentSerDeTest.java
----------------------------------------------------------------------
diff --git a/streams-contrib/streams-provider-google/google-gplus/src/test/java/com/google/gplus/GooglePlusCommentSerDeTest.java b/streams-contrib/streams-provider-google/google-gplus/src/test/java/com/google/gplus/GooglePlusCommentSerDeTest.java
deleted file mode 100644
index cd332b4..0000000
--- a/streams-contrib/streams-provider-google/google-gplus/src/test/java/com/google/gplus/GooglePlusCommentSerDeTest.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- * 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
- * with the License. You may obtain a copy of the License at
- *
- * 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.google.gplus;
-
-import com.fasterxml.jackson.databind.DeserializationFeature;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.module.SimpleModule;
-import com.google.api.client.util.Lists;
-import com.google.api.services.plus.model.Comment;
-import com.google.gplus.serializer.util.GPlusCommentDeserializer;
-import com.google.gplus.serializer.util.GooglePlusActivityUtil;
-import org.apache.commons.lang.StringUtils;
-import org.apache.streams.jackson.StreamsJacksonMapper;
-import org.apache.streams.pojo.json.Activity;
-import org.junit.*;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.BufferedReader;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.util.ArrayList;
-import java.util.List;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-
-/**
- * Tests conversion of gplus inputs to Activity
- */
-@Ignore("ignore until test resources are available.")
-public class GooglePlusCommentSerDeTest {
- private final static Logger LOGGER = LoggerFactory.getLogger(GooglePlusCommentSerDeTest.class);
- private ObjectMapper objectMapper;
- private GooglePlusActivityUtil googlePlusActivityUtil;
-
- @Before
- public void setup() {
- objectMapper = StreamsJacksonMapper.getInstance();
- SimpleModule simpleModule = new SimpleModule();
- simpleModule.addDeserializer(Comment.class, new GPlusCommentDeserializer());
- objectMapper.registerModule(simpleModule);
- objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
-
- googlePlusActivityUtil = new GooglePlusActivityUtil();
- }
-
- @org.junit.Test
- public void testCommentObjects() {
- InputStream is = GooglePlusPersonSerDeTest.class.getResourceAsStream("/google_plus_comments_jsons.txt");
- InputStreamReader isr = new InputStreamReader(is);
- BufferedReader br = new BufferedReader(isr);
-
- Activity activity = new Activity();
- List<Comment> comments = Lists.newArrayList();
-
- try {
- while (br.ready()) {
- String line = br.readLine();
- if (!StringUtils.isEmpty(line)) {
- LOGGER.info("raw: {}", line);
- Comment comment = objectMapper.readValue(line, Comment.class);
-
- LOGGER.info("comment: {}", comment);
-
- assertNotNull(comment);
- assertNotNull(comment.getEtag());
- assertNotNull(comment.getId());
- assertNotNull(comment.getInReplyTo());
- assertNotNull(comment.getObject());
- assertNotNull(comment.getPlusoners());
- assertNotNull(comment.getPublished());
- assertNotNull(comment.getUpdated());
- assertNotNull(comment.getSelfLink());
- assertEquals(comment.getVerb(), "post");
-
- comments.add(comment);
- }
- }
-
- assertEquals(comments.size(), 3);
-
- googlePlusActivityUtil.updateActivity(comments, activity);
- assertNotNull(activity);
- assertNotNull(activity.getObject());
- assertEquals(activity.getObject().getAttachments().size(), 3);
- } catch (Exception e) {
- LOGGER.error("Exception while testing serializability: {}", e);
- }
- }
-
- @org.junit.Test
- public void testEmptyComments() {
- Activity activity = new Activity();
-
- googlePlusActivityUtil.updateActivity(new ArrayList<Comment>(), activity);
-
- assertNull(activity.getObject());
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/3f45b23e/streams-contrib/streams-provider-google/google-gplus/src/test/java/com/google/gplus/GooglePlusPersonSerDeIT.java
----------------------------------------------------------------------
diff --git a/streams-contrib/streams-provider-google/google-gplus/src/test/java/com/google/gplus/GooglePlusPersonSerDeIT.java b/streams-contrib/streams-provider-google/google-gplus/src/test/java/com/google/gplus/GooglePlusPersonSerDeIT.java
new file mode 100644
index 0000000..056babe
--- /dev/null
+++ b/streams-contrib/streams-provider-google/google-gplus/src/test/java/com/google/gplus/GooglePlusPersonSerDeIT.java
@@ -0,0 +1,101 @@
+/*
+ * 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
+ * with the License. You may obtain a copy of the License at
+ *
+ * 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.google.gplus;
+
+import com.fasterxml.jackson.databind.*;
+import com.fasterxml.jackson.databind.module.SimpleModule;
+import com.google.api.services.plus.model.Person;
+import com.google.gplus.serializer.util.GPlusPersonDeserializer;
+import com.google.gplus.serializer.util.GooglePlusActivityUtil;
+import org.apache.commons.lang.StringUtils;
+import org.apache.streams.jackson.StreamsJacksonMapper;
+import org.apache.streams.pojo.json.Activity;
+import org.apache.streams.pojo.json.Actor;
+import org.apache.streams.pojo.json.Provider;
+import org.junit.Before;
+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 static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+/**
+ * Tests conversion of gplus inputs to Activity
+ */
+public class GooglePlusPersonSerDeIT {
+ private final static Logger LOGGER = LoggerFactory.getLogger(GooglePlusPersonSerDeIT.class);
+ private ObjectMapper objectMapper;
+ private GooglePlusActivityUtil googlePlusActivityUtil;
+
+ @Before
+ public void setup() {
+ objectMapper = StreamsJacksonMapper.getInstance();
+ SimpleModule simpleModule = new SimpleModule();
+ simpleModule.addDeserializer(Person.class, new GPlusPersonDeserializer());
+ objectMapper.registerModule(simpleModule);
+ objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
+
+ googlePlusActivityUtil = new GooglePlusActivityUtil();
+ }
+
+ @Test
+ public void TestPersonObjects() {
+ InputStream is = GooglePlusPersonSerDeIT.class.getResourceAsStream("/google_plus_person_jsons.txt");
+ InputStreamReader isr = new InputStreamReader(is);
+ BufferedReader br = new BufferedReader(isr);
+
+ try {
+ while (br.ready()) {
+ String line = br.readLine();
+ if (!StringUtils.isEmpty(line)) {
+ LOGGER.info("raw: {}", line);
+ Activity activity = new Activity();
+
+ Person person = objectMapper.readValue(line, Person.class);
+
+ googlePlusActivityUtil.updateActivity(person, activity);
+ LOGGER.info("activity: {}", activity);
+
+ assertNotNull(activity);
+ assert(activity.getId().contains("id:googleplus:update"));
+ assertEquals(activity.getVerb(), "update");
+
+ Provider provider = activity.getProvider();
+ assertEquals(provider.getId(), "id:providers:googleplus");
+ assertEquals(provider.getDisplayName(), "GooglePlus");
+
+ Actor actor = activity.getActor();
+ assertNotNull(actor.getImage());
+ assert(actor.getId().contains("id:googleplus:"));
+ assertNotNull(actor.getUrl());
+
+ }
+ }
+ } catch (Exception e) {
+ LOGGER.error("Exception while testing serializability: {}", e);
+ }
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/3f45b23e/streams-contrib/streams-provider-google/google-gplus/src/test/java/com/google/gplus/GooglePlusPersonSerDeTest.java
----------------------------------------------------------------------
diff --git a/streams-contrib/streams-provider-google/google-gplus/src/test/java/com/google/gplus/GooglePlusPersonSerDeTest.java b/streams-contrib/streams-provider-google/google-gplus/src/test/java/com/google/gplus/GooglePlusPersonSerDeTest.java
deleted file mode 100644
index 951f5cb..0000000
--- a/streams-contrib/streams-provider-google/google-gplus/src/test/java/com/google/gplus/GooglePlusPersonSerDeTest.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * 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
- * with the License. You may obtain a copy of the License at
- *
- * 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.google.gplus;
-
-import com.fasterxml.jackson.databind.*;
-import com.fasterxml.jackson.databind.module.SimpleModule;
-import com.google.api.services.plus.model.Person;
-import com.google.gplus.serializer.util.GPlusPersonDeserializer;
-import com.google.gplus.serializer.util.GooglePlusActivityUtil;
-import org.apache.commons.lang.StringUtils;
-import org.apache.streams.jackson.StreamsJacksonMapper;
-import org.apache.streams.pojo.json.Activity;
-import org.apache.streams.pojo.json.Actor;
-import org.apache.streams.pojo.json.Provider;
-import org.junit.Before;
-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 static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-
-/**
- * Tests conversion of gplus inputs to Activity
- */
-@Ignore("ignore until test resources are available.")
-public class GooglePlusPersonSerDeTest {
- private final static Logger LOGGER = LoggerFactory.getLogger(GooglePlusPersonSerDeTest.class);
- private ObjectMapper objectMapper;
- private GooglePlusActivityUtil googlePlusActivityUtil;
-
- @Before
- public void setup() {
- objectMapper = StreamsJacksonMapper.getInstance();
- SimpleModule simpleModule = new SimpleModule();
- simpleModule.addDeserializer(Person.class, new GPlusPersonDeserializer());
- objectMapper.registerModule(simpleModule);
- objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
-
- googlePlusActivityUtil = new GooglePlusActivityUtil();
- }
-
- @Test
- public void TestPersonObjects() {
- InputStream is = GooglePlusPersonSerDeTest.class.getResourceAsStream("/google_plus_person_jsons.txt");
- InputStreamReader isr = new InputStreamReader(is);
- BufferedReader br = new BufferedReader(isr);
-
- try {
- while (br.ready()) {
- String line = br.readLine();
- if (!StringUtils.isEmpty(line)) {
- LOGGER.info("raw: {}", line);
- Activity activity = new Activity();
-
- Person person = objectMapper.readValue(line, Person.class);
-
- googlePlusActivityUtil.updateActivity(person, activity);
- LOGGER.info("activity: {}", activity);
-
- assertNotNull(activity);
- assert(activity.getId().contains("id:googleplus:update"));
- assertEquals(activity.getVerb(), "update");
-
- Provider provider = activity.getProvider();
- assertEquals(provider.getId(), "id:providers:googleplus");
- assertEquals(provider.getDisplayName(), "GooglePlus");
-
- Actor actor = activity.getActor();
- assertNotNull(actor.getImage());
- assert(actor.getId().contains("id:googleplus:"));
- assertNotNull(actor.getUrl());
-
- }
- }
- } catch (Exception e) {
- LOGGER.error("Exception while testing serializability: {}", e);
- }
- }
-}
\ No newline at end of file