You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@streams.apache.org by "Steve Blackmon (JIRA)" <ji...@apache.org> on 2016/10/04 20:40:20 UTC

[jira] [Comment Edited] (STREAMS-415) Proof of concept integration test that pulls actual data from generator

    [ https://issues.apache.org/jira/browse/STREAMS-415?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15546593#comment-15546593 ] 

Steve Blackmon edited comment on STREAMS-415 at 10/4/16 8:39 PM:
-----------------------------------------------------------------

Imaging something like this would work when twitter oauth credentials are able to be sourced during verify:

public class TwitterTimelineProviderTest {

    @Test
    public void testTwitterTimelineProviderMain() throws Exception {

        System.setOut(new PrintStream(new BufferedOutputStream(new FileOutputStream("target/test-classes/TwitterTimelineProviderTest/stdout.txt")), true));
        System.setErr(new PrintStream(new BufferedOutputStream(new FileOutputStream("target/test-classes/TwitterTimelineProviderTest/stderr.txt")), true));

        TwitterTimelineProvider.main(new String[0]);

        File stdout = new File("target/test-classes/TwitterTimelineProviderTest/stdout.txt");
        assert (stdout.exists());
        assert (stdout.canRead());
        assert (stdout.isFile());

        File stderr = new File("target/test-classes/TwitterTimelineProviderTest/stderr.txt");
        assert (!stderr.exists());
    }
}



was (Author: steveblackmon):
Imaging something list like this would work when twitter oauth credentials are able to be sourced during verify:

public class TwitterTimelineProviderTest {

    @Test
    public void testTwitterTimelineProviderMain() throws Exception {

        System.setOut(new PrintStream(new BufferedOutputStream(new FileOutputStream("target/test-classes/TwitterTimelineProviderTest/stdout.txt")), true));
        System.setErr(new PrintStream(new BufferedOutputStream(new FileOutputStream("target/test-classes/TwitterTimelineProviderTest/stderr.txt")), true));

        TwitterTimelineProvider.main(new String[0]);

        File stdout = new File("target/test-classes/TwitterTimelineProviderTest/stdout.txt");
        assert (stdout.exists());
        assert (stdout.canRead());
        assert (stdout.isFile());

        File stderr = new File("target/test-classes/TwitterTimelineProviderTest/stderr.txt");
        assert (!stderr.exists());
    }
}


> Proof of concept integration test that pulls actual data from generator
> -----------------------------------------------------------------------
>
>                 Key: STREAMS-415
>                 URL: https://issues.apache.org/jira/browse/STREAMS-415
>             Project: Streams
>          Issue Type: Test
>            Reporter: Steve Blackmon
>             Fix For: 0.4
>
>
> Proof of concept integration test that pulls actual data from generator.
> When ITs are enabled, the test should source oauth credentials from the environment and confirm ability to pull down documents from the generator service using a provider class.
> If credentials have not been provided, the failure should illustrate how to provide them.
> Credentials dedicated to running these tests on jenkins will need to be created, added by an admin, and kept active going forward.
> For example: in streams-twitter-provider, collect user information, recents posts by, friends of and followers of @TheASF, and read from spritzer for 5 seconds.
> Use a smallish limit and confirm that data comes through and no exceptions are thrown.
> This same pattern should be applied to all providers once a suitable pattern is found.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)