1   /*
2    * Copyright 2004 Ronald Blaschke.
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *      http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.rblasch.convert.converters;
17  
18  import junit.framework.TestCase;
19  
20  import java.util.Set;
21  
22  public class ObjectToMetaConvertersConverterTest extends TestCase {
23      public void testSimple() throws Exception {
24          final ObjectToMetaConvertersConverter c = new ObjectToMetaConvertersConverter(100);
25          final Set/*<MetaConverter>*/ converters = (Set) c.convert(new TestConverter());
26          assertEquals(2, converters.size());
27          //XXX test the actual converters
28      }
29  
30      private static class TestConverter {
31          public String convert(final Integer i) {
32              return i.toString();
33          }
34  
35          public int convert2(final byte b) {
36              return b;
37          }
38  
39          public Object notFound1() {
40              return null;
41          }
42  
43          public void notFound2(final Object o) {
44          }
45  
46          public Object notFound3(final Object o1, final Object o2) {
47              return null;
48          }
49      }
50  }