New user to Caciocacallo
Mario Torre
neugens.limasoftware at gmail.com
Wed May 9 01:13:46 PDT 2012
2012/5/9 Nathan Anderson <nanderson at sum-ware.com>:
> Greetings all,
Hello Nathan,
> I'm new to Cacio and didn't have much success in my first attempt at getting
> my FEST project to run under Cacio-TTA. I suspect my setup is unusual so
> let me start with explaining what I am trying to do so someone can tell me
> if it should even work in theory ;)
>
> My project uses FEST to script the interaction with a Java Applet. The
> applet is developed by another company and is the only interface we have to
> interact with a remote system. Because I'm scripting the interaction with
> the applet rather than testing an UI I have built a stand alone application
> that doesn't use any test framework, but instead I just create my
> own AppletViewer, FrameFixture and Robot and manipulate them as needed.
Seems a very interesting setup.
> For a while I was able to develop in Eclipse (Helios) on my Windows 7 64-bit
> workstation, and deploy to Ubuntu 10.04 Gnome. However the most recent
> version of the applet no longer renders correctly in Ubuntu (certain
> critical AWT elements are not visible when they should be).
>
> What I have tried to do with Cacio so far is to use it on my Windows
> environment:
> Downloaded Oracle JDK7
> Configured Eclipse to be aware of Oracle JDK7
> Configured the project to use Oracle JDK7
> Downloaded cacio-shared-1.1.jar and cacio-tta-1.1.jar from the maven
> central repository
> Added the .jars to my project
> Added the JVM arguments:
> -Dawt.toolkit=net.java.openjdk.cacio.ctc.CTCToolkit
> -Djava.awt.graphicsenv=net.java.openjdk.cacio.ctc.CTCGraphicsEnvironment
> -Djava.awt.headless=false
>
> I'm getting a few errors:
>
> 1)
> CacioComponentPeer::setZOrder: NOT YET IMPLEMENTED
This is not an exception, but just a warning. We don't support Z
ordering yet... But is on our TODO.
> 2)
> java.lang.ClassCastException: my.package.Applet cannot be cast to
> java.awt.Window
> at
> sun.awt.peer.cacio.CacioWindowPeer.handlePeerEvent(CacioWindowPeer.java:229)
> at
> sun.awt.peer.cacio.managed.FocusManager.focusGained(FocusManager.java:159)
> at
> sun.awt.peer.cacio.managed.FocusManager.setFocusedWindow(FocusManager.java:131)
> at sun.awt.peer.cacio.managed.FocusManager.setVisible(FocusManager.java:103)
> at
> sun.awt.peer.cacio.managed.ManagedWindow.setVisible(ManagedWindow.java:352)
> at
> sun.awt.peer.cacio.CacioComponentPeer.setVisible(CacioComponentPeer.java:660)
> at java.awt.Component.show(Component.java:1618)
> at java.awt.Window.show(Window.java:1042)
We didn't try a setup with applets so far, since it wasn't common for
the kind of uses Cacio was developed initally.
It would be interesting to have some code that triggers this.
I believe the next exception is related, but right now I fail to see
how we end up in the Window peer, since an applet should be a Panel
instead.
Probably the applet passes the focus somehow to the enclosing Window,
and for some reason we fail to handle this and crash, not sure (still
need some coffee it seems :), but is indeed very weird.
> 3)
> Exception in thread "main" java.lang.ClassCastException: java.awt.Panel
> cannot be cast to java.awt.Window
> at
> sun.awt.peer.cacio.CacioWindowPeer.handlePeerEvent(CacioWindowPeer.java:229)
> at
> sun.awt.peer.cacio.managed.FocusManager.focusGained(FocusManager.java:159)
> at
> sun.awt.peer.cacio.managed.FocusManager.setFocusedWindow(FocusManager.java:131)
> at sun.awt.peer.cacio.managed.FocusManager.hideWindow(FocusManager.java:113)
> at sun.awt.peer.cacio.managed.FocusManager.setVisible(FocusManager.java:105)
> at
> sun.awt.peer.cacio.managed.ManagedWindow.setVisible(ManagedWindow.java:352)
> at
> sun.awt.peer.cacio.managed.ManagedWindow.setVisible(ManagedWindow.java:349)
> at
> sun.awt.peer.cacio.managed.ManagedWindow.setVisible(ManagedWindow.java:349)
> at
> sun.awt.peer.cacio.managed.ManagedWindow.setVisible(ManagedWindow.java:349)
> at
> sun.awt.peer.cacio.managed.ManagedWindow.setVisible(ManagedWindow.java:349)
> at
> sun.awt.peer.cacio.managed.ManagedWindow.setVisible(ManagedWindow.java:349)
> at
> sun.awt.peer.cacio.managed.ManagedWindow.setVisible(ManagedWindow.java:349)
> at
> sun.awt.peer.cacio.managed.ManagedWindow.setVisible(ManagedWindow.java:349)
> at
> sun.awt.peer.cacio.CacioComponentPeer.setVisible(CacioComponentPeer.java:660)
> at java.awt.Component.hide(Component.java:1688)
> at java.awt.Window.hide(Window.java:1116)
> at java.awt.Window$1DisposeAction.run(Window.java:1188)
> at java.awt.Window.doDispose(Window.java:1205)
> at java.awt.Window.dispose(Window.java:1147)
> at
> org.fest.swing.hierarchy.ExistingHierarchy.dispose(ExistingHierarchy.java:108)
> at org.fest.swing.hierarchy.NewHierarchy.dispose(NewHierarchy.java:156)
> at org.fest.swing.core.BasicRobot.dispose(BasicRobot.java:352)
>
> 4)
> org.fest.swing.exception.EdtViolationException: EDT violation detected
> at java.lang.Thread.getStackTrace(Thread.java:1567)
> at org.fest.util.StackTraces.stackTraceInCurrentThread(StackTraces.java:47)
> at
> org.fest.swing.edt.CheckThreadViolationRepaintManager.checkThreadViolations(CheckThreadViolationRepaintManager.java:78)
> at
> org.fest.swing.edt.CheckThreadViolationRepaintManager.addDirtyRegion(CheckThreadViolationRepaintManager.java:69)
> at
> org.fest.swing.edt.FailOnThreadViolationRepaintManager.addDirtyRegion(FailOnThreadViolationRepaintManager.java:31)
> at javax.swing.JComponent.repaint(JComponent.java:4795)
> at java.awt.Component.repaint(Component.java:3286)
> at
> javax.swing.plaf.basic.BasicComboBoxUI$Handler.contentsChanged(BasicComboBoxUI.java:1841)
> at
> javax.swing.AbstractListModel.fireContentsChanged(AbstractListModel.java:118)
> at
> javax.swing.DefaultComboBoxModel.setSelectedItem(DefaultComboBoxModel.java:94)
> at
> javax.swing.DefaultComboBoxModel.removeElementAt(DefaultComboBoxModel.java:146)
> at sun.awt.peer.cacio.CacioChoicePeer.removeAll(CacioChoicePeer.java:105)
> at java.awt.Choice.removeAll(Choice.java:355)
Yes, this maybe our problem... since AWT is supposed to be thread safe
(and I'll never understand why!), while Cacio calls back into Swing,
and this needs to be in the EDT.
You can quick fix this by using the EDT yourselves, but this is
another thing in our TODO list.
> I can try this on Ubuntu, but I wanted to get an idea if I should even try.
Can you send us some code? Maybe a test case?
Thanks for using Cacio!
Cheers,
Mario
--
pgp key: http://subkeys.pgp.net/ PGP Key ID: 80F240CF
Fingerprint: BA39 9666 94EC 8B73 27FA FC7C 4086 63E3 80F2 40CF
IcedRobot: www.icedrobot.org
Proud GNU Classpath developer: http://www.classpath.org/
Read About us at: http://planet.classpath.org
OpenJDK: http://openjdk.java.net/projects/caciocavallo/
Please, support open standards:
http://endsoftpatents.org/
More information about the caciocavallo-dev
mailing list