Re: java.lang.NoClassDefFoundError: org/apache/tapestry/test/TapestryTestConstants
Well PageTester is definitely in Tapestry Core - but I had to include tapestry test module to get TapestryTestConstants - that was being used by PageTester - like your stacktrace so just add the tapestry test module. Russell Brown wrote: Hi, Using tapestry 5.0.11 I get a NoClassDefFoundError when I try and use the PageTester class as described in the documents here (http://tapestry.apache.org/tapestry5/tapestry-core/guide/unit-testing-pages.html) when I try to create a new Instance of PageTester. The stack trace is as follows:-- --- java.lang.NoClassDefFoundError: org/apache/tapestry/test/TapestryTestConstants at org.apache.tapestry.internal.test.PageTesterContext.init(PageTesterContext.java:31) at org.apache.tapestry.test.PageTester.init(PageTester.java:104) at uk.co.vodco.sherbet.sherbetbeta.pages.StartPageIntTest.startPageSubmit(StartPageIntTest.java:31) 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:585) at org.testng.internal.MethodHelper.invokeMethod(MethodHelper.java:580) at org.testng.internal.Invoker.invokeMethod(Invoker.java:478) at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:607) at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:874) at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:125) at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:109) at org.testng.TestRunner.runWorkers(TestRunner.java:689) at org.testng.TestRunner.privateRun(TestRunner.java:566) at org.testng.TestRunner.run(TestRunner.java:466) at org.testng.SuiteRunner.runTest(SuiteRunner.java:301) at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:296) at org.testng.SuiteRunner.privateRun(SuiteRunner.java:276) at org.testng.SuiteRunner.run(SuiteRunner.java:191) at org.testng.TestNG.createAndRunSuiteRunners(TestNG.java:808) at org.testng.TestNG.runSuitesLocally(TestNG.java:776) at org.testng.TestNG.run(TestNG.java:701) at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:73) at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:124) -- These lines in PageTestContext seem to be the culprit public PageTesterContext(String contextRoot) { _contextRoot = new File(TapestryTestConstants.MODULE_BASE_DIR, contextRoot); } I looked in the jar and the svn repo and this class (TapestryTestConstants) is absent. Any ideas? Cheers Russell Communications on or through ioko's computer systems may be monitored or recorded to secure effective system operation and for other lawful purposes. Unless otherwise agreed expressly in writing, this communication is to be treated as confidential and the information in it may not be used or disclosed except for the purpose for which it has been sent. If you have reason to believe that you are not the intended recipient of this communication, please contact the sender immediately. No employee is authorised to conclude any binding agreement on behalf of ioko with another party by e-mail without prior express written confirmation. ioko365 Ltd. VAT reg 656 2443 31. Reg no 3048367. All rights reserved. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: PageTester and Select Component
Replying to myself again! Probably a bad sign: the problem was this: id=searchOptions should have been this:t:id=searchOptions funny that it worked in the web page but failed the test. Anyway, I guess that's what the test is for. David Roberts wrote: Hi, I'm having problems instantiating values into a select component when testing forms. This is my form: t:form t:id=searchForm t:errors/ t:select id=searchOptions value=searchType model=searchTypes validate=required/ t:textfield t:id=searchString t:value=searchString validate=required/ input type=submit value=Search/ /t:form and this is the test: doc = this.pageTester.renderPage(Search); form = doc.getElementById(searchForm); fieldValues = new HashMapString, String(); fieldValues.put(searchOptions, TEL_NO); fieldValues.put(searchString, +443739182931); doc = pageTester.submitForm(form, fieldValues); Basically, the select component value is left as null. The select is backed by an EnumSelectModel: public enum SearchType { NAME, TEL_NO } Any ideas? thanks. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Extending Base Pages
- Just to say that my question here was wrong in its premise - you can pull persisted fields up into a base class. A coding error was the problem. David Roberts wrote: Hi, I tried to create a base page which encapsulated a flash persistent value used on all/most of my Tapestry pages: class BasePage { @Persist(value=flash) private boolean isError; . getters and setters } However, though the variable was being used it wasn't being stored in flash scope. Is there any way I can do this for base pages. Similarly I want to encapsulate messages for all/most pages, but I am wondering if the right properties will be inject (if at all): class BasePage { @Inject private Messages messages; ... getters and setters } - Any thoughts on these issues would be appreciated. thanks, David. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Extending Base Pages
Hi, I tried to create a base page which encapsulated a flash persistent value used on all/most of my Tapestry pages: class BasePage { @Persist(value=flash) private boolean isError; . getters and setters } However, though the variable was being used it wasn't being stored in flash scope. Is there any way I can do this for base pages. Similarly I want to encapsulate messages for all/most pages, but I am wondering if the right properties will be inject (if at all): class BasePage { @Inject private Messages messages; ... getters and setters } - Any thoughts on these issues would be appreciated. thanks, David. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Tapestry Spring Documentation Incomplete
Hi, Just to say that I think the documentation here: http://tapestry.apache.org/tapestry5/tapestry-spring/ needs updating. Nowhere does it state that a dependency on tapestry-spring is needed in pom.xml as such: dependency groupIdorg.apache.tapestry/groupId artifactIdtapestry-spring/artifactId version${tapestry-release-version}/version /dependency I know this might seem obvious, but I for one assumed that this would come with the Tapestry-core dependency files. This cost me 3 hours with Tomcat startup failed due to previous errors errors whenever spring was added to web.xml until I remembered to look in the full tomcat log to find out what the problem was. Perhaps the same sort of update is also needed for the file upload page on the Tapestry web site as well. Its probably difficult to decided what to do when half of users are still downloading the full gzip file and the other half are doing this stuff using Maven but I think this is definitely something worth adding. David. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tapestry Spring Documentation Incomplete
Hi, Unfortunately, the documentation doesn't state that it **is** a separate module - which is precisely my point. Spring is so ubiquitous now that it would not be a wild assumption that Tapestry would come with Spring support out of the box. I think its reasonable enough to have Spring as a 'second' option to Tapestry IOC, if that is Howard's preference, but my point is the documentation (I followed the 'snippets' link on the HowTo on the wiki) emphasises just how little effort it takes to incorporate Spring - unfortunately it misses out some vital information i.e. This bit of code has dependencies - it would not harm the document to put the dependency markup right at the top. David. SergeEby wrote: Hi, It seems obvious to me that you need to add any self-contained module such as tapestry-spring, tapestry-hibernate or tapestry-upload to your application only if you use it. /Serge TapestryBeast wrote: Hi, Just to say that I think the documentation here: http://tapestry.apache.org/tapestry5/tapestry-spring/ needs updating. Nowhere does it state that a dependency on tapestry-spring is needed in pom.xml as such: dependency groupIdorg.apache.tapestry/groupId artifactIdtapestry-spring/artifactId version${tapestry-release-version}/version /dependency I know this might seem obvious, but I for one assumed that this would come with the Tapestry-core dependency files. This cost me 3 hours with Tomcat startup failed due to previous errors errors whenever spring was added to web.xml until I remembered to look in the full tomcat log to find out what the problem was. Perhaps the same sort of update is also needed for the file upload page on the Tapestry web site as well. Its probably difficult to decided what to do when half of users are still downloading the full gzip file and the other half are doing this stuff using Maven but I think this is definitely something worth adding. David. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tapestry Spring Documentation Incomplete
Yes I can take your point. What caught me out was following the link from the wiki HowTo - I didn't even realise I was in part of the documentation for the spring module - anyway, its nice to see that the mailing list is so active, I'm looking forward to upgrading to Tapestry5. Howard Lewis Ship wrote: It's a question of what's is assumed vs. what is understood. We can't be in the business of recapitulating all the Maven theory every time we talk about a dependency. Anyone whose used Maven will understand that each module, and from the project layout tapestry-spring is clearly its own module, is an additional dependency. I'm not saying your wrong, I'm saying that if this is important to you, you need to add a JIRA issue so the work can be prioritized. And a patch would help! One of the nice things in 5.0.12-SNAPSHOT is that the exception report inlcudes all the JVM system properties, including the classpath, which makes it easier to understand what's going on with many conflicts or missing modules. On Fri, May 23, 2008 at 8:59 AM, David Roberts [EMAIL PROTECTED] wrote: Hi, Unfortunately, the documentation doesn't state that it **is** a separate module - which is precisely my point. Spring is so ubiquitous now that it would not be a wild assumption that Tapestry would come with Spring support out of the box. I think its reasonable enough to have Spring as a 'second' option to Tapestry IOC, if that is Howard's preference, but my point is the documentation (I followed the 'snippets' link on the HowTo on the wiki) emphasises just how little effort it takes to incorporate Spring - unfortunately it misses out some vital information i.e. This bit of code has dependencies - it would not harm the document to put the dependency markup right at the top. David. SergeEby wrote: Hi, It seems obvious to me that you need to add any self-contained module such as tapestry-spring, tapestry-hibernate or tapestry-upload to your application only if you use it. /Serge TapestryBeast wrote: Hi, Just to say that I think the documentation here: http://tapestry.apache.org/tapestry5/tapestry-spring/ needs updating. Nowhere does it state that a dependency on tapestry-spring is needed in pom.xml as such: dependency groupIdorg.apache.tapestry/groupId artifactIdtapestry-spring/artifactId version${tapestry-release-version}/version /dependency I know this might seem obvious, but I for one assumed that this would come with the Tapestry-core dependency files. This cost me 3 hours with Tomcat startup failed due to previous errors errors whenever spring was added to web.xml until I remembered to look in the full tomcat log to find out what the problem was. Perhaps the same sort of update is also needed for the file upload page on the Tapestry web site as well. Its probably difficult to decided what to do when half of users are still downloading the full gzip file and the other half are doing this stuff using Maven but I think this is definitely something worth adding. David. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]