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

Mario-Leander Reimer edited comment on DELTASPIKE-821 at 1/21/15 3:37 PM:
--------------------------------------------------------------------------

@John: thanks for the analysis. Sometimes the solution is so obvious that it is 
overlooked easily.


was (Author: mario-leander.reimer):
@John: thanks for the analysis. Sometimes the solution is obvious but easily 
overlooked.

> check compatibility with gradle
> -------------------------------
>
>                 Key: DELTASPIKE-821
>                 URL: https://issues.apache.org/jira/browse/DELTASPIKE-821
>             Project: DeltaSpike
>          Issue Type: Task
>          Components: Documentation, TestControl
>    Affects Versions: 1.2.1
>            Reporter: Mario-Leander Reimer
>            Assignee: John D. Ament
>             Fix For: 1.2.2
>
>         Attachments: cdi-logging.zip
>
>
> When using the DeltaSpike Test-Control module I noticed that unit tests that 
> run perfectly fine with Maven won't run with Gradle at all.
> Let's say you have the following producer method to create a SLF4J Logger 
> instance:
> {code:title=LoggerProducer.java}
> public class LoggerProducer {
>     @Produces
>     @Default
>     public Logger createLogger(final InjectionPoint ip) {
>         Class declaringClass = ip.getMember().getDeclaringClass();
>         return org.slf4j.LoggerFactory.getLogger(declaringClass);
>     }
> }
> {code}
> The test for this is also pretty simple:
> {code:title=LoggerProducerTest.java}
> @RunWith(CdiTestRunner.class)
> public class LoggerProducerTest {
>     @Inject 
>     private Logger logger;
>     @Test
>     public void testCreateLogger() throws Exception {
>         assertThat(logger, is(notNullValue()));
>     }
> }
> {code}
> Weld as well as OpenWebBeans throw an exception when the unit test is 
> executed by Gradle, because no suitable beans seem to be found for injection. 
> I have attached a running demo project so you can see for yourself.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to