Skip to main content

help building swingx with ant

10 replies [Last post]
paultaylor
Offline
Joined: 2003-12-04
Points: 0

Hi, Im trying to build the latest swingx from cvs in order to get the latest highlighter stuff, but I'm failing with

[javac] D:\Code\jthink\opensrc\swing-incubator-cvs\swingx\src\test\org\jdesktop\swingx\DefaultDateSelectionModelTest.java:26: package junit.framew
ork does not exist
[javac] import junit.framework.TestCase;

Im aware there was a problem with ant and junit but I have tried against both ant 1.6.2 and ant 1.7 and in both cases renamed junit-4.jar to junit.jar and put in ants lib folder without any success. I use junit in my own project without any problems, can someone point me in the right direction please.

paul

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
rah003
Offline
Joined: 2004-05-26
Points: 0

>but I do need a swingx.jar at the end of it, can I disable the tests
Yes, as an alternative you can also remove offending tests, although as Karl pointed out it would be more interesting to figure out why those tests are failing. Could you post in on what setup are you having problems (OS version, java version and ant version, maybe also what's on your classpath before you start the build)?
Thanks.
Jan

paultaylor
Offline
Joined: 2003-12-04
Points: 0

Ok,

Windows XP

java -version gives:
Java java version "1.6.0_01"
Java(TM) SE Runtime Environment (build 1.6.0_01-b06)
Java HotSpot(TM) Client VM (build 1.6.0_01-b06, mixed mode, sharing)

ant 1.7 RC

classpath is blank

paultaylor
Offline
Joined: 2003-12-04
Points: 0

Well I think Ive found some problems with one test, they only work in the us locale, I'm running in the uk, I cant check in any the changes myself, but

Testcase: testDefaultConstructor(org.jdesktop.swingx.calendar.JXMonthViewTest):
assumes that SUNDAY is the 1st day of the week whatever the locale, whereas in UK its MONDAY.

kschaefe
Offline
Joined: 2006-06-08
Points: 0

I have checked in a change that set the default for component creation to use US locale. The locale checks should cover non-US defaults, but this allows the constructor tests to work as expected.

Karl

osbald
Offline
Joined: 2003-06-13
Points: 0

I ran right into that too, got some uncommitted changes for bug #494 in my incubator with a modified testcase. Seem to remember two tests were failing - one was definitely the start of week vs default Locale (what logic is that really testing in jxmonthview?) the other.. haven't had the time to chase down.

- Richard

kschaefe
Offline
Joined: 2006-06-08
Points: 0

Try this [url=http://forums.java.net/jive/thread.jspa?messageID=206897]thread[/url].

paultaylor
Offline
Joined: 2003-12-04
Points: 0

Thanks, that worked

Although now have a common compile error (i havent chnaged anything yet), anybody know why, is this meant to build at the moment ?

-do-compile-test:
[javac] Compiling 118 source files to D:\Code\jthink\opensrc\swing-incubator-cvs\swingx\build\test\classes
[javac] D:\Code\jthink\opensrc\swing-incubator-cvs\swingx\src\test\org\jdesktop\swingx\JXDatePickerVisualCheck.java:71: cannot find symbol
[javac] symbol : method getWindows()
[javac] location: class java.awt.Window
[javac] Window[] windows = Window.getWindows();
[javac] ^
[javac] D:\Code\jthink\opensrc\swing-incubator-cvs\swingx\src\test\org\jdesktop\swingx\JXLoginPanelVisualCheck.java:73: cannot find symbol
[javac] symbol : method getWindows()
[javac] location: class java.awt.Window
[javac] Window[] windows = Window.getWindows();
[javac] ^

kschaefe
Offline
Joined: 2006-06-08
Points: 0

Get the latest code. There was an update earlier today to remove some 1.6 methods that crept in.

paultaylor
Offline
Joined: 2003-12-04
Points: 0

Ok, thanks thats improved things everything compiled,

but sandbox test failed,
[junit] Testsuite: org.jdesktop.swingx.SandboxTest
[junit] 18-May-2007 19:40:04 org.jdesktop.swingx.SandboxTest testSecurityManager
[junit] INFO: cannot run testSecurityManager - no SecurityManager installed
[junit] 18-May-2007 19:40:04 org.jdesktop.swingx.SandboxTest testSecurityManagerAgain
[junit] INFO: cannot run testSecurityManagerAgain - no SecurityManager installed
[junit] Tests run: 2, Failures: 0, Errors: 0, Time elapsed: 0.907 sec
[junit]
[junit] ------------- Standard Error -----------------
[junit] 18-May-2007 19:40:04 org.jdesktop.swingx.SandboxTest testSecurityManager
[junit] INFO: cannot run testSecurityManager - no SecurityManager installed
[junit] 18-May-2007 19:40:04 org.jdesktop.swingx.SandboxTest testSecurityManagerAgain
[junit] INFO: cannot run testSecurityManagerAgain - no SecurityManager installed
[junit] ------------- ---------------- ---------------

and Date some test failed but I guess this is just work in progress

[junit] Testcase: testDefaultConstructor(org.jdesktop.swingx.calendar.JXMonthViewTest): FAILED
[junit] null
[junit] junit.framework.AssertionFailedError: null
[junit] at org.jdesktop.swingx.calendar.JXMonthViewTest.testDefaultConstructor(JXMonthViewTest.java:49)
[junit] at org.jmock.core.VerifyingTestCase.runBare(VerifyingTestCase.java:39)
[junit]
[junit]
[junit] Testcase: testWeekIntervalSelection(org.jdesktop.swingx.calendar.JXMonthViewTest): FAILED
[junit] null
[junit] junit.framework.AssertionFailedError: null
[junit] at org.jdesktop.swingx.calendar.JXMonthViewTest.testWeekIntervalSelection(JXMonthViewTest.java:152)
[junit] at org.jmock.core.VerifyingTestCase.runBare(VerifyingTestCase.java:39)
[junit]
[junit]

but I do need a swingx.jar at the end of it, can I disable the tests

kschaefe
Offline
Joined: 2006-06-08
Points: 0

I get no failures when running those unit tests. Neither does Hudson. Curious.

You can just run the jar(?) target. That should produce the jar without running the tests.

Karl