Diego | 11 May 2012 17:51
Picon

Variable path

Hello, I am launching my script as follows

java -cp lib/costello.jar -DappPath=app.jar junit.extensions.abbot.ScriptFixture
GLOBALRegression

in the test the launch step is as follows:

<launch args="[]" class="app.AwmApp" classpath="${appPath}" desc="Launch
app.AwmApp.main([)" method="main" />

If i replaced the ${appPath} with app.jar it will work, but this way I am
getting a app.AwmApp.main no class found... Any ideas??

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
Gerard Davison | 14 May 2012 11:15
Picon
Favicon

Re: Variable path


Hmm,

My understanding is that this would work, have you tried as a sanity check putting in a expression step
previously to trace out the value? If not can you put together a trivial test case, raise a bug and I will look
into why this doesn't work. I don't run my tests this way so I am not overly familiar with this process.

Thanks,

Gerard

On 11 May 2012, at 16:51, Diego wrote:

> Hello, I am launching my script as follows
> 
> java -cp lib/costello.jar -DappPath=app.jar junit.extensions.abbot.ScriptFixture
> GLOBALRegression
> 
> 
> in the test the launch step is as follows:
> 
> 
> <launch args="[]" class="app.AwmApp" classpath="${appPath}" desc="Launch
> app.AwmApp.main([)" method="main" />
> 
> 
> If i replaced the ${appPath} with app.jar it will work, but this way I am
> getting a app.AwmApp.main no class found... Any ideas??
> 
> 
(Continue reading)

Diego | 14 May 2012 18:17
Picon

Re: Variable path

Gerard Davison <gerard.davison <at> oracle.com> writes:

> 
> 
> Hmm,
> 
> My understanding is that this would work, have you tried as a sanity check
putting in a expression step
> previously to trace out the value? If not can you put together a trivial test
case, raise a bug and I will look
> into why this doesn't work. I don't run my tests this way so I am not overly
familiar with this process.
> 
> Thanks,
> 
> Gerard

Gerard, 

You can't put an expression step before the launch step or as it says when it
fails, after the expression step there cannot be a launch step.

If you write the expression after the launch step it still won't run if that
variable is in the launch step since the exception will occur first, and if I
write the correct path directly in the test code, the variable goes in
correctly.

This will work and print the correct path:

<launch args="[]" class="app" classpath="path-to-app/app.jar" method="main" />
(Continue reading)

Gerard Davison | 15 May 2012 11:19
Picon
Favicon

Re: Variable path


You can raise issues here:

http://sourceforge.net/tracker/?atid=461490&group_id=50939&func=browse

But I had a quick look at the code and it looks like this fix is simple so we can skip that step. It looks like a
really simple patch should fix the problem.

--- Launch.java	Tue May 15 10:03:05 2012
+++ Launch.java	Tue May 15 10:03:05 2012
 <at>  <at>  -100 +100,2  <at>  <at> 
-        return new AppClassLoader(classpath);
+        return new AppClassLoader(
+          ArgumentParser.substitute(getResolver(), classpath));

I have committed the fix for the SVN repository, so if you check out the SVN repository and build you should
find the fix there. 

Hope this gets you going, sorry for the confusion,

Gerard

On 14 May 2012, at 17:17, Diego wrote:

> Gerard Davison <gerard.davison <at> oracle.com> writes:
> 
>> 
>> 
>> Hmm,
>> 
(Continue reading)

Timothy Wall | 15 May 2012 12:44
Gravatar

Re: Variable path

The variable substitution was added some time after the rest of the script structure and originally
targeted at just assertion steps, so it wasn't consistently applied everywhere.  There are still a few
places where perhaps it *should* be used for consistency but still is not.

On May 15, 2012, at 5:19 AM, Gerard Davison wrote:

> 
> You can raise issues here:
> 
> http://sourceforge.net/tracker/?atid=461490&group_id=50939&func=browse
> 
> But I had a quick look at the code and it looks like this fix is simple so we can skip that step. It looks like a
really simple patch should fix the problem.
> 
> --- Launch.java	Tue May 15 10:03:05 2012
> +++ Launch.java	Tue May 15 10:03:05 2012
>  <at>  <at>  -100 +100,2  <at>  <at> 
> -        return new AppClassLoader(classpath);
> +        return new AppClassLoader(
> +          ArgumentParser.substitute(getResolver(), classpath));
> 
> I have committed the fix for the SVN repository, so if you check out the SVN repository and build you should
find the fix there. 
> 
> Hope this gets you going, sorry for the confusion,
> 
> Gerard
> 
> 
> 
(Continue reading)

Gerard Davison | 15 May 2012 14:22
Picon
Favicon

Re: Variable path


Tim,

Do you have a vague list in mind? To be honest it has always just work where-ever I have needed it; but I am quite
happy to fix up any missing commands.

Gerard

On 15 May 2012, at 11:44, Timothy Wall wrote:

> The variable substitution was added some time after the rest of the script structure and originally
targeted at just assertion steps, so it wasn't consistently applied everywhere.  There are still a few
places where perhaps it *should* be used for consistency but still is not.
> 
> On May 15, 2012, at 5:19 AM, Gerard Davison wrote:
> 
>> 
>> You can raise issues here:
>> 
>> http://sourceforge.net/tracker/?atid=461490&group_id=50939&func=browse
>> 
>> But I had a quick look at the code and it looks like this fix is simple so we can skip that step. It looks like a
really simple patch should fix the problem.
>> 
>> --- Launch.java	Tue May 15 10:03:05 2012
>> +++ Launch.java	Tue May 15 10:03:05 2012
>>  <at>  <at>  -100 +100,2  <at>  <at> 
>> -        return new AppClassLoader(classpath);
>> +        return new AppClassLoader(
>> +          ArgumentParser.substitute(getResolver(), classpath));
(Continue reading)

Timothy Wall | 15 May 2012 14:49
Gravatar

Re: Variable path

Too vague to be of any use.  I think I plugged it in to generally apply to a few common Step attributes, but never
really analyzed the whole set to see what might have been missed that would still be useful.  I figured it'd
be easy enough to hook up on an as-needed basis, and less work or disruption than adding it *everywhere*.

On May 15, 2012, at 8:22 AM, Gerard Davison wrote:

> 
> Tim,
> 
> Do you have a vague list in mind? To be honest it has always just work where-ever I have needed it; but I am
quite happy to fix up any missing commands.
> 
> Gerard
> 
> 
> On 15 May 2012, at 11:44, Timothy Wall wrote:
> 
>> The variable substitution was added some time after the rest of the script structure and originally
targeted at just assertion steps, so it wasn't consistently applied everywhere.  There are still a few
places where perhaps it *should* be used for consistency but still is not.
>> 
>> On May 15, 2012, at 5:19 AM, Gerard Davison wrote:
>> 
>>> 
>>> You can raise issues here:
>>> 
>>> http://sourceforge.net/tracker/?atid=461490&group_id=50939&func=browse
>>> 
>>> But I had a quick look at the code and it looks like this fix is simple so we can skip that step. It looks like a
really simple patch should fix the problem.
(Continue reading)

Diego | 16 May 2012 00:46
Picon

Re: Variable path

Gerard Davison <gerard.davison <at> oracle.com> writes:

> 
> 
> You can raise issues here:
> 
> http://sourceforge.net/tracker/?atid=461490&group_id=50939&func=browse
> 
> But I had a quick look at the code and it looks like this fix is simple so we
can skip that step. It looks like a
> really simple patch should fix the problem.
> 
> --- Launch.java	Tue May 15 10:03:05 2012
> +++ Launch.java	Tue May 15 10:03:05 2012
>  <at>  <at>  -100 +100,2  <at>  <at> 
> -        return new AppClassLoader(classpath);
> +        return new AppClassLoader(
> +          ArgumentParser.substitute(getResolver(), classpath));
> 
> I have committed the fix for the SVN repository, so if you check out the SVN
repository and build you should
> find the fix there. 
> 
> Hope this gets you going, sorry for the confusion,
> 
> Gerard
> 

Gerard,

(Continue reading)

Gerard Davison | 16 May 2012 14:58
Picon
Favicon

Re: Variable path


Diego,

Turns out this fix is a little bit more engineering so can you raise a bug for this so I don't forget to do it at
some point in the future?

You can override the global default timeout though if this is of any help? You can do this by overriding the
"abbot.assert.default_timeout" system property, there is a similar property for the interval value.

Gerard

On 15 May 2012, at 23:46, Diego wrote:

> Gerard Davison <gerard.davison <at> oracle.com> writes:
> 
>> 
>> 
>> You can raise issues here:
>> 
>> http://sourceforge.net/tracker/?atid=461490&group_id=50939&func=browse
>> 
>> But I had a quick look at the code and it looks like this fix is simple so we
> can skip that step. It looks like a
>> really simple patch should fix the problem.
>> 
>> --- Launch.java	Tue May 15 10:03:05 2012
>> +++ Launch.java	Tue May 15 10:03:05 2012
>>  <at>  <at>  -100 +100,2  <at>  <at> 
>> -        return new AppClassLoader(classpath);
>> +        return new AppClassLoader(
(Continue reading)


Gmane