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

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

public class ColorHandleTest
extends BaseTestCase

TestCases for ColorHandle.


Method Test Case Expected
testGetColor() Gets the RGB and CSS compatible colors in a style. Values matches with those in the design file.
Gets the RGB and CSS compatible colors in a highlight. Values matches with those in the design file.
Gets a color of a style with the default value of black. ColorHandle is not null and the color is black.
Gets a color of a style without the default value. ColorHandle is null.
testSetColor() Sets colors in the integer and string to a style. The value is set and the golden file matches with the output file.
Sets colors in the integer and string to a highlight. The value is set and the golden file matches with the output file.
testSetColor() locale is CHINA, color value is css "red" The return should be Chinese "Ίμ"
locale is CHINA, color value is "#FF00FF", preference is CSS_ABSOLUTE_FORMAT The return should be "RGB(255,0,255)"
locale is CHINA, color value is "#FF00FF", preference is CSS_RELATIVE_FORMAT The return should be "RGB(255%,0%,255%)"
locale is CHINA, color value is "#FF00FF", preference is HTML_FORMAT The return should be "#FF00FF"
locale is CHINA, color value is "#FF00FF", preference is JAVA_FORMAT The return should be "0xFF00FF"
locale is ENGLISH, color value is css "red", preference is JAVA_FORMAT The return should be "red"
input is integer value for "#FF00FF", radix is 10. preference is CSS_RELATIVE_FORMAT The return should be "RGB(255%,0%,255%)"
input is integer value for "#FF00FF", radix is 10. preference is HTML_FORMAT The return should be "#FF00FF"
input is integer value for "#FF00FF", radix is 10. preference is JAVA_FORMAT The return should be "0xFF00FF"
input is integer value for "#FF00FF", radix is 10. preference is is not in the allowed list The return should be default as CSS_ABSOLUTE_FORMAT
testGetCSSColors() call getColors() The return should be the choice array containing all the predefined css colors.
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
ColorHandleTest(java.lang.String name)
           
 
Method Summary
protected  void setUp()
           
static junit.framework.Test suite()
           
 void testGetColor()
          test getCSSCompatibleValue() and getRGB() and getStringValue().
 void testGetCSSColors()
          test getColors().
 void testSetColor()
          test setStringValue(), setIntValue() and setRGB().
 
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

ColorHandleTest

public ColorHandleTest(java.lang.String 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

testSetColor

public void testSetColor()
                  throws java.lang.Exception
test setStringValue(), setIntValue() and setRGB().

Throws:
java.lang.Exception - if the rgb value of the color is invalid or the output file cannot be saved.

testGetColor

public void testGetColor()
                  throws org.eclipse.birt.report.model.api.activity.SemanticException
test getCSSCompatibleValue() and getRGB() and getStringValue().

Throws:
org.eclipse.birt.report.model.api.activity.SemanticException - if the the value of the color is invalid.

testGetCSSColors

public void testGetCSSColors()
test getColors().