Hi
I am new to JWebUnit and have encountered a problem implementing tests that use a property file to validate page content.
I have set the resource bundle in setUp() like so:
getTestContext().setResourceBundleName("application.properties");then test for a particular error state like this:
assertKeyPresent("errors.required");
The result is the following error:
com.intellij.rt.execution.junit.TextTestRunner adamh.JSPUnitTests.StudentRegistrationWizardJSPTest
.java.util.MissingResourceException: Can't find bundle for base name application.properties, locale en_AU
at java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.java:804)
at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:773)
at java.util.ResourceBundle.getBundle(ResourceBundle.java:538)
at net.sourceforge.jwebunit.WebTester.getMessage(WebTester.java:74)
at net.sourceforge.jwebunit.WebTester.assertKeyPresent(WebTester.java:109)
at net.sourceforge.jwebunit.WebTestCase.assertKeyPresent(WebTestCase.java:64)
at adamh.JSPUnitTests.StudentRegistrationWizardJSPTest.testEmailAddressSubmit(StudentRegistrationWizardJSPTest.java:95)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at junit.framework.TestCase.runTest(TestCase.java:154)
at junit.framework.TestCase.runBare(TestCase.java:127)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at junit.textui.TestRunner.doRun(TestRunner.java:116)
at junit.textui.TestRunner.start(TestRunner.java:172)
at com.intellij.rt.execution.junit.TextTestRunner.main(TextTestRunner.java:12)
My understanding is that for the JWebUnit test to find the resource bundle, it has to be on my projects class path. Struts finds the resource bundle without trouble, so I can only assume that the classpath is configured correctly in my IDE (I am using IntelliJ IDEA). I am running the JWebUnit test from within IDEA.
Any suggestions about what may be causing this would be greatly appreciated. I hope that I have provided enough information here. I not, please let me know and I will happily fill in the gaps.
Regards, Langdon
-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM. Deadline: Sept. 13. Go here: http://sf.net/ppc_contest.php
_______________________________________________
Jwebunit-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jwebunit-users
