Package org.apache.harmony.jndi.tests.javax.naming.util

Examples of org.apache.harmony.jndi.tests.javax.naming.util.Person


public class DirStateFactoryResultTest extends TestCase {
    /**
     * Test Result(Object o, Attributes a) with normal values
     */
    public void testConstructor_Simple() {
        Person person = Person.getInstance();
        BasicAttributes attributes = new BasicAttributes("Anyuser", person);
        String strObj = "Harmony";
        DirStateFactory.Result result =
            new DirStateFactory.Result(strObj, attributes);
        assertEquals(strObj, result.getObject());
View Full Code Here


    /**
     * Test Result(Object o, Attributes a) with the first param o as null
     */
    public void testConstructor_ObjectNull() {
        Person person = Person.getInstance();
        BasicAttributes attributes = new BasicAttributes("Anyuser", person);
        DirStateFactory.Result result =
            new DirStateFactory.Result(null, attributes);
        assertNull(result.getObject());
        assertEquals(attributes, result.getAttributes());
View Full Code Here

        gContext.addToEnvironment(Context.APPLET, applet);
        assertEquals(applet, gContext.getEnvironment().get(Context.APPLET));
    }

    public void testBind() throws NamingException {
        Person person = Person.getInstance();
        Name name = new CompositeName(person.getName());
        gContext.bind(name, person);
        assertTrue(InvokeRecord.equals(null, name, person));
    }
View Full Code Here

        gContext.bind(name, null);
        assertTrue(InvokeRecord.equals(null, name, null));
    }

    public void testBind_url() throws NamingException {
        Person person = Person.getInstance();
        Name name = new CompositeName("'http://www.apache.org/foundation'");
        gContext.bind(name, person);
        assertTrue(InvokeRecord.equals(urlSchema, name, person));
    }
View Full Code Here

        assertTrue(InvokeRecord.equals(urlSchema, name, person));
    }

    public void testBind_name_empty() throws NamingException {
        log.setMethod("testBind_name_empty");
        Person person = Person.getInstance();
        Name name = new CompositeName("");
        gContext.bind(name, person);
        assertTrue(InvokeRecord.equals(null, name, person));
    }
View Full Code Here

        MockActionController actionController = new MockActionController();
        actionController.addAction(
                DazzleActionController.THROW_RUNTIMEEXCEPTION, "1");
        MockContext.setActionController(actionController);

        Person person = Person.getInstance();
        Name name = new CompositeName(person.getName());
        try {
            gContext.bind(name, person);
            fail("Should throw RuntimeException.");
        } catch (RuntimeException e) {
            // log.log(e.getClass().getName());
View Full Code Here

        MockActionController actionController = new MockActionController();
        actionController.addAction(
                DazzleActionController.THROW_NULLPOINTEREXCEPTION, "1");
        MockContext.setActionController(actionController);

        Person person = Person.getInstance();
        Name name = new CompositeName(person.getName());
        try {
            gContext.bind(name, person);
            fail("Should throw NullPointerException.");
        } catch (NullPointerException e) {
            // log.log(e.getClass().getName());
View Full Code Here

        // assertTrue(InvokeRecord.equals(null, name));
    }

    public void testRebind() throws NamingException {
        Name name = new CompositeName("hmy");
        Person person = Person.getInstance();
        gContext.rebind(name, person);
        assertTrue(InvokeRecord.equals(null, name, person));
    }
View Full Code Here

    }

    public void testRebind_namenull() throws NamingException {
        log.setMethod("testRebind_namenull");
        Name name = null;
        Person person = Person.getInstance();
        try {
            gContext.rebind(name, person);
            fail("Should throw NullPointerException.");
        } catch (NullPointerException e) {
            // log.log(e.toString());
View Full Code Here

        // assertTrue(InvokeRecord.equals(null, name, person));
    }

    public void testRebind_url() throws NamingException {
        String name = "http://www.apache.org/foundation";
        Person person = Person.getInstance();
        gContext.rebind(name, person);
        assertTrue(InvokeRecord.equals(urlSchema, name, person));
    }
View Full Code Here

TOP

Related Classes of org.apache.harmony.jndi.tests.javax.naming.util.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.