Package de.danet.an.util.persistentmaps

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


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


     */
    public void copyMap() throws Exception {
  JDBCPersistentMap map1 = new JDBCPersistentMap(null, "Danet");
  map1.setConnection(con);
  assertTrue(map1.size() == 0);
  map1.load();
  assertTrue(map1.size() == 8);
  JDBCPersistentMap map2 = new JDBCPersistentMap(null, "Danet2");
  map2.setConnection(con);
  assertTrue(map2.size() == 0);
  map2.putAll(map1);
View Full Code Here

  assertTrue(map2.size() == 8);
  map2.store();
  JDBCPersistentMap map3= new JDBCPersistentMap(null, "Danet2");
  map3.setConnection(con);
  assertTrue(map3.size() == 0);
  map3.load();
  assertTrue(map3.size() == 8);
  map2.clear();
  map2.store();
  map3.load();
  assertTrue(map3.size() == 0);
View Full Code Here

  assertTrue(map3.size() == 0);
  map3.load();
  assertTrue(map3.size() == 8);
  map2.clear();
  map2.store();
  map3.load();
  assertTrue(map3.size() == 0);
    }

    /**
     * Cleaning the table
View Full Code Here

  map.put("ML", "Dr. Michael Lipp");
  map.put("GB", "Gunnar von de Beck");
  map.put("INT", new Integer(1307));
  map.put("NULL", null);
  assertTrue(map.size() == 6);
  map.load(); // Load empty map
  assertTrue(map.size() == 0)
  map.put("HSc", "Holger Schl�ter");
  map.put("MSc", "Matthias Schirm");
  map.put("ML", "Dr. Michael Lipp");
  map.put("GB", "Gunnar von de Beck");
View Full Code Here

  map.put("ML", "Dr. Michael Lipp");
  map.put("GB", "Gunnar von de Beck");
  map.put("INT", new Integer(1307));
  map.put("NULL", null);
  map.store();
  map.load();
  assertTrue(map.size() == 6);
  map.clear(); // Clear the map
  assertTrue(map.size() == 0)
  map.store();
  map.load();
View Full Code Here

  map.load();
  assertTrue(map.size() == 6);
  map.clear(); // Clear the map
  assertTrue(map.size() == 0)
  map.store();
  map.load();
  assertTrue(map.size() == 0)
    }

    /**
     * Testing serialization
View Full Code Here

  ObjectOutputStream o = new ObjectOutputStream(bo);
  o.writeObject(map);
  o.close();
  map.remove("HSc");
  map.store();
  map.load();
  assertTrue(map.size() == 2); // Two entries stored in DB 
  ByteArrayInputStream bi = new ByteArrayInputStream(bo.toByteArray());
  ObjectInputStream i = new ObjectInputStream(bi);
  map = (JDBCPersistentMap)i.readObject(); // Three object read
  assertTrue(map.size() == 3)
View Full Code Here

      assertTrue(testMap.maxKeyLength() == 50);
      testMap.put("ALM", "Alex M�ller");
      testMap.store();
      testMap.clear();
      assertTrue(testMap.size() == 0);
      testMap.load();
      assertTrue(testMap.size() == 1);
  }
  testMap.setConnection(null);
  testMap.setConnection(con);
  assertTrue(testMap.maxKeyLength() == 50);
View Full Code Here

      assertTrue(testMap.size() == 1);
  }
  testMap.setConnection(null);
  testMap.setConnection(con);
  assertTrue(testMap.maxKeyLength() == 50);
  testMap.load();
  assertTrue(testMap.size() == 2);
  if (secondCon != null) {
      testMap.setConnection(secondCon);
      testMap.store();
      testMap.load();
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.