| 1 21 22 package org.apache.derbyTesting.functionTests.tests.store; 23 24 import java.sql.Connection ; 25 import java.sql.Statement ; 26 import java.sql.PreparedStatement ; 27 import java.sql.DriverManager ; 28 import java.util.Properties ; 29 import java.io.*; 30 31 36 public class EncryptionTest { 37 public static void main(String [] args) { 38 Connection conn = null; 39 try { 40 org.apache.derby.tools.ij.getPropertyArg(args); 43 conn = org.apache.derby.tools.ij.startJBMS(); 44 45 String derbyHome = System.getProperty("derby.system.home"); 49 50 Properties serviceProperties = new Properties (); 52 File f = new File(derbyHome + "/wombat/service.properties"); 53 serviceProperties.load(new FileInputStream(f.getAbsolutePath())); 54 if (serviceProperties.getProperty("bootPassword") == null) 55 report("TEST PASSED"); 56 else 57 report("FAIL -- bootPassword should not be written out into service.properties"); 58 59 conn.close(); 60 } catch (Throwable e) { 61 report("FAIL -- unexpected exception: " + e); 62 e.printStackTrace(); 63 } 64 65 } 66 67 71 public static void report(String msg) { 72 System.out.println(msg); 73 } 74 75 } 76 | Popular Tags |