Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
git-svn-id: http://anonsvn.jboss.org/repos/weld/ri/trunk@2445 1c488680-804c-0410-94cd-c6b725194a0e
- Loading branch information
Victor Yarmolovich
committed
Apr 16, 2009
1 parent
6d8093e
commit 3c684fc
Showing
10 changed files
with
173 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 20 additions & 12 deletions
32
tests/src/test/java/org/jboss/webbeans/test/unit/xml/beans/Order.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,42 @@ | ||
package org.jboss.webbeans.test.unit.xml.beans; | ||
|
||
import javax.context.Dependent; | ||
import javax.inject.Current; | ||
import javax.context.RequestScoped; | ||
import javax.inject.Initializer; | ||
import javax.inject.manager.Manager; | ||
|
||
import org.jboss.webbeans.test.unit.xml.beans.annotationtype.TestBindingType; | ||
import org.jboss.webbeans.test.unit.xml.beans.annotationtype.TestDeploymentType; | ||
import org.jboss.webbeans.test.unit.xml.beans.annotationtype.TestInterceptorBindingType; | ||
import org.jboss.webbeans.test.unit.xml.beans.annotationtype.TestStereotype; | ||
|
||
@RequestScoped | ||
@TestBindingType | ||
@TestInterceptorBindingType | ||
@TestStereotype | ||
@TestDeploymentType | ||
public class Order | ||
{ | ||
private boolean active; | ||
{ | ||
private int val; | ||
|
||
private String[] strArr; | ||
|
||
@Initializer | ||
public Order(@Current Manager manager) | ||
public Order() | ||
{ | ||
this.val = 0; | ||
} | ||
|
||
public Order(int val) | ||
{ | ||
this.val = val; | ||
} | ||
|
||
public int getVal() | ||
{ | ||
if (manager.getContext(Dependent.class).isActive()) | ||
{ | ||
active = true; | ||
} | ||
return this.val; | ||
} | ||
|
||
public boolean isActive() | ||
public String[] getStrArr() | ||
{ | ||
return active; | ||
return this.strArr; | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
tests/src/test/java/org/jboss/webbeans/test/unit/xml/beans/PaymentResource.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package org.jboss.webbeans.test.unit.xml.beans; | ||
|
||
import javax.annotation.Resource; | ||
|
||
@Resource | ||
public class PaymentResource | ||
{ | ||
|
||
} |
20 changes: 20 additions & 0 deletions
20
tests/src/test/java/org/jboss/webbeans/test/unit/xml/javaeepkg/JavaEePkgTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package org.jboss.webbeans.test.unit.xml.javaeepkg; | ||
|
||
import org.jboss.testharness.impl.packaging.Artifact; | ||
import org.jboss.testharness.impl.packaging.Classes; | ||
import org.jboss.testharness.impl.packaging.jsr299.BeansXml; | ||
import org.jboss.webbeans.test.AbstractWebBeansTest; | ||
import org.jboss.webbeans.test.unit.xml.javaeepkg.foo.Order; | ||
import org.testng.annotations.Test; | ||
|
||
@Artifact | ||
@Classes({Order.class}) | ||
@BeansXml("beans.xml") | ||
public class JavaEePkgTest extends AbstractWebBeansTest | ||
{ | ||
@Test | ||
public void testJavaEePkg() | ||
{ | ||
assert getCurrentManager().resolveByType(Order.class).size() == 2; | ||
} | ||
} |
53 changes: 53 additions & 0 deletions
53
tests/src/test/java/org/jboss/webbeans/test/unit/xml/javaeepkg/foo/Order.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
package org.jboss.webbeans.test.unit.xml.javaeepkg.foo; | ||
|
||
import java.util.Date; | ||
|
||
import javax.annotation.Named; | ||
import javax.context.RequestScoped; | ||
import javax.ejb.ScheduleExpression; | ||
import javax.event.Event; | ||
import javax.inject.Initializer; | ||
import javax.inject.Produces; | ||
import javax.interceptor.InvocationContext; | ||
import javax.jms.Connection; | ||
import javax.persistence.EntityManager; | ||
import javax.sql.CommonDataSource; | ||
import javax.xml.ws.Binding; | ||
|
||
@Named("orderBean") | ||
@RequestScoped | ||
public class Order | ||
{ | ||
private Integer integer; | ||
|
||
private Date date; | ||
|
||
@Initializer | ||
public Order() | ||
{ | ||
this(0, new Date(), null, null, null, null, null, null, null); | ||
} | ||
|
||
public Order(Integer integer, Date date, CommonDataSource source, InvocationContext invocation, Event e, ScheduleExpression schedule, | ||
EntityManager entityManager, Binding binding, Connection conn) | ||
{ | ||
this.integer = integer; | ||
this.date = date; | ||
} | ||
|
||
@Produces | ||
public Order getOrder() | ||
{ | ||
return new Order(); | ||
} | ||
|
||
public Integer getInteger() | ||
{ | ||
return integer; | ||
} | ||
|
||
public Date getDate() | ||
{ | ||
return date; | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
tests/src/test/java/org/jboss/webbeans/test/unit/xml/javaeepkg/foo/PaymentResource.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package org.jboss.webbeans.test.unit.xml.javaeepkg.foo; | ||
|
||
import javax.annotation.Resource; | ||
|
||
@Resource | ||
public class PaymentResource | ||
{ | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
tests/src/test/resources/org/jboss/webbeans/test/unit/xml/javaeepkg/beans.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<Beans xmlns="urn:java:ee" | ||
xmlns:test="urn:java:org.jboss.webbeans.test.unit.xml.javaeepkg.foo"> | ||
|
||
<test:Order> | ||
<RequestScoped /> | ||
<Integer /> | ||
<Date /> | ||
<CommonDataSource /> | ||
<InvocationContext /> | ||
<Event /> | ||
<ScheduleExpression /> | ||
<EntityManager /> | ||
<Binding /> | ||
<Connection /> | ||
<test:getOrder> | ||
<Produces> | ||
<test:Order /> | ||
</Produces> | ||
</test:getOrder> | ||
</test:Order> | ||
|
||
<test:PaymentResource> | ||
<Resource> | ||
<name>java:app/service/PaymentService</name> | ||
</Resource> | ||
</test:PaymentResource> | ||
</Beans> | ||
|
||
|
||
<!-- | ||
javax.context.RequestScoped; | ||
java.lang.Integer; | ||
java.util.Date; | ||
javax.sql.CommonDataSource; | ||
javax.interceptor.InvocationContext; | ||
javax.event.Event; | ||
javax.ejb.ScheduleExpression; | ||
javax.persistence.EntityManager; | ||
javax.xml.ws.Binding; | ||
javax.jms.Connection; | ||
javax.inject.Produces; | ||
javax.annotation.Resource; | ||
--> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters