[webbeans-commits] Webbeans SVN: r2634 - in tck/trunk/impl/src/main: java/org/jboss/jsr299/tck/tests/xml/namespace/javaee and 9 other directories.

webbeans-commits at lists.jboss.org webbeans-commits at lists.jboss.org
Wed Apr 29 11:16:02 EDT 2009


Author: dallen6
Date: 2009-04-29 11:16:02 -0400 (Wed, 29 Apr 2009)
New Revision: 2634

Added:
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/javatypes/
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/javatypes/ArrayTest.java
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/javatypes/CurrentCustomerAddress.java
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/javatypes/CurrentCustomerName.java
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/javatypes/LineItem.java
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/javatypes/PrimitiveTest.java
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/javatypes/Product.java
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/javatypes/PurchaseOrder.java
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/javatypes/ShipTo.java
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/javatypes/TypeMemberTest.java
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/javatypes/TypedParameterTest.java
   tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/namespace/javatypes/
   tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/namespace/javatypes/array-beans.xml
   tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/namespace/javatypes/member-beans.xml
   tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/namespace/javatypes/primitive-beans.xml
   tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/namespace/javatypes/typeparam-beans.xml
Removed:
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/javaee/JavaEeNamespaceTest.java
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/javaee/foo/
   tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/namespace/javaee/beans.xml
   tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/namespace/javaee/namespace
Modified:
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/javaee/pkg/foo/Order.java
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/notdeclared/NotDeclaredNamespaceTest.java
   tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/namespace/javaee/pkg/beans.xml
   tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/namespace/notdeclared/beans.xml
   tck/trunk/impl/src/main/resources/tck-audit.xml
Log:
Additional new tests added for namespaces and types XML tests.

Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/javaee/JavaEeNamespaceTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/javaee/JavaEeNamespaceTest.java	2009-04-29 09:15:52 UTC (rev 2633)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/javaee/JavaEeNamespaceTest.java	2009-04-29 15:16:02 UTC (rev 2634)
@@ -1,65 +0,0 @@
-package org.jboss.jsr299.tck.tests.xml.namespace.javaee;
-
-import java.lang.reflect.Type;
-import java.util.Set;
-
-import javax.context.RequestScoped;
-import javax.inject.manager.Bean;
-import javax.inject.manager.Manager;
-
-import org.hibernate.tck.annotations.SpecAssertion;
-import org.hibernate.tck.annotations.SpecAssertions;
-import org.jboss.jsr299.tck.AbstractJSR299Test;
-import org.jboss.jsr299.tck.tests.xml.namespace.javaee.foo.AnotherDeploymentType;
-import org.jboss.jsr299.tck.tests.xml.namespace.javaee.foo.Order;
-import org.jboss.testharness.impl.packaging.Artifact;
-import org.jboss.testharness.impl.packaging.Classes;
-import org.jboss.testharness.impl.packaging.Resource;
-import org.jboss.testharness.impl.packaging.Resources;
-import org.jboss.testharness.impl.packaging.jsr299.BeansXml;
-import org.testng.annotations.Test;
-
- at Artifact
- at Resources( { @Resource(source = "namespace", destination = "WEB-INF/classes/org/jboss/jsr299/tck/tests/xml/namespace/javaee/namespace") })
- at Classes( { Order.class, AnotherDeploymentType.class })
- at BeansXml("beans.xml")
-public class JavaEeNamespaceTest extends AbstractJSR299Test
-{
-   @Test
-   @SpecAssertions( { @SpecAssertion(section = "9.1", id = "e"), @SpecAssertion(section = "9.1", id = "f"), @SpecAssertion(section = "9.2", id = "f"), @SpecAssertion(section = "9.2.1", id = "b"), @SpecAssertion(section = "9.2.1", id = "c"), @SpecAssertion(section = "9.2.1", id = "d"), @SpecAssertion(section = "9.2.1", id = "e") })
-   public void testJavaEeNamespace()
-   {
-      Manager manager = getCurrentManager();
-      Set<Bean<Order>> beans = manager.resolveByType(Order.class);
-
-      assert beans.size() == 1;
-
-      for (Bean<Order> bean : beans)
-      {
-         assert bean.getDeploymentType().equals(AnotherDeploymentType.class);
-         assert bean.getScopeType().equals(RequestScoped.class);
-
-         Set<? extends Type> beanTypes = bean.getTypes();
-         assert beanTypes.contains(Order.class);
-
-         Class<?> clazz = Order.class;
-         try
-         {
-            assert clazz.getDeclaredConstructor(int.class) != null;
-            assert clazz.getDeclaredField("strArr").getType().equals(String[].class);
-         }
-         catch (SecurityException e)
-         {
-            assert false : "SecurityException while getting constructor with 'int' parameter from '" + clazz + "'";
-         }
-         catch (NoSuchMethodException e)
-         {
-            assert false : "Can not find constructor with 'int' parameter in '" + clazz + "'";
-         }
-         catch (NoSuchFieldException e)
-         {
-            assert false : "Can not find field 'strArr' in '" + clazz + "'";
-         }
-      }
-   }
-}

Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/javaee/pkg/foo/Order.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/javaee/pkg/foo/Order.java	2009-04-29 09:15:52 UTC (rev 2633)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/javaee/pkg/foo/Order.java	2009-04-29 15:16:02 UTC (rev 2634)
@@ -5,10 +5,9 @@
 import javax.context.RequestScoped;
 import javax.ejb.TimerHandle;
 import javax.event.Event;
-import javax.inject.Initializer;
 import javax.interceptor.InvocationContext;
 import javax.persistence.EntityManager;
-import javax.sql.CommonDataSource;
+import javax.sql.DataSource;
 import javax.xml.ws.Binding;
 
 @RequestScoped
@@ -19,13 +18,12 @@
    
    private final Date date;
    
-   @Initializer
    public Order()
    {
       this(0, new Date(), null, null, null, null, null, null);
    }
    
-   public Order(Integer integer, Date date, CommonDataSource source, InvocationContext invocation, Event e, TimerHandle schedule, 
+   public Order(Integer integer, Date date, DataSource source, InvocationContext invocation, Event<String> e, TimerHandle schedule, 
          EntityManager entityManager, Binding binding)
    {
       this.integer = integer;

Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/javatypes/ArrayTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/javatypes/ArrayTest.java	                        (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/javatypes/ArrayTest.java	2009-04-29 15:16:02 UTC (rev 2634)
@@ -0,0 +1,47 @@
+/*
+ * 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.jsr299.tck.tests.xml.namespace.javatypes;
+
+import org.hibernate.tck.annotations.SpecAssertion;
+import org.hibernate.tck.annotations.SpecAssertions;
+import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.testharness.impl.packaging.jsr299.BeansXml;
+import org.testng.annotations.Test;
+
+/**
+ * Tests use of the &lt;Array&gt; element in XML.
+ * 
+ * @author David Allen
+ *
+ */
+ at Artifact
+ at BeansXml("array-beans.xml")
+public class ArrayTest extends AbstractJSR299Test
+{
+   @Test(groups = { "broken", "xml" })
+   @SpecAssertions({
+      @SpecAssertion(section="9.2.1", id="d")
+    })
+    //TODO Cannot test array element since there is no defined place for it to appear
+   public void testArrayElement()
+   {
+      //TODO Test is using array on constructor, but that is not injectable
+      assert false;
+   }
+}


Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/javatypes/ArrayTest.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/javatypes/CurrentCustomerAddress.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/javatypes/CurrentCustomerAddress.java	                        (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/javatypes/CurrentCustomerAddress.java	2009-04-29 15:16:02 UTC (rev 2634)
@@ -0,0 +1,22 @@
+package org.jboss.jsr299.tck.tests.xml.namespace.javatypes;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.inject.BindingType;
+
+ at Target( { TYPE, METHOD, PARAMETER, FIELD })
+ at Retention(RUNTIME)
+ at Documented
+ at BindingType
+ at interface CurrentCustomerAddress
+{
+
+}


Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/javatypes/CurrentCustomerAddress.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/javatypes/CurrentCustomerName.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/javatypes/CurrentCustomerName.java	                        (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/javatypes/CurrentCustomerName.java	2009-04-29 15:16:02 UTC (rev 2634)
@@ -0,0 +1,22 @@
+package org.jboss.jsr299.tck.tests.xml.namespace.javatypes;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.inject.BindingType;
+
+ at Target( { TYPE, METHOD, PARAMETER, FIELD })
+ at Retention(RUNTIME)
+ at Documented
+ at BindingType
+ at interface CurrentCustomerName
+{
+
+}


Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/javatypes/CurrentCustomerName.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/javatypes/LineItem.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/javatypes/LineItem.java	                        (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/javatypes/LineItem.java	2009-04-29 15:16:02 UTC (rev 2634)
@@ -0,0 +1,42 @@
+package org.jboss.jsr299.tck.tests.xml.namespace.javatypes;
+
+class LineItem
+{
+   private String description = "";
+   private String productId = "";
+   private Integer quantity = 0;
+   private Double amount = 0.0d;
+
+   public String getDescription()
+   {
+      return description;
+   }
+   public void setDescription(String description)
+   {
+      this.description = description;
+   }
+   public String getProductId()
+   {
+      return productId;
+   }
+   public void setProductId(String productId)
+   {
+      this.productId = productId;
+   }
+   public Integer getQuantity()
+   {
+      return quantity;
+   }
+   public void setQuantity(Integer quantity)
+   {
+      this.quantity = quantity;
+   }
+   public Double getAmount()
+   {
+      return amount;
+   }
+   public void setAmount(Double amount)
+   {
+      this.amount = amount;
+   } 
+}


Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/javatypes/LineItem.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/javatypes/PrimitiveTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/javatypes/PrimitiveTest.java	                        (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/javatypes/PrimitiveTest.java	2009-04-29 15:16:02 UTC (rev 2634)
@@ -0,0 +1,67 @@
+/*
+ * 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.jsr299.tck.tests.xml.namespace.javatypes;
+
+import javax.inject.AnnotationLiteral;
+
+import org.hibernate.tck.annotations.SpecAssertion;
+import org.hibernate.tck.annotations.SpecAssertions;
+import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.testharness.impl.packaging.jsr299.BeansXml;
+import org.testng.annotations.Test;
+
+/**
+ * Tests related to primitive Java types in XML.
+ * 
+ * @author David Allen
+ *
+ */
+ at Artifact
+ at BeansXml("primitive-beans.xml")
+public class PrimitiveTest extends AbstractJSR299Test
+{
+   @Test(groups = { "broken", "xml" })
+   @SpecAssertions({
+      @SpecAssertion(section="9.2.1", id="e")
+    })
+    //TODO Test relies on section 9.5 behavior which is not supported
+    //TODO Test requires bug WBRI-244 to be fixed
+   public void testPrimitiveType() throws Exception
+   {
+      new RunInDependentContext()
+      {
+
+         @Override
+         protected void execute() throws Exception
+         {
+            StringBuilder customerName = getCurrentManager().getInstanceByType(StringBuilder.class, new AnnotationLiteral<CurrentCustomerName>(){});
+            StringBuilder customerAddress = getCurrentManager().getInstanceByType(StringBuilder.class, new AnnotationLiteral<CurrentCustomerAddress>(){});
+            customerName.append("Customer");
+            customerAddress.append("Address");
+            ShipTo shipTo = getCurrentManager().getInstanceByType(ShipTo.class);
+            assert shipTo.getName() != null;
+            assert shipTo.getAddress() != null;
+            assert shipTo.getName().equals("Customer");
+            assert shipTo.getAddress().equals("Address");
+         }
+         
+      }.run();
+      
+   }
+}


Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/javatypes/PrimitiveTest.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/javatypes/Product.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/javatypes/Product.java	                        (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/javatypes/Product.java	2009-04-29 15:16:02 UTC (rev 2634)
@@ -0,0 +1,28 @@
+package org.jboss.jsr299.tck.tests.xml.namespace.javatypes;
+
+class Product
+{
+   private int[]  inventories;
+   private String prodId;
+   
+   public Product()
+   {
+      
+   }
+   
+   public Product(String productId, int[] currentInventories)
+   {
+      this.prodId = productId;
+      this.inventories = currentInventories;
+   }
+
+   public int[] getInventories()
+   {
+      return inventories;
+   }
+
+   public String getProdId()
+   {
+      return prodId;
+   }
+}


Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/javatypes/Product.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Copied: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/javatypes/PurchaseOrder.java (from rev 2631, tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/javaee/foo/Order.java)
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/javatypes/PurchaseOrder.java	                        (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/javatypes/PurchaseOrder.java	2009-04-29 15:16:02 UTC (rev 2634)
@@ -0,0 +1,34 @@
+package org.jboss.jsr299.tck.tests.xml.namespace.javatypes;
+
+import java.util.ArrayList;
+
+import javax.context.RequestScoped;
+
+ at RequestScoped
+class PurchaseOrder
+{   
+   private int val;
+   
+   private ArrayList<String> strArr = new ArrayList<String>();
+   
+   public PurchaseOrder()
+   {
+      this.val = 0;
+   }
+   
+   public PurchaseOrder(Integer val, ArrayList<String> strArray)
+   {
+      this.val = val;
+      this.strArr = strArray;
+   }
+   
+   public int getVal()
+   {
+      return this.val;
+   }
+   
+   public ArrayList<String> getStrArr()
+   {
+      return this.strArr;
+   }
+}

Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/javatypes/ShipTo.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/javatypes/ShipTo.java	                        (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/javatypes/ShipTo.java	2009-04-29 15:16:02 UTC (rev 2634)
@@ -0,0 +1,28 @@
+package org.jboss.jsr299.tck.tests.xml.namespace.javatypes;
+
+class ShipTo
+{
+   private StringBuilder name;
+   private StringBuilder address;
+
+   public StringBuilder getName()
+   {
+      return name;
+   }
+
+   public void setName(StringBuilder name)
+   {
+      this.name = name;
+   }
+
+   public StringBuilder getAddress()
+   {
+      return address;
+   }
+
+   public void setAddress(StringBuilder address)
+   {
+      this.address = address;
+   }
+
+}


Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/javatypes/ShipTo.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/javatypes/TypeMemberTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/javatypes/TypeMemberTest.java	                        (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/javatypes/TypeMemberTest.java	2009-04-29 15:16:02 UTC (rev 2634)
@@ -0,0 +1,52 @@
+/*
+ * 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.jsr299.tck.tests.xml.namespace.javatypes;
+
+import org.hibernate.tck.annotations.SpecAssertion;
+import org.hibernate.tck.annotations.SpecAssertions;
+import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.testharness.impl.packaging.jsr299.BeansXml;
+import org.testng.annotations.Test;
+
+/**
+ * Confirms correct behavior of interpreting members of another Java
+ * type in XML.
+ * 
+ * @author David Allen
+ *
+ */
+ at Artifact
+ at BeansXml("member-beans.xml")
+public class TypeMemberTest extends AbstractJSR299Test
+{
+   @Test(groups = { "broken", "xml" })
+   @SpecAssertions({
+      @SpecAssertion(section="9.1", id="f"),
+      @SpecAssertion(section="9.2", id="f")
+    })
+    //TODO Cannot test type members since w/o 9.5 there is no defined behavior to test
+   public void testTypeMembers()
+   {
+      LineItem lineItem = getCurrentManager().getInstanceByType(LineItem.class);
+      assert lineItem.getAmount().equals(42.50d);
+      assert lineItem.getDescription().equals("Line item 1");
+      assert lineItem.getProductId().equals("prod-1");
+      assert lineItem.getQuantity().equals(42);
+   }
+}


Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/javatypes/TypeMemberTest.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/javatypes/TypedParameterTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/javatypes/TypedParameterTest.java	                        (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/javatypes/TypedParameterTest.java	2009-04-29 15:16:02 UTC (rev 2634)
@@ -0,0 +1,47 @@
+/*
+ * 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.jsr299.tck.tests.xml.namespace.javatypes;
+
+import org.hibernate.tck.annotations.SpecAssertion;
+import org.hibernate.tck.annotations.SpecAssertions;
+import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.testharness.impl.packaging.jsr299.BeansXml;
+import org.testng.annotations.Test;
+
+/**
+ * Only tests specifying types with a type parameter via XML.
+ * 
+ * @author David Allen
+ *
+ */
+ at Artifact
+ at BeansXml("typeparam-beans.xml")
+public class TypedParameterTest extends AbstractJSR299Test
+{
+   @Test(groups = { "broken", "xml" })
+   @SpecAssertions({
+      @SpecAssertion(section="9.1", id="e")
+    })
+    //TODO Fix test by adding some class to the XML with a type parameter
+   public void testTypeParameterForEEType()
+   {
+      PurchaseOrder purchaseOrder = getCurrentManager().getInstanceByType(PurchaseOrder.class);
+      assert purchaseOrder.getStrArr() != null;
+   }
+}


Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/javatypes/TypedParameterTest.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/notdeclared/NotDeclaredNamespaceTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/notdeclared/NotDeclaredNamespaceTest.java	2009-04-29 09:15:52 UTC (rev 2633)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/notdeclared/NotDeclaredNamespaceTest.java	2009-04-29 15:16:02 UTC (rev 2634)
@@ -15,7 +15,7 @@
 @ExpectedDeploymentException(DefinitionException.class)
 public class NotDeclaredNamespaceTest extends AbstractJSR299Test
 {
-   @Test
+   @Test(groups = { "xml" })
    @SpecAssertions({
       @SpecAssertion(section="9", id="e")
    })

Deleted: tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/namespace/javaee/beans.xml
===================================================================
--- tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/namespace/javaee/beans.xml	2009-04-29 09:15:52 UTC (rev 2633)
+++ tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/namespace/javaee/beans.xml	2009-04-29 15:16:02 UTC (rev 2634)
@@ -1,18 +0,0 @@
-<Beans xmlns="urn:java:ee" 
-		xmlns:test="urn:java:org.jboss.jsr299.tck.tests.xml.namespace.javaee">
-	<Deploy>
-		<Standard />
-		<Production />
-		<test:AnotherDeploymentType />
-	</Deploy>
-	<test:Order>
-		<RequestScoped />
-		<test:AnotherDeploymentType />
-		<Integer />
-		<Array>
-			<String />
-		</Array>
-		<test:val/>
-		<test:getVal />
-	</test:Order>
-</Beans>
\ No newline at end of file

Deleted: tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/namespace/javaee/namespace
===================================================================
--- tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/namespace/javaee/namespace	2009-04-29 09:15:52 UTC (rev 2633)
+++ tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/namespace/javaee/namespace	2009-04-29 15:16:02 UTC (rev 2634)
@@ -1,2 +0,0 @@
-org.jboss.jsr299.tck.tests.xml.namespace.javaee
-org.jboss.jsr299.tck.tests.xml.namespace.javaee.foo
\ No newline at end of file

Modified: tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/namespace/javaee/pkg/beans.xml
===================================================================
--- tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/namespace/javaee/pkg/beans.xml	2009-04-29 09:15:52 UTC (rev 2633)
+++ tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/namespace/javaee/pkg/beans.xml	2009-04-29 15:16:02 UTC (rev 2634)
@@ -10,9 +10,11 @@
 		<test:TestBindingType />
 		<Integer />
 		<Date />
-		<CommonDataSource />
+		<DataSource />
 		<InvocationContext />
-		<Event />
+		<Event>
+		   <String />
+		</Event>
 		<TimerHandle />
 		<EntityManager />
 		<Binding />
@@ -24,7 +26,7 @@
    javax.context.RequestScoped;
    java.lang.Integer;
    java.util.Date;
-   javax.sql.CommonDataSource;
+   javax.sql.DataSource;
    javax.interceptor.InvocationContext;
    javax.event.Event;
    javax.ejb.ScheduleExpression;

Added: tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/namespace/javatypes/array-beans.xml
===================================================================
--- tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/namespace/javatypes/array-beans.xml	                        (rev 0)
+++ tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/namespace/javatypes/array-beans.xml	2009-04-29 15:16:02 UTC (rev 2634)
@@ -0,0 +1,13 @@
+<Beans xmlns="urn:java:ee" 
+		xmlns:test="urn:java:org.jboss.jsr299.tck.tests.xml.namespace.javatypes">
+	<Deploy>
+		<Standard />
+		<Production />
+	</Deploy>
+	<test:Product>
+		<String />
+		<Array>
+			<Integer />
+		</Array>
+	</test:Product>
+</Beans>
\ No newline at end of file


Property changes on: tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/namespace/javatypes/array-beans.xml
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/namespace/javatypes/member-beans.xml
===================================================================
--- tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/namespace/javatypes/member-beans.xml	                        (rev 0)
+++ tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/namespace/javatypes/member-beans.xml	2009-04-29 15:16:02 UTC (rev 2634)
@@ -0,0 +1,13 @@
+<Beans xmlns="urn:java:ee" 
+		xmlns:test="urn:java:org.jboss.jsr299.tck.tests.xml.namespace.javatypes">
+	<Deploy>
+		<Standard />
+		<Production />
+	</Deploy>
+	<test:LineItem>
+		<test:amount>42.50</test:amount>
+		<test:quantity>42</test:quantity>
+		<test:description>Line item 1</test:description>
+		<test:productId>prod-1</test:productId>
+	</test:LineItem>
+</Beans>
\ No newline at end of file


Property changes on: tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/namespace/javatypes/member-beans.xml
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/namespace/javatypes/primitive-beans.xml
===================================================================
--- tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/namespace/javatypes/primitive-beans.xml	                        (rev 0)
+++ tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/namespace/javatypes/primitive-beans.xml	2009-04-29 15:16:02 UTC (rev 2634)
@@ -0,0 +1,21 @@
+<Beans xmlns="urn:java:ee" 
+		xmlns:test="urn:java:org.jboss.jsr299.tck.tests.xml.namespace.javatypes">
+	<Deploy>
+		<Standard />
+		<Production />
+	</Deploy>
+	<StringBuilder>
+		<test:CurrentCustomerName />
+	</StringBuilder>
+	<StringBuilder>
+		<test:CurrentCustomerAddress />
+	</StringBuilder>
+	<test:ShipTo>
+		<test:name>
+			<test:CurrentCustomerName />
+		</test:name>
+		<test:address>
+			<test:CurrentCustomerAddress />
+		</test:address>
+	</test:ShipTo>
+</Beans>
\ No newline at end of file


Property changes on: tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/namespace/javatypes/primitive-beans.xml
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Copied: tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/namespace/javatypes/typeparam-beans.xml (from rev 2631, tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/namespace/javaee/beans.xml)
===================================================================
--- tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/namespace/javatypes/typeparam-beans.xml	                        (rev 0)
+++ tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/namespace/javatypes/typeparam-beans.xml	2009-04-29 15:16:02 UTC (rev 2634)
@@ -0,0 +1,10 @@
+<Beans xmlns="urn:java:ee" 
+		xmlns:test="urn:java:org.jboss.jsr299.tck.tests.xml.namespace.javatypes">
+	<Deploy>
+		<Standard />
+		<Production />
+	</Deploy>
+	<test:PurchaseOrder>
+		
+	</test:PurchaseOrder>
+</Beans>
\ No newline at end of file

Modified: tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/namespace/notdeclared/beans.xml
===================================================================
--- tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/namespace/notdeclared/beans.xml	2009-04-29 09:15:52 UTC (rev 2633)
+++ tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/namespace/notdeclared/beans.xml	2009-04-29 15:16:02 UTC (rev 2634)
@@ -1,5 +1,4 @@
-<Beans xmlns="urn:java:ee"
-       xmlns:me="urn:java:foo">
+<Beans xmlns="urn:java:ee">
 	<Deploy>
 		<Standard />
 		<Production />

Modified: tck/trunk/impl/src/main/resources/tck-audit.xml
===================================================================
--- tck/trunk/impl/src/main/resources/tck-audit.xml	2009-04-29 09:15:52 UTC (rev 2633)
+++ tck/trunk/impl/src/main/resources/tck-audit.xml	2009-04-29 15:16:02 UTC (rev 2634)
@@ -4555,12 +4555,14 @@
       <text>The Java EE namespace |urn:java:ee| represents the following packages: |java.lang|, |java.util|, |javax.annotation|, |javax.inject|, |javax.context|, |javax.interceptor|, |javax.decorator|, |javax.event|, |javax.ejb|, |javax.persistence|, |javax.xml.ws|, |javax.jms|, and |javax.sql|</text>
     </assertion>
     
-    <assertion id="b">
+    <assertion id="b" testable="false">
       <text>Several elements in the |urn:java:ee| namespace do not represent Java types</text>
+      <note>Intent</note>
     </assertion>
     
-    <assertion id="c">
+    <assertion id="c" testable="false">
       <text>The root |&lt;Beans&gt;| element, together with the |&lt;Deploy&gt;|, |&lt;Interceptors&gt;| and |&lt;Decorators&gt;| elements belong to the namespace |urn:java:ee| and do not represent Java types nor members of Java types</text>
+      <note>Intent</note>
     </assertion>
     
     <assertion id="d">




More information about the weld-commits mailing list