Static Imports

213 views
Skip to first unread message

kembrek

unread,
Jul 25, 2016, 7:25:57 PM7/25/16
to gosu-lang
I just updated some toy code I had to use static imports for JUnit/Hamcrest things:


I created the above from the skeleton maven project when I created it originally.

When I run mvn clean install, it doesn't seem to compile/run my unit tests.

If you want to run my example:
 
git clone https://github.com/hiraethus/GosuMaven/
cd GosuMaven
git checkout -b bug/staticImportJunitNotRunning origin/bug/staticImportJunitNotRunning
mvn clean install

and then compare to before adding the static imports (also the gosu version is 1.10):

git checkout master
mvn clean install

You'll notice for master, it will run the tests but for bug/StaticImportJunitNotRunning it doesn't seem to compile the test classes.


The static imports seem to work for me otherwise. I created this staticImport.gs script and ran it with gosu 1.14 and it worked:

uses java.lang.String#format
uses java.util.ArrayList
var output = format("Answer to life, the Universe and Everything: %d", new Object[]{42})
print(output)

 
Is there something I'm doing incorrectly? Many thanks in advance - I'd like to have been able to work out why for myself :)

Kyle Moore

unread,
Jul 25, 2016, 8:03:28 PM7/25/16
to gosu...@googlegroups.com
Hi Mike.

Your project looks fine, this might be a bug in the parser. We are investigating. Hang tight!

- Kyle


--
You received this message because you are subscribed to the Google Groups "gosu-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gosu-lang+...@googlegroups.com.
To post to this group, send email to gosu...@googlegroups.com.
Visit this group at https://groups.google.com/group/gosu-lang.
For more options, visit https://groups.google.com/d/optout.

kembrek

unread,
Jul 25, 2016, 8:30:24 PM7/25/16
to gosu-lang
Man you're fast acting! Thanks Kyle

Scott McKinney

unread,
Aug 2, 2016, 6:33:59 PM8/2/16
to gosu-lang
We just released 1.14.1, which includes a fix for the problem reported here.

Cheers.

Patrick Simon

unread,
Sep 29, 2016, 1:26:02 AM9/29/16
to gosu-lang
I'm using ClaimCenter v8.

Are static imports available in the version of Gosu that ships with it?

Also, it appears that functions that are scoped "protected" on enhancement classes are not available in test classes within the same package (where as "protected" methods on POGO's are)

Kyle Moore

unread,
Sep 29, 2016, 12:47:09 PM9/29/16
to gosu...@googlegroups.com
Since static imports were released rather recently, this feature has not yet been incorporated in any Guidewire products. As a workaround, you could create a private instance method on the class you are using and have it wrap the call to the static method and return value, if any.

Unfortunately we can't answer any other Guidewire-related questions here. Please go through the proper Guidewire support channels for that.

Thanks,

Kyle

--
You received this message because you are subscribed to the Google Groups "gosu-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gosu-lang+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages