Skip to content

Commit 795951c

Browse files
hansonrhansonr
authored andcommitted
Test_Path for preferences
1 parent 9705464 commit 795951c

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

sources/net.sf.j2s.java.core/src/test/Test_Path.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class Test_Path extends Test_ {
1313
public static void main(String[] args) {
1414

1515

16-
// assert(checkDBName("none", "https://4virology.net/ca.virology/xml/DBPrefs.xml", null));
16+
assert(checkDBName("none", "https://4virology.net/ca.virology/xml/DBPrefs.xml", null));
1717

1818
File f;
1919
Path p,p2;
@@ -62,7 +62,7 @@ public static void main(String[] args) {
6262

6363
private static boolean checkDBName (String dbname, String dbprefs, String dbprefs_prefix) {
6464
test.bsml.DBPrefs dbp = new test.bsml.DBPrefs(dbprefs, dbprefs_prefix);
65-
if (dbp.checkDBExists(dbname)) //dbname exists in xml file
65+
if (dbp.checkDBExists(dbname)) //bdname exists in xml file
6666
return true;
6767
else
6868
return false;

sources/net.sf.j2s.java.core/src/test/bsml/DBPrefs.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,12 @@ public boolean checkDBExists(String dbname) {
141141
else vocsNodes = Preferences.userRoot().node("/" + PREFIX + "/" + VOCS_DB);
142142
try {
143143
String children[] = vocsNodes.childrenNames();
144+
System.out.println(vocsNodes.toString());
145+
144146
for (int i = 0; i < children.length; i++) {
145147
Preferences prefs = vocsNodes.node(children[i]);
148+
String s = prefs.get("host", "?");
149+
assert(s.equals("52.35.121.80"));
146150
if (prefs.get("database", "").equals(dbname) ) {
147151
return true;
148152
}

0 commit comments

Comments
 (0)