Unit tests on german Mac

40 views
Skip to first unread message

niels

unread,
Sep 22, 2010, 12:21:00 AM9/22/10
to windowlicker-users
Hello!

I am trying to fix the unit tests of windowlicker for using them on a
german Mac.

The first failing test is
JFileChooserDriverTest.testCanClickCancelButton(). After some
debugging I found that KeyboardLayout.defaultKeyboardLayoutName does
return "Mac-" instead "Mac-DE":

private static String defaultKeyboardLayoutName() {
String country =
InputContext.getInstance().getLocale().getCountry();
return Platform.is(Platform.Mac) ? "Mac-" + country : country;
}

Is this a known bug? I am using

$ java -version
java version "1.6.0_20"
Java(TM) SE Runtime Environment (build 1.6.0_20-b02-279-10M3065)
Java HotSpot(TM) 64-Bit Server VM (build 16.3-b01-279, mixed mode)

thanks
Niels

Nat Pryce

unread,
Sep 23, 2010, 2:51:17 AM9/23/10
to windowlic...@googlegroups.com
That sounds odd.  InputContext.getInstance().getLocale().getCountry() should return a value.  Maybe it's a bug in Apple's JVM. I'll see if I can reproduce it on my Mac.  Can you raise an issue in the windowlicker issue tracker?

As a workaround, you can explicitly set the keyboard layout name by setting the com.objogate.wl.keyboard system property.

--Nat


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




--
http://www.natpryce.com

niels

unread,
Sep 26, 2010, 3:43:20 PM9/26/10
to windowlicker-users
Hello!

More interesting observations on running the JUnit tests of
windowlicker on a german Mac OS 10.6.4:

I am not sure if this this normal behavior or if something is wrong
with my setup:
Currently I am trying to fix
"JFileChooserDriverTest.testCanClickCancelButton". It fails with the
following result:

--- snip ---
WARNING: could not load keyboard layout Mac-, using fallback layout
with reduced capabilities (/Users/coellen/Sources/windowlicker/
windowlicker-read-only/classes/production/windowlicker/com/objogate/wl/
keyboard/Mac- (No such file or directory))

java.lang.AssertionError:
Tried to find:
exactly 1 JButton (with text matching 'Cancel')
in the exact JFileChooser '"javax.swing.JFileChooser[,
0,0,550x400,invalid,layout=javax.swing.BoxLayout,alignmentX=0.0,alignmentY=0.0,border=,flags=320,maximumSize=,minimumSize=,preferredSize=,approveButtonText=Go,currentDirectory=/
Users/coellen/Sources/windowlicker/windowlicker-read-only/build/
grandparent.dir/parent.dir/
child.dir,dialogTitle=,dialogType=CUSTOM_DIALOG,fileSelectionMode=FILES_ONLY,returnValue=ERROR_OPTION,selectedFile=,useFileHiding=true]"'
and check that it is showing on screen
but:

contained 0 JButton (with text matching 'Cancel')
at com.objogate.wl.PollingProber.check(PollingProber.java:38)
at
com.objogate.wl.swing.driver.ComponentDriver.check(ComponentDriver.java:
62)
--- snap ---

The warning was the reason for my first posting. The test does fail
because the "Cancel"-Button could not be found. I started playing with
the VM parameters -Duser.language and -Duser.country (de, DE; en,
US; ...), but it did not solve the problem. The Swing labels were
still in german but date and time of the file were changing.

Any ideas?
Niels

P.S.: I tried running the tests with soylatte 1.0.3 instead of Apple
Java but this did fail too with an X11 failure.

James Richardson

unread,
Sep 27, 2010, 5:47:07 PM9/27/10
to windowlic...@googlegroups.com

There are quite a few issues with the tests for sone components wirh the mac look and feel.
Really they should be cleared up, and categorised into those that will and wont work - the more specialised components are particularly troublesome.
It doesnt have any effect on the rest of the library though...
James

> I am trying to fix the unit tests o...

Reply all
Reply to author
Forward
0 new messages