- Timestamp:
- Sep 22, 2010, 10:01:20 PM (14 years ago)
- Location:
- trunk/fmgVen
- Files:
-
- 3 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/fmgVen/lib/nblibraries.properties
r23 r24 6 6 ${base}/CopyLibs/org-netbeans-modules-java-j2seproject-copylibstask.jar 7 7 libs.Test.classpath=\ 8 ${base}/test/postgresql-8.4-701.jdbc3.jar 8 ${base}/test/postgresql-8.4-701.jdbc3.jar;\ 9 ${base}/test/liquibase-1.9.5.jar 9 10 libs.Ven.classpath=\ 10 11 ${base}/ven/spring-beans.jar;\ -
trunk/fmgVen/nbproject/project.properties
r23 r24 39 39 ${javac.classpath}:\ 40 40 ${build.classes.dir}:\ 41 ${libs.junit.classpath} 41 ${libs.junit.classpath}:\ 42 ${libs.Test.classpath} 42 43 javadoc.additionalparam= 43 44 javadoc.author=false -
trunk/fmgVen/test/com/fmguler/ven/sample/Sample.java
r23 r24 20 20 import com.fmguler.ven.Ven; 21 21 import com.fmguler.ven.sample.domain.SomeDomainObject; 22 import java.sql.SQLException; 23 import java.util.Locale; 22 24 import javax.sql.DataSource; 25 import liquibase.FileSystemFileOpener; 26 import liquibase.exception.JDBCException; 27 import liquibase.exception.LiquibaseException; 23 28 import org.springframework.jdbc.datasource.DriverManagerDataSource; 29 import liquibase.Liquibase; 30 import liquibase.database.Database; 31 import liquibase.database.DatabaseFactory; 24 32 25 33 /** … … 29 37 public class Sample { 30 38 public static void main(String[] args) { 39 buildDatabase(); 31 40 test1(); 41 //rollbackDatabase(); 32 42 } 33 43 … … 51 61 ds.setUsername("postgres"); 52 62 ds.setPassword("qwerty"); 53 ds.setUrl("jdbc:postgresql://127.0.0.1:5432/ven db");63 ds.setUrl("jdbc:postgresql://127.0.0.1:5432/ven-test"); 54 64 return ds; 55 65 } 66 67 private static void buildDatabase() { 68 try { 69 Locale currLocale = Locale.getDefault(); 70 Locale.setDefault(Locale.ENGLISH); 71 Database database = DatabaseFactory.getInstance().findCorrectDatabaseImplementation(getDataSource().getConnection()); 72 Liquibase liquibase = new Liquibase("etc/test-db/test-db-changelog.xml", new FileSystemFileOpener(), database); 73 liquibase.update(""); 74 Locale.setDefault(currLocale); 75 } catch (SQLException ex) { 76 ex.printStackTrace(); 77 } catch (JDBCException ex) { 78 ex.printStackTrace(); 79 } catch (LiquibaseException ex) { 80 ex.printStackTrace(); 81 } 82 } 83 84 private static void rollbackDatabase() { 85 try { 86 Locale currLocale = Locale.getDefault(); 87 Locale.setDefault(Locale.ENGLISH); 88 Database database = DatabaseFactory.getInstance().findCorrectDatabaseImplementation(getDataSource().getConnection()); 89 Liquibase liquibase = new Liquibase("etc/test-db/test-db-changelog.xml", new FileSystemFileOpener(), database); 90 //liquibase.rollback(51, ""); 91 liquibase.rollback("0", ""); 92 Locale.setDefault(currLocale); 93 } catch (SQLException ex) { 94 ex.printStackTrace(); 95 } catch (JDBCException ex) { 96 ex.printStackTrace(); 97 } catch (LiquibaseException ex) { 98 ex.printStackTrace(); 99 } 100 } 56 101 }
Note: See TracChangeset
for help on using the changeset viewer.