summaryrefslogtreecommitdiff
path: root/gohadoopxml_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'gohadoopxml_test.go')
-rw-r--r--gohadoopxml_test.go40
1 files changed, 40 insertions, 0 deletions
diff --git a/gohadoopxml_test.go b/gohadoopxml_test.go
new file mode 100644
index 0000000..aa81010
--- /dev/null
+++ b/gohadoopxml_test.go
@@ -0,0 +1,40 @@
+package gohadoopxml
+
+import (
+ "testing"
+)
+
+func isin(key string, c Configuration) int {
+ for i, p := range c.Properties {
+ if p.Name == key {
+ return i
+ }
+ }
+ return -1
+}
+
+func TestMergeConfiguration(t *testing.T) {
+ var config1 = Configuration{
+ Properties: []Property{
+ {
+ Name: "foo",
+ Value: "bar",
+ },
+ },
+ }
+ var config2 = Configuration{
+ Properties: []Property{
+ {
+ Name: "fizz",
+ Value: "buzz",
+ },
+ },
+ }
+ result := MergeConfigurations(config1, config2)
+ if i := isin("foo", result); i < 0 {
+ t.Fail()
+ }
+ if i := isin("fizz", result); i < 0 {
+ t.Fail()
+ }
+}