summaryrefslogtreecommitdiffstats
path: root/pki/base/common/test/com/netscape/cmscore/test/TestHelper.java
blob: cc19d8abaeac0d66ac5b9584bfd015d5d8024483 (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
package com.netscape.cmscore.test;

import java.util.Enumeration;

/**
 * Testing helper methods
 */
public class TestHelper {

    public static boolean enumerationContains(Enumeration enumeration,
                                              Object element) {
        while (enumeration.hasMoreElements()) {
            if (enumeration.nextElement().equals(element)) {
                return true;
            }
        }
        return false;
    }

    public static boolean contains(String[] list, String element) {
        for (int index = 0; index < list.length; index++) {
            if (list[index].equals(element)) {
                return true;
            }
        }

        return false;
    }

}