org.eclipse.birt.report.tests.model.api
Class UserPropertyHandleTest

java.lang.Object
  extended byjunit.framework.Assert
      extended byjunit.framework.TestCase
          extended byorg.eclipse.birt.report.tests.model.BaseTestCase
              extended byorg.eclipse.birt.report.tests.model.api.UserPropertyHandleTest
All Implemented Interfaces:
junit.framework.Test

public class UserPropertyHandleTest
extends BaseTestCase

TestCases for UserPropertyHandle.

Method Test Case Expected
testConstructor() Constructs a UserPropertyHandle with the specified element and the property definition. The object of UserPropertyHandle is created.
Constructs a UserPropertyHandle with the specified element and the property name. The object of UserPropertyHandle is created.
testGetters() Tests to get element, design, the property name, the value and the display name by a UserPropertyHandle. Values can be retrieved correctly.
testSetPropDefn() Sets UserPropertyDefn has no name. Throws UserPropertyException with the error code NAME_REQUIRED.
Sets a valid UserPropertyDefn with a name. The property definition is set correctly.
Sets a UserPropertyDefn with choices. Property type is ChoiceType and throws an exception for the invalid value.
Sets a valid value for a UserPropertyDefn with choices.. The value is set correctly.


Field Summary
 
Fields inherited from class org.eclipse.birt.report.tests.model.BaseTestCase
design, designHandle, GOLDEN_FOLDER, INPUT_FOLDER, OUTPUT_FOLDER, PLUGIN_NAME, PLUGIN_PATH, PLUGINLOC, ROM_DEF_NAME, sessionHandle, TEST_FOLDER, TEST_LOCALE
 
Constructor Summary
UserPropertyHandleTest(java.lang.String name)
           
 
Method Summary
protected  void setUp()
           
static junit.framework.Test suite()
           
 void testConstructor()
          Tests to construct the UserPropertyHandle.
 void testGetters()
          Tests to get element, design, the property name, the value and the display name.
 void testSetPropDefn()
          Test cases to set UserPropertyDefn.
 
Methods inherited from class org.eclipse.birt.report.tests.model.BaseTestCase
compareErrors, compareTextFile, compareTextFileAsResource, createDesign, createDesign, dumpErrors, getClassFolder, getFullQualifiedClassName, openDesign, openDesign, openDesign, openDesign, openDesignAsResource, openDesignAsResource, printSemanticError, printSemanticErrors, printSyntaxError, saveAs, saveAsInTempDir, tearDown
 
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

UserPropertyHandleTest

public UserPropertyHandleTest(java.lang.String name)
Parameters:
name -
Method Detail

suite

public static junit.framework.Test suite()

setUp

protected void setUp()
              throws java.lang.Exception
Overrides:
setUp in class BaseTestCase
Throws:
java.lang.Exception

testConstructor

public void testConstructor()
Tests to construct the UserPropertyHandle.


testSetPropDefn

public void testSetPropDefn()
                     throws org.eclipse.birt.report.model.api.activity.SemanticException,
                            java.io.IOException,
                            org.eclipse.birt.report.model.api.command.UserPropertyException,
                            org.eclipse.birt.report.model.api.metadata.PropertyValueException,
                            org.eclipse.birt.report.model.metadata.MetaDataException
Test cases to set UserPropertyDefn.

Throws:
org.eclipse.birt.report.model.api.activity.SemanticException
java.io.IOException
org.eclipse.birt.report.model.api.command.UserPropertyException
org.eclipse.birt.report.model.api.metadata.PropertyValueException
org.eclipse.birt.report.model.metadata.MetaDataException

testGetters

public void testGetters()
                 throws org.eclipse.birt.report.model.api.activity.SemanticException
Tests to get element, design, the property name, the value and the display name.

Throws:
org.eclipse.birt.report.model.api.activity.SemanticException - if the value cannot be set correctly.