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

Kenneth Knowles commented on BEAM-3495:
---------------------------------------

I could not find a Jira for it, but I half agree. (I understand why this is 
causing you trouble)

First point: {{src/test/java}} is not the "testing package". It is the _tests_ 
package. So there should essentially never be a dependency on this. We 
shouldn't be using it as a library, even though we do sometimes.

Second point: to do it right, we need a "testing package" with test-only bits 
in the {{src/main/java}} area. But realistically, there is basically no 
downside to just including JUnit, Hamcrest, PAssert, and TestStream in a 
package. They are tiny and have no transitive dependencies.

Third point: but we want to make a testing packages anyhow :-) The 
XyzTranslation modules are "first draft" work that should be replaced once we 
see the overall pattern, and now might be the time.

> core-construction-java should not depend on testing
> ---------------------------------------------------
>
>                 Key: BEAM-3495
>                 URL: https://issues.apache.org/jira/browse/BEAM-3495
>             Project: Beam
>          Issue Type: Bug
>          Components: runner-core, runner-direct
>            Reporter: Jeremie Lenfant-Engelmann
>            Assignee: Kenneth Knowles
>            Priority: Major
>
> core-construction-java currently depends on a class in the testing package 
> because 
> runners/core-construction-java/src/main/java/org/apache/beam/runners/core/construction/TestStreamTranslation.java
>  registers a translation for org.apache.beam.sdk.testing.TestStream.
> This means that when using core-construction-java, one needs to also depend 
> on the testing code. Core should not have to depend on testing, the 
> translation should move to the testing package.
> This also affects the direct runner with 
> runners/direct-java/src/main/java/org/apache/beam/runners/direct/TestStreamEvaluatorFactory.java.
>  For the direct runner, we should have a way to register these factories at 
> run time (via Autoservice) so that this can also be moved to the testing 
> package.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to