use of com.googlecode.gwt.test.exceptions.GwtTestConfigurationException in project gwt-test-utils by gwt-test-utils.
the class ModuleData method parseModule.
private void parseModule(String moduleName) {
try {
Document document = createDocument(moduleName);
XPath xpath = XPathFactory.newInstance().newXPath();
parseModuleFile(moduleName, document, xpath);
alias = getModuleAlias(document, xpath);
} catch (Exception e) {
if (GwtTestException.class.isInstance(e)) {
throw (GwtTestException) e;
} else {
throw new GwtTestConfigurationException("Error while parsing GWT module '" + moduleName + "'", e);
}
}
}
use of com.googlecode.gwt.test.exceptions.GwtTestConfigurationException in project gwt-test-utils by gwt-test-utils.
the class DeferredGenerateWithCreateHandler method initCustomGeneratedClasses.
private Set<Class<?>> initCustomGeneratedClasses() {
Set<Class<?>> result = new HashSet<Class<?>>();
String moduleName = GwtConfig.get().getTestedModuleName();
for (String className : ModuleData.get(moduleName).getCustomGeneratedClasses()) {
try {
result.add(GwtReflectionUtils.getClass(className));
} catch (ClassNotFoundException e) {
throw new GwtTestConfigurationException("Cannot find class configured to be instanced with a custom 'generate-with' Generator : '" + className + "'");
}
}
return result;
}
use of com.googlecode.gwt.test.exceptions.GwtTestConfigurationException in project gwt-test-utils by gwt-test-utils.
the class ConfigurationLoader method readFiles.
private void readFiles() {
try {
Enumeration<URL> configFiles = Thread.currentThread().getContextClassLoader().getResources(CONFIG_FILENAME);
while (configFiles.hasMoreElements()) {
URL url = configFiles.nextElement();
LOGGER.debug("Load config file " + url.toString());
Properties p = new Properties();
InputStream inputStream = url.openStream();
p.load(inputStream);
inputStream.close();
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);
}
}
use of com.googlecode.gwt.test.exceptions.GwtTestConfigurationException in project gwt-test-utils by gwt-test-utils.
the class ConfigurationLoader method process.
private void process(Properties p, URL url) {
for (Entry<Object, Object> entry : p.entrySet()) {
String key = ((String) entry.getKey()).trim();
String value = ((String) entry.getValue()).trim();
if ("gwt-module".equals(value)) {
gwtModules.add(key);
} else if ("scan-package".equals(value)) {
scanPackages.add(key);
} 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 + "'");
}
}
}
use of com.googlecode.gwt.test.exceptions.GwtTestConfigurationException in project gwt-test-utils by gwt-test-utils.
the class GeneratorCreateHandler method createModuleSpaceHost.
private ModuleSpaceHost createModuleSpaceHost(CompilationState compilationState, ModuleDef moduleDef) {
try {
ModuleSpaceHost moduleSpaceHost = new GwtTestModuleSpaceHost(GwtTreeLogger.get(), compilationState, moduleDef, null, ARTIFACT_ACCEPTOR, REBIND_CACHE);
ModuleSpace moduleSpace = createModuleSpace(moduleSpaceHost);
moduleSpaceHost.onModuleReady(moduleSpace);
return moduleSpaceHost;
} catch (UnableToCompleteException e) {
throw new GwtTestConfigurationException("Error while creating global ModuleSpaceHost :", e);
}
}
Aggregations