| 
  |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| CalendarConverterTestCase | Line # 27 | 6 | 0% | 6 | 0 | 100% | 
1.0
 | 
                
                                    ||||||||||||||||||||||||||||||||||||||||||||||||||||
| (11) | |||
| Result | |||
| 
            0.5
                         | 
        
            org.apache.commons.beanutils.converters.DateConverterTestBase.testDefaultType
             
            org.apache.commons.beanutils.converters.DateConverterTestBase.testDefaultType
         | 
        1 PASS | |
| 
            0.5
                         | 
        
            org.apache.commons.beanutils.converters.DateConverterTestBase.testPatternNullDefault
             
            org.apache.commons.beanutils.converters.DateConverterTestBase.testPatternNullDefault
         | 
        1 PASS | |
| 
            0.5
                         | 
        
            org.apache.commons.beanutils.converters.DateConverterTestBase.testMultiplePatterns
             
            org.apache.commons.beanutils.converters.DateConverterTestBase.testMultiplePatterns
         | 
        1 PASS | |
| 
            0.5
                         | 
        
            org.apache.commons.beanutils.converters.DateConverterTestBase.testLocale
             
            org.apache.commons.beanutils.converters.DateConverterTestBase.testLocale
         | 
        1 PASS | |
| 
            0.5
                         | 
        
            org.apache.commons.beanutils.converters.DateConverterTestBase.testPatternNoDefault
             
            org.apache.commons.beanutils.converters.DateConverterTestBase.testPatternNoDefault
         | 
        1 PASS | |
| 
            0.5
                         | 
        
            org.apache.commons.beanutils.converters.DateConverterTestBase.testPatternDefault
             
            org.apache.commons.beanutils.converters.DateConverterTestBase.testPatternDefault
         | 
        1 PASS | |
| 
            0.33333334
                         | 
        
            org.apache.commons.beanutils.converters.DateConverterTestBase.testStringConversion
             
            org.apache.commons.beanutils.converters.DateConverterTestBase.testStringConversion
         | 
        1 PASS | |
| 
            0.33333334
                         | 
        
            org.apache.commons.beanutils.converters.DateConverterTestBase.testConvertDate
             
            org.apache.commons.beanutils.converters.DateConverterTestBase.testConvertDate
         | 
        1 PASS | |
| 
            0.33333334
                         | 
        
            org.apache.commons.beanutils.converters.DateConverterTestBase.testDefaultStringToTypeConvert
             
            org.apache.commons.beanutils.converters.DateConverterTestBase.testDefaultStringToTypeConvert
         | 
        1 PASS | |
| 
            0.33333334
                         | 
        
            org.apache.commons.beanutils.converters.DateConverterTestBase.testConvertNull
             
            org.apache.commons.beanutils.converters.DateConverterTestBase.testConvertNull
         | 
        1 PASS | |
| 
            0.16666667
                         | 
        
            org.apache.commons.beanutils.converters.DateConverterTestBase.testInvalidType
             
            org.apache.commons.beanutils.converters.DateConverterTestBase.testInvalidType
         | 
        1 PASS | |
| 1 | /* | |
| 2 | * Licensed to the Apache Software Foundation (ASF) under one or more | |
| 3 | * contributor license agreements. See the NOTICE file distributed with | |
| 4 | * this work for additional information regarding copyright ownership. | |
| 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 | |
| 6 | * (the "License"); you may not use this file except in compliance with | |
| 7 | * the License. You may obtain a copy of the License at | |
| 8 | * | |
| 9 | * http://www.apache.org/licenses/LICENSE-2.0 | |
| 10 | * | |
| 11 | * Unless required by applicable law or agreed to in writing, software | |
| 12 | * distributed under the License is distributed on an "AS IS" BASIS, | |
| 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| 14 | * See the License for the specific language governing permissions and | |
| 15 | * limitations under the License. | |
| 16 | */ | |
| 17 | package org.apache.commons.beanutils.converters; | |
| 18 | ||
| 19 | import java.util.Calendar; | |
| 20 | import junit.framework.TestSuite; | |
| 21 | ||
| 22 | /** | |
| 23 | * Test Case for the CalendarConverter class. | |
| 24 | * | |
| 25 | * @version $Revision: 471352 $ | |
| 26 | */ | |
| 27 | public class CalendarConverterTestCase extends DateConverterTestBase { | |
| 28 | ||
| 29 | /** | |
| 30 | * Construct a new Calendar test case. | |
| 31 | * @param name Test Name | |
| 32 | */ | |
| 33 | 11 | 
           public CalendarConverterTestCase(String name) {     | 
  
| 34 | 11 | super(name); | 
| 35 | } | |
| 36 | ||
| 37 | // ------------------------------------------------------------------------ | |
| 38 | ||
| 39 | /** | |
| 40 | * Create Test Suite | |
| 41 | * @return test suite | |
| 42 | */ | |
| 43 | 1 | 
           public static TestSuite suite() {     | 
  
| 44 | 1 | return new TestSuite(CalendarConverterTestCase.class); | 
| 45 | } | |
| 46 | ||
| 47 | // ------------------------------------------------------------------------ | |
| 48 | /** | |
| 49 | * Create the Converter with no default value. | |
| 50 | * @return A new Converter | |
| 51 | */ | |
| 52 | 13 | 
           protected DateTimeConverter makeConverter() {     | 
  
| 53 | 13 | return new CalendarConverter(); | 
| 54 | } | |
| 55 | ||
| 56 | /** | |
| 57 | * Create the Converter with a default value. | |
| 58 | * @param defaultValue The default value | |
| 59 | * @return A new Converter | |
| 60 | */ | |
| 61 | 2 | 
           protected DateTimeConverter makeConverter(Object defaultValue) {     | 
  
| 62 | 2 | return new CalendarConverter(defaultValue); | 
| 63 | } | |
| 64 | ||
| 65 | /** | |
| 66 | * Return the expected type | |
| 67 | * @return The expected type | |
| 68 | */ | |
| 69 | 57 | 
           protected Class getExpectedType() {     | 
  
| 70 | 57 | return Calendar.class; | 
| 71 | } | |
| 72 | ||
| 73 | /** | |
| 74 | * Convert from a java.util.Date to the Converter's type. | |
| 75 | * | |
| 76 | * @param value The Date value to convert | |
| 77 | * @return The converted value | |
| 78 | */ | |
| 79 | 9 | 
           protected Object toType(Calendar value) {     | 
  
| 80 | 9 | return value; | 
| 81 | } | |
| 82 | ||
| 83 | } | |
  | 
||||||||||||