Clover Coverage Report - Maven Impex Plugin 1.0.22-SNAPSHOT
Coverage timestamp: Mon Jul 18 2011 09:37:20 EDT
18   41   3   6
0   35   0.17   3
3     1  
1    
 
  TransactionComparatorTest       Line # 11 18 0% 3 0 100% 1.0
 
  (1)
 
1    package org.apache.torque.mojo;
2   
3    import java.util.Collections;
4    import java.util.Comparator;
5    import java.util.Vector;
6   
7    import org.apache.torque.util.TransactionComparator;
8    import org.junit.Test;
9    import org.kuali.db.Transaction;
10   
 
11    public class TransactionComparatorTest {
12   
 
13  1 toggle @Test
14    public void testComparator() {
15  1 Comparator<Transaction> comparator = new TransactionComparator<Transaction>("ks-embedded-db");
16  1 Vector<Transaction> transactions = new Vector<Transaction>();
17  1 transactions.add(getTransaction("003.sql"));
18  1 transactions.add(getTransaction("004.sql"));
19  1 transactions.add(getTransaction("001.sql"));
20  1 transactions.add(getTransaction("sql/oracle/ks-embedded-db.sql"));
21  1 transactions.add(getTransaction("002.sql"));
22  1 transactions.add(getTransaction("sql/oracle/ks-embedded-db-constraints.sql"));
23  1 transactions.add(getTransaction("001.sql"));
24  1 transactions.add(getTransaction("000.sql"));
25  1 transactions.add(getTransaction("zzz000.sql"));
26  1 Collections.sort(transactions, comparator);
27  1 showTransactions(transactions);
28    }
29   
 
30  1 toggle protected void showTransactions(Vector<Transaction> transactions) {
31  1 for (Transaction t : transactions) {
32  9 System.out.println(t.getResourceLocation());
33    }
34    }
35   
 
36  9 toggle protected Transaction getTransaction(String location) {
37  9 Transaction t = new Transaction();
38  9 t.setResourceLocation(location);
39  9 return t;
40    }
41    }