org.apache.myfaces.component.html.ext
Class HtmlSelectManyCheckboxRendererCactus

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.apache.cactus.internal.AbstractCactusTestCase
              extended by org.apache.cactus.ServletTestCase
                  extended by org.apache.myfaces.component.html.ext.HtmlSelectManyCheckboxRendererCactus
All Implemented Interfaces:
junit.framework.Test, org.apache.cactus.internal.CactusTestCase

public class HtmlSelectManyCheckboxRendererCactus
extends org.apache.cactus.ServletTestCase

Cactus test for the rendering of the HtmlSelectBooleanCheckbox component. Various combinations of layouts (lineDirection,pageDirection) and layoutWidths are tested. TODO: Test the markup generated when SelectItemGroup's are used in combination with different layouts and layoutWidths.

Author:
Ken Weiner

Field Summary
 
Fields inherited from class org.apache.cactus.ServletTestCase
config, request, response, session
 
Constructor Summary
HtmlSelectManyCheckboxRendererCactus()
           
 
Method Summary
 void beginEncodeWithLineDirection(org.apache.cactus.WebRequest request)
           
 void beginEncodeWithLineDirectionAndLayoutWidth(org.apache.cactus.WebRequest request)
           
 void beginEncodeWithPageDirection(org.apache.cactus.WebRequest request)
           
 void beginEncodeWithPageDirectionAndLayoutWidth(org.apache.cactus.WebRequest request)
           
 void endEncodeWithLineDirection(org.apache.cactus.WebResponse response)
           
 void endEncodeWithLineDirectionAndLayoutWidth(org.apache.cactus.WebResponse response)
           
 void endEncodeWithPageDirection(org.apache.cactus.WebResponse response)
           
 void endEncodeWithPageDirectionAndLayoutWidth(org.apache.cactus.WebResponse response)
           
protected  List getSelections(int numSelected)
          Helper method to generate list of selected checkbox values.
protected  List getSelectManyCheckboxSelections(int numItems)
          Helper method to generate list of select items that represent the selection of checkboxes.
 void setUp()
           
 void tearDown()
           
 void testEncodeWithLineDirection()
           
 void testEncodeWithLineDirectionAndLayoutWidth()
           
 void testEncodeWithPageDirection()
           
 void testEncodeWithPageDirectionAndLayoutWidth()
           
 
Methods inherited from class org.apache.cactus.ServletTestCase
createProtocolHandler
 
Methods inherited from class org.apache.cactus.internal.AbstractCactusTestCase
runBare, runBareServer
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, 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, failNotEquals, failNotSame, failSame, format
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.cactus.internal.CactusTestCase
runBareServer
 

Constructor Detail

HtmlSelectManyCheckboxRendererCactus

public HtmlSelectManyCheckboxRendererCactus()
Method Detail

setUp

public void setUp()
           throws Exception
Overrides:
setUp in class junit.framework.TestCase
Throws:
Exception

beginEncodeWithLineDirection

public void beginEncodeWithLineDirection(org.apache.cactus.WebRequest request)

testEncodeWithLineDirection

public void testEncodeWithLineDirection()
                                 throws IOException
Throws:
IOException

endEncodeWithLineDirection

public void endEncodeWithLineDirection(org.apache.cactus.WebResponse response)

beginEncodeWithPageDirection

public void beginEncodeWithPageDirection(org.apache.cactus.WebRequest request)

testEncodeWithPageDirection

public void testEncodeWithPageDirection()
                                 throws IOException
Throws:
IOException

endEncodeWithPageDirection

public void endEncodeWithPageDirection(org.apache.cactus.WebResponse response)

beginEncodeWithLineDirectionAndLayoutWidth

public void beginEncodeWithLineDirectionAndLayoutWidth(org.apache.cactus.WebRequest request)

testEncodeWithLineDirectionAndLayoutWidth

public void testEncodeWithLineDirectionAndLayoutWidth()
                                               throws IOException
Throws:
IOException

endEncodeWithLineDirectionAndLayoutWidth

public void endEncodeWithLineDirectionAndLayoutWidth(org.apache.cactus.WebResponse response)

beginEncodeWithPageDirectionAndLayoutWidth

public void beginEncodeWithPageDirectionAndLayoutWidth(org.apache.cactus.WebRequest request)

testEncodeWithPageDirectionAndLayoutWidth

public void testEncodeWithPageDirectionAndLayoutWidth()
                                               throws IOException
Throws:
IOException

endEncodeWithPageDirectionAndLayoutWidth

public void endEncodeWithPageDirectionAndLayoutWidth(org.apache.cactus.WebResponse response)

getSelections

protected List getSelections(int numSelected)
Helper method to generate list of selected checkbox values. The values will be strings in the form "Value-X" where X is the 0-based index of the value.

Parameters:
numSelected - the number of values requested
Returns:
the list of selected checkbox values

getSelectManyCheckboxSelections

protected List getSelectManyCheckboxSelections(int numItems)
Helper method to generate list of select items that represent the selection of checkboxes. The select items will have labels and values in the form "Label-X", "Value-X" where X is the 0-based index of the label or value.

Parameters:
numItems - the number of checkboxes requested
Returns:
the list of checkbox select items

tearDown

public void tearDown()
Overrides:
tearDown in class junit.framework.TestCase


Copyright © 2012 The Apache Software Foundation. All Rights Reserved.