summaryrefslogtreecommitdiffstats
path: root/cobbler4j/src/org/fedorahosted/cobbler/test/FinderTests.java
blob: 46216b9e886c03b59d7dd93d777a9907bd891b4d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package org.fedorahosted.cobbler.test;

import java.util.List;
import org.junit.Test;
import org.junit.BeforeClass;
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);
    }

    @Test 
    public void findSomething() {
        Finder finder = Finder.getInstance();
        // TODO: Will fail if your cobbler server has no distros:
        List<Distro> d = (List<Distro>)finder.listItems(cobblercon, 
                ObjectType.DISTRO);

        // Ideally we'd check that some were returned, but we can't guarantee 
        // the cobbler server we're testing against has any distro's available.
    }

}