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

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

public class ReportDesignHandleTest
extends BaseTestCase

Tests cases for ReportDesignHandle.

Method Test Case Expected
testConfigVars() Tests to read, remove, replace ConfigVars. Operations are finished correctly and the output file matches the golden file.
testReportDesignOtherMethods() Tests to get element and design handle. Returns the design and design handle correctly.
Tests to get numbers of errors and warnings. Returns numbers of errors and warnings correctly.
testReportDesignProperties() Tests to get and set properties like base and default units. Values are set correctly and the output file matches the golden file.
testReportDesignSlots() Tests to get different kinds of slots like body, components, etc. Information of slots matches with the input design file.
testIteratorMethods() Tests to get iterators. Information of iterators matches with the input design file.
testTranslations() Tests to get translations. Information of translations matches with the input design 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
ReportDesignHandleTest(java.lang.String name)
           
 
Method Summary
protected  void setUp()
           
static junit.framework.Test suite()
           
 void testAddTranslation()
          Tests adding translation.
 void testConfigVars()
          Tests cases for reading and setting ConfigVars.
 void testDropTranslation()
          Tests dropping translation.
 void testEmbeddedImage()
           
 void testIteratorMethods()
          Tests iterator methods of a report design.
 void testNeedsSave()
          Tests the save state of a report design after several undo and redo.
 void testNeedsSave2()
          Execute an command and undo it, the state should be clean.
 void testRename()
          Test case for rename method.
 void testReportDesignOtherMethods()
          Tests cases for methods on ReportDesignHandle.
 void testReportDesignProperties()
          Tests cases for reading and setting properties of report design.
 void testReportDesignSlots()
          Tests cases for methods on slots.
 void testTranslations()
          Tests translations on a report design.
 
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

ReportDesignHandleTest

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

testConfigVars

public void testConfigVars()
                    throws java.lang.Exception
Tests cases for reading and setting ConfigVars.

Throws:
java.lang.Exception - if any exception

testReportDesignOtherMethods

public void testReportDesignOtherMethods()
Tests cases for methods on ReportDesignHandle.


testReportDesignSlots

public void testReportDesignSlots()
Tests cases for methods on slots.


testReportDesignProperties

public void testReportDesignProperties()
                                throws java.lang.Exception
Tests cases for reading and setting properties of report design.

Throws:
java.lang.Exception - if any exception.

testRename

public void testRename()
                throws java.lang.Exception
Test case for rename method. Give a free-form element, check the name of all of elements within its slot. if the name is duplicate with the current name space

Throws:
java.lang.Exception

testIteratorMethods

public void testIteratorMethods()
                         throws java.lang.Exception
Tests iterator methods of a report design.

Throws:
java.lang.Exception

testNeedsSave

public void testNeedsSave()
                   throws java.lang.Exception
Tests the save state of a report design after several undo and redo.

Throws:
java.lang.Exception

testNeedsSave2

public void testNeedsSave2()
                    throws java.lang.Exception
Execute an command and undo it, the state should be clean.

Throws:
java.lang.Exception

testTranslations

public void testTranslations()
                      throws java.lang.Exception
Tests translations on a report design.

Throws:
java.lang.Exception - if any exception.

testAddTranslation

public void testAddTranslation()
                        throws org.eclipse.birt.report.model.api.DesignFileException,
                               org.eclipse.birt.report.model.api.command.CustomMsgException
Tests adding translation.

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

testDropTranslation

public void testDropTranslation()
                         throws org.eclipse.birt.report.model.api.DesignFileException,
                                org.eclipse.birt.report.model.api.command.CustomMsgException
Tests dropping translation.

Throws:
org.eclipse.birt.report.model.api.DesignFileException - if failed to open design file.
org.eclipse.birt.report.model.api.command.CustomMsgException - if any translation operation error.

testEmbeddedImage

public void testEmbeddedImage()
                       throws java.lang.Exception
Throws:
java.lang.Exception