org.apache.commons.beanutils.locale.converters
Class BaseLocaleConverterTestCase

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.apache.commons.beanutils.locale.converters.BaseLocaleConverterTestCase
All Implemented Interfaces:
junit.framework.Test
Direct Known Subclasses:
BigDecimalLocaleConverterTestCase, BigIntegerLocaleConverterTestCase, ByteLocaleConverterTestCase, DateLocaleConverterTestCase, DoubleLocaleConverterTestCase, FloatLocaleConverterTestCase, IntegerLocaleConverterTestCase, LongLocaleConverterTestCase, ShortLocaleConverterTestCase

public class BaseLocaleConverterTestCase
extends junit.framework.TestCase

Base Test Case for the DecimalLocaleConverter classes. This class doesn't define any real tests; it just provides useful methods for the real test case classes to inherit.

Version:
$Revision: 469728 $ $Date: 2006-11-01 01:08:34 +0000 (Wed, 01 Nov 2006) $
Author:
Niall Pemberton

Field Summary
protected  BaseLocaleConverter converter
           
protected  String defaultDecimalPattern
           
protected  String defaultDecimalValue
           
protected  String defaultIntegerPattern
           
protected  String defaultIntegerValue
           
protected  Locale defaultLocale
           
protected  Object defaultValue
           
protected  String expectedDecimalValue
           
protected  String expectedIntegerValue
           
protected  Object expectedValue
           
protected  String localizedDecimalPattern
           
protected  String localizedDecimalValue
           
protected  String localizedIntegerPattern
           
protected  String localizedIntegerValue
           
protected  Locale localizedLocale
           
protected  Locale origLocale
           
protected  Object result
           
 
Constructor Summary
BaseLocaleConverterTestCase(String name)
           
 
Method Summary
protected  void convertInvalid(BaseLocaleConverter converter, Object expectedValue)
          Test Converting an invalid value.
protected  void convertInvalid(BaseLocaleConverter converter, String msgId, Object expectedValue)
          Test Converting an invalid value.
protected  void convertNull(BaseLocaleConverter converter, Object expectedValue)
          Test Converting Null value.
protected  void convertNull(BaseLocaleConverter converter, String msgId, Object expectedValue)
          Test Converting Null value.
protected  void convertValueNoPattern(BaseLocaleConverter converter, Object value, Object expectedValue)
          Test Converting Value WITHOUT a pattern
protected  void convertValueNoPattern(BaseLocaleConverter converter, String msgId, Object value, Object expectedValue)
          Test Converting Value WITHOUT a pattern
protected  void convertValueToType(BaseLocaleConverter converter, Class clazz, Object value, String pattern, Object expectedValue)
          Test Converting Value To a spcified Type
protected  void convertValueToType(BaseLocaleConverter converter, String msgId, Class clazz, Object value, String pattern, Object expectedValue)
          Test Converting Value To a spcified Type
protected  void convertValueWithPattern(BaseLocaleConverter converter, Object value, String pattern, Object expectedValue)
          Test Converting Value WITH a pattern
protected  void convertValueWithPattern(BaseLocaleConverter converter, String msgId, Object value, String pattern, Object expectedValue)
          Test Converting Value WITH a pattern
 void setUp()
          Set up instance variables required by this test case.
 void tearDown()
          Tear down instance variables required by this test case.
 void testNothing()
          This class isn't intended to perform any real tests; it just provides methods for the real test cases to inherit.
 
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
 

Field Detail

origLocale

protected Locale origLocale

converter

protected BaseLocaleConverter converter

result

protected Object result

defaultValue

protected Object defaultValue

expectedValue

protected Object expectedValue

localizedLocale

protected Locale localizedLocale

localizedDecimalPattern

protected String localizedDecimalPattern

localizedIntegerPattern

protected String localizedIntegerPattern

localizedDecimalValue

protected String localizedDecimalValue

localizedIntegerValue

protected String localizedIntegerValue

defaultLocale

protected Locale defaultLocale

defaultDecimalPattern

protected String defaultDecimalPattern

defaultIntegerPattern

protected String defaultIntegerPattern

defaultDecimalValue

protected String defaultDecimalValue

defaultIntegerValue

protected String defaultIntegerValue

expectedDecimalValue

protected String expectedDecimalValue

expectedIntegerValue

protected String expectedIntegerValue
Constructor Detail

BaseLocaleConverterTestCase

public BaseLocaleConverterTestCase(String name)
Method Detail

setUp

public void setUp()
           throws Exception
Set up instance variables required by this test case.

Overrides:
setUp in class junit.framework.TestCase
Throws:
Exception

tearDown

public void tearDown()
Tear down instance variables required by this test case.

Overrides:
tearDown in class junit.framework.TestCase

convertValueWithPattern

protected void convertValueWithPattern(BaseLocaleConverter converter,
                                       Object value,
                                       String pattern,
                                       Object expectedValue)
Test Converting Value WITH a pattern


convertValueWithPattern

protected void convertValueWithPattern(BaseLocaleConverter converter,
                                       String msgId,
                                       Object value,
                                       String pattern,
                                       Object expectedValue)
Test Converting Value WITH a pattern


convertValueNoPattern

protected void convertValueNoPattern(BaseLocaleConverter converter,
                                     Object value,
                                     Object expectedValue)
Test Converting Value WITHOUT a pattern


convertValueNoPattern

protected void convertValueNoPattern(BaseLocaleConverter converter,
                                     String msgId,
                                     Object value,
                                     Object expectedValue)
Test Converting Value WITHOUT a pattern


convertValueToType

protected void convertValueToType(BaseLocaleConverter converter,
                                  Class clazz,
                                  Object value,
                                  String pattern,
                                  Object expectedValue)
Test Converting Value To a spcified Type


convertValueToType

protected void convertValueToType(BaseLocaleConverter converter,
                                  String msgId,
                                  Class clazz,
                                  Object value,
                                  String pattern,
                                  Object expectedValue)
Test Converting Value To a spcified Type


convertNull

protected void convertNull(BaseLocaleConverter converter,
                           Object expectedValue)
Test Converting Null value.


convertNull

protected void convertNull(BaseLocaleConverter converter,
                           String msgId,
                           Object expectedValue)
Test Converting Null value.


convertInvalid

protected void convertInvalid(BaseLocaleConverter converter,
                              Object expectedValue)
Test Converting an invalid value.


convertInvalid

protected void convertInvalid(BaseLocaleConverter converter,
                              String msgId,
                              Object expectedValue)
Test Converting an invalid value.


testNothing

public void testNothing()
This class isn't intended to perform any real tests; it just provides methods for the real test cases to inherit. However junit complains if a class named ..TestCase contains no test methods, so here we define a dummy one to keep it happy.



Copyright © 2000-2010 The Apache Software Foundation. All Rights Reserved.