[jboss-svn-commits] JBoss Common SVN: r2671 - in jbossxb/trunk/src/test: java/org/jboss/test/xb/builder/object/type/xmlenum/test and 1 other directories.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Sat Nov 3 17:00:33 EDT 2007


Author: alex.loubyansky at jboss.com
Date: 2007-11-03 17:00:33 -0400 (Sat, 03 Nov 2007)
New Revision: 2671

Added:
   jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/xmlenum/support/CollectionOfEnum.java
   jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/xmlenum/test/CollectionOfEnumUnitTestCase.java
   jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/type/xmlenum/test/CollectionOfEnum.xml
Modified:
   jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/xmlenum/test/EnumGlobalTypeUnitTestCase.java
Log:
test collection of enums

Added: jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/xmlenum/support/CollectionOfEnum.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/xmlenum/support/CollectionOfEnum.java	                        (rev 0)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/xmlenum/support/CollectionOfEnum.java	2007-11-03 21:00:33 UTC (rev 2671)
@@ -0,0 +1,46 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.xb.builder.object.type.xmlenum.support;
+
+import java.util.List;
+
+
+/**
+ * A CollectionOfEnum.
+ * 
+ * @author <a href="alex at jboss.com">Alexey Loubyansky</a>
+ * @version $Revision: 1.1 $
+ */
+public class CollectionOfEnum
+{
+   private List<EnumGlobalType> col;
+   
+   public List<EnumGlobalType> getEnums()
+   {
+      return col;
+   }
+   
+   public void setEnums(List<EnumGlobalType> col)
+   {
+      this.col = col;
+   }
+}

Added: jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/xmlenum/test/CollectionOfEnumUnitTestCase.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/xmlenum/test/CollectionOfEnumUnitTestCase.java	                        (rev 0)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/xmlenum/test/CollectionOfEnumUnitTestCase.java	2007-11-03 21:00:33 UTC (rev 2671)
@@ -0,0 +1,57 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.xb.builder.object.type.xmlenum.test;
+
+import java.util.List;
+
+import org.jboss.test.xb.builder.AbstractBuilderTest;
+import org.jboss.test.xb.builder.object.type.xmlenum.support.CollectionOfEnum;
+import org.jboss.test.xb.builder.object.type.xmlenum.support.EnumGlobalType;
+
+
+/**
+ * A CollectionOfEnumUnitTestCase.
+ * 
+ * @author <a href="alex at jboss.com">Alexey Loubyansky</a>
+ * @version $Revision: 1.1 $
+ */
+public class CollectionOfEnumUnitTestCase extends AbstractBuilderTest
+{
+   public CollectionOfEnumUnitTestCase(String name)
+   {
+      super(name);
+   }
+   
+   public void testMain() throws Exception
+   {
+      CollectionOfEnum colOfEnum = unmarshalObject(CollectionOfEnum.class);
+      List<EnumGlobalType> enums = colOfEnum.getEnums();
+      assertNotNull(enums);
+      assertEquals(6, enums.size());
+      assertEquals(EnumGlobalType.ONE, enums.get(0));
+      assertEquals(EnumGlobalType.TWO, enums.get(1));
+      assertEquals(EnumGlobalType.TWO, enums.get(2));
+      assertEquals(EnumGlobalType.THREE, enums.get(3));
+      assertEquals(EnumGlobalType.THREE, enums.get(4));
+      assertEquals(EnumGlobalType.THREE, enums.get(5));
+   }
+}

Modified: jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/xmlenum/test/EnumGlobalTypeUnitTestCase.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/xmlenum/test/EnumGlobalTypeUnitTestCase.java	2007-11-03 19:43:07 UTC (rev 2670)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/xmlenum/test/EnumGlobalTypeUnitTestCase.java	2007-11-03 21:00:33 UTC (rev 2671)
@@ -72,8 +72,8 @@
       assertNotNull(elementBinding);
       TypeBinding typeBinding = elementBinding.getType();
       assertNotNull(typeBinding);
-      System.out.println(Strings.defaultToString(type));
-      System.out.println(Strings.defaultToString(typeBinding));
+      //System.out.println(Strings.defaultToString(type));
+      //System.out.println(Strings.defaultToString(typeBinding));
       assertTrue(type == typeBinding);
    }
 }

Added: jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/type/xmlenum/test/CollectionOfEnum.xml
===================================================================
--- jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/type/xmlenum/test/CollectionOfEnum.xml	                        (rev 0)
+++ jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/type/xmlenum/test/CollectionOfEnum.xml	2007-11-03 21:00:33 UTC (rev 2671)
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<collection-of-enum>
+   <enums>ONE</enums>
+   <enums>TWO</enums>
+   <enums>TWO</enums>
+   <enums>THREE</enums>
+   <enums>THREE</enums>
+   <enums>THREE</enums>
+</collection-of-enum>
\ No newline at end of file




More information about the jboss-svn-commits mailing list