camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Henryk Konsek (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CAMEL-5336) Improve Stream Component test coverage
Date Wed, 06 Jun 2012 06:40:23 GMT

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

Henryk Konsek commented on CAMEL-5336:
--------------------------------------

I see that we generate a fragment of documentation based on the tests I've changed:

==========================
@Test
public void testStringContent() throws Exception {
    template.sendBody("direct:in", "Hello Text World\n");
}

@Test
public void testBinaryContent() {
    template.sendBody("direct:in", "Hello Bytes World\n".getBytes());
}

protected RouteBuilder createRouteBuilder() {
    return new RouteBuilder() {
        public void configure() {
            from("direct:in").to("stream:out");
        }
    };
}
==========================

I suggest to replace this snippet with dedicated custom code example (without @Test annotations).
I can do it if you accept my patch.
                
> Improve Stream Component test coverage
> --------------------------------------
>
>                 Key: CAMEL-5336
>                 URL: https://issues.apache.org/jira/browse/CAMEL-5336
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-stream
>    Affects Versions: 2.9.2
>            Reporter: Henryk Konsek
>             Fix For: 2.10.0
>
>         Attachments: stream-component-tests.patch
>
>
> Hi,
> I've improved the test coverage of Camel Stream component.
> In particular I've added:
> a) tests for Stream producer writing to the URL output stream (StreamToUrlTest).
> b) assertions to StreamSystemOutTest. Previously we've been sending a messages to the
System.out but made no assertions about it. This looked like the AssertionFreeTesting [1].
:) I changed the test to temporarily switch System.out with another PrintStream instance so
we could make some assertions on it.
> Could somebody take a look at patch and possibly apply it to the trunk?
> [1] http://martinfowler.com/bliki/AssertionFreeTesting.html

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message