The wiki document has been updated for this change.

http://code.google.com/p/aost/wiki/Tellurium070Update#Tellurium_Configuration

On Fri, Apr 9, 2010 at 5:30 PM, John <[email protected]> wrote:

> Hi All,
>
> I have put the configuration file name into the Environment class,
> i.e.,
>
> @Singleton
> public class Environment implements Configurable{
>
>  protected String configFileName = "TelluriumConfig.groovy";
>
> ...
> }
>
> You could get hold on this singleton and change the configuration file
> name before
> the Tellurium core gets started if you really want to.
>
> In the meanwhile, I added the support to pass in a JSON string as the
> configuration.
>
> @Singleton
> public class Environment implements Configurable{
>
>  protected String configFileName = "TelluriumConfig.groovy";
>
>  protected String configString = "";
>
> ...
> }
>
> If the variable configString is not empty, the JSON string will be
> honored first and Tellurium
> core will not look at the configuration file.
>
> One way to use the JSON string is illustrated by the following
> example.
>
> public class JettyLogonJUnitTestCase extends
> TelluriumMockJUnitTestCase {
>    private static JettyLogonModule jlm;
>    static{
>        Environment env = Environment.getEnvironment();
>        env.useConfigString(JettyLogonModule.JSON_CONF);
>    }
>
> where variable JSON_CONF is the JSON configuration string.
>
> public class JettyLogonModule extends DslContext {
>  public static String JSON_CONF = """{"tellurium":{"test":{"result":
>
> {"reporter":"XMLResultReporter","filename":"TestResult.output","output":"Console"},"exception":
>
> {"filenamePattern":"Screenshot?.png","captureScreenshot":false},"execution":
> {"trace":false}},"accessor":{"checkElement":false},"embeddedserver":
>
> {"port":"4444","browserSessionReuse":false,"debugMode":false,"ensureCleanSession":false,"interactive":false,"avoidProxy":false,"timeoutInSeconds":
>
> 30,"runInternally":true,"trustAllSSLCertificates":true,"useMultiWindows":false,"userExtension":"","profile":""},"uiobject":
> {"builder":{}},"eventhandler":
> {"checkElement":false,"extraEvent":false},"connector":
> {"baseUrl":"http://localhost:
>
> 8080","port":"4444","browser":"*chrome","customClass":"","serverHost":"localhost","options":""},"bundle":
> {"maxMacroCmd":5,"useMacroCommand":true},"datadriven":{"dataprovider":
> {"reader":"PipeFileReader"}},"widget":{"module":{"included":""}}}}""";
>
> ...
> }
>
> It is not elegant to use the static{} block. Is there any better way
> to pass in the JSON string before Tellurium core starts?
> I don't know any other options since the @BeforeClass method in the
> parent class will always be called first. If you do have
> some workarounds, please let me know.
>
> Thanks,
>
> Jian
>
> On Apr 1, 9:18 pm, Jian Fang <[email protected]> wrote:
> > Ok, let us keep TelluriumConfig.groovy as it is now.
> >
> > Thanks for your feedback.
> >
> > Jian
> >
> > On Thu, Apr 1, 2010 at 10:08 AM, Robert Fletcher <
> >
> > [email protected]> wrote:
> > > It is by no means a big deal to load a different file.
> >
> > > On Thu, Apr 1, 2010 at 2:01 PM, Jian Fang <[email protected]>
> > > wrote:
> > > > I see, you prefer the existing name TelluriumConfig.groovy, right?
> >
> > > --
> > > You received this message because you are subscribed to the Google
> Groups
> > > "tellurium-users" group.
> > > To post to this group, send email to [email protected].
> > > To unsubscribe from this group, send email to
> > > [email protected]<tellurium-users%[email protected]>
> <tellurium-users%[email protected]<tellurium-users%[email protected]>
> >
> > > .
> > > For more options, visit this group at
> > >http://groups.google.com/group/tellurium-users?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups
> "tellurium-users" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<tellurium-users%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/tellurium-users?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"tellurium-users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/tellurium-users?hl=en.

Reply via email to