PageRenderTime 15ms CodeModel.GetById 8ms app.highlight 4ms RepoModel.GetById 1ms app.codeStats 0ms

/tst/org/diffkit/diff/diffor/tst/TestConvertingDiffor.groovy

http://diffkit.googlecode.com/
Groovy | 44 lines | 15 code | 11 blank | 18 comment | 1 complexity | 0c1efa77c5d3f86f618dae9c40187032 MD5 | raw file
 1/**
 2 * Copyright 2010-2011 Joseph Panico
 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 */
16package org.diffkit.diff.diffor.tst
17
18
19
20
21import groovy.util.GroovyTestCase;
22import org.apache.commons.beanutils.converters.IntegerConverter 
23import org.diffkit.diff.diffor.DKConvertingDiffor 
24import org.diffkit.diff.diffor.DKEqualsDiffor;
25
26
27/**
28 * @author jpanico
29 */
30public class TestConvertingDiffor extends GroovyTestCase {
31   
32   public void testDiff(){
33      
34      DKConvertingDiffor diffor = [null, Long.class, DKEqualsDiffor.instance]
35      assert ! diffor.isDiff(new Long(1234), '1234', null)
36   }
37   
38   public void testConvert(){
39      
40      assert new IntegerConverter(true).convert(Long.class, '1234') == 1234
41      
42      assert new BigDecimal(1).equals(new BigDecimal(1))
43   }
44}