IBM Rational Software Modeler
Release 6.0

com.ibm.xtools.patterns.framework.test
Class AbstractTestCase

java.lang.Object
  extended byjunit.framework.Assert
      extended byjunit.framework.TestCase
          extended bycom.ibm.xtools.patterns.framework.test.AbstractTestCase
All Implemented Interfaces:
junit.framework.Test

public abstract class AbstractTestCase
extends junit.framework.TestCase

This is the base class for all pattern test cases. It enforces that all pattern test cases to provide the following information about themselves: - The ID, version, and name of the pattern that it is testing, and the Eclipse plug-in for the test case.


Constructor Summary
AbstractTestCase()
           
 
Method Summary
protected  boolean addParameterArgument(String parameterName, Object value)
          Add the specified value as an argument to the parameter with the specified name
protected  boolean addParameterArguments(String parameterName, Object[] values)
          Add the specified values as arguments to the parameter with the specified name.
protected  boolean addParameterValue(String parameterName, Object value)
          Add the specified value to the parameter with the specified name
protected  boolean addParameterValues(String parameterName, Object[] values)
          Add the specified values to the parameter with the specified name.
protected  void generateCodeForModel(AbstractTransform modelTransform, Model testModel, org.eclipse.jdt.core.IJavaProject targetJavaProject)
          Deprecated. use AbstractGoFTestSetup.generateCodeForSourceList
protected  IParameterDescriptor getParameter(String name)
          Retrieve the pattern parameter with the specified name
protected  Object[] getParameterValues(String parameterName)
          Retrieve this values assigned to the specified parameter
protected abstract  String getPatternId()
           
protected abstract  AbstractPatternInstance getPatternInstance()
           
protected abstract  String getPatternVersion()
           
protected abstract  Plugin getTestPlugin()
           
protected  boolean removeParameterValue(String parameterName, Object value)
          Remove the specified value from the parameter with the specified name
protected  void setUp()
          Sets up the fixture, for example, open a network connection.
protected  void tearDown()
          Tears down the fixture, for example, close a network connection.
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, 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
 

Constructor Detail

AbstractTestCase

public AbstractTestCase()
Method Detail

addParameterValue

protected boolean addParameterValue(String parameterName,
                                    Object value)
Add the specified value to the parameter with the specified name

Parameters:
parameterName - name of a pattern parameter
value - value to be added to the specified parameter
Returns:
true if the value was added successfully

addParameterArgument

protected boolean addParameterArgument(String parameterName,
                                       Object value)
Add the specified value as an argument to the parameter with the specified name

Parameters:
parameterName - name of a pattern parameter
value - value to be added as an argument to the specified parameter
Returns:
true if the value was added successfully

addParameterValues

protected boolean addParameterValues(String parameterName,
                                     Object[] values)
Add the specified values to the parameter with the specified name.

Parameters:
parameterName - name of a pattern parameter
values - list of values to be added to the specified parameter
Returns:
true if the values were added successfully

addParameterArguments

protected boolean addParameterArguments(String parameterName,
                                        Object[] values)
Add the specified values as arguments to the parameter with the specified name.

Parameters:
parameterName - name of a pattern parameter
values - list of values to be added as arguments to the specified parameter
Returns:
true if the values were added successfully

generateCodeForModel

protected void generateCodeForModel(AbstractTransform modelTransform,
                                    Model testModel,
                                    org.eclipse.jdt.core.IJavaProject targetJavaProject)
Deprecated. use AbstractGoFTestSetup.generateCodeForSourceList

This is a workaround method that generates code for whole model


getParameter

protected IParameterDescriptor getParameter(String name)
                                     throws NoSuchElementException
Retrieve the pattern parameter with the specified name

Parameters:
name - name of a pattern parameter
Returns:
pattern parameter with the specified name
Throws:
NoSuchElementException

getParameterValues

protected Object[] getParameterValues(String parameterName)
Retrieve this values assigned to the specified parameter

Parameters:
parameterName - name of a pattern parameter
Returns:
the values assigned to the specified parameter

getPatternId

protected abstract String getPatternId()
Returns:
The id of the pattern to be tested

getPatternVersion

protected abstract String getPatternVersion()
Returns:
The version of the pattern to be tested

getPatternInstance

protected abstract AbstractPatternInstance getPatternInstance()
Returns:
An instance of the pattern to be tested

getTestPlugin

protected abstract Plugin getTestPlugin()
Returns:
XTools plugin for this test case.

removeParameterValue

protected boolean removeParameterValue(String parameterName,
                                       Object value)
Remove the specified value from the parameter with the specified name

Parameters:
parameterName - name of a pattern parameter
value - value to be removed from the specified parameter
Returns:
true if the value was removed successfully

setUp

protected void setUp()
              throws Exception
Description copied from class: junit.framework.TestCase
Sets up the fixture, for example, open a network connection. This method is called before a test is executed.

Throws:
Exception
See Also:
TestCase.setUp()

tearDown

protected void tearDown()
                 throws Exception
Description copied from class: junit.framework.TestCase
Tears down the fixture, for example, close a network connection. This method is called after a test is executed.

Throws:
Exception
See Also:
TestCase.tearDown()

IBM Rational Software Modeler
Release 6.0


Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp. and others 2004. All rights reserved.