Package org.apache.harmony.jndi.tests.javax.naming.spi.mock.ldap

Examples of org.apache.harmony.jndi.tests.javax.naming.spi.mock.ldap.MockUnsolicitedNotification


  /**
   * Test for the class javax.naming.ldap.UnsolicitedNotificationEvent
   *
   */
  public void testUnsolicitedNotificationEvent(){
      MockUnsolicitedNotification mun=new MockUnsolicitedNotification();
      UnsolicitedNotificationEvent une=new UnsolicitedNotificationEvent(new Object(), mun);
      UnsolicitedNotificationEvent une2=null;
    try{
      ByteArrayOutputStream buffer = new ByteArrayOutputStream();
      ObjectOutput out = new ObjectOutputStream(buffer);
View Full Code Here


   * one null arguments. This is not specified in the API.</p>
   * <p>The expected result is an Illegal Argument exception.</p>
   */
  public void testUnsolicitedNotificationEvent003() {
        try {
            MockUnsolicitedNotification u = new MockUnsolicitedNotification();
            new UnsolicitedNotificationEvent(null, u);
            fail("The arguments could not be null.");
        } catch (IllegalArgumentException e) {}
    }
View Full Code Here

   * <p>This is the constructor method that constructs a new instance of UnsolicitedNotificationEvent. In this case we are sending
   * one null arguments. This is not specified in the API.</p>
   * <p>The expected result is an Illegal Argument exception.</p>
   */
  public void testUnsolicitedNotificationEvent004() {
        MockUnsolicitedNotification u = new MockUnsolicitedNotification();
        new UnsolicitedNotificationEvent(new Object(), u);
    }
View Full Code Here

   * with an object and a null notification as the parameters.</p>
   * <p>The expected result is a not null notification.</p>
   */
  public void testGetNotification002() {
        Object x = new Object();
        MockUnsolicitedNotification u = new MockUnsolicitedNotification();
        UnsolicitedNotificationEvent une = new UnsolicitedNotificationEvent(x, u);
        assertEquals(u, une.getNotification());
    }
View Full Code Here

   * <p>The expected result is a null pointer exception.</p>
   */
  public void testDispatch001() {
        Object x = new Object();
        UnsolicitedNotificationEvent une = new UnsolicitedNotificationEvent(x,
                new MockUnsolicitedNotification());
        try {
            une.dispatch(null);
            fail("Failed notification is null.");
        } catch (NullPointerException e) {}
    }
View Full Code Here

   * sending as a parameter a non null listener.</p>
   * <p>The expected result is a null pointer exception.</p>
   */
  public void testDispatch002() {
        Object x = new Object();
        MockUnsolicitedNotification u = new MockUnsolicitedNotification();
        MockUnsolicitedNotification f = new MockUnsolicitedNotification();
        UnsolicitedNotificationEvent une = new UnsolicitedNotificationEvent(x, u);
        une.dispatch(f);
        assertTrue(f.getFlag());
    }
View Full Code Here

TOP

Related Classes of org.apache.harmony.jndi.tests.javax.naming.spi.mock.ldap.MockUnsolicitedNotification

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.