Package org.openuri.enumtest

Examples of org.openuri.enumtest.StatusreportDocument


    public EnumTests(String name) { super(name); }
    public static Test suite() { return new TestSuite(EnumTests.class); }

    public static void testReport1() throws Exception
    {
        StatusreportDocument doc = (StatusreportDocument)
                    XmlObject.Factory.parse(TestEnv.xbeanCase("enumtest/report1.xml"));

        Quantity.Enum[] contents = new Quantity.Enum[]
        {
            Quantity.ALL,
            Quantity.ALL,
            Quantity.FEW,
            Quantity.ALL,
            Quantity.MOST,
            Quantity.NONE,
            Quantity.NONE,
            Quantity.NONE,
        };
        Data[] data = doc.getStatusreport().getStatusArray();
        int t = 0;
        for (int i = 0; i < data.length; i++)
        {
            Assert.assertEquals(contents[t++], data[i].enumValue());
            // System.out.println("Target: " + data[i].getTarget() + ", value: " + data[i].enumValue());
View Full Code Here


        }
    }

    public static void testReport2() throws Exception
    {
        StatusreportDocument doc = StatusreportDocument.Factory.newInstance();
        StatusreportDocument.Statusreport report = doc.addNewStatusreport();

        Data d = report.addNewStatus();
        d.set(Quantity.ALL);
        d.setTarget(Quantity.ALL);

        d = report.addNewStatus();
        d.set(Quantity.FEW);
        d.setTarget(Quantity.ALL);

        d = report.addNewStatus();
        d.set(Quantity.MOST);
        d.setTarget(Quantity.NONE);

        d = report.addNewStatus();
        d.set(Quantity.NONE);
        d.setTarget(Quantity.NONE);

        Quantity.Enum[] contents = new Quantity.Enum[]
        {
            Quantity.ALL,
            Quantity.ALL,
            Quantity.FEW,
            Quantity.ALL,
            Quantity.MOST,
            Quantity.NONE,
            Quantity.NONE,
            Quantity.NONE,
        };
        Data[] data = doc.getStatusreport().getStatusArray();
        int t = 0;
        for (int i = 0; i < data.length; i++)
        {
            Assert.assertEquals(contents[t++], data[i].enumValue());
            // System.out.println("Target: " + data[i].getTarget() + ", value: " + data[i].enumValue());
View Full Code Here

    public EnumTests(String name) { super(name); }
    public static Test suite() { return new TestSuite(EnumTests.class); }

    public static void testReport1() throws Exception
    {
        StatusreportDocument doc = (StatusreportDocument)
                    XmlObject.Factory.parse(TestEnv.xbeanCase("enumtest/report1.xml"));

        Quantity.Enum[] contents = new Quantity.Enum[]
        {
            Quantity.ALL,
            Quantity.ALL,
            Quantity.FEW,
            Quantity.ALL,
            Quantity.MOST,
            Quantity.NONE,
            Quantity.NONE,
            Quantity.NONE,
        };
        Data[] data = doc.getStatusreport().getStatusArray();
        int t = 0;
        for (int i = 0; i < data.length; i++)
        {
            Assert.assertEquals(contents[t++], data[i].enumValue());
            // System.out.println("Target: " + data[i].getTarget() + ", value: " + data[i].enumValue());
View Full Code Here

TOP

Related Classes of org.openuri.enumtest.StatusreportDocument

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.