javax.management.openmbean.CompositeData#toString ( )源码实例Demo

下面列出了javax.management.openmbean.CompositeData#toString ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: dragonwell8_jdk   文件: CompositeDataStringTest.java
public static void main(String[] args) throws Exception {
    CompositeType basicCT = new CompositeType(
            "basicCT", "basic CompositeType",
            new String[] {"name", "value"},
            new String[] {"name", "value"},
            new OpenType<?>[] {SimpleType.STRING, SimpleType.INTEGER});
    CompositeType ct = new CompositeType(
            "noddy", "descr",
            new String[] {"strings", "ints", "cds"},
            new String[] {"string array", "int array", "composite data array"},
            new OpenType<?>[] {
                ArrayType.getArrayType(SimpleType.STRING),
                ArrayType.getPrimitiveArrayType(int[].class),
                ArrayType.getArrayType(basicCT)
            });
    CompositeData basicCD1 = new CompositeDataSupport(
            basicCT, new String[] {"name", "value"}, new Object[] {"ceathar", 4});
    CompositeData basicCD2 = new CompositeDataSupport(
            basicCT, new String[] {"name", "value"}, new Object[] {"naoi", 9});
    CompositeData cd = new CompositeDataSupport(
            ct,
            new String[] {"strings", "ints", "cds"},
            new Object[] {
                new String[] {"fred", "jim", "sheila"},
                new int[] {2, 3, 5, 7},
                new CompositeData[] {basicCD1, basicCD2}
            });
    String s = cd.toString();
    System.out.println("CompositeDataSupport.toString(): " + s);
    String[] expected = {
        "fred, jim, sheila",
        "2, 3, 5, 7",
        "ceathar",
        "naoi",
    };
    boolean ok = true;
    for (String expect : expected) {
        if (s.contains(expect))
            System.out.println("OK: string contains <" + expect + ">");
        else {
            ok = false;
            System.out.println("NOT OK: string does not contain <" +
                    expect + ">");
        }
    }
    if (ok)
        System.out.println("TEST PASSED");
    else
        throw new Exception("TEST FAILED: string did not contain expected substrings");
}
 
源代码2 项目: TencentKona-8   文件: CompositeDataStringTest.java
public static void main(String[] args) throws Exception {
    CompositeType basicCT = new CompositeType(
            "basicCT", "basic CompositeType",
            new String[] {"name", "value"},
            new String[] {"name", "value"},
            new OpenType<?>[] {SimpleType.STRING, SimpleType.INTEGER});
    CompositeType ct = new CompositeType(
            "noddy", "descr",
            new String[] {"strings", "ints", "cds"},
            new String[] {"string array", "int array", "composite data array"},
            new OpenType<?>[] {
                ArrayType.getArrayType(SimpleType.STRING),
                ArrayType.getPrimitiveArrayType(int[].class),
                ArrayType.getArrayType(basicCT)
            });
    CompositeData basicCD1 = new CompositeDataSupport(
            basicCT, new String[] {"name", "value"}, new Object[] {"ceathar", 4});
    CompositeData basicCD2 = new CompositeDataSupport(
            basicCT, new String[] {"name", "value"}, new Object[] {"naoi", 9});
    CompositeData cd = new CompositeDataSupport(
            ct,
            new String[] {"strings", "ints", "cds"},
            new Object[] {
                new String[] {"fred", "jim", "sheila"},
                new int[] {2, 3, 5, 7},
                new CompositeData[] {basicCD1, basicCD2}
            });
    String s = cd.toString();
    System.out.println("CompositeDataSupport.toString(): " + s);
    String[] expected = {
        "fred, jim, sheila",
        "2, 3, 5, 7",
        "ceathar",
        "naoi",
    };
    boolean ok = true;
    for (String expect : expected) {
        if (s.contains(expect))
            System.out.println("OK: string contains <" + expect + ">");
        else {
            ok = false;
            System.out.println("NOT OK: string does not contain <" +
                    expect + ">");
        }
    }
    if (ok)
        System.out.println("TEST PASSED");
    else
        throw new Exception("TEST FAILED: string did not contain expected substrings");
}
 
源代码3 项目: jdk8u60   文件: CompositeDataStringTest.java
public static void main(String[] args) throws Exception {
    CompositeType basicCT = new CompositeType(
            "basicCT", "basic CompositeType",
            new String[] {"name", "value"},
            new String[] {"name", "value"},
            new OpenType<?>[] {SimpleType.STRING, SimpleType.INTEGER});
    CompositeType ct = new CompositeType(
            "noddy", "descr",
            new String[] {"strings", "ints", "cds"},
            new String[] {"string array", "int array", "composite data array"},
            new OpenType<?>[] {
                ArrayType.getArrayType(SimpleType.STRING),
                ArrayType.getPrimitiveArrayType(int[].class),
                ArrayType.getArrayType(basicCT)
            });
    CompositeData basicCD1 = new CompositeDataSupport(
            basicCT, new String[] {"name", "value"}, new Object[] {"ceathar", 4});
    CompositeData basicCD2 = new CompositeDataSupport(
            basicCT, new String[] {"name", "value"}, new Object[] {"naoi", 9});
    CompositeData cd = new CompositeDataSupport(
            ct,
            new String[] {"strings", "ints", "cds"},
            new Object[] {
                new String[] {"fred", "jim", "sheila"},
                new int[] {2, 3, 5, 7},
                new CompositeData[] {basicCD1, basicCD2}
            });
    String s = cd.toString();
    System.out.println("CompositeDataSupport.toString(): " + s);
    String[] expected = {
        "fred, jim, sheila",
        "2, 3, 5, 7",
        "ceathar",
        "naoi",
    };
    boolean ok = true;
    for (String expect : expected) {
        if (s.contains(expect))
            System.out.println("OK: string contains <" + expect + ">");
        else {
            ok = false;
            System.out.println("NOT OK: string does not contain <" +
                    expect + ">");
        }
    }
    if (ok)
        System.out.println("TEST PASSED");
    else
        throw new Exception("TEST FAILED: string did not contain expected substrings");
}
 
源代码4 项目: openjdk-jdk8u   文件: CompositeDataStringTest.java
public static void main(String[] args) throws Exception {
    CompositeType basicCT = new CompositeType(
            "basicCT", "basic CompositeType",
            new String[] {"name", "value"},
            new String[] {"name", "value"},
            new OpenType<?>[] {SimpleType.STRING, SimpleType.INTEGER});
    CompositeType ct = new CompositeType(
            "noddy", "descr",
            new String[] {"strings", "ints", "cds"},
            new String[] {"string array", "int array", "composite data array"},
            new OpenType<?>[] {
                ArrayType.getArrayType(SimpleType.STRING),
                ArrayType.getPrimitiveArrayType(int[].class),
                ArrayType.getArrayType(basicCT)
            });
    CompositeData basicCD1 = new CompositeDataSupport(
            basicCT, new String[] {"name", "value"}, new Object[] {"ceathar", 4});
    CompositeData basicCD2 = new CompositeDataSupport(
            basicCT, new String[] {"name", "value"}, new Object[] {"naoi", 9});
    CompositeData cd = new CompositeDataSupport(
            ct,
            new String[] {"strings", "ints", "cds"},
            new Object[] {
                new String[] {"fred", "jim", "sheila"},
                new int[] {2, 3, 5, 7},
                new CompositeData[] {basicCD1, basicCD2}
            });
    String s = cd.toString();
    System.out.println("CompositeDataSupport.toString(): " + s);
    String[] expected = {
        "fred, jim, sheila",
        "2, 3, 5, 7",
        "ceathar",
        "naoi",
    };
    boolean ok = true;
    for (String expect : expected) {
        if (s.contains(expect))
            System.out.println("OK: string contains <" + expect + ">");
        else {
            ok = false;
            System.out.println("NOT OK: string does not contain <" +
                    expect + ">");
        }
    }
    if (ok)
        System.out.println("TEST PASSED");
    else
        throw new Exception("TEST FAILED: string did not contain expected substrings");
}
 
public static void main(String[] args) throws Exception {
    CompositeType basicCT = new CompositeType(
            "basicCT", "basic CompositeType",
            new String[] {"name", "value"},
            new String[] {"name", "value"},
            new OpenType<?>[] {SimpleType.STRING, SimpleType.INTEGER});
    CompositeType ct = new CompositeType(
            "noddy", "descr",
            new String[] {"strings", "ints", "cds"},
            new String[] {"string array", "int array", "composite data array"},
            new OpenType<?>[] {
                ArrayType.getArrayType(SimpleType.STRING),
                ArrayType.getPrimitiveArrayType(int[].class),
                ArrayType.getArrayType(basicCT)
            });
    CompositeData basicCD1 = new CompositeDataSupport(
            basicCT, new String[] {"name", "value"}, new Object[] {"ceathar", 4});
    CompositeData basicCD2 = new CompositeDataSupport(
            basicCT, new String[] {"name", "value"}, new Object[] {"naoi", 9});
    CompositeData cd = new CompositeDataSupport(
            ct,
            new String[] {"strings", "ints", "cds"},
            new Object[] {
                new String[] {"fred", "jim", "sheila"},
                new int[] {2, 3, 5, 7},
                new CompositeData[] {basicCD1, basicCD2}
            });
    String s = cd.toString();
    System.out.println("CompositeDataSupport.toString(): " + s);
    String[] expected = {
        "fred, jim, sheila",
        "2, 3, 5, 7",
        "ceathar",
        "naoi",
    };
    boolean ok = true;
    for (String expect : expected) {
        if (s.contains(expect))
            System.out.println("OK: string contains <" + expect + ">");
        else {
            ok = false;
            System.out.println("NOT OK: string does not contain <" +
                    expect + ">");
        }
    }
    if (ok)
        System.out.println("TEST PASSED");
    else
        throw new Exception("TEST FAILED: string did not contain expected substrings");
}
 
源代码6 项目: openjdk-jdk9   文件: CompositeDataStringTest.java
public static void main(String[] args) throws Exception {
    CompositeType basicCT = new CompositeType(
            "basicCT", "basic CompositeType",
            new String[] {"name", "value"},
            new String[] {"name", "value"},
            new OpenType<?>[] {SimpleType.STRING, SimpleType.INTEGER});
    CompositeType ct = new CompositeType(
            "noddy", "descr",
            new String[] {"strings", "ints", "cds"},
            new String[] {"string array", "int array", "composite data array"},
            new OpenType<?>[] {
                ArrayType.getArrayType(SimpleType.STRING),
                ArrayType.getPrimitiveArrayType(int[].class),
                ArrayType.getArrayType(basicCT)
            });
    CompositeData basicCD1 = new CompositeDataSupport(
            basicCT, new String[] {"name", "value"}, new Object[] {"ceathar", 4});
    CompositeData basicCD2 = new CompositeDataSupport(
            basicCT, new String[] {"name", "value"}, new Object[] {"naoi", 9});
    CompositeData cd = new CompositeDataSupport(
            ct,
            new String[] {"strings", "ints", "cds"},
            new Object[] {
                new String[] {"fred", "jim", "sheila"},
                new int[] {2, 3, 5, 7},
                new CompositeData[] {basicCD1, basicCD2}
            });
    String s = cd.toString();
    System.out.println("CompositeDataSupport.toString(): " + s);
    String[] expected = {
        "fred, jim, sheila",
        "2, 3, 5, 7",
        "ceathar",
        "naoi",
    };
    boolean ok = true;
    for (String expect : expected) {
        if (s.contains(expect))
            System.out.println("OK: string contains <" + expect + ">");
        else {
            ok = false;
            System.out.println("NOT OK: string does not contain <" +
                    expect + ">");
        }
    }
    if (ok)
        System.out.println("TEST PASSED");
    else
        throw new Exception("TEST FAILED: string did not contain expected substrings");
}
 
源代码7 项目: jdk8u-jdk   文件: CompositeDataStringTest.java
public static void main(String[] args) throws Exception {
    CompositeType basicCT = new CompositeType(
            "basicCT", "basic CompositeType",
            new String[] {"name", "value"},
            new String[] {"name", "value"},
            new OpenType<?>[] {SimpleType.STRING, SimpleType.INTEGER});
    CompositeType ct = new CompositeType(
            "noddy", "descr",
            new String[] {"strings", "ints", "cds"},
            new String[] {"string array", "int array", "composite data array"},
            new OpenType<?>[] {
                ArrayType.getArrayType(SimpleType.STRING),
                ArrayType.getPrimitiveArrayType(int[].class),
                ArrayType.getArrayType(basicCT)
            });
    CompositeData basicCD1 = new CompositeDataSupport(
            basicCT, new String[] {"name", "value"}, new Object[] {"ceathar", 4});
    CompositeData basicCD2 = new CompositeDataSupport(
            basicCT, new String[] {"name", "value"}, new Object[] {"naoi", 9});
    CompositeData cd = new CompositeDataSupport(
            ct,
            new String[] {"strings", "ints", "cds"},
            new Object[] {
                new String[] {"fred", "jim", "sheila"},
                new int[] {2, 3, 5, 7},
                new CompositeData[] {basicCD1, basicCD2}
            });
    String s = cd.toString();
    System.out.println("CompositeDataSupport.toString(): " + s);
    String[] expected = {
        "fred, jim, sheila",
        "2, 3, 5, 7",
        "ceathar",
        "naoi",
    };
    boolean ok = true;
    for (String expect : expected) {
        if (s.contains(expect))
            System.out.println("OK: string contains <" + expect + ">");
        else {
            ok = false;
            System.out.println("NOT OK: string does not contain <" +
                    expect + ">");
        }
    }
    if (ok)
        System.out.println("TEST PASSED");
    else
        throw new Exception("TEST FAILED: string did not contain expected substrings");
}
 
源代码8 项目: hottub   文件: CompositeDataStringTest.java
public static void main(String[] args) throws Exception {
    CompositeType basicCT = new CompositeType(
            "basicCT", "basic CompositeType",
            new String[] {"name", "value"},
            new String[] {"name", "value"},
            new OpenType<?>[] {SimpleType.STRING, SimpleType.INTEGER});
    CompositeType ct = new CompositeType(
            "noddy", "descr",
            new String[] {"strings", "ints", "cds"},
            new String[] {"string array", "int array", "composite data array"},
            new OpenType<?>[] {
                ArrayType.getArrayType(SimpleType.STRING),
                ArrayType.getPrimitiveArrayType(int[].class),
                ArrayType.getArrayType(basicCT)
            });
    CompositeData basicCD1 = new CompositeDataSupport(
            basicCT, new String[] {"name", "value"}, new Object[] {"ceathar", 4});
    CompositeData basicCD2 = new CompositeDataSupport(
            basicCT, new String[] {"name", "value"}, new Object[] {"naoi", 9});
    CompositeData cd = new CompositeDataSupport(
            ct,
            new String[] {"strings", "ints", "cds"},
            new Object[] {
                new String[] {"fred", "jim", "sheila"},
                new int[] {2, 3, 5, 7},
                new CompositeData[] {basicCD1, basicCD2}
            });
    String s = cd.toString();
    System.out.println("CompositeDataSupport.toString(): " + s);
    String[] expected = {
        "fred, jim, sheila",
        "2, 3, 5, 7",
        "ceathar",
        "naoi",
    };
    boolean ok = true;
    for (String expect : expected) {
        if (s.contains(expect))
            System.out.println("OK: string contains <" + expect + ">");
        else {
            ok = false;
            System.out.println("NOT OK: string does not contain <" +
                    expect + ">");
        }
    }
    if (ok)
        System.out.println("TEST PASSED");
    else
        throw new Exception("TEST FAILED: string did not contain expected substrings");
}
 
public static void main(String[] args) throws Exception {
    CompositeType basicCT = new CompositeType(
            "basicCT", "basic CompositeType",
            new String[] {"name", "value"},
            new String[] {"name", "value"},
            new OpenType<?>[] {SimpleType.STRING, SimpleType.INTEGER});
    CompositeType ct = new CompositeType(
            "noddy", "descr",
            new String[] {"strings", "ints", "cds"},
            new String[] {"string array", "int array", "composite data array"},
            new OpenType<?>[] {
                ArrayType.getArrayType(SimpleType.STRING),
                ArrayType.getPrimitiveArrayType(int[].class),
                ArrayType.getArrayType(basicCT)
            });
    CompositeData basicCD1 = new CompositeDataSupport(
            basicCT, new String[] {"name", "value"}, new Object[] {"ceathar", 4});
    CompositeData basicCD2 = new CompositeDataSupport(
            basicCT, new String[] {"name", "value"}, new Object[] {"naoi", 9});
    CompositeData cd = new CompositeDataSupport(
            ct,
            new String[] {"strings", "ints", "cds"},
            new Object[] {
                new String[] {"fred", "jim", "sheila"},
                new int[] {2, 3, 5, 7},
                new CompositeData[] {basicCD1, basicCD2}
            });
    String s = cd.toString();
    System.out.println("CompositeDataSupport.toString(): " + s);
    String[] expected = {
        "fred, jim, sheila",
        "2, 3, 5, 7",
        "ceathar",
        "naoi",
    };
    boolean ok = true;
    for (String expect : expected) {
        if (s.contains(expect))
            System.out.println("OK: string contains <" + expect + ">");
        else {
            ok = false;
            System.out.println("NOT OK: string does not contain <" +
                    expect + ">");
        }
    }
    if (ok)
        System.out.println("TEST PASSED");
    else
        throw new Exception("TEST FAILED: string did not contain expected substrings");
}
 
源代码10 项目: openjdk-8   文件: CompositeDataStringTest.java
public static void main(String[] args) throws Exception {
    CompositeType basicCT = new CompositeType(
            "basicCT", "basic CompositeType",
            new String[] {"name", "value"},
            new String[] {"name", "value"},
            new OpenType<?>[] {SimpleType.STRING, SimpleType.INTEGER});
    CompositeType ct = new CompositeType(
            "noddy", "descr",
            new String[] {"strings", "ints", "cds"},
            new String[] {"string array", "int array", "composite data array"},
            new OpenType<?>[] {
                ArrayType.getArrayType(SimpleType.STRING),
                ArrayType.getPrimitiveArrayType(int[].class),
                ArrayType.getArrayType(basicCT)
            });
    CompositeData basicCD1 = new CompositeDataSupport(
            basicCT, new String[] {"name", "value"}, new Object[] {"ceathar", 4});
    CompositeData basicCD2 = new CompositeDataSupport(
            basicCT, new String[] {"name", "value"}, new Object[] {"naoi", 9});
    CompositeData cd = new CompositeDataSupport(
            ct,
            new String[] {"strings", "ints", "cds"},
            new Object[] {
                new String[] {"fred", "jim", "sheila"},
                new int[] {2, 3, 5, 7},
                new CompositeData[] {basicCD1, basicCD2}
            });
    String s = cd.toString();
    System.out.println("CompositeDataSupport.toString(): " + s);
    String[] expected = {
        "fred, jim, sheila",
        "2, 3, 5, 7",
        "ceathar",
        "naoi",
    };
    boolean ok = true;
    for (String expect : expected) {
        if (s.contains(expect))
            System.out.println("OK: string contains <" + expect + ">");
        else {
            ok = false;
            System.out.println("NOT OK: string does not contain <" +
                    expect + ">");
        }
    }
    if (ok)
        System.out.println("TEST PASSED");
    else
        throw new Exception("TEST FAILED: string did not contain expected substrings");
}
 
源代码11 项目: jdk8u_jdk   文件: CompositeDataStringTest.java
public static void main(String[] args) throws Exception {
    CompositeType basicCT = new CompositeType(
            "basicCT", "basic CompositeType",
            new String[] {"name", "value"},
            new String[] {"name", "value"},
            new OpenType<?>[] {SimpleType.STRING, SimpleType.INTEGER});
    CompositeType ct = new CompositeType(
            "noddy", "descr",
            new String[] {"strings", "ints", "cds"},
            new String[] {"string array", "int array", "composite data array"},
            new OpenType<?>[] {
                ArrayType.getArrayType(SimpleType.STRING),
                ArrayType.getPrimitiveArrayType(int[].class),
                ArrayType.getArrayType(basicCT)
            });
    CompositeData basicCD1 = new CompositeDataSupport(
            basicCT, new String[] {"name", "value"}, new Object[] {"ceathar", 4});
    CompositeData basicCD2 = new CompositeDataSupport(
            basicCT, new String[] {"name", "value"}, new Object[] {"naoi", 9});
    CompositeData cd = new CompositeDataSupport(
            ct,
            new String[] {"strings", "ints", "cds"},
            new Object[] {
                new String[] {"fred", "jim", "sheila"},
                new int[] {2, 3, 5, 7},
                new CompositeData[] {basicCD1, basicCD2}
            });
    String s = cd.toString();
    System.out.println("CompositeDataSupport.toString(): " + s);
    String[] expected = {
        "fred, jim, sheila",
        "2, 3, 5, 7",
        "ceathar",
        "naoi",
    };
    boolean ok = true;
    for (String expect : expected) {
        if (s.contains(expect))
            System.out.println("OK: string contains <" + expect + ">");
        else {
            ok = false;
            System.out.println("NOT OK: string does not contain <" +
                    expect + ">");
        }
    }
    if (ok)
        System.out.println("TEST PASSED");
    else
        throw new Exception("TEST FAILED: string did not contain expected substrings");
}
 
源代码12 项目: jdk8u-jdk   文件: CompositeDataStringTest.java
public static void main(String[] args) throws Exception {
    CompositeType basicCT = new CompositeType(
            "basicCT", "basic CompositeType",
            new String[] {"name", "value"},
            new String[] {"name", "value"},
            new OpenType<?>[] {SimpleType.STRING, SimpleType.INTEGER});
    CompositeType ct = new CompositeType(
            "noddy", "descr",
            new String[] {"strings", "ints", "cds"},
            new String[] {"string array", "int array", "composite data array"},
            new OpenType<?>[] {
                ArrayType.getArrayType(SimpleType.STRING),
                ArrayType.getPrimitiveArrayType(int[].class),
                ArrayType.getArrayType(basicCT)
            });
    CompositeData basicCD1 = new CompositeDataSupport(
            basicCT, new String[] {"name", "value"}, new Object[] {"ceathar", 4});
    CompositeData basicCD2 = new CompositeDataSupport(
            basicCT, new String[] {"name", "value"}, new Object[] {"naoi", 9});
    CompositeData cd = new CompositeDataSupport(
            ct,
            new String[] {"strings", "ints", "cds"},
            new Object[] {
                new String[] {"fred", "jim", "sheila"},
                new int[] {2, 3, 5, 7},
                new CompositeData[] {basicCD1, basicCD2}
            });
    String s = cd.toString();
    System.out.println("CompositeDataSupport.toString(): " + s);
    String[] expected = {
        "fred, jim, sheila",
        "2, 3, 5, 7",
        "ceathar",
        "naoi",
    };
    boolean ok = true;
    for (String expect : expected) {
        if (s.contains(expect))
            System.out.println("OK: string contains <" + expect + ">");
        else {
            ok = false;
            System.out.println("NOT OK: string does not contain <" +
                    expect + ">");
        }
    }
    if (ok)
        System.out.println("TEST PASSED");
    else
        throw new Exception("TEST FAILED: string did not contain expected substrings");
}
 
源代码13 项目: jdk8u-dev-jdk   文件: CompositeDataStringTest.java
public static void main(String[] args) throws Exception {
    CompositeType basicCT = new CompositeType(
            "basicCT", "basic CompositeType",
            new String[] {"name", "value"},
            new String[] {"name", "value"},
            new OpenType<?>[] {SimpleType.STRING, SimpleType.INTEGER});
    CompositeType ct = new CompositeType(
            "noddy", "descr",
            new String[] {"strings", "ints", "cds"},
            new String[] {"string array", "int array", "composite data array"},
            new OpenType<?>[] {
                ArrayType.getArrayType(SimpleType.STRING),
                ArrayType.getPrimitiveArrayType(int[].class),
                ArrayType.getArrayType(basicCT)
            });
    CompositeData basicCD1 = new CompositeDataSupport(
            basicCT, new String[] {"name", "value"}, new Object[] {"ceathar", 4});
    CompositeData basicCD2 = new CompositeDataSupport(
            basicCT, new String[] {"name", "value"}, new Object[] {"naoi", 9});
    CompositeData cd = new CompositeDataSupport(
            ct,
            new String[] {"strings", "ints", "cds"},
            new Object[] {
                new String[] {"fred", "jim", "sheila"},
                new int[] {2, 3, 5, 7},
                new CompositeData[] {basicCD1, basicCD2}
            });
    String s = cd.toString();
    System.out.println("CompositeDataSupport.toString(): " + s);
    String[] expected = {
        "fred, jim, sheila",
        "2, 3, 5, 7",
        "ceathar",
        "naoi",
    };
    boolean ok = true;
    for (String expect : expected) {
        if (s.contains(expect))
            System.out.println("OK: string contains <" + expect + ">");
        else {
            ok = false;
            System.out.println("NOT OK: string does not contain <" +
                    expect + ">");
        }
    }
    if (ok)
        System.out.println("TEST PASSED");
    else
        throw new Exception("TEST FAILED: string did not contain expected substrings");
}