Package de.cuioss.test.jsf.converter
Class TestItems<T>
- java.lang.Object
-
- de.cuioss.test.jsf.converter.TestItems<T>
-
- Type Parameters:
T- type of Test Item value
public class TestItems<T> extends Object
TestData Store for Test Items which will be used byAbstractConverterTest
Class is prepared to be used as Fluent Interface
-
-
Constructor Summary
Constructors Constructor Description TestItems()
-
Method Summary
-
-
-
Constructor Detail
-
TestItems
public TestItems()
-
-
Method Detail
-
addRoundtripValues
public TestItems<T> addRoundtripValues(String... roundtripValue)
Adds roundtrip String values to be tested. SeeAbstractConverterTest.shouldRoundTripValidData()- Parameters:
roundtripValue- the values to be roundtrip converted- Returns:
- TestItems reference to this object
-
addInvalidObject
public TestItems<T> addInvalidObject(T value)
Adds testData to be used for testingConverter.getAsString(javax.faces.context.FacesContext, javax.faces.component.UIComponent, Object)Test item must fail withConverterException- Parameters:
value- T invalid value which should cause aConverterException- Returns:
- TestItems reference to this object
-
addInvalidObjectWithMessage
public TestItems<T> addInvalidObjectWithMessage(T value, String message)
Adds testData to be used for testingConverter.getAsString(javax.faces.context.FacesContext, javax.faces.component.UIComponent, Object)Test item must fail withConverterException- Parameters:
value- T invalid value which should cause aConverterExceptionmessage- which should be set within theConverterException- Returns:
- TestItems reference to this object
-
addValidObject
public TestItems<T> addValidObject(T value)
Adds testData to be used for testingConverter.getAsString(javax.faces.context.FacesContext, javax.faces.component.UIComponent, Object)Test item should pass withoutConverterException- Parameters:
value- valid value which should cause aConverterException- Returns:
- TestItems reference to this object
-
addValidObjectWithStringResult
public TestItems<T> addValidObjectWithStringResult(T value, String converterResult)
Adds testData to be used for testingConverter.getAsString(javax.faces.context.FacesContext, javax.faces.component.UIComponent, Object)Test item should pass withoutConverterExceptionand the result should be the same as the given converterResult- Parameters:
value- valid value which should cause aConverterExceptionconverterResult- the String to be returned byConverter.getAsString(javax.faces.context.FacesContext, javax.faces.component.UIComponent, Object)- Returns:
- TestItems reference to this object
-
addInvalidString
public TestItems<T> addInvalidString(String value)
Adds testData to be used for testingConverter.getAsObject(javax.faces.context.FacesContext, javax.faces.component.UIComponent, String)Test item must fail withConverterException- Parameters:
value- invalid String-value which should cause aConverterException- Returns:
- TestItems reference to this object
-
addInvalidStringWithMessage
public TestItems<T> addInvalidStringWithMessage(String value, String message)
Adds testData to be used for testingConverter.getAsObject(javax.faces.context.FacesContext, javax.faces.component.UIComponent, String)Test item must fail withConverterException- Parameters:
value- invalid String-value which should cause aConverterExceptionmessage- which should be set within theConverterException- Returns:
- TestItems reference to this object
-
addValidString
public TestItems<T> addValidString(String value)
Adds testData to be used for testingConverter.getAsObject(javax.faces.context.FacesContext, javax.faces.component.UIComponent, String)Test item should pass withoutConverterException- Parameters:
value- valid String-value which should pass withoutConverterException- Returns:
- TestItems reference to this object
-
addValidStringWithObjectResult
public TestItems<T> addValidStringWithObjectResult(String value, T converterResult)
Adds testData to be used for testingConverter.getAsObject(javax.faces.context.FacesContext, javax.faces.component.UIComponent, String)Test item should pass withoutConverterExceptionand the result should be the same as the given converterResult- Parameters:
value- valid String-value which should pass withoutConverterExceptionconverterResult- the String to be returned byConverter.getAsObject(javax.faces.context.FacesContext, javax.faces.component.UIComponent, String)- Returns:
- TestItems reference to this object
-
-