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

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

public class DesignWriterTest
extends BaseTestCase

Unit test for DesignWriter, ReportDesignHandle.

Test Cases

Method Test Case Expected Result
testSerializeOutputStream Save the opened design file by calling ReportDesignHandle.serialize(java.io.OutputStream) Get the output stream after save, reopen the design from the output stream, then save again by calling ReportDesignHandle.saveAs( String ), finally compare the final output file to a golden file, they should be identical except the modification date
testUTF8Encoding Tests to write some character that are not UTF-8. The file can be written and read correctly.

See Also:
org.eclipse.birt.report.model.writer.DesignWriter, ReportDesignHandle, XMLWriter

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
DesignWriterTest(java.lang.String name)
           
 
Method Summary
protected  void setUp()
           
 void testBOMSignature()
          Tests UTF signature.
 void testSerializeOutputStream()
          Save the design by calling Please see here for detail test case description.
 void testUTF8Encoding()
          Tests UTF-8 writer and DesignReader.
 void testWriter()
           
 
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

DesignWriterTest

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

setUp

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

testSerializeOutputStream

public void testSerializeOutputStream()
                               throws java.lang.Exception
Save the design by calling Please see here for detail test case description.

Throws:
java.lang.Exception

testUTF8Encoding

public void testUTF8Encoding()
                      throws java.lang.Exception
Tests UTF-8 writer and DesignReader.

Throws:
java.lang.Exception

testBOMSignature

public void testBOMSignature()
                      throws java.lang.Exception
Tests UTF signature.

Throws:
java.lang.Exception

testWriter

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