Examples of UnsolicitedNotificationEvent


Examples of javax.naming.ldap.UnsolicitedNotificationEvent

                    namingEvent.dispatch(listener);
                } else if (event instanceof NamingExceptionEvent) {
                    NamingExceptionEvent exceptionEvent = (NamingExceptionEvent) event;
                    listener.namingExceptionThrown(exceptionEvent);
                } else if (event instanceof UnsolicitedNotificationEvent) {
                    UnsolicitedNotificationEvent namingEvent = (UnsolicitedNotificationEvent) event;
                    namingEvent
                            .dispatch((UnsolicitedNotificationListener) listener);
                }

            }
View Full Code Here

Examples of javax.naming.ldap.UnsolicitedNotificationEvent

        if (obj instanceof UnsolicitedNotification) {

            // Fire UnsolicitedNotification to unsolicited listeners

            UnsolicitedNotificationEvent evt =
                new UnsolicitedNotificationEvent(ctx, (UnsolicitedNotification)obj);
            queueEvent(evt, unsolicited);

        } else if (obj instanceof NamingException) {

            // Fire NamingExceptionEvent to unsolicited listeners.
View Full Code Here

Examples of javax.naming.ldap.UnsolicitedNotificationEvent

   * 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);
      out.writeObject(une);
      out.close();
      ObjectInput in = new ObjectInputStream(new ByteArrayInputStream(buffer.toByteArray()));
      une2 = (UnsolicitedNotificationEvent) in.readObject();
      in.close();
      assertEquals(((MockUnsolicitedNotification)une.getNotification()).getIDSerial(),((MockUnsolicitedNotification)une2.getNotification()).getIDSerial());
     
    }catch (Exception e) {
      fail("Failed with:"+e);
    }
  }
View Full Code Here

Examples of javax.naming.ldap.UnsolicitedNotificationEvent

   * <p>This is the constructor method that constructs a new instance of UnsolicitedNotificationEvent. In this case we are sending
   * two null arguments. This is not specified in the API.</p>
   * <p>The expected result is an Illegal argument exception.</p>
   */
  public void testUnsolicitedNotificationEvent001() {
        new UnsolicitedNotificationEvent(new Object(), null);

        try {
            new UnsolicitedNotificationEvent(null, null);
            fail("The arguments could not be null.");
        } catch (IllegalArgumentException e) {}
    }
View Full Code Here

Examples of javax.naming.ldap.UnsolicitedNotificationEvent

   * <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

Examples of javax.naming.ldap.UnsolicitedNotificationEvent

   * 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

Examples of javax.naming.ldap.UnsolicitedNotificationEvent

   * <p>Here we are testing if the method returns the unsolicited notification. In this case we create a notification
   * with an object and a null notification as the parameters.</p>
   * <p>The expected result is a not null notification.</p>
   */
  public void testGetNotification001() {
        UnsolicitedNotificationEvent une = new UnsolicitedNotificationEvent(
                new Object(), null);

        assertNull(une.getNotification());
    }
View Full Code Here

Examples of javax.naming.ldap.UnsolicitedNotificationEvent

   * <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

Examples of javax.naming.ldap.UnsolicitedNotificationEvent

   * sending as a parameter a null listener.</p>
   * <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

Examples of javax.naming.ldap.UnsolicitedNotificationEvent

   */
  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
Copyright © 2018 www.massapi.com. 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.