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);
}
In addition to making it easier to provide new implementations without a fully.qualified.ClassName on the command line, it will also make it easier to move standard implementations out of the gwt-dev.jar classpath - decoupling jetty versions (htmlunit uses jetty 9's websocket client, and dev mode presently defaults to jetty 9, see #10057).
Command line usage then can look like -runStyle WebDriver:http://localhost:4444/?firefox.
The text was updated successfully, but these errors were encountered:
Note that ServletContainerLauncher has a default constructor, so it can be its own ServiceLoader provider (or rather, it can be a provide for the ServletContainer implementation).
RunStyle however cannot, as the existing RunStyle constructor takes a JUnitShell argument. As such, it will need a RunStyleProvider interface added that projects may contribute to the classpath.
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):
In addition to making it easier to provide new implementations without a fully.qualified.ClassName on the command line, it will also make it easier to move standard implementations out of the gwt-dev.jar classpath - decoupling jetty versions (htmlunit uses jetty 9's websocket client, and dev mode presently defaults to jetty 9, see #10057).
Command line usage then can look like
-runStyle WebDriver:http://localhost:4444/?firefox
.The text was updated successfully, but these errors were encountered: