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

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

public class SimpleMasterPageHandleTest
extends BaseTestCase

Test SimpleMasterPage related classes, including SimpleMasterPage,SimpleMasterPageState& SimpleMasterPageHandle.

Method Test Case Expected
testProperties Test all additional propertis comparing with MasterPage on a simple master page. Parse the design file, get property values, they should be identical to what stored in the file. Then, make some changes to these properties, get them again, they should be identical to those after the modification.
testSlots Test the two slots of simple master page Get the element count of page header and page footer, they should be the same as how many elements defined in the design file; then check the exact element in the slot, they should be identical to what is defined in the slot.
testSemanticErros Create another design file contains some errors on simple master page Parse the design file, check the syntax error count, they should be equals to what are designed; then check each syntax error code, they should be the same as what are design too.
testWriteSimpleMasterPage Open a design file, make some changes, then save it back to an output file Compare the output file with a golden file, they should be identical


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
SimpleMasterPageHandleTest(java.lang.String name)
           
 
Method Summary
protected  void setUp()
           
static junit.framework.Test suite()
           
 void testProperties()
          Test all the properties of a simple master page.
 void testSemanticErrors()
          Parse an input xml file with some error on simple master page to see if these semantic errors are reported correctly.
 void testSlots()
          Test all the page header and footer slot in a simple master page.
 void testWriterSimpleMasterPage()
          Open a design file which contains one or more simple master pages, make some modifications, then save it and compare it with another golden 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

SimpleMasterPageHandleTest

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

testProperties

public void testProperties()
                    throws java.lang.Exception
Test all the properties of a simple master page.

Throws:
java.lang.Exception - if the test fails.

testSlots

public void testSlots()
               throws java.lang.Exception
Test all the page header and footer slot in a simple master page.

Throws:
java.lang.Exception - if the test fails.

testSemanticErrors

public void testSemanticErrors()
                        throws java.lang.Exception
Parse an input xml file with some error on simple master page to see if these semantic errors are reported correctly.

Throws:
java.lang.Exception - if test fails.

testWriterSimpleMasterPage

public void testWriterSimpleMasterPage()
                                throws java.lang.Exception
Open a design file which contains one or more simple master pages, make some modifications, then save it and compare it with another golden file.

Throws:
java.lang.Exception - if test fails.