[ https://issues.apache.org/jira/browse/STREAMS-584?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16441012#comment-16441012 ]
ASF GitHub Bot commented on STREAMS-584: ---------------------------------------- steveblackmon closed pull request #448: resolves STREAMS-584 URL: https://github.com/apache/streams/pull/448 This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/pom.xml b/pom.xml index f46a164c2c..3b3cc079d4 100644 --- a/pom.xml +++ b/pom.xml @@ -364,7 +364,7 @@ <joda-convert.version>1.8.1</joda-convert.version> <json-flattener.version>0.5.0</json-flattener.version> <json-schema-validator.version>0.1.10</json-schema-validator.version> - <juneau.version>7.0.1</juneau.version> + <juneau.version>7.1.0</juneau.version> <jsonschema2pojo.version>0.4.10</jsonschema2pojo.version> <jaxb2.version>0.13.1</jaxb2.version> <jaxb2-basics.version>0.11.1</jaxb2-basics.version> diff --git a/streams-contrib/streams-provider-instagram/src/main/java/org/apache/streams/instagram/api/Instagram.java b/streams-contrib/streams-provider-instagram/src/main/java/org/apache/streams/instagram/api/Instagram.java index e153b5fbbe..9f5cd63c2c 100644 --- a/streams-contrib/streams-provider-instagram/src/main/java/org/apache/streams/instagram/api/Instagram.java +++ b/streams-contrib/streams-provider-instagram/src/main/java/org/apache/streams/instagram/api/Instagram.java @@ -83,7 +83,7 @@ private Instagram(InstagramConfiguration configuration) throws InstantiationExce .setMaxConnPerRoute(20) .setMaxConnTotal(100) .build(); - this.restClient = new RestClientBuilder() + this.restClient = RestClient.create() .rootUrl(rootUrl) .accept(APPLICATION_JSON.getMimeType()) .httpClient(httpclient, true) @@ -99,7 +99,7 @@ private Instagram(InstagramConfiguration configuration) throws InstantiationExce .build()) .retryable( configuration.getRetryMax().intValue(), - configuration.getRetrySleepMs(), + configuration.getRetrySleepMs().intValue(), new InstagramRetryHandler()) .build(); this.mapper = StreamsJacksonMapper.getInstance(); diff --git a/streams-contrib/streams-provider-twitter/src/main/java/org/apache/streams/twitter/api/Twitter.java b/streams-contrib/streams-provider-twitter/src/main/java/org/apache/streams/twitter/api/Twitter.java index a34d7f3739..a91b65377a 100644 --- a/streams-contrib/streams-provider-twitter/src/main/java/org/apache/streams/twitter/api/Twitter.java +++ b/streams-contrib/streams-provider-twitter/src/main/java/org/apache/streams/twitter/api/Twitter.java @@ -121,7 +121,7 @@ private Twitter(TwitterConfiguration configuration) throws InstantiationExceptio .addInterceptorLast((HttpRequestInterceptor) (httpRequest, httpContext) -> LOGGER.debug(httpRequest.getRequestLine().getUri())) .addInterceptorLast((HttpResponseInterceptor) (httpResponse, httpContext) -> LOGGER.debug(httpResponse.getStatusLine().toString())) .build(); - this.restClientBuilder = new RestClientBuilder() + this.restClientBuilder = RestClient.create() .httpClient(httpclient, true) .parser( JsonParser.DEFAULT.builder() @@ -137,7 +137,7 @@ private Twitter(TwitterConfiguration configuration) throws InstantiationExceptio .rootUrl(rootUrl) .retryable( configuration.getRetryMax().intValue(), - configuration.getRetrySleepMs(), + configuration.getRetrySleepMs().intValue(), new TwitterRetryHandler()); if( configuration.getDebug() ) { restClientBuilder = restClientBuilder.debug(); diff --git a/streams-contrib/streams-provider-twitter/src/test/java/org/apache/streams/twitter/test/utils/TwitterActivityConvertersTest.java b/streams-contrib/streams-provider-twitter/src/test/java/org/apache/streams/twitter/test/utils/TwitterActivityConvertersTest.java index 7bfb8ceed5..99cdfcdac7 100644 --- a/streams-contrib/streams-provider-twitter/src/test/java/org/apache/streams/twitter/test/utils/TwitterActivityConvertersTest.java +++ b/streams-contrib/streams-provider-twitter/src/test/java/org/apache/streams/twitter/test/utils/TwitterActivityConvertersTest.java @@ -49,6 +49,8 @@ private ActivityConverterUtil activityConverterUtil = ActivityConverterUtil.getInstance(); + private String deleteJson = "{\"delete\":{\"status\":{\"id\":12345,\"user_id\":56789}}}"; + private String followJson = "{\"follower\":{\"id\":12345},\"followee\":{\"id\":56789}}}"; private String tweetJson = "{\"created_at\":\"Wed Dec 11 22:27:34 +0000 2013\",\"id\":12345,\"id_str\":\"12345\",\"text\":\"text\",\"source\":\"source\",\"truncated\":false,\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":91407775,\"id_str\":\"12345\",\"name\":\"name\",\"screen_name\":\"screen_name\",\"location\":\"\",\"url\":null,\"description\":null,\"protected\":false,\"followers_count\":136,\"friends_count\":0,\"listed_count\":1,\"created_at\":\"Fri Nov 20 19:29:02 +0000 2009\",\"favourites_count\":0,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":false,\"statuses_count\":1793,\"lang\":\"en\",\"contributors_enabled\":false,\"is_translator\":false,\"profile_background_color\":\"C0DEED\",\"profile_background_image_url\":\"http:\\/\\/profile_background_image_url.png\",\"profile_background_image_url_https\":\"https:\\/\\/profile_background_image_url_https.png\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\/\\/profile_image_url.jpg\",\"profile_image_url_https\":\"https:\\/\\/profile_image_url_https.jpg\",\"profile_link_color\":\"0084B4\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"default_profile\":true,\"default_profile_image\":false,\"following\":null,\"follow_request_sent\":null,\"notifications\":null},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"retweet_count\":0,\"favorite_count\":0,\"entities\":{\"hashtags\":[],\"symbols\":[],\"urls\":[{\"url\":\"http:\\/\\/url\",\"expanded_url\":\"http:\\/\\/expanded_url\",\"display_url\":\"display_url\",\"indices\":[118,140]}],\"user_mentions\":[]},\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"filter_level\":\"medium\",\"lang\":\"en\"}\n"; private String retweetJson = "{\"created_at\":\"Wed Dec 11 22:27:34 +0000 2013\",\"id\":23456,\"id_str\":\"23456\",\"text\":\"text\",\"source\":\"web\",\"truncated\":false,\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":163149656,\"id_str\":\"34567\",\"name\":\"name\",\"screen_name\":\"screen_name\",\"location\":\"location\",\"url\":\"http:\\/\\/www.youtube.com\\/watch?v=url\",\"description\":\"description\\u00ed\",\"protected\":false,\"followers_count\":41,\"friends_count\":75,\"listed_count\":2,\"created_at\":\"Mon Jul 05 17:35:49 +0000 2010\",\"favourites_count\":4697,\"utc_offset\":-10800,\"time_zone\":\"Buenos Aires\",\"geo_enabled\":false,\"verified\":false,\"statuses_count\":5257,\"lang\":\"es\",\"contributors_enabled\":false,\"is_translator\":false,\"profile_background_color\":\"C4A64B\",\"profile_background_image_url\":\"http:\\/\\/a0.twimg.com\\/profile_background_images\\/12345\\/12345.jpeg\",\"profile_background_image_url_https\":\"https:\\/\\/si0.twimg.com\\/profile_background_images\\/12345\\/12345.jpeg\",\"profile_background_tile\":true,\"profile_image_url\":\"http:\\/\\/pbs.twimg.com\\/profile_images\\/12345\\/12345.jpeg\",\"profile_image_url_https\":\"https:\\/\\/pbs.twimg.com\\/profile_images\\/12345\\/12345.jpeg\",\"profile_banner_url\":\"https:\\/\\/pbs.twimg.com\\/profile_banners\\/12345\\/12345\",\"profile_link_color\":\"BF415A\",\"profile_sidebar_border_color\":\"000000\",\"profile_sidebar_fill_color\":\"B17CED\",\"profile_text_color\":\"3D1957\",\"profile_use_background_image\":true,\"default_profile\":false,\"default_profile_image\":false,\"following\":null,\"follow_request_sent\":null,\"notifications\":null},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"retweeted_status\":{\"created_at\":\"Wed Dec 11 22:25:06 +0000 2013\",\"id\":34567,\"id_str\":\"34567\",\"text\":\"text\",\"source\":\"source\",\"truncated\":false,\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":34567,\"id_str\":\"34567\",\"name\":\"name\",\"screen_name\":\"screen_name\",\"location\":\"\",\"url\":\"http:\\/\\/www.web.com\",\"description\":\"description\",\"protected\":false,\"followers_count\":34307,\"friends_count\":325,\"listed_count\":361,\"created_at\":\"Fri Apr 13 19:00:11 +0000 2012\",\"favourites_count\":44956,\"utc_offset\":3600,\"time_zone\":\"Madrid\",\"geo_enabled\":false,\"verified\":false,\"statuses_count\":24011,\"lang\":\"es\",\"contributors_enabled\":false,\"is_translator\":false,\"profile_background_color\":\"000000\",\"profile_background_image_url\":\"http:\\/\\/profile_background_image_url.jpeg\",\"profile_background_image_url_https\":\"https:\\/\\/si0.twimg.com\\/profile_background_images\\/34567\\/34567.jpeg\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\/\\/pbs.twimg.com\\/profile_images\\/34567\\/34567.gif\",\"profile_image_url_https\":\"https:\\/\\/pbs.twimg.com\\/profile_images\\/34567\\/34567.gif\",\"profile_banner_url\":\"https:\\/\\/pbs.twimg.com\\/profile_banners\\/34567\\/34567\",\"profile_link_color\":\"FF00E1\",\"profile_sidebar_border_color\":\"FFFFFF\",\"profile_sidebar_fill_color\":\"F3F3F3\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"default_profile\":false,\"default_profile_image\":false,\"following\":null,\"follow_request_sent\":null,\"notifications\":null},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"retweet_count\":9,\"favorite_count\":6,\"entities\":{\"hashtags\":[],\"symbols\":[],\"urls\":[],\"user_mentions\":[]},\"favorited\":false,\"retweeted\":false,\"lang\":\"es\"},\"retweet_count\":0,\"favorite_count\":0,\"entities\":{\"hashtags\":[],\"symbols\":[],\"urls\":[],\"user_mentions\":[{\"screen_name\":\"screen_name\",\"name\":\"name emocional\",\"id\":45678,\"id_str\":\"45678\",\"indices\":[3,14]}]},\"favorited\":false,\"retweeted\":false,\"filter_level\":\"medium\",\"lang\":\"es\"}\n"; @@ -76,7 +78,7 @@ public void testConvertRetweet() throws Exception { @Test public void testConvertDelete() throws Exception { - Delete delete = mapper.readValue(retweetJson, Delete.class); + Delete delete = mapper.readValue(deleteJson, Delete.class); List<Activity> activityList = activityConverterUtil.convert(delete); Assert.assertEquals(activityList.size(), 1); Activity activity = activityList.get(0); @@ -87,7 +89,7 @@ public void testConvertDelete() throws Exception { @Test public void testConvertFollow() throws Exception { - Follow follow = mapper.readValue(retweetJson, Follow.class); + Follow follow = mapper.readValue(followJson, Follow.class); List<Activity> activityList = activityConverterUtil.convert(follow); Assert.assertTrue(activityList.size() == 1); Activity activity = activityList.get(0); diff --git a/streams-contrib/streams-provider-twitter/src/test/resources/TwitterIT.conf b/streams-contrib/streams-provider-twitter/src/test/resources/TwitterIT.conf index 278c62a9d9..0bf774ef22 100644 --- a/streams-contrib/streams-provider-twitter/src/test/resources/TwitterIT.conf +++ b/streams-contrib/streams-provider-twitter/src/test/resources/TwitterIT.conf @@ -16,7 +16,7 @@ # under the License. include "../../../../twitter.conf" org.apache.streams.twitter.config.TwitterConfiguration { - debug = true + #debug = true retrySleepMs = 100 retryMax = 1 } diff --git a/streams-examples/streams-examples-local/twitter-follow-neo4j/src/test/resources/application.conf b/streams-examples/streams-examples-local/twitter-follow-neo4j/src/test/resources/application.conf index 2a49a331f4..99c624c542 100644 --- a/streams-examples/streams-examples-local/twitter-follow-neo4j/src/test/resources/application.conf +++ b/streams-examples/streams-examples-local/twitter-follow-neo4j/src/test/resources/application.conf @@ -26,7 +26,7 @@ graph = { include file("../../../neo4j.properties") } graph = { include file("../../../../neo4j.properties") } graph = { include file("../../../../../neo4j.properties") } twitter { - debug = true + #debug = true ids_only = false endpoint = "friends" info = [ diff --git a/streams-pojo/src/main/java/org/apache/streams/juneau/JodaDateSwap.java b/streams-pojo/src/main/java/org/apache/streams/juneau/JodaDateSwap.java index 2befa33185..5a37517941 100644 --- a/streams-pojo/src/main/java/org/apache/streams/juneau/JodaDateSwap.java +++ b/streams-pojo/src/main/java/org/apache/streams/juneau/JodaDateSwap.java @@ -18,6 +18,8 @@ package org.apache.streams.juneau; +import org.apache.streams.data.util.RFC3339Utils; + import org.apache.commons.lang3.StringUtils; import org.apache.juneau.BeanSession; import org.apache.juneau.ClassMeta; @@ -45,8 +47,8 @@ public JodaDateSwap() { @Override /* PojoSwap */ public String swap(BeanSession session, DateTime o) { DateTimeFormatter dateFormatter = this.dateFormatter; - if( StringUtils.isNotBlank(session.getStringProperty("format"))) { - dateFormatter = DateTimeFormat.forPattern(session.getStringProperty("format")); + if( StringUtils.isNotBlank(session.getProperty("format", String.class, RFC3339Utils.UTC_STANDARD_FMT.toString()))) { + dateFormatter = DateTimeFormat.forPattern(session.getProperty("format", String.class, RFC3339Utils.UTC_STANDARD_FMT.toString())); } return dateFormatter.print(o); } @@ -54,8 +56,8 @@ public String swap(BeanSession session, DateTime o) { @Override /* PojoSwap */ public DateTime unswap(BeanSession session, String f, ClassMeta<?> hint) throws ParseException { DateTimeFormatter dateFormatter = this.dateFormatter; - if( StringUtils.isNotBlank(session.getStringProperty("format"))) { - dateFormatter = DateTimeFormat.forPattern(session.getStringProperty("format")); + if( StringUtils.isNotBlank(session.getProperty("format", String.class, RFC3339Utils.UTC_STANDARD_FMT.toString()))) { + dateFormatter = DateTimeFormat.forPattern(session.getProperty("format", String.class, RFC3339Utils.UTC_STANDARD_FMT.toString())); } return dateFormatter.parseDateTime(f); } diff --git a/streams-pojo/src/main/java/org/apache/streams/juneau/ListSerializer.java b/streams-pojo/src/main/java/org/apache/streams/juneau/ListSerializer.java index 04290871dc..d73729ceb6 100644 --- a/streams-pojo/src/main/java/org/apache/streams/juneau/ListSerializer.java +++ b/streams-pojo/src/main/java/org/apache/streams/juneau/ListSerializer.java @@ -19,23 +19,23 @@ package org.apache.streams.juneau; import org.apache.commons.lang3.StringUtils; -import org.apache.juneau.PartType; -import org.apache.juneau.serializer.PartSerializer; +import org.apache.juneau.httppart.HttpPartType; +import org.apache.juneau.httppart.HttpPartSerializer; import java.util.List; /** * Serializes {@link java.util.List} as appropriately delimited {@link String Strings}. */ -public class ListSerializer implements PartSerializer { +public class ListSerializer implements HttpPartSerializer { @Override - public String serialize(PartType type, Object value) { + public String serialize(HttpPartType type, Object value) { List list = (List) value; if( list.size() > 0 ) { - if( type.equals(PartType.QUERY)) { + if( type.equals(HttpPartType.QUERY)) { return StringUtils.join(list, ","); - } else if( type.equals(PartType.PATH)) { + } else if( type.equals(HttpPartType.PATH)) { return StringUtils.join(list, "/"); } } ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Upgrade to Juneau 7.1.0 > ----------------------- > > Key: STREAMS-584 > URL: https://issues.apache.org/jira/browse/STREAMS-584 > Project: Streams > Issue Type: Task > Reporter: Steve Blackmon > Assignee: Steve Blackmon > Priority: Major > Fix For: 0.6.0 > > Original Estimate: 1h > Remaining Estimate: 1h > > Upgrade to Juneau 7.1.0 once the release candidate is available. -- This message was sent by Atlassian JIRA (v7.6.3#76005)