camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Leber, Thomas" <thomas.le...@omnetric.com>
Subject camel-test-blueprint includes camel-test, breaks java.nio.file.Files.probeContentType(source);
Date Tue, 06 Jun 2017 09:52:27 GMT
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-blueprint/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

Mime
View raw message