Testing Swing Apps

Monday, November 9th, 2015

I need to write some end-to-end tests for a Swing GUI application, likely running on Linux. Note that these are not unit tests. I am not testing through the API. Rather I am launching the application (in this case IntelliJ IDEA with our plugins installed) and select menu items, press buttons, read the screen, and so forth.

What tools are folks using for this? Open source strongly preferred (since the plugins we’re testing are open source) but this is not absolutely required.

Quick Java Favor

Monday, February 18th, 2013

If anyone out there has the JDK installed on Windows, could you run this program and tell me what output you get, and what version of Windows and the JDK you’re using?

import java.nio.charset.*;

public class URLtest {
    public static void main(String[] args) {
        System.out.println(Charset.defaultCharset());
    }
}

Just leave a comment with the info. Thanks.

How to Tell Where Eclipse Finds a Class?

Saturday, January 3rd, 2009

I’m debugging a weird class loading issue in XOM. Some of my unit tests can find the Crimson parser. Some can’t. I don’t know why. In Eclipse, I can press F3 and it locates both the class and corresponding source for this jar. But where did it find it? is there any way to see where (i.e. path in the file system) that class came from?

Error occurred during initialization of VM java/lang/ClassNotFoundException: error in opening JAR file /usr/local/java/jre/lib/rt.jar

Saturday, November 17th, 2007

Just a little Google fodder. Should you encounter this uncommon error message when trying to compile or run a Java program:

$ javac -version
Error occurred during initialization of VM
java/lang/ClassNotFoundException: error in opening JAR file /usr/local/java/jre/lib/rt.jar

it means that your installation of the JDK, and likely your original download is corrupt. Delete it, download again, and reinstall. This can occur with essentially any Java program: the interpreter, the compiler, jar, or a program merely written in Java such as LimeWire.

For reasons that aren’t especially clear, this bug seems to occur most frequently on Ubuntu Linux 7.10 Gutsy Gibbon when running in a virtualized environment such as VMWare. At least those seem to be the common factors for everyone else I found with this problem when googling it myself.

SQLAlchemy for Java

Thursday, June 28th, 2007

Anyone know of an equivalent of the SQLAlchemy Python data binding library for Java? SQLAlchemy maps Python classes to the records in a table. What distinguishes it from Java-based ORM tools that I’ve seen such as Hibernate is that in SQLAlchemy you can map any table, not just ones that actually exists in the database.

SQLAlchemy doesn’t view databases as just collections of tables; it sees them as relational algebra engines. Its object relational mapper enables classes to be mapped against the database in more than one way. SQL constructs don’t just select from just tables—you can also select from joins, subqueries, and unions. Thus database relationships and domain object models can be cleanly decoupled from the beginning, allowing both sides to develop to their full potential.

(more…)

Choosing a Continuous Integration Server

Saturday, June 2nd, 2007

I’ve been tasked with setting up a continuous integration server for a team Java project. Options are:

We don’t have a strong opinion about any of these. Anyone care to comment on which one we should use and why?