[jboss-svn-commits] JBoss Common SVN: r2917 - in jbossxb/trunk/src: main/java/org/jboss/xb/binding/sunday/unmarshalling and 5 other directories.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Wed Sep 10 20:10:22 EDT 2008
Author: alex.loubyansky at jboss.com
Date: 2008-09-10 20:10:22 -0400 (Wed, 10 Sep 2008)
New Revision: 2917
Added:
jbossxb/trunk/src/test/java/org/jboss/test/xml/LoginConfigUnitTestCase.java
jbossxb/trunk/src/test/java/org/jboss/test/xml/loginconfig/
jbossxb/trunk/src/test/java/org/jboss/test/xml/loginconfig/SimpleGroup.java
jbossxb/trunk/src/test/java/org/jboss/test/xml/loginconfig/SimplePrincipal.java
jbossxb/trunk/src/test/java/org/jboss/test/xml/loginconfig/Users.java
jbossxb/trunk/src/test/resources/org/jboss/test/xml/RepeatableTermsUnitTestCase_testPolymorphicArray2.xml
jbossxb/trunk/src/test/resources/org/jboss/test/xml/RepeatableTermsUnitTestCase_testPolymorphicArray2.xsd
jbossxb/trunk/src/test/resources/xml/loginconfig/user-roles.xml
Modified:
jbossxb/trunk/src/main/java/org/jboss/xb/binding/group/ValueList.java
jbossxb/trunk/src/main/java/org/jboss/xb/binding/sunday/unmarshalling/SundayContentHandler.java
jbossxb/trunk/src/test/java/org/jboss/test/xml/RepeatableTermsUnitTestCase.java
jbossxb/trunk/src/test/java/org/jboss/test/xml/repeatableterms/AbstractProduct.java
jbossxb/trunk/src/test/resources/xml/loginconfig/user-roles_1_0.xsd
Log:
JBXB-158
Modified: jbossxb/trunk/src/main/java/org/jboss/xb/binding/group/ValueList.java
===================================================================
--- jbossxb/trunk/src/main/java/org/jboss/xb/binding/group/ValueList.java 2008-09-10 09:11:52 UTC (rev 2916)
+++ jbossxb/trunk/src/main/java/org/jboss/xb/binding/group/ValueList.java 2008-09-11 00:10:22 UTC (rev 2917)
@@ -31,6 +31,7 @@
import org.jboss.xb.binding.JBossXBRuntimeException;
import org.jboss.xb.binding.metadata.PropertyMetaData;
import org.jboss.xb.binding.sunday.unmarshalling.AttributeBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.ElementBinding;
import org.jboss.xb.binding.sunday.unmarshalling.ParticleBinding;
import org.jboss.xb.binding.sunday.unmarshalling.CharactersHandler;
import org.jboss.xb.binding.sunday.unmarshalling.impl.runtime.RtUtil;
@@ -114,8 +115,25 @@
void addRepeatableTermValue(QName qName, ParticleBinding binding, Object handler, Object value, ParticleBinding parentParticle)
{
NonRequiredValue last = (NonRequiredValue) (nonRequiredValues.isEmpty() ? null : nonRequiredValues.get(nonRequiredValues.size() - 1));
- if (last == null /*|| last.binding != binding*/)
+
+ boolean isSameBinding;
+ if(last == null)
+ isSameBinding = false;
+ else if(last.binding == binding)
+ isSameBinding = true;
+ else if(!(last.binding instanceof ParticleBinding))
+ isSameBinding = false;
+ else
{
+ ParticleBinding lastBinding = (ParticleBinding) last.binding;
+ if(lastBinding.getTerm().isElement() && binding.getTerm().isElement())
+ isSameBinding = ((ElementBinding)lastBinding.getTerm()).getQName().equals(((ElementBinding)binding.getTerm()).getQName());
+ else
+ isSameBinding = false;
+ }
+
+ if (!isSameBinding)
+ {
Collection col;
PropertyMetaData propMetaData = binding.getTerm().getPropertyMetaData();
if(propMetaData != null && propMetaData.getCollectionType() != null)
Modified: jbossxb/trunk/src/main/java/org/jboss/xb/binding/sunday/unmarshalling/SundayContentHandler.java
===================================================================
--- jbossxb/trunk/src/main/java/org/jboss/xb/binding/sunday/unmarshalling/SundayContentHandler.java 2008-09-10 09:11:52 UTC (rev 2916)
+++ jbossxb/trunk/src/main/java/org/jboss/xb/binding/sunday/unmarshalling/SundayContentHandler.java 2008-09-11 00:10:22 UTC (rev 2917)
@@ -331,10 +331,10 @@
{
if(element.getQName().equals(startName))
{
+ item.reset();
particle = item.particle;
parentType = item.parentType;
repeated = true;
- item.reset();
if(!particle.isRepeatable())
{
@@ -542,10 +542,11 @@
if(xsiType != null)
{
if(trace)
- {
log.trace(element.getQName() + " uses xsi:type " + xsiType);
- }
+ if(item.nonXsiParticle == null)
+ item.nonXsiParticle = particle;
+
String xsiTypePrefix;
String xsiTypeLocal;
int colon = xsiType.indexOf(':');
@@ -1389,6 +1390,7 @@
{
final ModelGroupBinding.Cursor cursor;
ParticleBinding particle;
+ ParticleBinding nonXsiParticle;
ParticleHandler handler;
TypeBinding parentType;
boolean ignoreCharacters;
@@ -1435,6 +1437,9 @@
indentation = null;
ignorableCharacters = true;
+
+ if(nonXsiParticle != null)
+ particle = nonXsiParticle;
}
}
Added: jbossxb/trunk/src/test/java/org/jboss/test/xml/LoginConfigUnitTestCase.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xml/LoginConfigUnitTestCase.java (rev 0)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xml/LoginConfigUnitTestCase.java 2008-09-11 00:10:22 UTC (rev 2917)
@@ -0,0 +1,67 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.xml;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+
+import org.jboss.test.xml.loginconfig.Users;
+import org.jboss.xb.binding.Unmarshaller;
+import org.jboss.xb.binding.UnmarshallerFactory;
+import org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.XsdBinder;
+
+/**
+ * A LoginConfigUnitTestCase.
+ *
+ * @author <a href="alex at jboss.com">Alexey Loubyansky</a>
+ * @version $Revision: 1.1 $
+ */
+public class LoginConfigUnitTestCase extends AbstractJBossXBTest
+{
+ public LoginConfigUnitTestCase(String name)
+ {
+ super(name);
+ }
+
+ public void testLoginConfig() throws Exception
+ {
+ InputStream xsdIs = openStream("xml/loginconfig/user-roles_1_0.xsd");
+ InputStream xmlIs = openStream("xml/loginconfig/user-roles.xml");
+ SchemaBinding schema = XsdBinder.bind(xsdIs, null);
+ schema.setStrictSchema(true);
+ schema.setIgnoreUnresolvedFieldOrClass(false);
+ Unmarshaller unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
+ Users users = (Users) unmarshaller.unmarshal(xmlIs, schema);
+ assertNotNull(users);
+ assertEquals(6, users.size());
+ }
+
+ private InputStream openStream(String path) throws IOException
+ {
+ java.net.URL url = Thread.currentThread().getContextClassLoader().getResource(path);
+ if (url == null)
+ fail("URL not found: " + path);
+ return url.openStream();
+ }
+}
Modified: jbossxb/trunk/src/test/java/org/jboss/test/xml/RepeatableTermsUnitTestCase.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xml/RepeatableTermsUnitTestCase.java 2008-09-10 09:11:52 UTC (rev 2916)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xml/RepeatableTermsUnitTestCase.java 2008-09-11 00:10:22 UTC (rev 2917)
@@ -127,7 +127,35 @@
assertEquals(i, product.getPrice());
}
}
-
+
+ public void testPolymorphicArray2() throws Exception
+ {
+ Object o = unmarshal();
+ assertNotNull(o);
+ assertTrue(o instanceof ProductArray);
+ ProductArray arr = (ProductArray) o;
+ List<AbstractProduct> products = arr.getProduct();
+ assertNotNull(products);
+ assertEquals(3, products.size());
+
+ int i = 0;
+ AbstractProduct product = products.get(i++);
+ assertNotNull(product);
+ assertEquals("product" + i, product.getName());
+ assertFalse(product instanceof Product);
+
+ product = products.get(i++);
+ assertNotNull(product);
+ assertEquals("product" + i, product.getName());
+ assertTrue(product instanceof Product);
+ assertEquals(i, ((Product)product).getPrice());
+
+ product = products.get(i++);
+ assertNotNull(product);
+ assertEquals("product" + i, product.getName());
+ assertFalse(product instanceof Product);
+ }
+
// Inner
public static final class Top
Added: jbossxb/trunk/src/test/java/org/jboss/test/xml/loginconfig/SimpleGroup.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xml/loginconfig/SimpleGroup.java (rev 0)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xml/loginconfig/SimpleGroup.java 2008-09-11 00:10:22 UTC (rev 2917)
@@ -0,0 +1,147 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.xml.loginconfig;
+
+import java.security.Principal;
+import java.security.acl.Group;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.Iterator;
+
+/** An implementation of Group that manages a collection of Principal
+objects based on their hashCode() and equals() methods. This class
+is not thread safe.
+
+ at author Scott.Stark at jboss.org
+ at version $Revision$
+*/
+public class SimpleGroup extends SimplePrincipal implements Group, Cloneable
+{
+ /** The serialVersionUID */
+ private static final long serialVersionUID = 6051859639378507247L;
+
+ private HashMap members;
+
+ public SimpleGroup(String groupName)
+ {
+ super(groupName);
+ members = new HashMap(3);
+ }
+
+ /** Adds the specified member to the group.
+ @param user the principal to add to this group.
+ @return true if the member was successfully added,
+ false if the principal was already a member.
+ */
+ public boolean addMember(Principal user)
+ {
+ boolean isMember = members.containsKey(user);
+ if( isMember == false )
+ members.put(user, user);
+ return isMember == false;
+ }
+ /** Returns true if the passed principal is a member of the group.
+ This method does a recursive search, so if a principal belongs to a
+ group which is a member of this group, true is returned.
+
+ A special check is made to see if the member is an instance of
+ org.jboss.security.AnybodyPrincipal or org.jboss.security.NobodyPrincipal
+ since these classes do not hash to meaningful values.
+ @param member the principal whose membership is to be checked.
+ @return true if the principal is a member of this group,
+ false otherwise.
+ */
+ public boolean isMember(Principal member)
+ {
+ // First see if there is a key with the member name
+ boolean isMember = members.containsKey(member);
+/* if( isMember == false )
+ { // Check the AnybodyPrincipal & NobodyPrincipal special cases
+ isMember = (member instanceof org.jboss.security.AnybodyPrincipal);
+ if( isMember == false )
+ {
+ if( member instanceof org.jboss.security.NobodyPrincipal )
+ return false;
+ }
+ }
+*/ if( isMember == false )
+ { // Check any Groups for membership
+ Collection values = members.values();
+ Iterator iter = values.iterator();
+ while( isMember == false && iter.hasNext() )
+ {
+ Object next = iter.next();
+ if( next instanceof Group )
+ {
+ Group group = (Group) next;
+ isMember = group.isMember(member);
+ }
+ }
+ }
+ return isMember;
+ }
+
+ /** Returns an enumeration of the members in the group.
+ The returned objects can be instances of either Principal
+ or Group (which is a subinterface of Principal).
+ @return an enumeration of the group members.
+ */
+ public Enumeration<Principal> members()
+ {
+ return Collections.enumeration(members.values());
+ }
+
+ /** Removes the specified member from the group.
+ @param user the principal to remove from this group.
+ @return true if the principal was removed, or
+ false if the principal was not a member.
+ */
+ public boolean removeMember(Principal user)
+ {
+ Object prev = members.remove(user);
+ return prev != null;
+ }
+
+ public String toString()
+ {
+ StringBuffer tmp = new StringBuffer(getName());
+ tmp.append("(members:");
+ Iterator iter = members.keySet().iterator();
+ while( iter.hasNext() )
+ {
+ tmp.append(iter.next());
+ tmp.append(',');
+ }
+ tmp.setCharAt(tmp.length()-1, ')');
+ return tmp.toString();
+ }
+
+ public synchronized Object clone() throws CloneNotSupportedException
+ {
+ SimpleGroup clone = (SimpleGroup) super.clone();
+ if(clone != null)
+ clone.members = (HashMap)this.members.clone();
+ return clone;
+ }
+}
\ No newline at end of file
Added: jbossxb/trunk/src/test/java/org/jboss/test/xml/loginconfig/SimplePrincipal.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xml/loginconfig/SimplePrincipal.java (rev 0)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xml/loginconfig/SimplePrincipal.java 2008-09-11 00:10:22 UTC (rev 2917)
@@ -0,0 +1,73 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.xml.loginconfig;
+
+import java.security.Principal;
+
+/** A simple String based implementation of Principal. Typically
+a SimplePrincipal is created given a userID which is used
+as the Principal name.
+
+ at author <a href="on at ibis.odessa.ua">Oleg Nitz</a>
+ at author Scott.Stark at jboss.org
+*/
+public class SimplePrincipal implements Principal, java.io.Serializable
+{
+ private static final long serialVersionUID = 1L;
+ private String name;
+
+ public SimplePrincipal(String name)
+ {
+ this.name = name;
+ }
+
+ /** Compare this SimplePrincipal's name against another Principal
+ @return true if name equals another.getName();
+ */
+ public boolean equals(Object another)
+ {
+ if( !(another instanceof Principal) )
+ return false;
+ String anotherName = ((Principal)another).getName();
+ boolean equals = false;
+ if( name == null )
+ equals = anotherName == null;
+ else
+ equals = name.equals(anotherName);
+ return equals;
+ }
+
+ public int hashCode()
+ {
+ return (name == null ? 0 : name.hashCode());
+ }
+
+ public String toString()
+ {
+ return name;
+ }
+
+ public String getName()
+ {
+ return name;
+ }
+}
\ No newline at end of file
Added: jbossxb/trunk/src/test/java/org/jboss/test/xml/loginconfig/Users.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xml/loginconfig/Users.java (rev 0)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xml/loginconfig/Users.java 2008-09-11 00:10:22 UTC (rev 2917)
@@ -0,0 +1,162 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.xml.loginconfig;
+
+import java.security.Principal;
+import java.security.acl.Group;
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.Iterator;
+
+/**
+ * The XMLLoginModule users/roles object representation.
+ *
+ * @author Scott.Stark at jboss.org
+ * @version $Revision$
+ */
+public class Users
+{
+ private HashMap<String,User> users = new HashMap<String,User>();
+
+ public static class User implements Comparable<User>
+ {
+ private String name;
+ private String password;
+ private String encoding;
+ private HashMap<String,Group> roleGroups = new HashMap<String,Group>();
+
+ public User()
+ {
+ }
+ public User(String name)
+ {
+ this.name = name;
+ }
+ public String getName()
+ {
+ return name;
+ }
+ public void setName(String name)
+ {
+ this.name = name;
+ }
+ public String getPassword()
+ {
+ return password;
+ }
+ public void setPassword(String password)
+ {
+ this.password = password;
+ }
+
+ public String getEncoding()
+ {
+ return encoding;
+ }
+ public void setEncoding(String encoding)
+ {
+ this.encoding = encoding;
+ }
+
+ @SuppressWarnings("unchecked")
+ public Group[] getRoleSets()
+ {
+ Group[] roleSets = new Group[roleGroups.size()];
+ roleGroups.values().toArray(roleSets);
+ return roleSets;
+ }
+ public String[] getRoleNames()
+ {
+ return getRoleNames("Roles");
+ }
+ public String[] getRoleNames(String roleGroup)
+ {
+ Group group = (Group) roleGroups.get(roleGroup);
+ String[] names = {};
+ if( group != null )
+ {
+ ArrayList<String> tmp = new ArrayList<String>();
+ Enumeration<? extends Principal> iter = group.members();
+ while( iter.hasMoreElements() )
+ {
+ Principal p = iter.nextElement();
+ tmp.add(p.getName());
+ }
+ names = new String[tmp.size()];
+ tmp.toArray(names);
+ }
+ return names;
+ }
+ public void addRole(String roleName, String roleGroup)
+ {
+ Group group = (Group) roleGroups.get(roleGroup);
+ if( group == null )
+ {
+ group = new SimpleGroup(roleGroup);
+ roleGroups.put(roleGroup, group);
+ }
+ SimplePrincipal role = new SimplePrincipal(roleName);
+ group.addMember(role);
+ }
+ public int compareTo(User obj)
+ {
+ return name.compareTo(obj.name);
+ }
+
+ public String toString()
+ {
+ return "User{" +
+ "name='" + name + "'" +
+ ", password=*" +
+ ", encoding='" + encoding + "'" +
+ ", roleGroups=" + roleGroups +
+ "}";
+ }
+ }
+
+ public void addUser(User user)
+ {
+ users.put(user.getName(), user);
+ }
+ public Iterator<User> getUsers()
+ {
+ return users.values().iterator();
+ }
+ public User getUser(String name)
+ {
+ User find = (User) users.get(name);
+ return find;
+ }
+
+ public int size()
+ {
+ return users.size();
+ }
+
+ public String toString()
+ {
+ return "Users("+System.identityHashCode(this)+"){" +
+ "users=" + users +
+ "}";
+ }
+}
Modified: jbossxb/trunk/src/test/java/org/jboss/test/xml/repeatableterms/AbstractProduct.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xml/repeatableterms/AbstractProduct.java 2008-09-10 09:11:52 UTC (rev 2916)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xml/repeatableterms/AbstractProduct.java 2008-09-11 00:10:22 UTC (rev 2917)
@@ -27,7 +27,7 @@
* @author <a href="alex at jboss.com">Alexey Loubyansky</a>
* @version $Revision: 1.1 $
*/
-public abstract class AbstractProduct
+public class AbstractProduct
{
private String name;
Added: jbossxb/trunk/src/test/resources/org/jboss/test/xml/RepeatableTermsUnitTestCase_testPolymorphicArray2.xml
===================================================================
--- jbossxb/trunk/src/test/resources/org/jboss/test/xml/RepeatableTermsUnitTestCase_testPolymorphicArray2.xml (rev 0)
+++ jbossxb/trunk/src/test/resources/org/jboss/test/xml/RepeatableTermsUnitTestCase_testPolymorphicArray2.xml 2008-09-11 00:10:22 UTC (rev 2917)
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<product-array xmlns='http://www.jboss.org/test/xml/repeatableterms' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
+ <product>
+ <name>product1</name>
+ </product>
+ <product xsi:type='Product'>
+ <name>product2</name>
+ <price>2</price>
+ </product>
+ <product>
+ <name>product3</name>
+ </product>
+</product-array>
Added: jbossxb/trunk/src/test/resources/org/jboss/test/xml/RepeatableTermsUnitTestCase_testPolymorphicArray2.xsd
===================================================================
--- jbossxb/trunk/src/test/resources/org/jboss/test/xml/RepeatableTermsUnitTestCase_testPolymorphicArray2.xsd (rev 0)
+++ jbossxb/trunk/src/test/resources/org/jboss/test/xml/RepeatableTermsUnitTestCase_testPolymorphicArray2.xsd 2008-09-11 00:10:22 UTC (rev 2917)
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ targetNamespace="http://www.jboss.org/test/xml/repeatableterms"
+ xmlns="http://www.jboss.org/test/xml/repeatableterms"
+ xmlns:jbxb="http://www.jboss.org/xml/ns/jbxb"
+ elementFormDefault="qualified"
+ attributeFormDefault="unqualified"
+ version="1.0">
+
+ <xsd:element name="product-array">
+ <xsd:annotation>
+ <xsd:appinfo>
+ <jbxb:class impl="org.jboss.test.xml.repeatableterms.ProductArray"/>
+ </xsd:appinfo>
+ </xsd:annotation>
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="product" type="AbstractProduct" maxOccurs="unbounded"/>
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:complexType name='AbstractProduct'>
+ <xsd:annotation>
+ <xsd:appinfo>
+ <jbxb:class impl="org.jboss.test.xml.repeatableterms.AbstractProduct"/>
+ </xsd:appinfo>
+ </xsd:annotation>
+ <xsd:sequence>
+ <xsd:element name='name' nillable='true' type='xsd:string'/>
+ </xsd:sequence>
+ </xsd:complexType>
+ <xsd:complexType name='Product'>
+ <xsd:annotation>
+ <xsd:appinfo>
+ <jbxb:class impl="org.jboss.test.xml.repeatableterms.Product"/>
+ </xsd:appinfo>
+ </xsd:annotation>
+ <xsd:complexContent>
+ <xsd:extension base='AbstractProduct'>
+ <xsd:sequence>
+ <xsd:element name='price' type='xsd:int'/>
+ </xsd:sequence>
+ </xsd:extension>
+ </xsd:complexContent>
+ </xsd:complexType>
+</xsd:schema>
Added: jbossxb/trunk/src/test/resources/xml/loginconfig/user-roles.xml
===================================================================
--- jbossxb/trunk/src/test/resources/xml/loginconfig/user-roles.xml (rev 0)
+++ jbossxb/trunk/src/test/resources/xml/loginconfig/user-roles.xml 2008-09-11 00:10:22 UTC (rev 2917)
@@ -0,0 +1,32 @@
+<ur:users
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="urn:jboss:user-roles user-roles_1_0.xsd"
+ xmlns:ur="urn:jboss:user-roles">
+ <ur:user name="jduke" password="theduke">
+ <ur:role name="Role1"/>
+ <ur:role name="Role2"/>
+ <ur:role name="Echo"/>
+ <ur:role name="callerJduke" group="CallerPrincipal"/>
+ </ur:user>
+ <ur:user name="scott" password="echoman">
+ <ur:role name="Echo"/>
+ <ur:role name="ProjectUser"/>
+ <ur:role name="callerScott" group="CallerPrincipal"/>
+ </ur:user>
+ <ur:user name="stark" password="javaman">
+ <ur:role name="Java"/>
+ <ur:role name="Coder"/>
+ <ur:role name="callerStark" group="CallerPrincipal"/>
+ </ur:user>
+ <ur:user name="jdukeman" password="anotherduke">
+ <ur:role name="Role2"/>
+ <ur:role name="Role3"/>
+ <ur:role name="callerJdukeman" group="CallerPrincipal"/>
+ </ur:user>
+ <ur:user name="invoker" password="invoker">
+ <ur:role name="HttpInvoker"/>
+ </ur:user>
+ <ur:user name="admin" password="admin">
+ <ur:role name="JBossAdmin"/>
+ </ur:user>
+</ur:users>
Modified: jbossxb/trunk/src/test/resources/xml/loginconfig/user-roles_1_0.xsd
===================================================================
--- jbossxb/trunk/src/test/resources/xml/loginconfig/user-roles_1_0.xsd 2008-09-10 09:11:52 UTC (rev 2916)
+++ jbossxb/trunk/src/test/resources/xml/loginconfig/user-roles_1_0.xsd 2008-09-11 00:10:22 UTC (rev 2917)
@@ -10,7 +10,7 @@
<xsd:element name="users">
<xsd:annotation>
<xsd:appinfo>
- <jbxb:class impl="org.jboss.security.auth.spi.Users"/>
+ <jbxb:class impl="org.jboss.test.xml.loginconfig.Users"/>
</xsd:appinfo>
</xsd:annotation>
<xsd:complexType>
@@ -22,7 +22,7 @@
<xsd:element name="user">
<xsd:annotation>
<xsd:appinfo>
- <jbxb:class impl="org.jboss.security.auth.spi.Users$User"/>
+ <jbxb:class impl="org.jboss.test.xml.loginconfig.Users$User"/>
<jbxb:addMethod name="addUser" valueType="child"/>
</xsd:appinfo>
</xsd:annotation>
More information about the jboss-svn-commits
mailing list