samples/livedb/test/org/apidesign/livedb/example/LiveDBTest.java
author Jaroslav Tulach <jtulach@netbeans.org>
Thu, 29 Jul 2010 17:55:04 +0200
changeset 362 de139a9cfb36
parent 361 6507a9474b6d
permissions -rw-r--r--
Show just body of the test method
jtulach@355
     1
package org.apidesign.livedb.example;
jtulach@355
     2
jtulach@357
     3
import java.sql.SQLException;
jtulach@357
     4
import java.util.List;
jtulach@355
     5
import junit.framework.TestCase;
jtulach@355
     6
jtulach@355
     7
/**
jtulach@355
     8
 *
jtulach@355
     9
 * @author Jaroslav Tulach <jtulach@netbeans.org>
jtulach@355
    10
 */
jtulach@355
    11
public class LiveDBTest extends TestCase {
jtulach@355
    12
    
jtulach@355
    13
    public LiveDBTest(String testName) {
jtulach@355
    14
        super(testName);
jtulach@355
    15
    }
jtulach@355
    16
jtulach@362
    17
    public void testSomeMethod() throws SQLException {
jtulach@361
    18
    // BEGIN: livedb.test
jtulach@357
    19
        List<Age> ages = Age.query();
jtulach@359
    20
        assertEquals("One record", 1, ages.size());
jtulach@359
    21
        Age age = ages.get(0);
jtulach@359
    22
        assertEquals("name is apidesign", "apidesign", age.NAME);
jtulach@359
    23
        assertEquals("it is three years old", 3, age.AGE.intValue());
jtulach@362
    24
    // END: livedb.test
jtulach@355
    25
    }
jtulach@355
    26
jtulach@355
    27
}