Package org.openuri.mytest

Examples of org.openuri.mytest.Person


        CustomerDocument doc =
            CustomerDocument.Factory.parse(
                TestEnv.xbeanCase("schema/simple/person.xml"), null);

        // Move from the root to the root customer element
        Person person = doc.getCustomer();
        Assert.assertEquals("Howdy", person.getFirstname());
        Assert.assertEquals(4,   person.sizeOfNumberArray());
        Assert.assertEquals(436, person.getNumberArray(0));
        Assert.assertEquals(123, person.getNumberArray(1));
        Assert.assertEquals(44,  person.getNumberArray(2));
        Assert.assertEquals(933, person.getNumberArray(3));
        Assert.assertEquals(2,   person.sizeOfBirthdayArray());
        Assert.assertEquals(new Date("Tue Aug 25 17:00:00 PDT 1998"), person.getBirthdayArray(0));

        Person.Gender.Enum g = person.getGender();
        Assert.assertEquals(Person.Gender.MALE, g);

        Assert.assertEquals("EGIQTWYZJ", new String(person.getHex()));
        Assert.assertEquals("This string is base64Binary encoded!",
                            new String(person.getBase64()));

        Assert.assertEquals("GGIQTWYGG", new String(person.getHexAtt()));
        Assert.assertEquals("This string is base64Binary encoded!",
                            new String(person.getBase64Att()));

        person.setFirstname("George");
        Assert.assertEquals("George", person.getFirstname());

        person.setHex("hex encoding".getBytes());
        Assert.assertEquals("hex encoding", new String(person.getHex()));

        person.setBase64("base64 encoded".getBytes());
        Assert.assertEquals("base64 encoded",
                            new String(person.getBase64()));

        //person.setHexAtt("hex encoding in attributes".getBytes());
        //Assert.assertEquals("hex encoding in attributes",
        //                    new String(person.getHexAtt()));
View Full Code Here


            cursor.setText("933");
            cursor.toNext();
            cursor.setText("2000-08-06-08:00");
            cursor.toRoot();
            cursor.toFirstChild();
            Person person = (Person)cursor.obj();
            System.err.println("Person.getFirstname() = " + person.getFirstname());
            int sum = 0;
            for (int i = 0; i < person.countOfNumber(); i++)
            {
                System.err.println("Person.getNumber(" + i +") = " + person.getNumber(i));
                sum += person.getNumber(i);
            }
            System.err.println("sum of numbers = " + sum);
            for (int i = 0; i < person.countOfBirthday(); i++)
            {
                System.err.println("Person.getBirthday(" + i +") = " + person.getBirthday(i));
                System.err.println("Person.xgetBirthday(" + i +") = " + person.xgetBirthday(i));
                System.err.println("Person.xgetBirthday(" + i +").gDateValue().getDay() = " + person.xgetBirthday(i).gDateValue().getDay());
                sum += person.getNumber(i);
            }
            System.err.println("Setting firstname to George");
            person.setFirstname("George");
            System.err.println("Person.getFirstname() = " + person.getFirstname());
            System.err.flush();
        }

    }
View Full Code Here

TOP

Related Classes of org.openuri.mytest.Person

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.