Package com.googlecode.gwt.test.exceptions

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


         } else if ("delegate".equals(value)) {
            delegates.add(key);
         } else if ("src-directory".equals(value)) {
            processSrcDirectory(key);
         } else {
            throw new GwtTestConfigurationException("Error in '" + url.getPath()
                     + "' : unknown value '" + value + "'");
         }
      }

   }
View Full Code Here


         }
      }

      if (classpathUrls == null) {
         // should never happen
         throw new GwtTestConfigurationException("Unable to collect classpath entries");
      }

      for (URL classpathUrl : classpathUrls) {
         srcDirectories.add(classpathUrl);

         if (!classpathUrl.getPath().endsWith(".jar")) {
            // we are only interested in directory files from eventual referenced java project in
            // workspace
            try {
               collectEventualSourceDirectories(new File(classpathUrl.toURI()), 2, 0);
            } catch (URISyntaxException e) {
               throw new GwtTestConfigurationException(
                        "Error while getting source folder(s) related to path "
                                 + classpathUrl.getPath(), e);
            }
         }
      }
View Full Code Here

            process(p, url);
            LOGGER.debug("File loaded and processed " + url.toString());
         }

         if (gwtModules.size() == 0) {
            throw new GwtTestConfigurationException(
                     "No declared module. Did you forget to add your own META-INF/gwt-test-utils.properties file with a 'gwt-module' property in the test classpath?");
         }

      } catch (IOException e) {
         throw new GwtTestConfigurationException("Error while reading '" + CONFIG_FILENAME
                  + "' files", e);
      }
   }
View Full Code Here

   private static URL getURLToUse() {
      if (urlHolder.url == null) {
         try {
            urlHolder.url = new URL(GWT.getHostPageBaseURL() + computePath() + Location.getHash());
         } catch (MalformedURLException e) {
            throw new GwtTestConfigurationException(
                     "GWT.getHostPageBaseURL() has failed to be parsed in a " + URL.class.getName()
                              + " instance", e);
         }
      }
View Full Code Here

      }

      try {
         return Class.forName(servletClassName, true, GwtFactory.get().getClassLoader());
      } catch (ClassNotFoundException e) {
         throw new GwtTestConfigurationException("Cannot find servlet class '" + servletClassName
                  + "' configured for servlet path '" + remoteServicePath + "'");
      }
   }
View Full Code Here

         } catch (FileNotFoundException e) {
            // try next
         }
      }

      throw new GwtTestConfigurationException("Cannot find GWT module configuration file '"
               + moduleFilePath + "' in the classpath");
   }
View Full Code Here

      } catch (Exception e) {
         if (GwtTestException.class.isInstance(e)) {
            throw (GwtTestException) e;
         } else {
            throw new GwtTestConfigurationException("Error while parsing GWT module '" + moduleName
                     + "'", e);
         }
      }
   }
View Full Code Here

   public void setupGwtModule(Class<?> testClass) {
      GwtModule gwtModule = testClass.getAnnotation(GwtModule.class);

      if (gwtModule == null) {
         throw new GwtTestConfigurationException("The test class " + testClass.getName()
                  + " must be annotated with @" + GwtModule.class.getSimpleName()
                  + " to specify the fully qualified name of the GWT module to test");
      }

      String moduleName = gwtModule.value();

      if (moduleName == null || "".equals(moduleName.trim())) {
         throw new GwtTestConfigurationException("Incorrect value for @"
                  + GwtModule.class.getSimpleName() + " on " + testClass.getName() + ": "
                  + moduleName);
      }

      if (!GwtFactory.get().getConfigurationLoader().getGwtModules().contains(moduleName)) {
         throw new GwtTestConfigurationException(
                  "The tested @GwtModule '"
                           + moduleName
                           + "' configured in "
                           + testClass.getName()
                           + " has not been found. Did you forget to declare a 'gwt-module' property in your 'META-INF/gwt-test-utils.properties' configuration file ?");
View Full Code Here

         ModuleSpace moduleSpace = createModuleSpace(moduleSpaceHost);
         moduleSpaceHost.onModuleReady(moduleSpace);

         return moduleSpaceHost;
      } catch (UnableToCompleteException e) {
         throw new GwtTestConfigurationException("Error while creating global ModuleSpaceHost :", e);
      }
   }
View Full Code Here

         customGeneratedClasses = initCustomGeneratedClasses();
      }

      for (Class<?> clazz : customGeneratedClasses) {
         if (clazz.isAssignableFrom(classLiteral)) {
            throw new GwtTestConfigurationException(
                     "A custom Generator should be used to instanciate '"
                              + classLiteral.getName()
                              + "', but gwt-test-utils does not support GWT compiler API, so you have to add our own GwtCreateHandler with 'GwtTest.addGwtCreateHandler(..)' method or to declare your tested object with @Mock");
         }
      }
View Full Code Here

TOP

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

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.