Package org.apache.ws.notification.subscription

Examples of org.apache.ws.notification.subscription.SubscriptionTableManager


    * @throws Exception
    */
   public void testCreateSubscriptionTable(  )
   throws Exception
   {
      SubscriptionTableManager mgr = SubscriptionTableManagerFactory.createSubscriptionTableManager(  );

      mgr.initialize(  );

      SubscriptionTable table = mgr.createSubscriptionTable(  );

      Subscription      sub1  = createSubscription( 1 );
      Subscription      sub2  = createSubscription( 2 );
      Subscription      sub3  = createSubscription( 3 );
      Subscription      xsub4 = createExpiredSubscription( 4 );
      Subscription      xsub5 = createExpiredSubscription( 5 );

      table.addSubscription( sub1 );
      table.addSubscription( sub2 );
      table.addSubscription( sub3 );
      table.addSubscription( xsub4 );
      table.addSubscription( xsub5 );

      assertEquals( "3 subscriptions should have been left", 3,
                    table.getSubscribers( sub1.getResourceProps(  ).getTopicExpression(  ) ).length );

      mgr.shutdown(  );

      return;
   }
View Full Code Here


   /**
    * Make sure subscription tables and manager are serializable.
    */
   public void testSubscriptionTableSerialization(  )
   {
      SubscriptionTableManager mgr;
      SubscriptionTable        table;
      Subscription             t1;
      Subscription             t2;

      mgr =
         SubscriptionTableManagerFactory.createSubscriptionTableManager( SubscriptionTableManagerFactory.MANAGER_TYPE_MEMORY );

      mgr.initialize(  );

      table    = mgr.createSubscriptionTable(  );
      t1       = createSubscription( 1 );
      t2       = createSubscription( 2 );

      table.addSubscription( t1 );
      table.addSubscription( t2 );

      assertEquals( 2,
                    table.getSubscriptionCount(  ) );

      t1       = (Subscription) roundTrip( t1 );
      table    = (SubscriptionTable) roundTrip( table );
      mgr      = (SubscriptionTableManager) roundTrip( mgr );

      // make sure the deserialized table maintained its subscriptions
      assertEquals( 2,
                    table.getSubscriptionCount(  ) );

      mgr.shutdown(  );
   }
View Full Code Here

TOP

Related Classes of org.apache.ws.notification.subscription.SubscriptionTableManager

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.