Package org.jboss.remoting.callback

Examples of org.jboss.remoting.callback.CallbackStore


   private boolean passes = false;
  
   public void testNonserializableCallbackJavaSerialization()
   {
      log.info("entering " + getName());
      CallbackStore store = null;
     
      try
      {
         store = new CallbackStore();
         HashMap config = new HashMap();
         String path = getClass().getResource(".").getPath();
         config.put(CallbackStore.FILE_PATH_KEY, path);
         store.setConfig(config);
         store.start();
        
         Callback callback = new Callback(new NonserializablePayload(7));
        
         try
         {
            store.add(callback);
            fail();
         }
         catch (NotSerializableException e)
         {
            log.info("got expected exception");
         }
         catch (Exception e)
         {
            log.error(e);
            e.printStackTrace();
            fail();
         }
        
         passes = true;
      }
      catch (Throwable t)
      {
         log.error(t);
         t.printStackTrace();
         fail();
      }
      finally
      {
         store.purgeFiles();
         store.stop();
        
         if (passes)
            log.info(getName() + " PASSES");
         else
            log.info(getName() + " FAILS");
View Full Code Here


  
  
   public void testNonserializableCallbackJBossSerialization()
   {
      log.info("entering " + getName());
      CallbackStore store = null;
     
      try
      {
         store = new CallbackStore();
         HashMap config = new HashMap();
         String path = getClass().getResource(".").getPath();
         config.put(CallbackStore.FILE_PATH_KEY, path);
         config.put(InvokerLocator.SERIALIZATIONTYPE, "jboss");
         store.setConfig(config);
         store.start();
        
         Object payload = new NonserializablePayload(11);
         Callback callback = new Callback(payload);
        
         try
         {
            store.add(callback);
         }
         catch (Exception e)
         {
            log.error(e);
            e.printStackTrace();
            fail();
         }
        
         Callback retrievedCallback = (Callback) store.getNext();
         Object retrievedPayload = retrievedCallback.getParameter();
         assertTrue(payload.equals(retrievedPayload));
        
         passes = true;
      }
      catch (Throwable t)
      {
         log.error(t);
         t.printStackTrace();
         fail();
      }
      finally
      {
         store.purgeFiles();
         store.stop();
        
         if (passes)
            log.info(getName() + " PASSES");
         else
            log.info(getName() + " FAILS");
View Full Code Here

   private boolean passes = false;
  
   public void testNonserializableCallbackJavaSerialization()
   {
      log.info("entering " + getName());
      CallbackStore store = null;
     
      try
      {
         store = new CallbackStore();
         HashMap config = new HashMap();
         String path = getClass().getResource(".").getPath();
         config.put(CallbackStore.FILE_PATH_KEY, path);
         store.setConfig(config);
         store.start();
        
         Callback callback = new Callback(new NonserializablePayload(7));
        
         try
         {
            store.add(callback);
            fail();
         }
         catch (NotSerializableException e)
         {
            log.info("got expected exception");
         }
         catch (Exception e)
         {
            log.error(e);
            e.printStackTrace();
            fail();
         }
        
         passes = true;
      }
      catch (Throwable t)
      {
         log.error(t);
         t.printStackTrace();
         fail();
      }
      finally
      {
         store.purgeFiles();
         store.stop();
        
         if (passes)
            log.info(getName() + " PASSES");
         else
            log.info(getName() + " FAILS");
View Full Code Here

  
  
   public void testNonserializableCallbackJBossSerialization()
   {
      log.info("entering " + getName());
      CallbackStore store = null;
     
      try
      {
         store = new CallbackStore();
         HashMap config = new HashMap();
         String path = getClass().getResource(".").getPath();
         config.put(CallbackStore.FILE_PATH_KEY, path);
         config.put(InvokerLocator.SERIALIZATIONTYPE, "jboss");
         store.setConfig(config);
         store.start();
        
         Object payload = new NonserializablePayload(11);
         Callback callback = new Callback(payload);
        
         try
         {
            store.add(callback);
         }
         catch (Exception e)
         {
            log.error(e);
            e.printStackTrace();
            fail();
         }
        
         Callback retrievedCallback = (Callback) store.getNext();
         Object retrievedPayload = retrievedCallback.getParameter();
         assertTrue(payload.equals(retrievedPayload));
        
         passes = true;
      }
      catch (Throwable t)
      {
         log.error(t);
         t.printStackTrace();
         fail();
      }
      finally
      {
         store.purgeFiles();
         store.stop();
        
         if (passes)
            log.info(getName() + " PASSES");
         else
            log.info(getName() + " FAILS");
View Full Code Here

TOP

Related Classes of org.jboss.remoting.callback.CallbackStore

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.