[webbeans-commits] Webbeans SVN: r3655 - ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/manager.

webbeans-commits at lists.jboss.org webbeans-commits at lists.jboss.org
Sun Sep 13 17:17:19 EDT 2009


Author: pete.muir at jboss.org
Date: 2009-09-13 17:17:19 -0400 (Sun, 13 Sep 2009)
New Revision: 3655

Added:
   ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/manager/Cat.java
   ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/manager/CatLocal.java
   ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/manager/EjbDescriptorLookupTest.java
Log:
Test EjbDescriptor

Added: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/manager/Cat.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/manager/Cat.java	                        (rev 0)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/manager/Cat.java	2009-09-13 21:17:19 UTC (rev 3655)
@@ -0,0 +1,29 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,  
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.webbeans.test.unit.manager;
+
+import javax.ejb.Stateful;
+
+/**
+ * @author pmuir
+ *
+ */
+ at Stateful
+public class Cat implements CatLocal
+{
+
+}


Property changes on: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/manager/Cat.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/manager/CatLocal.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/manager/CatLocal.java	                        (rev 0)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/manager/CatLocal.java	2009-09-13 21:17:19 UTC (rev 3655)
@@ -0,0 +1,29 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,  
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.webbeans.test.unit.manager;
+
+import javax.ejb.Local;
+
+/**
+ * @author pmuir
+ *
+ */
+ at Local
+public interface CatLocal
+{
+
+}


Property changes on: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/manager/CatLocal.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/manager/EjbDescriptorLookupTest.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/manager/EjbDescriptorLookupTest.java	                        (rev 0)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/manager/EjbDescriptorLookupTest.java	2009-09-13 21:17:19 UTC (rev 3655)
@@ -0,0 +1,55 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,  
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.webbeans.test.unit.manager;
+
+import javax.enterprise.inject.spi.Bean;
+import javax.enterprise.inject.spi.InjectionTarget;
+
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.testharness.impl.packaging.Packaging;
+import org.jboss.testharness.impl.packaging.PackagingType;
+import org.jboss.webbeans.bean.EnterpriseBean;
+import org.jboss.webbeans.ejb.InternalEjbDescriptor;
+import org.jboss.webbeans.ejb.spi.EjbDescriptor;
+import org.jboss.webbeans.test.AbstractWebBeansTest;
+import org.testng.annotations.Test;
+
+/**
+ * @author pmuir
+ *
+ */
+ at Artifact
+ at Packaging(PackagingType.EAR)
+public class EjbDescriptorLookupTest extends AbstractWebBeansTest
+{
+   
+   @Test
+   public void testCorrectSubType()
+   {
+      EjbDescriptor<CatLocal> descriptor = getCurrentManager().getEjbDescriptor("Cat");
+      assert descriptor.getClass().equals(InternalEjbDescriptor.class);
+      Bean<CatLocal> bean = getCurrentManager().getBean(descriptor);
+      assert bean != null;
+      assert bean instanceof EnterpriseBean;
+      assert bean.getBeanClass().equals(Cat.class);
+      InjectionTarget<CatLocal> it = getCurrentManager().createInjectionTarget(descriptor);
+      assert it != null;
+      assert it instanceof EnterpriseBean;
+      assert it == bean;
+   }
+
+}


Property changes on: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/manager/EjbDescriptorLookupTest.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain




More information about the weld-commits mailing list