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

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.PropertyHandleTest
All Implemented Interfaces:
junit.framework.Test

public class PropertyHandleTest
extends BaseTestCase

TestCases for PropertyHandle class.

Method Test Case Expected
testItemOperations Tests on adding, moving, removing, inserting, replacing maps rules in a style. The operations can be completed successfully and the output file matches the golden file.
testSetGetValues Sets and gets the property value in different prototype like float, string. Values can be set/gotten correctly and the output file matches the golden file.
testOtherOperations Gets the property definition. Retrieves the property definition correctly.
Gets the structure handle of FONT_WEIGHT and MAP_RULE properties. The structure handle of FONT_WEIGHT is null and the structure handle of MAP_RULE is null.


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
PropertyHandleTest(java.lang.String name)
           
 
Method Summary
protected  void setUp()
           
static junit.framework.Test suite()
           
 void testEqual()
          test whether the two property handle are equal.
 void testgetReferenceElementValueList()
          test get the reference element value list if the property is a element referencable type.
 void testItemOperations()
          Tests add, move, remove, insert, replace map rules in a style.
 void testOtherOperations()
          Tests get property definition, choices of property and structure handle of a property.
 void testPropertyVisibilities()
          Tests property visibilities defined in ROM.
 void testSetGetValues()
          Tests to set and get property values.
 
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

PropertyHandleTest

public PropertyHandleTest(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

testOtherOperations

public void testOtherOperations()
Tests get property definition, choices of property and structure handle of a property.


testItemOperations

public void testItemOperations()
                        throws java.lang.Exception
Tests add, move, remove, insert, replace map rules in a style.

Throws:
java.lang.Exception - if the property is not a list property, the index of the item is invalid or the output file cannot be saved correctly.

testSetGetValues

public void testSetGetValues()
                      throws java.lang.Exception
Tests to set and get property values.

Throws:
java.lang.Exception - if values are invalid or the output file cannot be saved correctly.

testEqual

public void testEqual()
test whether the two property handle are equal. case1: get property handle twice from style.font-family. These two handle should be equal. case2: get property handle from style.font-family and style.BACKGROUND_ATTACHMENT_PROP. These two proeprty handles should not be equal. case3: a property handle should not be equal to null. case4: get property handle from different element but same property. These two handle should not be equal.


testgetReferenceElementValueList

public void testgetReferenceElementValueList()
                                      throws org.eclipse.birt.report.model.api.DesignFileException
test get the reference element value list if the property is a element referencable type. case1: get the data set list. case2: get the data source list. case3: get the style list.

Throws:
org.eclipse.birt.report.model.api.DesignFileException

testPropertyVisibilities

public void testPropertyVisibilities()
Tests property visibilities defined in ROM.