diff options
author | Devan Goodwin <dgoodwin@rm-rf.ca> | 2009-11-02 16:36:04 -0400 |
---|---|---|
committer | Devan Goodwin <dgoodwin@rm-rf.ca> | 2009-11-02 16:36:04 -0400 |
commit | 9956f5627241ab84ad74bb30b91974ae8d1e0667 (patch) | |
tree | 49e55d4e63b327f86768509fe3288efa502de779 | |
parent | 6b224660b95f59b9008f1dd79231ba615e558029 (diff) | |
download | cobbler-9956f5627241ab84ad74bb30b91974ae8d1e0667.tar.gz cobbler-9956f5627241ab84ad74bb30b91974ae8d1e0667.tar.xz cobbler-9956f5627241ab84ad74bb30b91974ae8d1e0667.zip |
cobbler4j: Introduct a test Fixture.
-rw-r--r-- | cobbler4j/src/org/fedorahosted/cobbler/test/FinderTests.java | 14 | ||||
-rw-r--r-- | cobbler4j/src/org/fedorahosted/cobbler/test/Fixture.java | 21 |
2 files changed, 23 insertions, 12 deletions
diff --git a/cobbler4j/src/org/fedorahosted/cobbler/test/FinderTests.java b/cobbler4j/src/org/fedorahosted/cobbler/test/FinderTests.java index 46216b9e..cf49933b 100644 --- a/cobbler4j/src/org/fedorahosted/cobbler/test/FinderTests.java +++ b/cobbler4j/src/org/fedorahosted/cobbler/test/FinderTests.java @@ -8,20 +8,10 @@ import static org.junit.Assert.*; import org.fedorahosted.cobbler.autogen.*; import org.fedorahosted.cobbler.*; -public class FinderTests { - - public static final String user = "testing"; - public static final String pass = "testing"; - public static CobblerConnection cobblercon; - - @BeforeClass - public static void establishConnection() { - cobblercon = new CobblerConnection("http://192.168.1.1", - user, pass); - } +public class FinderTests extends Fixture { @Test - public void findSomething() { + public void findDistros() { Finder finder = Finder.getInstance(); // TODO: Will fail if your cobbler server has no distros: List<Distro> d = (List<Distro>)finder.listItems(cobblercon, diff --git a/cobbler4j/src/org/fedorahosted/cobbler/test/Fixture.java b/cobbler4j/src/org/fedorahosted/cobbler/test/Fixture.java new file mode 100644 index 00000000..6f7cb12c --- /dev/null +++ b/cobbler4j/src/org/fedorahosted/cobbler/test/Fixture.java @@ -0,0 +1,21 @@ +package org.fedorahosted.cobbler.test; + +import org.junit.BeforeClass; + +import org.fedorahosted.cobbler.*; + +public class Fixture { + + // TODO: Get these from some kind of user defined test config file: + public static final String user = "testing"; + public static final String pass = "testing"; + public static CobblerConnection cobblercon; + + @BeforeClass + public static void establishConnection() { + cobblercon = new CobblerConnection("http://192.168.1.1", + user, pass); + } + +} + |