You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by ke...@apache.org on 2007/02/26 15:51:52 UTC

svn commit: r511831 - in /incubator/tuscany/java/sdo/tools/src/test/java: com/example/subgroup/ com/example/subgroup/impl/ org/apache/tuscany/sdo/test/

Author: kelvingoodson
Date: Mon Feb 26 06:51:51 2007
New Revision: 511831

URL: http://svn.apache.org/viewvc?view=rev&rev=511831
Log:
TUSCANY-521 add test cases for substitution groups and generated classes with inheritance

Added:
    incubator/tuscany/java/sdo/tools/src/test/java/com/example/subgroup/
    incubator/tuscany/java/sdo/tools/src/test/java/com/example/subgroup/A.java   (with props)
    incubator/tuscany/java/sdo/tools/src/test/java/com/example/subgroup/B.java   (with props)
    incubator/tuscany/java/sdo/tools/src/test/java/com/example/subgroup/Bprime.java   (with props)
    incubator/tuscany/java/sdo/tools/src/test/java/com/example/subgroup/SubgroupFactory.java   (with props)
    incubator/tuscany/java/sdo/tools/src/test/java/com/example/subgroup/impl/
    incubator/tuscany/java/sdo/tools/src/test/java/com/example/subgroup/impl/AImpl.java   (with props)
    incubator/tuscany/java/sdo/tools/src/test/java/com/example/subgroup/impl/BImpl.java   (with props)
    incubator/tuscany/java/sdo/tools/src/test/java/com/example/subgroup/impl/BprimeImpl.java   (with props)
    incubator/tuscany/java/sdo/tools/src/test/java/com/example/subgroup/impl/SubgroupFactoryImpl.java   (with props)
    incubator/tuscany/java/sdo/tools/src/test/java/org/apache/tuscany/sdo/test/InheritanceTestCase.java   (with props)
Modified:
    incubator/tuscany/java/sdo/tools/src/test/java/org/apache/tuscany/sdo/test/AllTests.java

Added: incubator/tuscany/java/sdo/tools/src/test/java/com/example/subgroup/A.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sdo/tools/src/test/java/com/example/subgroup/A.java?view=auto&rev=511831
==============================================================================
--- incubator/tuscany/java/sdo/tools/src/test/java/com/example/subgroup/A.java (added)
+++ incubator/tuscany/java/sdo/tools/src/test/java/com/example/subgroup/A.java Mon Feb 26 06:51:51 2007
@@ -0,0 +1,95 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package com.example.subgroup;
+
+import commonj.sdo.Sequence;
+
+import java.io.Serializable;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>A</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ *   <li>{@link com.example.subgroup.A#getGe1Group <em>Ge1 Group</em>}</li>
+ *   <li>{@link com.example.subgroup.A#getGe1 <em>Ge1</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @extends Serializable
+ * @generated
+ */
+public interface A extends Serializable
+{
+  /**
+   * Returns the value of the '<em><b>Ge1 Group</b></em>' attribute list.
+   * <!-- begin-user-doc -->
+   * <p>
+   * If the meaning of the '<em>Ge1 Group</em>' attribute list isn't clear,
+   * there really should be more of a description here...
+   * </p>
+   * <!-- end-user-doc -->
+   * @return the value of the '<em>Ge1 Group</em>' attribute list.
+   * @generated
+   */
+  Sequence getGe1Group();
+
+  /**
+   * Returns the value of the '<em><b>Ge1</b></em>' containment reference.
+   * <!-- begin-user-doc -->
+   * <p>
+   * If the meaning of the '<em>Ge1</em>' containment reference isn't clear,
+   * there really should be more of a description here...
+   * </p>
+   * <!-- end-user-doc -->
+   * @return the value of the '<em>Ge1</em>' containment reference.
+   * @see #isSetGe1()
+   * @see #unsetGe1()
+   * @see #setGe1(B)
+   * @generated
+   */
+  B getGe1();
+
+  /**
+   * Sets the value of the '{@link com.example.subgroup.A#getGe1 <em>Ge1</em>}' containment reference.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @param value the new value of the '<em>Ge1</em>' containment reference.
+   * @see #isSetGe1()
+   * @see #unsetGe1()
+   * @see #getGe1()
+   * @generated
+   */
+  void setGe1(B value);
+
+  /**
+   * Unsets the value of the '{@link com.example.subgroup.A#getGe1 <em>Ge1</em>}' containment reference.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @see #isSetGe1()
+   * @see #getGe1()
+   * @see #setGe1(B)
+   * @generated
+   */
+  void unsetGe1();
+
+  /**
+   * Returns whether the value of the '{@link com.example.subgroup.A#getGe1 <em>Ge1</em>}' containment reference is set.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @return whether the value of the '<em>Ge1</em>' containment reference is set.
+   * @see #unsetGe1()
+   * @see #getGe1()
+   * @see #setGe1(B)
+   * @generated
+   */
+  boolean isSetGe1();
+
+} // A

Propchange: incubator/tuscany/java/sdo/tools/src/test/java/com/example/subgroup/A.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sdo/tools/src/test/java/com/example/subgroup/A.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/tuscany/java/sdo/tools/src/test/java/com/example/subgroup/B.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sdo/tools/src/test/java/com/example/subgroup/B.java?view=auto&rev=511831
==============================================================================
--- incubator/tuscany/java/sdo/tools/src/test/java/com/example/subgroup/B.java (added)
+++ incubator/tuscany/java/sdo/tools/src/test/java/com/example/subgroup/B.java Mon Feb 26 06:51:51 2007
@@ -0,0 +1,79 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package com.example.subgroup;
+
+import java.io.Serializable;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>B</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ *   <li>{@link com.example.subgroup.B#getImInTypeB <em>Im In Type B</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @extends Serializable
+ * @generated
+ */
+public interface B extends Serializable
+{
+  /**
+   * Returns the value of the '<em><b>Im In Type B</b></em>' attribute.
+   * <!-- begin-user-doc -->
+   * <p>
+   * If the meaning of the '<em>Im In Type B</em>' attribute isn't clear,
+   * there really should be more of a description here...
+   * </p>
+   * <!-- end-user-doc -->
+   * @return the value of the '<em>Im In Type B</em>' attribute.
+   * @see #isSetImInTypeB()
+   * @see #unsetImInTypeB()
+   * @see #setImInTypeB(String)
+   * @generated
+   */
+  String getImInTypeB();
+
+  /**
+   * Sets the value of the '{@link com.example.subgroup.B#getImInTypeB <em>Im In Type B</em>}' attribute.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @param value the new value of the '<em>Im In Type B</em>' attribute.
+   * @see #isSetImInTypeB()
+   * @see #unsetImInTypeB()
+   * @see #getImInTypeB()
+   * @generated
+   */
+  void setImInTypeB(String value);
+
+  /**
+   * Unsets the value of the '{@link com.example.subgroup.B#getImInTypeB <em>Im In Type B</em>}' attribute.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @see #isSetImInTypeB()
+   * @see #getImInTypeB()
+   * @see #setImInTypeB(String)
+   * @generated
+   */
+  void unsetImInTypeB();
+
+  /**
+   * Returns whether the value of the '{@link com.example.subgroup.B#getImInTypeB <em>Im In Type B</em>}' attribute is set.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @return whether the value of the '<em>Im In Type B</em>' attribute is set.
+   * @see #unsetImInTypeB()
+   * @see #getImInTypeB()
+   * @see #setImInTypeB(String)
+   * @generated
+   */
+  boolean isSetImInTypeB();
+
+} // B

Propchange: incubator/tuscany/java/sdo/tools/src/test/java/com/example/subgroup/B.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sdo/tools/src/test/java/com/example/subgroup/B.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/tuscany/java/sdo/tools/src/test/java/com/example/subgroup/Bprime.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sdo/tools/src/test/java/com/example/subgroup/Bprime.java?view=auto&rev=511831
==============================================================================
--- incubator/tuscany/java/sdo/tools/src/test/java/com/example/subgroup/Bprime.java (added)
+++ incubator/tuscany/java/sdo/tools/src/test/java/com/example/subgroup/Bprime.java Mon Feb 26 06:51:51 2007
@@ -0,0 +1,77 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package com.example.subgroup;
+
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Bprime</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ *   <li>{@link com.example.subgroup.Bprime#getImInTypeBprime <em>Im In Type Bprime</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public interface Bprime extends B
+{
+  /**
+   * Returns the value of the '<em><b>Im In Type Bprime</b></em>' attribute.
+   * <!-- begin-user-doc -->
+   * <p>
+   * If the meaning of the '<em>Im In Type Bprime</em>' attribute isn't clear,
+   * there really should be more of a description here...
+   * </p>
+   * <!-- end-user-doc -->
+   * @return the value of the '<em>Im In Type Bprime</em>' attribute.
+   * @see #isSetImInTypeBprime()
+   * @see #unsetImInTypeBprime()
+   * @see #setImInTypeBprime(String)
+   * @generated
+   */
+  String getImInTypeBprime();
+
+  /**
+   * Sets the value of the '{@link com.example.subgroup.Bprime#getImInTypeBprime <em>Im In Type Bprime</em>}' attribute.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @param value the new value of the '<em>Im In Type Bprime</em>' attribute.
+   * @see #isSetImInTypeBprime()
+   * @see #unsetImInTypeBprime()
+   * @see #getImInTypeBprime()
+   * @generated
+   */
+  void setImInTypeBprime(String value);
+
+  /**
+   * Unsets the value of the '{@link com.example.subgroup.Bprime#getImInTypeBprime <em>Im In Type Bprime</em>}' attribute.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @see #isSetImInTypeBprime()
+   * @see #getImInTypeBprime()
+   * @see #setImInTypeBprime(String)
+   * @generated
+   */
+  void unsetImInTypeBprime();
+
+  /**
+   * Returns whether the value of the '{@link com.example.subgroup.Bprime#getImInTypeBprime <em>Im In Type Bprime</em>}' attribute is set.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @return whether the value of the '<em>Im In Type Bprime</em>' attribute is set.
+   * @see #unsetImInTypeBprime()
+   * @see #getImInTypeBprime()
+   * @see #setImInTypeBprime(String)
+   * @generated
+   */
+  boolean isSetImInTypeBprime();
+
+} // Bprime

Propchange: incubator/tuscany/java/sdo/tools/src/test/java/com/example/subgroup/Bprime.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sdo/tools/src/test/java/com/example/subgroup/Bprime.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/tuscany/java/sdo/tools/src/test/java/com/example/subgroup/SubgroupFactory.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sdo/tools/src/test/java/com/example/subgroup/SubgroupFactory.java?view=auto&rev=511831
==============================================================================
--- incubator/tuscany/java/sdo/tools/src/test/java/com/example/subgroup/SubgroupFactory.java (added)
+++ incubator/tuscany/java/sdo/tools/src/test/java/com/example/subgroup/SubgroupFactory.java Mon Feb 26 06:51:51 2007
@@ -0,0 +1,66 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package com.example.subgroup;
+
+import commonj.sdo.helper.HelperContext;
+
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Factory</b> for the model.
+ * It provides a create method for each non-abstract class of the model.
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public interface SubgroupFactory
+{
+
+  /**
+   * The singleton instance of the factory.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  SubgroupFactory INSTANCE = com.example.subgroup.impl.SubgroupFactoryImpl.init();
+
+  /**
+   * Returns a new object of class '<em>A</em>'.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @return a new object of class '<em>A</em>'.
+   * @generated
+   */
+  A createA();
+
+  /**
+   * Returns a new object of class '<em>B</em>'.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @return a new object of class '<em>B</em>'.
+   * @generated
+   */
+  B createB();
+
+  /**
+   * Returns a new object of class '<em>Bprime</em>'.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @return a new object of class '<em>Bprime</em>'.
+   * @generated
+   */
+  Bprime createBprime();
+
+  /**
+   * Registers the types supported by this Factory within the supplied scope.argument
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @param scope an instance of HelperContext used to manage the scoping of types.
+   * @generated
+   */
+  public void register(HelperContext scope);
+   
+} //SubgroupFactory

Propchange: incubator/tuscany/java/sdo/tools/src/test/java/com/example/subgroup/SubgroupFactory.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sdo/tools/src/test/java/com/example/subgroup/SubgroupFactory.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/tuscany/java/sdo/tools/src/test/java/com/example/subgroup/impl/AImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sdo/tools/src/test/java/com/example/subgroup/impl/AImpl.java?view=auto&rev=511831
==============================================================================
--- incubator/tuscany/java/sdo/tools/src/test/java/com/example/subgroup/impl/AImpl.java (added)
+++ incubator/tuscany/java/sdo/tools/src/test/java/com/example/subgroup/impl/AImpl.java Mon Feb 26 06:51:51 2007
@@ -0,0 +1,297 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package com.example.subgroup.impl;
+
+import com.example.subgroup.A;
+import com.example.subgroup.B;
+import com.example.subgroup.SubgroupFactory;
+
+import commonj.sdo.Sequence;
+import commonj.sdo.Type;
+
+import org.apache.tuscany.sdo.impl.DataObjectBase;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>A</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ *   <li>{@link com.example.subgroup.impl.AImpl#getGe1Group <em>Ge1 Group</em>}</li>
+ *   <li>{@link com.example.subgroup.impl.AImpl#getGe1 <em>Ge1</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class AImpl extends DataObjectBase implements A
+{
+
+  public final static int GE1_GROUP = -1;
+
+  public final static int GE1 = 0;
+
+  public final static int SDO_PROPERTY_COUNT = 1;
+
+  public final static int EXTENDED_PROPERTY_COUNT = -1;
+
+
+  /**
+   * The internal feature id for the '<em><b>Ge1 Group</b></em>' attribute list.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   * @ordered
+   */ 
+  public final static int INTERNAL_GE1_GROUP = 0;
+
+  /**
+   * The internal feature id for the '<em><b>Ge1</b></em>' containment reference.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   * @ordered
+   */ 
+  public final static int INTERNAL_GE1 = 1;
+
+  /**
+   * The number of properties for this type.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   * @ordered
+   */
+  public final static int INTERNAL_PROPERTY_COUNT = 2;
+
+  protected int internalConvertIndex(int internalIndex)
+  {
+    switch (internalIndex)
+    {
+      case INTERNAL_GE1_GROUP: return GE1_GROUP;
+      case INTERNAL_GE1: return GE1;
+    }
+    return super.internalConvertIndex(internalIndex);
+  }
+
+
+  /**
+   * The cached value of the '{@link #getGe1Group() <em>Ge1 Group</em>}' attribute list.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @see #getGe1Group()
+   * @generated
+   * @ordered
+   */
+  
+  protected Sequence ge1Group = null;
+  
+  /**
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public AImpl()
+  {
+    super();
+  }
+
+  /**
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public Type getType()
+  {
+    return ((SubgroupFactoryImpl)SubgroupFactory.INSTANCE).getA();
+  }
+
+  /**
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public Sequence getGe1Group()
+  {
+    if (ge1Group == null)
+    {
+      ge1Group = createSequence(INTERNAL_GE1_GROUP);
+    }
+    return ge1Group;
+  }
+  /**
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public B getGe1()
+  {
+    return (B)get(getGe1Group(), getType(), INTERNAL_GE1);
+  }
+  /**
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public ChangeContext basicSetGe1(B newGe1, ChangeContext changeContext)
+  {
+    return basicAdd(getGe1Group(), getType(), GE1, newGe1, changeContext);
+  }
+
+  /**
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public void setGe1(B newGe1)
+  {
+    set(getGe1Group(), getType(), INTERNAL_GE1, newGe1);
+  }
+
+  /**
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public ChangeContext basicUnsetGe1(ChangeContext changeContext)
+  {
+    // TODO: implement this method to unset the contained 'Ge1' containment reference
+    // -> this method is automatically invoked to keep the containment relationship in synch
+    // -> do not modify other features
+    // -> return changeContext, after adding any generated Notification to it (if it is null, a NotificationChain object must be created first)
+    // Ensure that you remove @generated or mark it @generated NOT
+    throw new UnsupportedOperationException();
+  }
+
+  /**
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public void unsetGe1()
+  {
+        unset(getGe1Group(), getType(), GE1);
+  }
+
+  /**
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public boolean isSetGe1()
+  {
+        return isSet(getGe1Group(), getType(), GE1);
+  }
+
+  /**
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public ChangeContext inverseRemove(Object otherEnd, int propertyIndex, ChangeContext changeContext)
+  {
+    switch (propertyIndex)
+    {
+      case GE1_GROUP:
+        return removeFromSequence(getGe1Group(), otherEnd, changeContext);
+      case GE1:
+        return basicUnsetGe1(changeContext);
+    }
+    return super.inverseRemove(otherEnd, propertyIndex, changeContext);
+  }
+
+  /**
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public Object get(int propertyIndex, boolean resolve)
+  {
+    switch (propertyIndex)
+    {
+      case GE1_GROUP:
+        // XXX query introduce coreType as an argument? -- semantic = if true -- coreType - return the core EMF object if value is a non-EMF wrapper/view
+        //if (coreType) 
+        return getGe1Group();
+      case GE1:
+        return getGe1();
+    }
+    return super.get(propertyIndex, resolve);
+  }
+
+  /**
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public void set(int propertyIndex, Object newValue)
+  {
+    switch (propertyIndex)
+    {
+      case GE1_GROUP:
+      	setSequence(getGe1Group(), newValue);
+        return;
+      case GE1:
+        setGe1((B)newValue);
+        return;
+    }
+    super.set(propertyIndex, newValue);
+  }
+
+  /**
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public void unset(int propertyIndex)
+  {
+    switch (propertyIndex)
+    {
+      case GE1_GROUP:
+        unsetSequence(getGe1Group());
+        return;
+      case GE1:
+        unsetGe1();
+        return;
+    }
+    super.unset(propertyIndex);
+  }
+
+  /**
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public boolean isSet(int propertyIndex)
+  {
+    switch (propertyIndex)
+    {
+      case GE1_GROUP:
+        return ge1Group != null && !isSequenceEmpty(getGe1Group());
+      case GE1:
+        return isSetGe1();
+    }
+    return super.isSet(propertyIndex);
+  }
+
+  /**
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public String toString()
+  {
+    if (isProxy(this)) return super.toString();
+
+    StringBuffer result = new StringBuffer(super.toString());
+    result.append(" (ge1Group: ");
+    result.append(ge1Group);
+    result.append(')');
+    return result.toString();
+  }
+
+} //AImpl

Propchange: incubator/tuscany/java/sdo/tools/src/test/java/com/example/subgroup/impl/AImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sdo/tools/src/test/java/com/example/subgroup/impl/AImpl.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/tuscany/java/sdo/tools/src/test/java/com/example/subgroup/impl/BImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sdo/tools/src/test/java/com/example/subgroup/impl/BImpl.java?view=auto&rev=511831
==============================================================================
--- incubator/tuscany/java/sdo/tools/src/test/java/com/example/subgroup/impl/BImpl.java (added)
+++ incubator/tuscany/java/sdo/tools/src/test/java/com/example/subgroup/impl/BImpl.java Mon Feb 26 06:51:51 2007
@@ -0,0 +1,243 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package com.example.subgroup.impl;
+
+import com.example.subgroup.B;
+import com.example.subgroup.SubgroupFactory;
+
+import commonj.sdo.Type;
+
+import org.apache.tuscany.sdo.impl.DataObjectBase;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>B</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ *   <li>{@link com.example.subgroup.impl.BImpl#getImInTypeB <em>Im In Type B</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class BImpl extends DataObjectBase implements B
+{
+
+  public final static int IM_IN_TYPE_B = 0;
+
+  public final static int SDO_PROPERTY_COUNT = 1;
+
+  public final static int EXTENDED_PROPERTY_COUNT = 0;
+
+
+  /**
+   * The internal feature id for the '<em><b>Im In Type B</b></em>' attribute.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   * @ordered
+   */ 
+  public final static int INTERNAL_IM_IN_TYPE_B = 0;
+
+  /**
+   * The number of properties for this type.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   * @ordered
+   */
+  public final static int INTERNAL_PROPERTY_COUNT = 1;
+
+  protected int internalConvertIndex(int internalIndex)
+  {
+    switch (internalIndex)
+    {
+      case INTERNAL_IM_IN_TYPE_B: return IM_IN_TYPE_B;
+    }
+    return super.internalConvertIndex(internalIndex);
+  }
+
+
+  /**
+   * The default value of the '{@link #getImInTypeB() <em>Im In Type B</em>}' attribute.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @see #getImInTypeB()
+   * @generated
+   * @ordered
+   */
+  protected static final String IM_IN_TYPE_B_DEFAULT_ = null;
+
+  /**
+   * The cached value of the '{@link #getImInTypeB() <em>Im In Type B</em>}' attribute.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @see #getImInTypeB()
+   * @generated
+   * @ordered
+   */
+  protected String imInTypeB = IM_IN_TYPE_B_DEFAULT_;
+
+  /**
+   * This is true if the Im In Type B attribute has been set.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   * @ordered
+   */
+  protected boolean imInTypeB_set_ = false;
+
+  /**
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public BImpl()
+  {
+    super();
+  }
+
+  /**
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public Type getType()
+  {
+    return ((SubgroupFactoryImpl)SubgroupFactory.INSTANCE).getB();
+  }
+
+  /**
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public String getImInTypeB()
+  {
+    return imInTypeB;
+  }
+  /**
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public void setImInTypeB(String newImInTypeB)
+  {
+    String oldImInTypeB = imInTypeB;
+    imInTypeB = newImInTypeB;
+    boolean oldImInTypeB_set_ = imInTypeB_set_;
+    imInTypeB_set_ = true;
+    if (isNotifying())
+      notify(ChangeKind.SET, IM_IN_TYPE_B, oldImInTypeB, imInTypeB, !oldImInTypeB_set_);
+  }
+
+  /**
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public void unsetImInTypeB()
+  {
+    String oldImInTypeB = imInTypeB;
+    boolean oldImInTypeB_set_ = imInTypeB_set_;
+    imInTypeB = IM_IN_TYPE_B_DEFAULT_;
+    imInTypeB_set_ = false;
+    if (isNotifying())
+      notify(ChangeKind.UNSET, IM_IN_TYPE_B, oldImInTypeB, IM_IN_TYPE_B_DEFAULT_, oldImInTypeB_set_);
+  }
+
+  /**
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public boolean isSetImInTypeB()
+  {
+    return imInTypeB_set_;
+  }
+
+  /**
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public Object get(int propertyIndex, boolean resolve)
+  {
+    switch (propertyIndex)
+    {
+      case IM_IN_TYPE_B:
+        return getImInTypeB();
+    }
+    return super.get(propertyIndex, resolve);
+  }
+
+  /**
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public void set(int propertyIndex, Object newValue)
+  {
+    switch (propertyIndex)
+    {
+      case IM_IN_TYPE_B:
+        setImInTypeB((String)newValue);
+        return;
+    }
+    super.set(propertyIndex, newValue);
+  }
+
+  /**
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public void unset(int propertyIndex)
+  {
+    switch (propertyIndex)
+    {
+      case IM_IN_TYPE_B:
+        unsetImInTypeB();
+        return;
+    }
+    super.unset(propertyIndex);
+  }
+
+  /**
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public boolean isSet(int propertyIndex)
+  {
+    switch (propertyIndex)
+    {
+      case IM_IN_TYPE_B:
+        return isSetImInTypeB();
+    }
+    return super.isSet(propertyIndex);
+  }
+
+  /**
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public String toString()
+  {
+    if (isProxy(this)) return super.toString();
+
+    StringBuffer result = new StringBuffer(super.toString());
+    result.append(" (imInTypeB: ");
+    if (imInTypeB_set_) result.append(imInTypeB); else result.append("<unset>");
+    result.append(')');
+    return result.toString();
+  }
+
+} //BImpl

Propchange: incubator/tuscany/java/sdo/tools/src/test/java/com/example/subgroup/impl/BImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sdo/tools/src/test/java/com/example/subgroup/impl/BImpl.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/tuscany/java/sdo/tools/src/test/java/com/example/subgroup/impl/BprimeImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sdo/tools/src/test/java/com/example/subgroup/impl/BprimeImpl.java?view=auto&rev=511831
==============================================================================
--- incubator/tuscany/java/sdo/tools/src/test/java/com/example/subgroup/impl/BprimeImpl.java (added)
+++ incubator/tuscany/java/sdo/tools/src/test/java/com/example/subgroup/impl/BprimeImpl.java Mon Feb 26 06:51:51 2007
@@ -0,0 +1,251 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package com.example.subgroup.impl;
+
+import com.example.subgroup.Bprime;
+import com.example.subgroup.SubgroupFactory;
+
+import commonj.sdo.Type;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Bprime</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ *   <li>{@link com.example.subgroup.impl.BprimeImpl#getImInTypeBprime <em>Im In Type Bprime</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class BprimeImpl extends BImpl implements Bprime
+{
+
+  public final static int IM_IN_TYPE_BPRIME = BImpl.SDO_PROPERTY_COUNT + 0;
+
+  public final static int SDO_PROPERTY_COUNT = BImpl.SDO_PROPERTY_COUNT + 1;
+
+  public final static int EXTENDED_PROPERTY_COUNT = BImpl.EXTENDED_PROPERTY_COUNT - 0;
+
+
+  /**
+   * The internal feature id for the '<em><b>Im In Type B</b></em>' attribute.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   * @ordered
+   */ 
+  public final static int INTERNAL_IM_IN_TYPE_B = BImpl.IM_IN_TYPE_B;
+
+  /**
+   * The internal feature id for the '<em><b>Im In Type Bprime</b></em>' attribute.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   * @ordered
+   */ 
+  public final static int INTERNAL_IM_IN_TYPE_BPRIME = BImpl.INTERNAL_PROPERTY_COUNT + 0;
+
+  /**
+   * The number of properties for this type.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   * @ordered
+   */
+  public final static int INTERNAL_PROPERTY_COUNT = BImpl.INTERNAL_PROPERTY_COUNT + 1;
+
+  protected int internalConvertIndex(int internalIndex)
+  {
+    switch (internalIndex)
+    {
+      case INTERNAL_IM_IN_TYPE_B: return IM_IN_TYPE_B;
+      case INTERNAL_IM_IN_TYPE_BPRIME: return IM_IN_TYPE_BPRIME;
+    }
+    return super.internalConvertIndex(internalIndex);
+  }
+
+
+  /**
+   * The default value of the '{@link #getImInTypeBprime() <em>Im In Type Bprime</em>}' attribute.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @see #getImInTypeBprime()
+   * @generated
+   * @ordered
+   */
+  protected static final String IM_IN_TYPE_BPRIME_DEFAULT_ = null;
+
+  /**
+   * The cached value of the '{@link #getImInTypeBprime() <em>Im In Type Bprime</em>}' attribute.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @see #getImInTypeBprime()
+   * @generated
+   * @ordered
+   */
+  protected String imInTypeBprime = IM_IN_TYPE_BPRIME_DEFAULT_;
+
+  /**
+   * This is true if the Im In Type Bprime attribute has been set.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   * @ordered
+   */
+  protected boolean imInTypeBprime_set_ = false;
+
+  /**
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public BprimeImpl()
+  {
+    super();
+  }
+
+  /**
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public Type getType()
+  {
+    return ((SubgroupFactoryImpl)SubgroupFactory.INSTANCE).getBprime();
+  }
+
+  /**
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public String getImInTypeBprime()
+  {
+    return imInTypeBprime;
+  }
+  /**
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public void setImInTypeBprime(String newImInTypeBprime)
+  {
+    String oldImInTypeBprime = imInTypeBprime;
+    imInTypeBprime = newImInTypeBprime;
+    boolean oldImInTypeBprime_set_ = imInTypeBprime_set_;
+    imInTypeBprime_set_ = true;
+    if (isNotifying())
+      notify(ChangeKind.SET, IM_IN_TYPE_BPRIME, oldImInTypeBprime, imInTypeBprime, !oldImInTypeBprime_set_);
+  }
+
+  /**
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public void unsetImInTypeBprime()
+  {
+    String oldImInTypeBprime = imInTypeBprime;
+    boolean oldImInTypeBprime_set_ = imInTypeBprime_set_;
+    imInTypeBprime = IM_IN_TYPE_BPRIME_DEFAULT_;
+    imInTypeBprime_set_ = false;
+    if (isNotifying())
+      notify(ChangeKind.UNSET, IM_IN_TYPE_BPRIME, oldImInTypeBprime, IM_IN_TYPE_BPRIME_DEFAULT_, oldImInTypeBprime_set_);
+  }
+
+  /**
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public boolean isSetImInTypeBprime()
+  {
+    return imInTypeBprime_set_;
+  }
+
+  /**
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public Object get(int propertyIndex, boolean resolve)
+  {
+    switch (propertyIndex)
+    {
+      case IM_IN_TYPE_BPRIME:
+        return getImInTypeBprime();
+    }
+    return super.get(propertyIndex, resolve);
+  }
+
+  /**
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public void set(int propertyIndex, Object newValue)
+  {
+    switch (propertyIndex)
+    {
+      case IM_IN_TYPE_BPRIME:
+        setImInTypeBprime((String)newValue);
+        return;
+    }
+    super.set(propertyIndex, newValue);
+  }
+
+  /**
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public void unset(int propertyIndex)
+  {
+    switch (propertyIndex)
+    {
+      case IM_IN_TYPE_BPRIME:
+        unsetImInTypeBprime();
+        return;
+    }
+    super.unset(propertyIndex);
+  }
+
+  /**
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public boolean isSet(int propertyIndex)
+  {
+    switch (propertyIndex)
+    {
+      case IM_IN_TYPE_BPRIME:
+        return isSetImInTypeBprime();
+    }
+    return super.isSet(propertyIndex);
+  }
+
+  /**
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public String toString()
+  {
+    if (isProxy(this)) return super.toString();
+
+    StringBuffer result = new StringBuffer(super.toString());
+    result.append(" (imInTypeBprime: ");
+    if (imInTypeBprime_set_) result.append(imInTypeBprime); else result.append("<unset>");
+    result.append(')');
+    return result.toString();
+  }
+
+} //BprimeImpl

Propchange: incubator/tuscany/java/sdo/tools/src/test/java/com/example/subgroup/impl/BprimeImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sdo/tools/src/test/java/com/example/subgroup/impl/BprimeImpl.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/tuscany/java/sdo/tools/src/test/java/com/example/subgroup/impl/SubgroupFactoryImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sdo/tools/src/test/java/com/example/subgroup/impl/SubgroupFactoryImpl.java?view=auto&rev=511831
==============================================================================
--- incubator/tuscany/java/sdo/tools/src/test/java/com/example/subgroup/impl/SubgroupFactoryImpl.java (added)
+++ incubator/tuscany/java/sdo/tools/src/test/java/com/example/subgroup/impl/SubgroupFactoryImpl.java Mon Feb 26 06:51:51 2007
@@ -0,0 +1,339 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package com.example.subgroup.impl;
+
+import commonj.sdo.helper.HelperContext;
+import org.apache.tuscany.sdo.helper.TypeHelperImpl;
+
+import com.example.subgroup.*;
+
+import commonj.sdo.DataObject;
+import commonj.sdo.Property;
+import commonj.sdo.Type;
+
+import org.apache.tuscany.sdo.SDOFactory;
+
+import org.apache.tuscany.sdo.impl.FactoryBase;
+
+import org.apache.tuscany.sdo.model.ModelFactory;
+
+import org.apache.tuscany.sdo.model.impl.ModelFactoryImpl;
+
+import org.apache.tuscany.sdo.util.SDOUtil;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model <b>Factory</b>.
+ * Generator information:
+ * patternVersion=1.1; -prefix Subgroup
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class SubgroupFactoryImpl extends FactoryBase implements SubgroupFactory
+{
+
+  /**
+   * The package namespace URI.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public static final String NAMESPACE_URI = "http://example.com/subgroup";
+
+  /**
+   * The package namespace name.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public static final String NAMESPACE_PREFIX = "sg";
+
+  /**
+   * The version of the generator pattern used to generate this class.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public static final String PATTERN_VERSION = "1.1";
+  
+  public static final int A = 1;	
+  public static final int B = 2;	
+  public static final int BPRIME = 3;
+  
+  /**
+   * Creates an instance of the factory.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public SubgroupFactoryImpl()
+  {
+    super(NAMESPACE_URI, NAMESPACE_PREFIX, "com.example.subgroup");
+  }
+
+  /**
+   * Registers the Factory instance so that it is available within the supplied scope.
+   * @argument scope a HelperContext instance that will make the types supported by this Factory available.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */	
+  public void register(HelperContext scope) {
+    if(scope == null) {
+       throw new IllegalArgumentException("Scope can not be null");
+    } 
+    TypeHelperImpl th = (TypeHelperImpl)scope.getTypeHelper();
+    th.getExtendedMetaData().putPackage(NAMESPACE_URI, this);
+  }
+  
+  /**
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public DataObject create(int typeNumber)
+  {
+    switch (typeNumber)
+    {
+      case A: return (DataObject)createA();
+      case B: return (DataObject)createB();
+      case BPRIME: return (DataObject)createBprime();
+      default:
+        return super.create(typeNumber);
+    }
+  }
+
+  /**
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public A createA()
+  {
+    AImpl a = new AImpl();
+    return a;
+  }
+  /**
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public B createB()
+  {
+    BImpl b = new BImpl();
+    return b;
+  }
+  /**
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public Bprime createBprime()
+  {
+    BprimeImpl bprime = new BprimeImpl();
+    return bprime;
+  }
+  
+  // Following creates and initializes SDO metadata for the supported types.		
+  protected Type aType = null;
+
+  public Type getA()
+  {
+    return aType;
+  }
+    
+  protected Type bType = null;
+
+  public Type getB()
+  {
+    return bType;
+  }
+    
+  protected Type bprimeType = null;
+
+  public Type getBprime()
+  {
+    return bprimeType;
+  }
+    
+
+  private static boolean isInited = false;
+
+  public static SubgroupFactoryImpl init()
+  {
+    if (isInited) return (SubgroupFactoryImpl)FactoryBase.getStaticFactory(SubgroupFactoryImpl.NAMESPACE_URI);
+    SubgroupFactoryImpl theSubgroupFactoryImpl = new SubgroupFactoryImpl();
+    isInited = true;
+
+    // Initialize simple dependencies
+    SDOUtil.registerStaticTypes(SDOFactory.class);
+    SDOUtil.registerStaticTypes(ModelFactory.class);
+
+    // Create package meta-data objects
+    theSubgroupFactoryImpl.createMetaData();
+
+    // Initialize created meta-data
+    theSubgroupFactoryImpl.initializeMetaData();
+
+    // Mark meta-data to indicate it can't be changed
+    //theSubgroupFactoryImpl.freeze(); //FB do we need to freeze / should we freeze ????
+
+    return theSubgroupFactoryImpl;
+  }
+  
+  private boolean isCreated = false;
+
+  public void createMetaData()
+  {
+    if (isCreated) return;
+    isCreated = true;	
+
+    // Create types and their properties
+          aType = createType(false, A);
+    createProperty(true, aType,AImpl.INTERNAL_GE1_GROUP); 
+    createProperty(false, aType,AImpl.INTERNAL_GE1); 
+          bType = createType(false, B);
+    createProperty(true, bType,BImpl.INTERNAL_IM_IN_TYPE_B); 
+          bprimeType = createType(false, BPRIME);
+    createProperty(true, bprimeType,BprimeImpl.INTERNAL_IM_IN_TYPE_BPRIME); 
+  }
+  
+  private boolean isInitialized = false;
+
+  public void initializeMetaData()
+  {
+    if (isInitialized) return;
+    isInitialized = true;
+
+    // Obtain other dependent packages
+    ModelFactoryImpl theModelPackageImpl = (ModelFactoryImpl)FactoryBase.getStaticFactory(ModelFactoryImpl.NAMESPACE_URI);
+    Property property = null;
+
+    // Add supertypes to types
+    addSuperType(bprimeType, bType);
+
+    // Initialize types and properties
+    initializeType(aType, A.class, "A", false);
+    property = getProperty(aType, AImpl.INTERNAL_GE1_GROUP);
+    initializeProperty(property, getSequence(), "ge1Group", null, 1, 1, A.class, false, false, false);
+
+    property = getProperty(aType, AImpl.INTERNAL_GE1);
+    initializeProperty(property, this.getB(), "ge1", null, 1, 1, A.class, false, true, true, true , null);
+
+    initializeType(bType, B.class, "B", false);
+    property = getProperty(bType, BImpl.INTERNAL_IM_IN_TYPE_B);
+    initializeProperty(property, theModelPackageImpl.getString(), "imInTypeB", null, 1, 1, B.class, false, true, false);
+
+    initializeType(bprimeType, Bprime.class, "Bprime", false);
+    property = getProperty(bprimeType, BprimeImpl.INTERNAL_IM_IN_TYPE_BPRIME);
+    initializeProperty(property, theModelPackageImpl.getString(), "imInTypeBprime", null, 1, 1, Bprime.class, false, true, false);
+
+    createXSDMetaData(theModelPackageImpl);
+  }
+    
+  protected void createXSDMetaData(ModelFactoryImpl theModelPackageImpl)
+  {
+    super.initXSD();
+    
+    Property property = null;
+    
+
+    addXSDMapping
+      (aType,
+       new String[] 
+       {
+       "name", "A",
+       "kind", "elementOnly"
+       });
+
+    addXSDMapping
+      (getProperty(aType, AImpl.INTERNAL_GE1_GROUP),
+       new String[]
+       {
+       "kind", "group",
+       "name", "ge1:group",
+       "namespace", "##targetNamespace"
+       });
+
+    addXSDMapping
+      (getProperty(aType, AImpl.INTERNAL_GE1),
+       new String[]
+       {
+       "kind", "element",
+       "name", "ge1",
+       "namespace", "##targetNamespace",
+       "group", "ge1:group"
+       });
+
+    addXSDMapping
+      (bType,
+       new String[] 
+       {
+       "name", "B",
+       "kind", "elementOnly"
+       });
+
+    addXSDMapping
+      (getProperty(bType, BImpl.INTERNAL_IM_IN_TYPE_B),
+       new String[]
+       {
+       "kind", "element",
+       "name", "imInTypeB",
+       "namespace", "##targetNamespace"
+       });
+
+    addXSDMapping
+      (bprimeType,
+       new String[] 
+       {
+       "name", "Bprime",
+       "kind", "elementOnly"
+       });
+
+    addXSDMapping
+      (getProperty(bprimeType, BprimeImpl.INTERNAL_IM_IN_TYPE_BPRIME),
+       new String[]
+       {
+       "kind", "element",
+       "name", "imInTypeBprime",
+       "namespace", "##targetNamespace"
+       });
+
+    property = createGlobalProperty
+      ("a",
+      this.getA(),
+       new String[]
+       {
+       "kind", "element",
+       "name", "a",
+       "namespace", "##targetNamespace"
+       });
+                
+    property = createGlobalProperty
+      ("ge1",
+      this.getB(),
+       new String[]
+       {
+       "kind", "element",
+       "name", "ge1",
+       "namespace", "##targetNamespace"
+       });
+                
+    property = createGlobalProperty
+      ("se1",
+      this.getBprime(),
+       new String[]
+       {
+       "kind", "element",
+       "name", "se1",
+       "namespace", "##targetNamespace",
+       "affiliation", "ge1"
+       });
+                
+  }
+    
+} //SubgroupFactoryImpl

Propchange: incubator/tuscany/java/sdo/tools/src/test/java/com/example/subgroup/impl/SubgroupFactoryImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sdo/tools/src/test/java/com/example/subgroup/impl/SubgroupFactoryImpl.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: incubator/tuscany/java/sdo/tools/src/test/java/org/apache/tuscany/sdo/test/AllTests.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sdo/tools/src/test/java/org/apache/tuscany/sdo/test/AllTests.java?view=diff&rev=511831&r1=511830&r2=511831
==============================================================================
--- incubator/tuscany/java/sdo/tools/src/test/java/org/apache/tuscany/sdo/test/AllTests.java (original)
+++ incubator/tuscany/java/sdo/tools/src/test/java/org/apache/tuscany/sdo/test/AllTests.java Mon Feb 26 06:51:51 2007
@@ -31,6 +31,7 @@
       
         suite.addTestSuite(ChangeSummaryGenTestCase.class);
         suite.addTestSuite(GenPatternsTestCase.class);
+        suite.addTestSuite(InheritanceTestCase.class);
         suite.addTestSuite(SimpleStaticTestCase.class);
 
         return suite;

Added: incubator/tuscany/java/sdo/tools/src/test/java/org/apache/tuscany/sdo/test/InheritanceTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sdo/tools/src/test/java/org/apache/tuscany/sdo/test/InheritanceTestCase.java?view=auto&rev=511831
==============================================================================
--- incubator/tuscany/java/sdo/tools/src/test/java/org/apache/tuscany/sdo/test/InheritanceTestCase.java (added)
+++ incubator/tuscany/java/sdo/tools/src/test/java/org/apache/tuscany/sdo/test/InheritanceTestCase.java Mon Feb 26 06:51:51 2007
@@ -0,0 +1,83 @@
+package org.apache.tuscany.sdo.test;
+
+import java.io.IOException;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sdo.util.SDOUtil;
+
+import com.example.subgroup.A;
+import com.example.subgroup.B;
+import com.example.subgroup.Bprime;
+import com.example.subgroup.SubgroupFactory;
+import com.example.subgroup.impl.AImpl;
+import commonj.sdo.DataObject;
+import commonj.sdo.helper.HelperContext;
+import commonj.sdo.helper.XMLDocument;
+
+public class InheritanceTestCase extends TestCase {
+
+	private HelperContext scope;
+
+	public void testSubGroupLoad() throws IOException {
+		XMLDocument doc = scope.getXMLHelper().load(
+		    getClass().getResourceAsStream("/subgroup1.xml"));
+		assertEquals("a", doc.getRootElementName());
+		String strdoc = scope.getXMLHelper().save(
+				doc.getRootObject(), doc.getRootElementURI(), doc.getRootElementName());
+		assertTrue(strdoc.indexOf("<sg:imInTypeB>thisIsElB</sg:imInTypeB>") != -1);
+	}
+
+	public void testSubGroup_AcontainsB() {
+		A a = (A) scope.getDataFactory().create(A.class);
+		B b = (B) scope.getDataFactory().create(B.class);
+		b.setImInTypeB("thisIsElB");
+		a.setGe1(b);
+
+		assertSame(b, a.getGe1());
+		assertSame(b, ((AImpl) a).get(AImpl.GE1));
+
+		String doc = scope.getXMLHelper().save((DataObject) a,
+		    "http://example.com/subgroup", "a");
+		assertTrue(doc.indexOf("<sg:imInTypeB>thisIsElB</sg:imInTypeB>") != -1);
+
+	}
+
+	public void testSubGroup_AcontainsBprime() {
+		A a = (A) scope.getDataFactory().create(A.class);
+		Bprime bp = (Bprime) scope.getDataFactory().create(Bprime.class);
+		bp.setImInTypeBprime("thisIsElBprime");
+		a.setGe1(bp);
+
+		assertSame(bp, a.getGe1());
+		assertSame(bp, ((AImpl) a).get(AImpl.GE1));
+
+		String doc = scope.getXMLHelper().save((DataObject) a,
+		    "http://example.com/subgroup", "a");
+		
+		assertTrue(doc.indexOf("<sg:imInTypeBprime>thisIsElBprime</sg:imInTypeBprime>") != -1);
+
+	}
+
+	public void testSubGroup_Bprime() {
+		Bprime bp = (Bprime) scope.getDataFactory().create(Bprime.class);
+		bp.setImInTypeB("bValue");
+		bp.setImInTypeBprime("bpvalue");
+		String doc = scope.getXMLHelper().save((DataObject) bp,
+		    "http://example.com/subgroup", "bp");
+		assertTrue(doc.indexOf("<sg:imInTypeB>bValue</sg:imInTypeB>") != -1);
+		assertTrue(doc.indexOf("<sg:imInTypeBprime>bpvalue</sg:imInTypeBprime>") != -1);
+	}
+
+	protected void setUp() throws Exception {
+		super.setUp();
+		scope = SDOUtil.createHelperContext();
+
+		SubgroupFactory.INSTANCE.register(scope);
+	}
+
+	protected void tearDown() throws Exception {
+		super.tearDown();
+	}
+
+}

Propchange: incubator/tuscany/java/sdo/tools/src/test/java/org/apache/tuscany/sdo/test/InheritanceTestCase.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sdo/tools/src/test/java/org/apache/tuscany/sdo/test/InheritanceTestCase.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date



---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org