You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The -runStyle and -server flags of JUnitShell and DevMode respectively take an optional classname, which can be irritating to fully populate. The -server flag defaults to using a built in class without naming it, com.google.gwt.dev.shell.JettyLauncher (see #10057 to consider changing that default), while the -runStyle flag supports Manual, Selenium (hugely out of date), HtmlUnit, and ExternalBrowser (officially unsupported, but will attempt to run if referenced by name).
Both of these features are worthy to extend and make more useful, but can be irritating to enter a fully qualified class name, especially when canonical implementations are supported by simple name.
This ticket proposes to introduce an optional factory type for this sort of feature, which would allow a create(...) method to be defined on it, and would already have a String getName() method, something like
publicinterfaceNamedFactory {
StringgetName();
}
Subtypes of this would add their create() method, and implementations of the factory could then be picked up by a ServiceLoader call, and tested to ensure their names don't collide. A user-specified name then can be used in addition to the fully qualified class name (which would continue to work to avoid the factory where one doesn't exist or where there is a collision).
Example (written without the aid of an IDE, missing duplicate checking, exception handling, etc):
New class to add within GWT itself, to load by name as needed
publicinterfaceRunStyleFactoryextendsNamedFactory {
staticRunStylecreate(JUnitShellshell, Stringname) {
for (RunStyleFactoryf : ServiceLoader.load(RunStyleFactory.class)) {
if (f.getName().equals(name)) {
returnf.create(shell);
}
}
returnClass.forName(name);
}
RunStylecreate(JUnitShellshell);
}
The
-runStyle
and-server
flags of JUnitShell and DevMode respectively take an optional classname, which can be irritating to fully populate. The-server
flag defaults to using a built in class without naming it,com.google.gwt.dev.shell.JettyLauncher
(see #10057 to consider changing that default), while the-runStyle
flag supportsManual
,Selenium
(hugely out of date),HtmlUnit
, andExternalBrowser
(officially unsupported, but will attempt to run if referenced by name).Both of these features are worthy to extend and make more useful, but can be irritating to enter a fully qualified class name, especially when canonical implementations are supported by simple name.
This ticket proposes to introduce an optional factory type for this sort of feature, which would allow a create(...) method to be defined on it, and would already have a
String getName()
method, something likeSubtypes of this would add their create() method, and implementations of the factory could then be picked up by a ServiceLoader call, and tested to ensure their names don't collide. A user-specified name then can be used in addition to the fully qualified class name (which would continue to work to avoid the factory where one doesn't exist or where there is a collision).
Example (written without the aid of an IDE, missing duplicate checking, exception handling, etc):
New class to add within GWT itself, to load by name as needed
Example factory provided in a library for WebDriver support (something like https://github.com/gwtproject/gwt-core/pull/14/files):
Command line usage then can look like
-runStyle WebDriver:http://localhost:4444/?firefox
.The text was updated successfully, but these errors were encountered: