You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by hwaastad <he...@waastad.org> on 2014/09/01 15:59:47 UTC

Re: Alternatives and beans.xml

Hi,
I'm sorry that I'm revitalizing this thread, but I' like to discuss a thing
or two regarding (DS) and mocking.

Scenario:
Running IT tests using embedded and @classrules.

testfile:
@PropertyFile("test-lab.properties")
public class MockIT {
}

In test-lab.properties I can define project stage, ex:
org.apache.deltaspike.ProjectStage=IntegrationTest

So in my project I have:

@Exclude(exceptIfProjectStage = ProjectStage.Production.class)
HelloBean impl HelloBeanLocal

and I've added in test classes:
@Exclude(exceptIfProjectStage = ProjectStage.IntegrationTest.class)
MockHelloBean impl HelloBeanLocal


I can define different "cdi mocks" dependening on what I want to test,

Now, what about Deltaspike repositories?

Is it possible to do somthing similar with a:

public abstract class HelloRepository extends AbstractEntityRepository<> ?

The reason for asking is that I have'nt been able to, probably because my
lack of thouough cdi knowledge....

I know I can do something similar to the example
"cdi-alternative-and-stereotypes" but I like the @exclude dynamics from DS.

br hw




--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/Alternatives-and-beans-xml-tp4670031p4671514.html
Sent from the TomEE Users mailing list archive at Nabble.com.