com.ashridgetech.jamda.test
Class ValueObjectTest

java.lang.Object
  |
  +--junit.framework.Assert
        |
        +--junit.framework.TestCase
              |
              +--com.ashridgetech.jamda.test.BaseTest
                    |
                    +--com.ashridgetech.jamda.test.ValueObjectTest
All Implemented Interfaces:
junit.framework.Test

public class ValueObjectTest
extends BaseTest

Tests updates to the com.ashridgetech.jamda.ejb.uml package classes. Invoke via junit.swingui.TestRunner. Assumes the use of the ecomm2j test package. Further tests needed: Class with superclass


Field Summary
protected  ClassType address
           
protected  DataType booleanType
           
protected  ClassType company
           
protected  ClassType customer
           
protected  ClassType customerType
           
protected  ClassType dateType
           
protected  DataTransferObjectTypeFactory dtoFactory
           
protected  java.util.List factoryList
           
protected  ClassType integerType
           
protected  DataType intType
           
protected  InterfaceType listType
           
protected  Type oidType
           
protected  ClassType order
           
protected  Stereotype propertyInitStereotype
           
protected  ClassType salesperson
           
protected  ClassType stringType
           
static java.lang.String updatedFileName
           
protected  DataType voidType
           
 
Fields inherited from class com.ashridgetech.jamda.test.BaseTest
checkTextIgnorePrefixes, classWriter, MAGICDRAW_STYLESHEET_LOCATION, NO_NAMES, NO_TYPES, projectRoot, stringWriter, testFile
 
Constructor Summary
ValueObjectTest(java.lang.String name)
          Standard constructor required by subclasses of TestCase
 
Method Summary
protected  void assertHasParameter(Operation operation, int paramPosition, java.lang.String name, Type type, Stereotype stereotype)
          Tests that an Operation has a certain Parameter in a certain position in its parameter list.
protected  void assertHasParameter(Operation operation, java.lang.String name, Type type, Stereotype stereotype)
          Tests that an Operation has a certain Parameter somewhere in its parameter list.
protected  void assertHasProperty(StructuredType type, java.lang.String name, Type propertyType, boolean readWrite, boolean hasAttribute)
          Tests that a class or interface has a certain property.
protected  boolean doUpdates()
           
protected  boolean doWriteAndRepeat()
           
protected  void retrieveModel(java.lang.String fileName, boolean transformWithXslt)
           
protected  void setUp()
           
static junit.framework.Test suite()
           
 void testDescObjectType()
          Tests that DescObjectTypes are created correctly.
 void testUpdateObjectType()
          Tests that UpdateObjectTypes are created correctly.
 void testValueObjectCodeGen()
          Tests that ValueObjectCreator followed by CodeGenTransformer leads to correct files.
 void testValueObjectCreator()
          Tests that ValueObjectCreator transforms correctly.
 void testValueObjectType()
          Tests that ValueObjectTypes are created correctly.
 void testValueObjectTypeForSubclass()
          Tests that ValueObjectTypes for subclasses are created correctly.
 boolean writeAndRepeat()
           
 void writeXmiFile()
          Writes the updated model to a new XMI file
 
Methods inherited from class com.ashridgetech.jamda.test.BaseTest
assertContains, assertContainsAsString, assertContainsOnly, assertContainsOnly, assertContainsOnly, assertContainsOnly, assertEmpty, assertNotContainsAsString, checkAssocEnd, checkAttribute, checkEquals, checkEquals, checkOperation, checkProperty, checkText, checkText, checkTextIgnore, fullPathName, getModel, getText, loadModel, loadModel, testFileName
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, tearDown, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

updatedFileName

public static final java.lang.String updatedFileName

stringType

protected ClassType stringType

dateType

protected ClassType dateType

listType

protected InterfaceType listType

integerType

protected ClassType integerType

oidType

protected Type oidType

intType

protected DataType intType

voidType

protected DataType voidType

booleanType

protected DataType booleanType

address

protected ClassType address

customer

protected ClassType customer

customerType

protected ClassType customerType

company

protected ClassType company

order

protected ClassType order

salesperson

protected ClassType salesperson

propertyInitStereotype

protected Stereotype propertyInitStereotype

dtoFactory

protected DataTransferObjectTypeFactory dtoFactory

factoryList

protected java.util.List factoryList
Constructor Detail

ValueObjectTest

public ValueObjectTest(java.lang.String name)
Standard constructor required by subclasses of TestCase

Parameters:
name - name
Method Detail

suite

public static junit.framework.Test suite()

setUp

protected void setUp()
Overrides:
setUp in class junit.framework.TestCase

retrieveModel

protected void retrieveModel(java.lang.String fileName,
                             boolean transformWithXslt)

doUpdates

protected boolean doUpdates()

doWriteAndRepeat

protected boolean doWriteAndRepeat()

testValueObjectType

public void testValueObjectType()
                         throws java.io.IOException
Tests that ValueObjectTypes are created correctly.

java.io.IOException

testDescObjectType

public void testDescObjectType()
                        throws java.io.IOException
Tests that DescObjectTypes are created correctly.

java.io.IOException

testUpdateObjectType

public void testUpdateObjectType()
                          throws java.io.IOException
Tests that UpdateObjectTypes are created correctly.

java.io.IOException

testValueObjectTypeForSubclass

public void testValueObjectTypeForSubclass()
                                    throws java.io.IOException
Tests that ValueObjectTypes for subclasses are created correctly.

java.io.IOException

writeXmiFile

public void writeXmiFile()
                  throws java.io.IOException
Writes the updated model to a new XMI file

java.io.IOException

writeAndRepeat

public boolean writeAndRepeat()
                       throws java.io.IOException
java.io.IOException

assertHasProperty

protected void assertHasProperty(StructuredType type,
                                 java.lang.String name,
                                 Type propertyType,
                                 boolean readWrite,
                                 boolean hasAttribute)
Tests that a class or interface has a certain property.

Parameters:
type - the StructuredType which should contain the property
name - the name of the property
propertyType - the type of the property
readWrite - true if the property should have a setter
hasAttribute - true if the property should have an attribute

testValueObjectCreator

public void testValueObjectCreator()
                            throws java.io.IOException,
                                   ModelTransformer.TransformException
Tests that ValueObjectCreator transforms correctly.

java.io.IOException
ModelTransformer.TransformException

testValueObjectCodeGen

public void testValueObjectCodeGen()
                            throws java.io.IOException,
                                   ModelTransformer.TransformException
Tests that ValueObjectCreator followed by CodeGenTransformer leads to correct files.

java.io.IOException
ModelTransformer.TransformException

assertHasParameter

protected void assertHasParameter(Operation operation,
                                  int paramPosition,
                                  java.lang.String name,
                                  Type type,
                                  Stereotype stereotype)
Tests that an Operation has a certain Parameter in a certain position in its parameter list.

Parameters:
operation - the Operation which should contain the parameter
paramPosition - the position of the parameter in the list
name - the name of the parameter
type - the type of the parameter
stereotype - the stereotype of the parameter

assertHasParameter

protected void assertHasParameter(Operation operation,
                                  java.lang.String name,
                                  Type type,
                                  Stereotype stereotype)
Tests that an Operation has a certain Parameter somewhere in its parameter list.

Parameters:
operation - the Operation which should contain the parameter
name - the name of the parameter
type - the type of the parameter
stereotype - the stereotype of the parameter


Copyright © 2003 Ashridge Technologies Ltd. All Rights Reserved.