[lsc-changes] r400 - lsc/trunk/src/test/java/org/lsc/persistence

rschermesser at lsc-project.org rschermesser at lsc-project.org
Sat Nov 7 22:35:48 CET 2009


Author: rschermesser
Date: 2009-11-07 22:35:48 +0100 (Sat, 07 Nov 2009)
New Revision: 400

Modified:
   lsc/trunk/src/test/java/org/lsc/persistence/DaoConfigTest.java
Log:
Reformat

Modified: lsc/trunk/src/test/java/org/lsc/persistence/DaoConfigTest.java
===================================================================
--- lsc/trunk/src/test/java/org/lsc/persistence/DaoConfigTest.java	2009-11-07 21:35:40 UTC (rev 399)
+++ lsc/trunk/src/test/java/org/lsc/persistence/DaoConfigTest.java	2009-11-07 21:35:48 UTC (rev 400)
@@ -63,71 +63,69 @@
  */
 public class DaoConfigTest extends TestCase {
 
-    private Connection con;
+	private Connection con;
+	private Logger LOGGER = LoggerFactory.getLogger(DaoConfigTest.class);
 
-    private Logger LOGGER = LoggerFactory.getLogger(DaoConfigTest.class);
+	/**
+	 * Test the JDBC connection.
+	 */
+	public final void testConnection() {
+		try {
+			Properties pc = org.lsc.persistence.DaoConfig.getSqlMapProperties();
+			pc.put("url", "jdbc:hsqldb:file:target/hsqldb/lsc");
 
-    /**
-     * Test the JDBC connection.
-     */
-    public final void testConnection() {
-        try {
-            Properties pc = org.lsc.persistence.DaoConfig.getSqlMapProperties();
-            pc.put("url", "jdbc:hsqldb:file:target/hsqldb/lsc");
+			/* Test loading driver */
+			LOGGER.info("=> loading driver:");
+			Class.forName((String) pc.get("driver")).newInstance();
+			LOGGER.info("OK");
 
-            /* Test loading driver */
-            LOGGER.info("=> loading driver:");
-            Class.forName((String) pc.get("driver")).newInstance();
-            LOGGER.info("OK");
+			/* Test the connection */
+			LOGGER.info("=> connecting:");
+			con = DriverManager.getConnection((String) pc.get("url"));
+			LOGGER.info("OK");
+		} catch (ClassNotFoundException y) {
+			LOGGER.error("ERR: driver not found. Please check your CLASSPATH !");
+		} catch (Exception x) {
+			LOGGER.error(x.toString(), x);
+		}
+	}
 
-            /* Test the connection */
-            LOGGER.info("=> connecting:");
-            con = DriverManager.getConnection((String) pc.get("url"));
-            LOGGER.info("OK");
-        } catch (ClassNotFoundException y) {
-            LOGGER.error("ERR: driver not found. Please check your CLASSPATH !");
-        } catch (Exception x) {
-            LOGGER.error(x.toString(), x);
-        }
-    }
+	public final void testRequest() {
+		ResultSet rs = null;
+		try {
+			if (con == null) {
+				testConnection();
+			}
+			Statement stm = con.createStatement();
+			String sql = "DROP TABLE test IF EXISTS; CREATE TABLE test (id INTEGER PRIMARY KEY)";
+			rs = stm.executeQuery(sql);
+			//
+			while (rs.next()) {
+				System.out.println("Table has " + rs.getInt(1) + " rows.");
+			}
+		} catch (SQLException e) {
+			LOGGER.error(e.toString(), e);
+		}
+		assertNotNull(rs);
+	}
 
-    public final void testRequest() {
-        ResultSet rs = null;
-        try {
-            if(con == null) {
-                testConnection();
-            }
-            Statement stm = con.createStatement();
-            String sql = "DROP TABLE test IF EXISTS; CREATE TABLE test (id INTEGER PRIMARY KEY)";
-            rs = stm.executeQuery(sql);
-            //
-            while (rs.next()) {
-                System.out.println("Table has " + rs.getInt(1) + " rows.");
-            }
-        } catch (SQLException e) {
-            LOGGER.error(e.toString(), e);
-        }
-        assertNotNull(rs);
-    }
+	public final void testGetSqlMapClient() {
+		// this is useless but breaks the test otherwise :)
+		if (con == null) {
+			testConnection();
+		}
+		assertNotNull(DaoConfig.getSqlMapClient());
+	}
 
-    public final void testGetSqlMapClient() {
-    	// this is useless but breaks the test otherwise :)
-        if(con == null) {
-            testConnection();
-        }
-
-    	assertNotNull(DaoConfig.getSqlMapClient());
-    }
-
-    /**
-     * Close DB connection
-     */
+	/**
+	 * Close DB connection
+	 */
 	@Override
-    public final void tearDown() {
-        try {
-            con.close();
-        } catch (SQLException e) {
-            LOGGER.error(e.toString(), e);
-        }
-    }
+	public final void tearDown() {
+		try {
+			con.close();
+		} catch (SQLException e) {
+			LOGGER.error(e.toString(), e);
+		}
+	}
 }



More information about the lsc-changes mailing list