[shale] renderKit proposal for testing framework

2006-01-14 Thread Dennis Byrne
The following doesn't pass ...

public class RenderKitTestCase extends AbstractJsfTestCase{

public RenderKitTestCase(String name){
super(name);
}

public void testRenderKits(){
assertTrue(facesContext.getRenderKit() == renderKit);
}

}

This is because MockRenderKitFactory creates a new MockRenderKit in it's 
constructor and holds on to it for all tests of the suite.  Although the new 
MockRenderKit in AbstractJsfTestCase is added to the MockRenderKitFactory, 
MockRenderKitFactory throws an exception that is swallowed by the TestCase.

If I comment out the MockRenderKit construction in MockRenderKitFactory, all is 
well.  I wish the try/catch wasn't there also.

BTW, I really do like this is a great tool.

Dennis Byrne



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[shale] UnsupportedOperationException w/ Mock Objects

2006-01-11 Thread Dennis Byrne
MockServletContext.log throws a UnsupportedOperationException, making it hard 
to test many core parts of MyFaces.  Was the intention here for the tester to 
override MockServletContext.log, or does MockServletContext assume the tested 
code simply would/should not call ExternalContext.log() ? 



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



building Struts w/ maven

2006-01-10 Thread Dennis Byrne
The web site says to use 'mvn build-all' .

http://struts.apache.org/acquiring.html#Source_Code

Using build-all gives me the following error message, but using 'mvn install' 
builds everything. I am not a maven expert, but should the web site be updated?

[ERROR] BUILD FAILURE
[INFO] 

[INFO] Invalid task 'build-all': you must specify a valid lifecycle phase, or a 
goal in the format plugin:goal or p
luginGroupId:pluginArtifactId:pluginVersion:goal



also, I am getting the following stack trace w/ 'mvn install'

java.lang.InstantiationException: 
org.apache.struts.action.TestActionServlet$CustomFormBeanConfigArg
at java.lang.Class.newInstance0(Class.java:293)
at java.lang.Class.newInstance(Class.java:261)
at 
org.apache.struts.util.RequestUtils.applicationInstance(RequestUtils.java:177)
at 
org.apache.struts.util.RequestUtils.applicationInstance(RequestUtils.java:152)
at 
org.apache.struts.action.ActionServlet.processFormBeanConfigClass(ActionServlet.java:1062)
at 
org.apache.struts.action.TestActionServlet.testProcessFormBeanConfigClassError(TestActionServlet.java:45
5)
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 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 
org.apache.maven.surefire.battery.JUnitBattery.executeJUnit(JUnitBattery.java:230)
at org.apache.maven.surefire.battery.JUnitBattery.execute(JUnitBattery.java:204)
at org.apache.maven.surefire.Surefire.executeBattery(Surefire.java:218)
at org.apache.maven.surefire.Surefire.run(Surefire.java:166)
at org.apache.maven.surefire.Surefire.run(Surefire.java:90)
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 
org.apache.maven.surefire.SurefireBooter.runTestsInProcess(SurefireBooter.java:246)
at org.apache.maven.surefire.SurefireBooter.run(SurefireBooter.java:195)
at org.apache.maven.test.SurefirePlugin.execute(SurefirePlugin.java:366)
at 
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:432)
at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:530)
at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.ja
va:472)
at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:451)
at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecuto
r.java:303)
at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:27
0)
at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:139)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:322)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:115)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:249)
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 org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Jan 10, 2006 9:44:15 PM org.apache.struts.action.ActionServlet 
handleValueRequiredException
SEVERE: Missing key value for java.lang.NullPointerException global exception 
config
Jan 10, 2006 9:44:15 PM org.apache.struts.action.ActionServlet 
handleCreationException
SEVERE: Unable to create an instance of 
org.apache.struts.action.TestActionServlet$CustomExceptionConfigArg
java.lang.InstantiationException: 
org.apache.struts.action.Test

Re: Refactoring JSP to JSF (and then possibly to Shale)

2006-01-10 Thread Dennis Byrne
>Actually you bring up one of the reasons I'm not in love JSF at the 
>moment. I know most people like the idea of using pre-built or custom 
>renderers and get all googly eyed over the nice things you can get 
>out-of-the-box from MyFaces or Oracle ADF, but I guess I'm still 
>old-school and like the control of building the front end how I want 
>with simple JSTL and html. From my brief time with JSF I felt sort of 
>constrained having to use the DataTable (I think that's what it was 
>called:) to iterate over stuff for display purposes etc. Not saying the 
>concept of renderers is bad at all and I guess a set of common controls 
>is pretty cool. I just know from experience that pre-built stuff always 
>ends up having to be tweaked to meet some crazy business requirement I 
>end up having to deal with. At least when I'm working with straight html 
>(and the annoying dhtml stuff) I can create everything how I want.

You may want to look into writing a custom renderer to address some of these 
issues.



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [shale] UnsupportedOperationException w/ Mock Objects

2006-01-10 Thread Dennis Byrne
>I wouldn't be averse to using Commons Logging here, but perhaps it would be
>a little simpler to  just write to System.out or System.err, with a system
>property to control the logging levels actually output?
>
>Craig

Fair enough :) I can see piping log(String, Throwable) to System.err, but I 
don't quite follow on the levels.  

Can encodeNamespace() just return the same String provided to it?  This is what 
the myfaces.context.servlet.ServletExternalContextImpl and the RI do.

Dennis Byrne



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [shale] UnsupportedOperationException w/ Mock Objects

2006-01-09 Thread Dennis Byrne
Will it be acceptable if all 3 MockServletContext.log methods wrap a static 
commons logging method call?

Dennis Byrne

>-Original Message-
>From: Craig McClanahan [mailto:[EMAIL PROTECTED]
>Sent: Tuesday, January 10, 2006 02:17 AM
>To: 'Struts Users Mailing List'
>Subject: Re: [shale] UnsupportedOperationException w/ Mock Objects
>
>On 1/9/06, Dennis Byrne <[EMAIL PROTECTED]> wrote:
>>
>> MockServletContext.log and many other methods throw a
>> UnsupportedOperationException. This makes it hard to test many core parts of
>> MyFaces.
>>
>> Was the intention here for the tester to override MockServletContext.log,
>> or does MockServletContext assume the tested code simply would/should not
>> call ExternalContext.log() ?
>
>
>The intent was to incrementally implement the methods that people actually
>find useful, rather than try to predict everything people would need :-).
>Your example seems like a perfectly good case where we need such an
>implementation.  Feel free to file bugs against specific methods that are
>not currently supported (and patches too, if you'd like them implemented
>faster).
>
>  http://issues.apache.org/bugzilla/
>
>Dennis Byrne
>
>
>Craig
>



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[shale] UnsupportedOperationException w/ Mock Objects

2006-01-09 Thread Dennis Byrne
MockServletContext.log and many other methods throw a 
UnsupportedOperationException. This makes it hard to test many core parts of 
MyFaces. 

Was the intention here for the tester to override MockServletContext.log, or 
does MockServletContext assume the tested code simply would/should not call 
ExternalContext.log() ? 

Dennis Byrne



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]