-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
configuration parsing for client and namenode, bug fixes
- Loading branch information
Showing
9 changed files
with
277 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package client | ||
|
||
import ( | ||
"testing" | ||
) | ||
|
||
func TestValidXML(t *testing.T) { | ||
|
||
err := ParseConfigXML("exampleclient.xml") | ||
if err != nil { | ||
t.Errorf(err.Error()) | ||
} | ||
// Single client for now | ||
// if id != "C" { | ||
// t.Errorf("Config did not set id correctly") | ||
// } | ||
|
||
if serverhost != "localhost" { | ||
t.Errorf("Config did not set host correctly") | ||
} | ||
|
||
if serverport != "8080" { | ||
t.Errorf("Config did not set port correctly") | ||
} | ||
|
||
if SIZEOFBLOCK != 4096 { | ||
t.Errorf("Config did not set SIZEOFBLOCK correctly") | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<ConfigOptionList> | ||
<ConfigOption key="serverhost">localhost</ConfigOption> | ||
<ConfigOption key="serverport">8080</ConfigOption> | ||
<ConfigOption key="sizeofblock">4096</ConfigOption> | ||
</ConfigOptionList> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package datanode | ||
|
||
import ( | ||
"testing" | ||
) | ||
|
||
func TestValidXML(t *testing.T) { | ||
|
||
err := ParseConfigXML("exampledatanode.xml") | ||
if err != nil { | ||
t.Errorf(err.Error()) | ||
} | ||
|
||
if id != "DN1" { | ||
t.Errorf("Config did not set id correctly") | ||
} | ||
|
||
if root != "/DN1" { | ||
t.Errorf("Config did not set id correctly") | ||
} | ||
|
||
if serverhost != "localhost" { | ||
t.Errorf("Config did not set host correctly") | ||
} | ||
|
||
if serverport != "8080" { | ||
t.Errorf("Config did not set port correctly") | ||
} | ||
|
||
if SIZEOFBLOCK != 4096 { | ||
t.Errorf("Config did not set SIZEOFBLOCK correctly") | ||
} | ||
|
||
} |
Oops, something went wrong.