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

James Netherton commented on CAMEL-11763:
-----------------------------------------

Actually, none of the tests in {{ServerLocalTest}} seem to verify that the Milo 
server consumer actually works. The route under test is:

{code}
from("milo-server:myitem1").to("mock:test")
{code}

But no messages ever seem to arrive at the mock endpoint.

> Some camel-milo unit tests pass even when exceptions are thrown 
> ----------------------------------------------------------------
>
>                 Key: CAMEL-11763
>                 URL: https://issues.apache.org/jira/browse/CAMEL-11763
>             Project: Camel
>          Issue Type: Test
>          Components: camel-milo
>    Affects Versions: 2.20.0
>            Reporter: James Netherton
>            Priority: Minor
>
> I've been running the Milo 
> [ServerLocalTest|https://github.com/apache/camel/blob/master/components/camel-milo/src/test/java/org/apache/camel/component/milo/server/ServerLocalTest.java].
>  There's a few tests that use the 'Variant' type as the message body. 
> Although the tests seem to pass, they shouldn't be because an exception is 
> thrown in the background:
> {code}
> java.lang.IllegalArgumentException: Variant cannot contain Variant
>       at 
> com.google.common.base.Preconditions.checkArgument(Preconditions.java:122)
>       at 
> org.eclipse.milo.opcua.stack.core.types.builtin.Variant.<init>(Variant.java:49)
>       at 
> org.apache.camel.component.milo.server.internal.CamelServerItem.update(CamelServerItem.java:140)
>       at 
> org.apache.camel.component.milo.server.MiloServerProducer.process(MiloServerProducer.java:36)
>       at 
> org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61)
>       at 
> org.apache.camel.processor.SharedCamelInternalProcessor.process(SharedCamelInternalProcessor.java:186)
>       at 
> org.apache.camel.processor.SharedCamelInternalProcessor.process(SharedCamelInternalProcessor.java:86)
>       at 
> org.apache.camel.impl.ProducerCache$1.doInProducer(ProducerCache.java:541)
>       at 
> org.apache.camel.impl.ProducerCache$1.doInProducer(ProducerCache.java:506)
>       at 
> org.apache.camel.impl.ProducerCache.doInProducer(ProducerCache.java:369)
>       at 
> org.apache.camel.impl.ProducerCache.sendExchange(ProducerCache.java:506)
>       at org.apache.camel.impl.ProducerCache.send(ProducerCache.java:229)
>       at 
> org.apache.camel.impl.DefaultProducerTemplate.send(DefaultProducerTemplate.java:144)
>       at 
> org.apache.camel.impl.DefaultProducerTemplate.send(DefaultProducerTemplate.java:130)
>       at 
> org.apache.camel.test.junit4.CamelTestSupport.sendBody(CamelTestSupport.java:792)
>       at 
> org.apache.camel.component.milo.server.ServerLocalTest.testAcceptVariantString(ServerLocalTest.java:67)
>       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>       at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>       at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>       at java.lang.reflect.Method.invoke(Method.java:498)
>       at 
> org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
>       at 
> org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
>       at 
> org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
>       at 
> org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
>       at 
> org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
>       at 
> org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
> {code}
> If you tweak the tests to verify that a message was received by the mock 
> endpoint, then it'll fail because of this.
> I'm no Milo expert, so my knowledge here is limited.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to