Package com.googlecode.gwt.test.exceptions

Examples of com.googlecode.gwt.test.exceptions.GwtTestRpcException


   public static ServletMockProvider ensureServletMockProvider(
            AbstractRemoteServiceServlet servlet, String methodName) {
      ServletMockProvider servletMockProvider = GwtConfig.get().getModuleRunner().getServletMockProvider();
      if (servletMockProvider == null) {
         throw new GwtTestRpcException("Illegal call to " + servlet.getClass().getName() + "."
                  + methodName + " : You have to set a valid "
                  + ServletMockProvider.class.getSimpleName() + " instance through "
                  + GwtConfig.get().getModuleRunner().getClass().getSimpleName()
                  + ".setServletMockProvider(..) method");
      }
View Full Code Here


      String asyncName = className + "Async";
      String relativePath = getRemoveServiceRelativePath(classLiteral);
      Class<?> asyncClazz = GwtReflectionUtils.getClass(asyncName);
      if (asyncClazz == null) {
         throw new GwtTestRpcException("Remote serivce Async class not found : " + asyncName);
      }
      logger.debug("Searching remote service implementing " + className);

      // try to find
      Object service = findService(classLiteral, relativePath);
View Full Code Here

            if (annotation.getTypeName().equals(RemoteServiceRelativePath.class.getName())) {
               return ((StringMemberValue) annotation.getAnnotation().getMemberValue("value")).getValue();
            }
         }
      }
      throw new GwtTestRpcException("Cannot find the '@"
               + RemoteServiceRelativePath.class.getSimpleName()
               + "' annotation on RemoteService interface '" + clazz.getName() + "'");
   }
View Full Code Here

         for (Map.Entry<Field, Object> entry : buffer.entrySet()) {
            entry.getKey().set(ex, entry.getValue());
         }

      } catch (Exception e) {
         throw new GwtTestRpcException("Error during deserialization of object "
                  + ex.getClass().getName(), e);
      }

   }
View Full Code Here

            Object[] serializedArgs = new Object[subArgs.length];
            for (int i = 0; i < subArgs.length; i++) {
               try {
                  serializedArgs[i] = serializerHander.serializeUnserialize(subArgs[i]);
               } catch (Exception e) {
                  throw new GwtTestRpcException("Error while serializing argument " + i
                           + " of type " + subArgs[i].getClass().getName() + " in method "
                           + method.getDeclaringClass().getSimpleName() + "." + method.getName()
                           + "(..)", e);
               }
            }

            // notify
            for (RemoteServiceExecutionHandler handler : handlers) {
               handler.beforeRpcRequestSerialization(m, serializedArgs);
            }

            AbstractRemoteServiceServletPatcher.currentCalledMethod = m;

            // notify
            for (RemoteServiceExecutionHandler handler : handlers) {
               handler.beforeRpcMethodExecution(m, serializedArgs);
            }

            Object resultObject = m.invoke(target, serializedArgs);

            // notify
            for (RemoteServiceExecutionHandler handler : handlers) {
               handler.afterRpcMethodExecution(m, resultObject);
            }

            Object returnObject;
            try {
               // notify
               for (RemoteServiceExecutionHandler handler : handlers) {
                  handler.beforeRpcResponseSerialization(m, resultObject);
               }
               returnObject = serializerHander.serializeUnserialize(resultObject);
               // notify
               for (RemoteServiceExecutionHandler handler : handlers) {
                  handler.afterRpcResponseSerialization(m, returnObject);
               }
            } catch (Exception e) {
               throw new GwtTestRpcException("Error while serializing object of type "
                        + resultObject.getClass().getName()
                        + " which was returned from RPC Service "
                        + method.getDeclaringClass().getSimpleName() + "." + method.getName()
                        + "(..)", e);
            }
View Full Code Here

TOP

Related Classes of com.googlecode.gwt.test.exceptions.GwtTestRpcException

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.