samples/livedb/src/test/java/org/apidesign/livedb/example/LiveDBTest.java
author Jaroslav Tulach <jaroslav.tulach@apidesign.org>
Fri, 03 Apr 2020 16:32:36 +0200
changeset 416 9ed8788a1a4e
permissions -rw-r--r--
Using HTTPS to download the libraries
     1 package org.apidesign.livedb.example;
     2 
     3 import java.sql.SQLException;
     4 import java.util.List;
     5 import static junit.framework.TestCase.assertEquals;
     6 import org.junit.Test;
     7 
     8 /**
     9  *
    10  * @author Jaroslav Tulach <jtulach@netbeans.org>
    11  */
    12 public class LiveDBTest {
    13     
    14     public LiveDBTest() {
    15     }
    16 
    17     @Test
    18     public void testSomeMethod() throws SQLException {
    19     // BEGIN: livedb.test
    20         List<Age> ages = Age.query();
    21         assertEquals("One record", 1, ages.size());
    22         Age age = ages.get(0);
    23         assertEquals("name is apidesign", "apidesign", age.NAME);
    24         assertEquals("it is three years old", 3, age.AGE.intValue());
    25     // END: livedb.test
    26     }
    27 
    28 }