Author: ivaynberg
Date: Mon Jun 16 16:10:39 2008
New Revision: 668341

URL: http://svn.apache.org/viewvc?rev=668341&view=rev
Log:
WICKET-1702

Modified:
    
wicket/trunk/wicket/src/main/java/org/apache/wicket/markup/resolver/WicketMessageResolver.java
    
wicket/trunk/wicket/src/test/java/org/apache/wicket/markup/resolver/WicketMessageResolverTest.java

Modified: 
wicket/trunk/wicket/src/main/java/org/apache/wicket/markup/resolver/WicketMessageResolver.java
URL: 
http://svn.apache.org/viewvc/wicket/trunk/wicket/src/main/java/org/apache/wicket/markup/resolver/WicketMessageResolver.java?rev=668341&r1=668340&r2=668341&view=diff
==============================================================================
--- 
wicket/trunk/wicket/src/main/java/org/apache/wicket/markup/resolver/WicketMessageResolver.java
 (original)
+++ 
wicket/trunk/wicket/src/main/java/org/apache/wicket/markup/resolver/WicketMessageResolver.java
 Mon Jun 16 16:10:39 2008
@@ -20,6 +20,7 @@
 import java.util.Iterator;
 import java.util.Map;
 
+import org.apache.wicket.Application;
 import org.apache.wicket.Component;
 import org.apache.wicket.MarkupContainer;
 import org.apache.wicket.Response;
@@ -108,8 +109,6 @@
         */
        private static final String DEFAULT_VALUE = 
"DEFAULT_WICKET_MESSAGE_RESOLVER_VALUE";
 
-       /** If true, than throw an exception if the property key was not found 
*/
-       private static boolean throwExceptionIfPropertyNotFound = false;
 
        /**
         * Try to resolve the tag, then create a component, add it to the 
container and render it.
@@ -125,7 +124,7 @@
         *            The current component tag while parsing the markup
         * @return true, if componentId was handle by the resolver. False, 
otherwise
         */
-       public boolean resolve(final MarkupContainer< ? > container, final 
MarkupStream markupStream,
+       public boolean resolve(final MarkupContainer<?> container, final 
MarkupStream markupStream,
                final ComponentTag tag)
        {
                if (tag instanceof WicketTag)
@@ -163,21 +162,9 @@
         * 
         * @return throwExceptionIfPropertyNotFound
         */
-       public static boolean isThrowExceptionIfPropertyNotFound()
+       private static boolean isThrowExceptionIfPropertyNotFound()
        {
-               return throwExceptionIfPropertyNotFound;
-       }
-
-       /**
-        * If true, than throw an exception if a property key is not found. If 
false, just a warning is
-        * issued in the logged.
-        * 
-        * @param throwExceptionIfPropertyNotFound
-        *            throwExceptionIfPropertyNotFound
-        */
-       public static void setThrowExceptionIfPropertyNotFound(boolean 
throwExceptionIfPropertyNotFound)
-       {
-               WicketMessageResolver.throwExceptionIfPropertyNotFound = 
throwExceptionIfPropertyNotFound;
+               return 
Application.get().getResourceSettings().getThrowExceptionOnMissingResource();
        }
 
        /**
@@ -372,7 +359,7 @@
                                                        final StringResponse 
response = new StringResponse();
                                                        
getRequestCycle().setResponse(response);
 
-                                                       Component< ? > 
component = getParent().get(id);
+                                                       Component<?> component 
= getParent().get(id);
                                                        if (component != null)
                                                        {
                                                                
component.render(markupStream);

Modified: 
wicket/trunk/wicket/src/test/java/org/apache/wicket/markup/resolver/WicketMessageResolverTest.java
URL: 
http://svn.apache.org/viewvc/wicket/trunk/wicket/src/test/java/org/apache/wicket/markup/resolver/WicketMessageResolverTest.java?rev=668341&r1=668340&r2=668341&view=diff
==============================================================================
--- 
wicket/trunk/wicket/src/test/java/org/apache/wicket/markup/resolver/WicketMessageResolverTest.java
 (original)
+++ 
wicket/trunk/wicket/src/test/java/org/apache/wicket/markup/resolver/WicketMessageResolverTest.java
 Mon Jun 16 16:10:39 2008
@@ -39,6 +39,7 @@
         */
        public void test_1() throws Exception
        {
+               
tester.getApplication().getResourceSettings().setThrowExceptionOnMissingResource(false);
                executeTest(SimplePage_1.class, 
"SimplePageExpectedResult_1.html");
        }
 
@@ -74,7 +75,7 @@
        {
                try
                {
-                       
WicketMessageResolver.setThrowExceptionIfPropertyNotFound(true);
+                       
tester.getApplication().getResourceSettings().setThrowExceptionOnMissingResource(true);
                        executeTest(SimplePage_4.class, 
"SimplePageExpectedResult_4.html");
                }
                catch (WicketRuntimeException ex)


Reply via email to