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

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

public class ReportItemHandleTest
extends BaseTestCase

Test ReportItemHandle.


Method Test Case Expected
testDataSet() check free-form element which contains attribute data-set dataset name is myDataSet
check list element which doesn't contain attribute data-set null
testReadVisibilityRules() Gets visibility rules in elements and tests whether values match with those defined the design file. Returned values match with the design file. If "format" values are not defined, the default value "all" is used.
The number of visibility rules in elements. The number is 2.
testWriteVisibilityRules The default format value in the visibility rule. The default value can be written out to the design file.
Sets "format" and "valueExpr" properties of a visibility rule. "format" and "valueExpr" can be written out and the output file matches with the golden file.
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
ReportItemHandleTest(java.lang.String name)
           
 
Method Summary
protected  void setUp()
           
static junit.framework.Test suite()
           
 void testDataSet()
          test getDataSet().
 void testProperties()
          Tests common properties on a report item.
 void testReadVisibilityRules()
          Test to read hide rules.
 void testUndoInvalidDataSet()
          Tests the undo operation for invalid DataSet name.
 void testUndoInvalidStyle()
          Tests the undo operation for invalid style name.
 void testWriteVisibilityRules()
          Tests to write hide rules to the design file.
 
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

ReportItemHandleTest

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

testDataSet

public void testDataSet()
                 throws org.eclipse.birt.report.model.api.activity.SemanticException
test getDataSet().

Test Cases:

Excepted:

Throws:
org.eclipse.birt.report.model.api.activity.SemanticException

testReadVisibilityRules

public void testReadVisibilityRules()
                             throws java.lang.Exception
Test to read hide rules.

Throws:
java.lang.Exception - if open the design file with errors.

testWriteVisibilityRules

public void testWriteVisibilityRules()
                              throws java.lang.Exception
Tests to write hide rules to the design file.

Throws:
java.lang.Exception - if open/write the design file with IO errors.

testProperties

public void testProperties()
                    throws org.eclipse.birt.report.model.api.activity.SemanticException
Tests common properties on a report item.

Throws:
org.eclipse.birt.report.model.api.activity.SemanticException

testUndoInvalidStyle

public void testUndoInvalidStyle()
                          throws java.lang.Exception
Tests the undo operation for invalid style name.

Throws:
java.lang.Exception - if any exception

testUndoInvalidDataSet

public void testUndoInvalidDataSet()
                            throws java.lang.Exception
Tests the undo operation for invalid DataSet name.

Throws:
java.lang.Exception - if any exception