flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rmetzger <...@git.apache.org>
Subject [GitHub] flink pull request: Implemented TwitterSourceFilter and adapted Tw...
Date Wed, 20 May 2015 07:25:42 GMT
Github user rmetzger commented on a diff in the pull request:

    --- Diff: flink-staging/flink-streaming/flink-streaming-connectors/src/test/java/org/apache/flink/streaming/connectors/twitter/TwitterFilterSourceTest.java
    @@ -0,0 +1,56 @@
    + * 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 org.apache.flink.streaming.connectors.twitter;
    +import org.apache.flink.streaming.api.datastream.DataStream;
    +import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;
    +import org.apache.flink.streaming.connectors.json.JSONParseFlatMap;
    +import org.apache.flink.util.Collector;
    +public class TwitterFilterSourceTest {
    +	private static final String PATH_TO_AUTH_FILE = "/twitter.properties";
    +	public static void main(String[] args) {
    --- End diff --
    I see. The source is expecting a running twitter service.
    Our tests should be self-contained, without relying on external services.
    For the Kafka connector, we are starting an internal testing kafka server in the same
JVM and test Flink-kafka against that one.
    Do you think its doable to implement a little server which is behaving like twitters APIs
    That would be the very best way to test this reliably.
    Maybe it would be sufficient to make `initializeClient()` protected, create a `TestingTwitterSource`
which is overriding `initializeClient()` and creating a testing implementation of `com.twitter.hbc.core.Client`
    But I also understand that its probably more work to implement that test compared to your
    Since we didn't have tests before, I would also agree to merge your changes now and file
a issue for implementing the test.

If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.

View raw message