1 package org.apache.ojb.broker; 2 3 9 public class TestHelper 10 { 11 public static final String DEF_REPOSITORY = "repository.xml"; 12 13 public static final String DEF_JCD_ALIAS = PersistenceBrokerFactory.getDefaultKey().getAlias(); 14 public static final String DEF_USER = PersistenceBrokerFactory.getDefaultKey().getUser(); 15 public static final String DEF_PASSWORD = PersistenceBrokerFactory.getDefaultKey().getPassword(); 16 public static final String DEF_DATABASE_NAME; 17 static 18 { 19 DEF_DATABASE_NAME = buildDefDatabase(); 20 } 21 22 public static final PBKey DEF_KEY = new PBKey(DEF_JCD_ALIAS, DEF_USER, DEF_PASSWORD); 23 24 25 public static final String FAR_AWAY_CONNECTION_REPOSITORY = "Test_ConnectionDescriptor.xml"; 26 public static final String FAR_AWAY_JCD_ALIAS = "farAway"; 27 public static final String FAR_AWAY_DATABASE_NAME = "farAway#sa#"; 28 public static final PBKey FAR_AWAY_KEY = new PBKey(FAR_AWAY_JCD_ALIAS, "sa", ""); 29 30 public static final String DATABASE_REPOSITORY = "repository_database.xml"; 31 32 33 protected static String buildDefDatabase() 34 { 35 StringBuffer buf = new StringBuffer (); 36 PBKey defKey = PersistenceBrokerFactory.getDefaultKey(); 37 buf.append(defKey.getAlias()); 38 if ((defKey.getUser() != null && !(defKey.getUser().trim().equals("")))) 39 { 40 buf.append("#" + defKey.getUser()); 41 } 42 if (defKey.getPassword() != null) buf.append("#" + defKey.getPassword()); 43 return buf.toString(); 44 } 45 } 46 | Popular Tags |