Package de.danet.an.util.persistentmaps

Examples of de.danet.an.util.persistentmaps.JDBCPersistentMap.load()


  i.close();
  map.setConnection(con);
  map.store(); // Three objects stored
  map.clear();
  assertTrue(map.size() == 0)
  map.load(); // All three objects read
  assertTrue(map.size() == 3)
    }

    /**
     * Testing null and "" distinction.
View Full Code Here


      = new JDBCPersistentMap(null, "Danet","DefaultPersistenceMap");
  map.setConnection(con);
  map.put("nullString", null);
  map.put("emptyString", "");
  map.store();
  map.load();
  assertTrue (map.get ("nullString") == null);
  assertTrue (map.get("emptyString").equals (""));
    }
}
View Full Code Here

  assertTrue(testMap.isModified());
  testMap.store();
  assertTrue(!testMap.isModified());
  testMap.setMapId("Dnaet");
  assertTrue(!testMap.isModified());
  testMap.load();
  assertTrue(!testMap.isModified());
  assertTrue(testMap.size() == 0);
  testMap.setMapId("Danet");
  testMap.load();
  assertTrue(testMap.size() == 2);
View Full Code Here

  assertTrue(!testMap.isModified());
  testMap.load();
  assertTrue(!testMap.isModified());
  assertTrue(testMap.size() == 0);
  testMap.setMapId("Danet");
  testMap.load();
  assertTrue(testMap.size() == 2);
  testMap.clear();
  testMap.store();
    }
View Full Code Here

  assertTrue(exceptionCaught);
  storeMap.store();
  storeMap.store();
  JDBCPersistentMap loadMap = new JDBCPersistentMap(null, "Danet");
  loadMap.setConnection(useCon);
  loadMap.load();
  // Verfiy that maps do match
  assertTrue(loadMap.size() == 7);
//   for (Iterator i = loadMap.entrySet().iterator(); i.hasNext ();) {
//       Map.Entry e = (Map.Entry)i.next ();
//       assertTrue ("Got: " + e.getValue() + " != Put: "
View Full Code Here

     * @exception Exception if an error occurs
     */
    private void modifyAndRemoveCon(Connection useCon) throws Exception {
  JDBCPersistentMap storeMap = new JDBCPersistentMap(null, "Danet");
  storeMap.setConnection(useCon);
  storeMap.load();
  assertTrue(!storeMap.isModified());
  storeMap.remove("HSc");
  assertTrue(storeMap.isModified());
  storeMap.remove("MSc");
  storeMap.remove("RSc");
View Full Code Here

  storeMap.remove("ROt");
  storeMap.store();
  storeMap.store();
  JDBCPersistentMap loadMap = new JDBCPersistentMap(null, "Danet");
  loadMap.setConnection(useCon);
  loadMap.load();
  // Verfiy that maps do match
  assertTrue(loadMap.size() == 7);
  assertTrue(storeMap.equals(loadMap));
    }
View Full Code Here

  String newStatement = map.getLoadStatement();
  // Verfiy that new statement ist used
  assertTrue(newStatement.equals("ILLEGAL STATEMENT"));
  boolean exceptionCaught = false;
  try {
      map.load();
  } catch( IOException exc ) {
      exceptionCaught = true;
  }
  assertTrue(exceptionCaught);
    }
View Full Code Here

     * @exception Exception if an error occurs
     */
    public void insertStatement() throws Exception {
  JDBCPersistentMap map = new JDBCPersistentMap(null, "Danet");
  map.setConnection(con);
  map.load();
  String oldStatement = map.getInsertStatement();
  map.setInsertStatement("ILLEGAL STATEMENT");
  String newStatement = map.getInsertStatement();
  assertTrue(newStatement.equals("ILLEGAL STATEMENT"));
  // Verify that nothing is done (optimizing)
View Full Code Here

     * @exception Exception if an error occurs
     */
    public void updateStatement() throws Exception {
  JDBCPersistentMap map = new JDBCPersistentMap(null, "Danet");
  map.setConnection(con);
  map.load();
  String oldStatement = map.getUpdateStatement();
  map.setUpdateStatement
      ("ILLEGAL STATEMENT WHERE MAPID = ? AND ITEM = ?");
  String newStatement = map.getUpdateStatement();
  assertTrue(newStatement.equals
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.