Package com.googlecode.gwt.test.exceptions

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


            urls[i] = new URL(classpathEntries[i]);
         }

         return urls;
      } catch (Exception e) {
         throw new GwtTestException("Error while parsing maven-surefire-plugin booter jar: "
                  + surefireBooterJarPath, e);
      }

   }
View Full Code Here


                  testName);
      }

      clearPendingCommands();

      throw new GwtTestException(errorMessage);

   }
View Full Code Here

         gwtClassLoader = GwtClassLoader.createClassLoader(configurationLoader, compilationState,
                  overlayRewriter);
      } catch (UnableToCompleteException e) {
         // log related errors
         GwtTreeLogger.get().onUnableToCompleteError();
         throw new GwtTestException("Error while generating gwt-test-utils prerequisites", e);
      } finally {
         // reset the default classloader
         Thread.currentThread().setContextClassLoader(defaultClassLoader);
      }
   }
View Full Code Here

    *
    * @param gwtModuleRunner The configuration of the module to be run.
    */
   public void setupInstance(GwtModuleRunner gwtModuleRunner) {
      if (this.gwtModuleRunner != null) {
         throw new GwtTestException(
                  "Because of the single-threaded nature of the GWT environment, gwt-test-utils tests can not be run in multiple thread at the same time");
      }

      this.gwtModuleRunner = gwtModuleRunner;
      this.moduleAlias = ModuleData.get(testedModuleName).getAlias();
View Full Code Here

      Configuration cfg = new Configuration();
      cfg.setObjectWrapper(ObjectWrapper.DEFAULT_WRAPPER);

      XTemplate xTemplate = method.getAnnotation(XTemplate.class);
      if (xTemplate == null) {
        throw new GwtTestException(
            "gwt-test-utils expects to find a @XTemplate annotation on method "
                + method.toString());
      }

      String templateName = method.toGenericString();

      if (xTemplate.source().length() > 0) {
        InputStream in = method.getDeclaringClass().getResourceAsStream(
            xTemplate.source());

        if (in == null) {
          throw new GwtTestException("Cannot find file @Template source file "
              + xTemplate.source() + " declared for method " + method);
        }
        BufferedReader br = new BufferedReader(new InputStreamReader(in));
        try {
          return new Template(templateName, br, cfg);
        } catch (IOException e) {
          throw new GwtTestException(
              "Error while trying to get template for method " + method);
        }
      } else {
        return Template.getPlainTextTemplate(templateName, xTemplate.value(),
            cfg);
View Full Code Here

         String error = (throwables.size() == 1)
                  ? "One exception thrown during gwt-test-utils cleanup phase : "
                  : throwables.size()
                           + " exceptions thrown during gwt-test-utils cleanup phase. First one is thrown :";

         throw new GwtTestException(error, throwables.get(0));
      }

   }
View Full Code Here

    private BindingPropertySetInvocationHandler(Class<?> proxiedClass) {
      this.proxiedClass = proxiedClass;
      this.propertyName = JavassistUtils.getInvisibleAnnotationStringValue(
          proxiedClass, PropertyName.class, "value");
      if (propertyName == null) {
        throw new GwtTestException(proxiedClass.getName()
            + " must be annotated with @" + PropertyName.class.getSimpleName());
      }
    }
View Full Code Here

    public Object invoke(Object proxy, Method method, Object[] args)
        throws Throwable {
      String propertyValue = JavassistUtils.getInvisibleAnnotationStringValue(
          method, PropertyValue.class, "value");
      if (propertyValue == null) {
        throw new GwtTestException(method.toString()
            + " must be annotated with @" + PropertyValue.class.getSimpleName());
      }

      if (method.getReturnType() != Boolean.TYPE
          && method.getReturnType() != Boolean.class) {
        throw new GwtTestException(proxiedClass.getName()
            + " must return a boolean");
      }

      return propertyValue.equals(GwtConfig.get().getModuleRunner().getClientProperty(
          propertyName));
View Full Code Here

         } else {
            return new GwtClassLoaderWithRewriter(configurationLoader, compilationState,
                     overlayRewriter);
         }
      } catch (Exception e) {
         throw new GwtTestException("Error during " + GwtClassLoader.class.getSimpleName()
                  + " instanciation :", e);
      }
   }
View Full Code Here

TOP

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

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.