camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Leber, Thomas" <thomas.le...@omnetric.com>
Subject AW: camel-test-blueprint includes camel-test, breaks java.nio.file.Files.probeContentType(source);
Date Thu, 08 Jun 2017 14:07:40 GMT
Ah sorry read this too late. Next time :)

-----Urspr√ľngliche Nachricht-----
Von: Claus Ibsen [mailto:claus.ibsen@gmail.com] 
Gesendet: Dienstag, 06. Juni 2017 20:23
An: users@camel.apache.org
Betreff: Re: camel-test-blueprint includes camel-test, breaks java.nio.file.Files.probeContentType(source);

Hi

I found a little time and have committed a fix for this on the branches.

On Tue, Jun 6, 2017 at 12:25 PM, Claus Ibsen <claus.ibsen@gmail.com> wrote:
> Hi
>
> Ah that test-jar should only be used as part of testing 
> camel-test-blueprint itself. It should have scope=test like it does in 
> camel-spring etc.
>
> You are welcome to contribute a fix via a github PR
>
> On Tue, Jun 6, 2017 at 11:52 AM, Leber, Thomas 
> <thomas.leber@omnetric.com> wrote:
>> Hi all,
>>
>> We are using blueprint and therefore we include camel-test-blueprint. This also includes
Camel-core dependencies with type "test-jar":
>>
>> https://github.com/apache/camel/blob/master/components/camel-test-blu
>> eprint/pom.xml
>>
>> <dependency>
>>         <groupId>org.apache.camel</groupId>
>>         <artifactId>camel-core</artifactId>
>>         <type>test-jar</type
>>  </dependency>
>>
>> Problem is now that this contains a java service for " 
>> java.nio.file.spi.FileTypeDetector": 
>> https://github.com/apache/camel/blob/camel-2.17.x/camel-core/src/test
>> /resources/META-INF/services/java.nio.file.spi.FileTypeDetector
>>
>> This one is specifying the class " 
>> org.apache.camel.component.file.MyFileTypeDetector": 
>> https://github.com/apache/camel/blob/master/camel-core/src/test/java/
>> org/apache/camel/component/file/MyFileTypeDetector.java
>>
>> We are using in our code NIO to probe file contents. In our jUnit test cases Java
is detecting the service and is therefore only loading " MyFileTypeDetector".
>> This always returns "txt" for a file type.
>>
>> We could fix this with adding an exclusion to our pom:
>>
>> <dependency>
>>         <groupId>org.apache.camel</groupId>
>>         <artifactId>camel-test-blueprint</artifactId>
>>         <exclusions>
>>                 <exclusion>
>>                         <groupId>org.apache.camel</groupId>
>>                         <artifactId>camel-core</artifactId>
>>                         <type>test-jar</type>
>>                 </exclusion>
>>         </exclusions>
>> </dependency>
>>
>> This is maybe something that should be fixed or at least mentioned in the camel documentation
for blueprint camel test.
>>
>> Thomas Leber
>
>
>
> --
> Claus Ibsen
> -----------------
> http://davsclaus.com @davsclaus
> Camel in Action 2: https://www.manning.com/ibsen2



--
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2
Mime
View raw message