1 package org.paneris.bibliomania.test;
2
3 import org.melati.poem.Database;
4 import org.melati.poem.PoemDatabaseFactory;
5 import org.melati.poem.test.PoemTestCase;
6 import org.paneris.bibliomania.BibliomaniaDatabase;
7
8
9
10
11
12
13 public class BibliomaniaTestCase extends PoemTestCase {
14
15 public BibliomaniaTestCase(){ }
16 public BibliomaniaTestCase(String name) {
17 super(name);
18 }
19
20 public Database getDb() {
21 return getTreeDatabase();
22 }
23
24 public Database getTreeDatabase() {
25 maxTrans = 4;
26
27
28 return PoemDatabaseFactory.getDatabase("tree",
29 "jdbc:postgresql:" + "bibliomania",
30 "postgres",
31 "*","org.paneris.bibliomania.test.BibliomaniaTestDatabase",
32 "org.paneris.bibliomania.poem.dbms.Postgresql",
33 false, false, false, 4);
34
35
36
37
38
39
40
41
42
43
44 }
45
46
47 protected void databaseUnchanged() {
48 assertEquals("Setting changed", 41, getDb().getSettingTable().count());
49 assertEquals("Group changed", 4, getDb().getGroupTable().count());
50
51 assertEquals("Capability changed", 8, getDb().getCapabilityTable().count());
52 assertEquals("GroupCapability changed", 10, getDb().getGroupCapabilityTable().count());
53 assertEquals("TableCategory changed", 6, getDb().getTableCategoryTable().count());
54
55 assertEquals("ColumnInfo changed", 347, getDb().getColumnInfoTable().count());
56 assertEquals("TableInfo changed", 45, getDb().getTableInfoTable().count());
57 assertEquals("AuthorWebsite changed", 224, ((BibliomaniaDatabase)getDb()).getAuthorWebSiteTable().count());
58 checkTablesAndColumns(45,347);
59 }
60
61 }