PageRenderTime 58ms CodeModel.GetById 51ms app.highlight 4ms RepoModel.GetById 1ms app.codeStats 0ms

/tst/org/diffkit/db/tst/TestDBColumn.groovy

http://diffkit.googlecode.com/
Groovy | 44 lines | 19 code | 7 blank | 18 comment | 4 complexity | 82af33df33812e306ec43ca5fd97ff3a 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.db.tst
17
18
19import org.diffkit.db.DKDBColumn 
20import org.diffkit.db.DKDBType;
21import org.diffkit.db.DKDBTypeInfo;
22
23import groovy.util.GroovyTestCase;
24
25
26/**
27 * @author jpanico
28 */
29public class TestDBColumn extends GroovyTestCase {
30   
31   public void testCompareTo(){
32      DKDBColumn[] columns = new DKDBColumn[4]
33      columns[0] = new DKDBColumn('col4',4,'VARCHAR',-1,false)
34      columns[1] = new DKDBColumn('col1',1,'VARCHAR',-1,false)
35      columns[2] = new DKDBColumn('col3',3,'VARCHAR',-1,false)
36      columns[3] = new DKDBColumn('col2',2,'VARCHAR',-1,false)
37      
38      Arrays.sort(columns)
39      assert columns[0].ordinalPosition == 1 
40      assert columns[1].ordinalPosition == 2 
41      assert columns[2].ordinalPosition == 3 
42      assert columns[3].ordinalPosition == 4
43   }
44}