Package unitTest.org.yaorma.dvoClassFactory.dvoClassFactoryImpl.mySql.dvoClassFilesGeneratedByUnitTest

Examples of unitTest.org.yaorma.dvoClassFactory.dvoClassFactoryImpl.mySql.dvoClassFilesGeneratedByUnitTest.PersonDvo


      Data data = Database.query(sqlString, conn);
      ArrayList<PersonDvo> personList = Dao.load(PersonDvo.class, data);
      System.out.println("got " + personList.size() + " people.");
      assertTrue(personList.size() > 0);
      for(int i=0;i<personList.size();i++) {
        PersonDvo person = personList.get(i);
        System.out.println(person.getDisplayName());
      }
      System.out.println("done with testLoadPersonList().");
    } finally {
      if (conn != null) {
        conn.close();
View Full Code Here


  public void testInsertPerson() throws Exception {
    Connection conn = null;
    try {
      conn = ConnectionFactoryForUnitTests.getDedicatedConnection();
      PersonDvo dvo = new PersonDvo();
      dvo.setDisplayName("Mr. Insert Unit Test");
      Dao.insert(dvo, dvo, conn);
      Dao.setPrimaryKeys(dvo, dvo, conn);
      System.out.println("New user inserted.");
      String pk = dvo.getPersonId();
      System.out.println("The new user was assigned the synthetic key:");
      System.out.println(pk);
      assertTrue(pk != null && pk.length() > 0);
      System.out.println("The new user has the following name:");
      System.out.println(dvo.getDisplayName());
      assertTrue("Mr. Insert Unit Test".equals(dvo.getDisplayName()));
      dvo.setDisplayName("Mr. Update Unit Test");
      Dao.update(dvo, dvo, conn);
      assertTrue("Mr. Update Unit Test".equals(dvo.getDisplayName()));
      conn.rollback();
      System.out.println("Done with insert and update test.");
    } finally {
      if(conn != null) {
        conn.close();
View Full Code Here

TOP

Related Classes of unitTest.org.yaorma.dvoClassFactory.dvoClassFactoryImpl.mySql.dvoClassFilesGeneratedByUnitTest.PersonDvo

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.