samples/livedb/test/org/apidesign/livedb/example/LiveDBTest.java
author Jaroslav Tulach <jtulach@netbeans.org>
Fri, 16 Jul 2010 23:35:08 +0200
branchlivedb
changeset 359 9d430d9bc4b1
parent 357 837370f791ba
child 361 6507a9474b6d
permissions -rw-r--r--
Creating the database in Ant. Placing it on a test classpath. Test test now checks real DB content.
     1 /*
     2  * To change this template, choose Tools | Templates
     3  * and open the template in the editor.
     4  */
     5 
     6 package org.apidesign.livedb.example;
     7 
     8 import java.sql.SQLException;
     9 import java.util.List;
    10 import junit.framework.TestCase;
    11 
    12 /**
    13  *
    14  * @author Jaroslav Tulach <jtulach@netbeans.org>
    15  */
    16 public class LiveDBTest extends TestCase {
    17     
    18     public LiveDBTest(String testName) {
    19         super(testName);
    20     }
    21 
    22     public void testSomeMethod() throws SQLException {
    23         List<Age> ages = Age.query();
    24         assertEquals("One record", 1, ages.size());
    25         Age age = ages.get(0);
    26         assertEquals("name is apidesign", "apidesign", age.NAME);
    27         assertEquals("it is three years old", 3, age.AGE.intValue());
    28     }
    29 
    30 }