Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not possible to use javax.swing.JLayer as context #63

Closed
lindmik opened this issue Feb 6, 2015 · 3 comments
Closed

Not possible to use javax.swing.JLayer as context #63

lindmik opened this issue Feb 6, 2015 · 3 comments
Milestone

Comments

@lindmik
Copy link

lindmik commented Feb 6, 2015

Java 7 adds a new class javax.swing.JLayer, which we use for the root components of the tabs of a tabbed pane. When selecting the tab as the context in Robot we get an TestFailedException stating that the current context is not a "correct context".

Adding javax.swing.JLayer to the expected classes array in DefaultContextVerifier fixes the issue, but it creates a dependency on Java 7 from SwingLibrary.

@jussimalinen
Copy link
Member

Damn... I think we should probably drop java 1.6 support at some point, but we cant drop that support yet. If you have an idea how to do this so that we still support 1.6, we could then fix this right away.

@lindmik
Copy link
Author

lindmik commented Feb 9, 2015

Only thing I can think of is reflection. Something like

try {
    Class class1 = Class.forName("javax.swing.JLayer");
    classes.add(class1);
} catch (ClassNotFoundException e) {
    // Java version < 1.7
}

Though, I noticed that your tests use a mocking framework to create instances of the classes, and javax.swing.JLayer is a final class which cannot be mocked.

@pekkaklarck
Copy link
Member

RF 2.9 is is going to require Jython 2.7 which in turn requires Java 7. Those who need to still use Java 6 (or 5) can obviously keep on using SwingLibrary with RF 2.8 or older, but perhaps they could also keep on using older SwingLibrary versions. Perhaps creating one more minor release with Java 6 support and then dropping it in the next major release would be a good plan.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants