You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tapestry.apache.org by hl...@apache.org on 2007/09/29 17:14:28 UTC
svn commit: r580594 - in /tapestry/tapestry5/trunk:
src/site/resources/images/ tapestry-annotations/src/site/resources/
tapestry-component-report/src/site/resources/
tapestry-core/src/main/java/org/apache/tapestry/corelib/components/
tapestry-core/src/...
Author: hlship
Date: Sat Sep 29 08:14:27 2007
New Revision: 580594
URL: http://svn.apache.org/viewvc?rev=580594&view=rev
Log:
TAPESTRY-1785: Move non-component classes out of corelib.components
TAPESTRY-1798: Exception messages listing pages, components, etc, should strip out the "core/" prefix
Added:
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/internal/
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/internal/FormSupportImpl.java
- copied, changed from r579888, tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/FormSupportImpl.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/internal/InternalMessages.java
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/corelib/internal/
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/corelib/internal/InternalStrings.properties
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/corelib/internal/
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/corelib/internal/FormSupportImplTest.java
- copied, changed from r579888, tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/corelib/components/FormSupportImplTest.java
Removed:
tapestry/tapestry5/trunk/src/site/resources/images/
tapestry/tapestry5/trunk/tapestry-annotations/src/site/resources/
tapestry/tapestry5/trunk/tapestry-component-report/src/site/resources/
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/ComponentMessages.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/FormSupportImpl.java
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/corelib/components/ComponentStrings.properties
tapestry/tapestry5/trunk/tapestry-core/src/site/resources/css/
tapestry/tapestry5/trunk/tapestry-core/src/site/resources/images/asf_logo_wide.gif
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/corelib/components/FormSupportImplTest.java
tapestry/tapestry5/trunk/tapestry-hibernate/src/site/resources/
tapestry/tapestry5/trunk/tapestry-ioc/src/site/resources/css/
tapestry/tapestry5/trunk/tapestry-ioc/src/site/resources/images/asf_logo_wide.gif
tapestry/tapestry5/trunk/tapestry-project/
tapestry/tapestry5/trunk/tapestry-spring/src/site/resources/css/
tapestry/tapestry5/trunk/tapestry-test/src/site/resources/
tapestry/tapestry5/trunk/tapestry-upload/src/site/resources/
Modified:
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/BeanEditForm.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/BeanEditor.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/Errors.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/Form.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/ComponentClassResolverImpl.java
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/internal/services/ServicesStrings.properties
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/corelib/components/SubmitTest.java
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/services/ComponentClassResolverImplTest.java
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/services/PersistentFieldManagerImplTest.java
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/BeanEditForm.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/BeanEditForm.java?rev=580594&r1=580593&r2=580594&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/BeanEditForm.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/BeanEditForm.java Sat Sep 29 08:14:27 2007
@@ -24,6 +24,7 @@
import org.apache.tapestry.annotations.Parameter;
import org.apache.tapestry.annotations.SupportsInformalParameters;
import org.apache.tapestry.beaneditor.BeanModel;
+import org.apache.tapestry.corelib.internal.InternalMessages;
import org.apache.tapestry.ioc.internal.util.TapestryException;
import org.apache.tapestry.services.BeanModelSource;
import org.apache.tapestry.services.ComponentDefaultProvider;
@@ -135,7 +136,7 @@
}
catch (Exception ex)
{
- throw new TapestryException(ComponentMessages.failureInstantiatingObject(
+ throw new TapestryException(InternalMessages.failureInstantiatingObject(
type,
_resources.getCompleteId(),
ex), _resources.getLocation(), ex);
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/BeanEditor.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/BeanEditor.java?rev=580594&r1=580593&r2=580594&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/BeanEditor.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/BeanEditor.java Sat Sep 29 08:14:27 2007
@@ -21,6 +21,7 @@
import org.apache.tapestry.annotations.Inject;
import org.apache.tapestry.annotations.Parameter;
import org.apache.tapestry.beaneditor.BeanModel;
+import org.apache.tapestry.corelib.internal.InternalMessages;
import org.apache.tapestry.internal.beaneditor.BeanModelUtils;
import org.apache.tapestry.ioc.internal.util.TapestryException;
import org.apache.tapestry.services.BeanModelSource;
@@ -172,7 +173,7 @@
}
catch (Exception ex)
{
- throw new TapestryException(ComponentMessages.failureInstantiatingObject(
+ throw new TapestryException(InternalMessages.failureInstantiatingObject(
type,
_resources.getCompleteId(),
ex), _resources.getLocation(), ex);
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/Errors.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/Errors.java?rev=580594&r1=580593&r2=580594&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/Errors.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/Errors.java Sat Sep 29 08:14:27 2007
@@ -20,6 +20,7 @@
import org.apache.tapestry.ValidationTracker;
import org.apache.tapestry.annotations.Environmental;
import org.apache.tapestry.annotations.Parameter;
+import org.apache.tapestry.corelib.internal.InternalMessages;
import org.apache.tapestry.internal.InternalConstants;
import org.apache.tapestry.services.FormSupport;
@@ -53,7 +54,7 @@
// TODO: Would be nice if there was a Location to report ... can we add a Location property
// to ComponentResources?
- if (_tracker == null) throw new RuntimeException(ComponentMessages.encloseErrorsInForm());
+ if (_tracker == null) throw new RuntimeException(InternalMessages.encloseErrorsInForm());
String cssClass = _tracker.getHasErrors() ? _class : _class + " t-invisible";
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/Form.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/Form.java?rev=580594&r1=580593&r2=580594&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/Form.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/Form.java Sat Sep 29 08:14:27 2007
@@ -40,6 +40,7 @@
import org.apache.tapestry.annotations.Parameter;
import org.apache.tapestry.annotations.Path;
import org.apache.tapestry.annotations.Persist;
+import org.apache.tapestry.corelib.internal.FormSupportImpl;
import org.apache.tapestry.corelib.mixins.RenderInformals;
import org.apache.tapestry.dom.Element;
import org.apache.tapestry.internal.TapestryInternalUtils;
Copied: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/internal/FormSupportImpl.java (from r579888, tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/FormSupportImpl.java)
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/internal/FormSupportImpl.java?p2=tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/internal/FormSupportImpl.java&p1=tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/FormSupportImpl.java&r1=579888&r2=580594&rev=580594&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/FormSupportImpl.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/internal/FormSupportImpl.java Sat Sep 29 08:14:27 2007
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-package org.apache.tapestry.corelib.components;
+package org.apache.tapestry.corelib.internal;
import static org.apache.tapestry.ioc.internal.util.CollectionFactory.newList;
import static org.apache.tapestry.ioc.internal.util.Defense.cast;
@@ -35,7 +35,7 @@
* TODO: Most methods should only be invokable depending on whether the form is rendering or
* processing a submission.
*/
-class FormSupportImpl implements FormSupport
+public class FormSupportImpl implements FormSupport
{
private final IdAllocator _idAllocator = new IdAllocator();
@@ -81,7 +81,7 @@
}
catch (IOException ex)
{
- throw new RuntimeException(ComponentMessages.componentActionNotSerializable(
+ throw new RuntimeException(InternalMessages.componentActionNotSerializable(
completeId,
ex), ex);
}
@@ -101,7 +101,7 @@
_commands.add(notNull(command, "command"));
}
- void executeDeferred()
+ public void executeDeferred()
{
if (_commands == null) return;
@@ -116,7 +116,7 @@
return _clientId;
}
- String getEncodingType()
+ public String getEncodingType()
{
return _encodingType;
}
@@ -126,7 +126,7 @@
notBlank(encodingType, "encodingType");
if (_encodingType != null && !_encodingType.equals(encodingType))
- throw new IllegalStateException(ComponentMessages.conflictingEncodingType(
+ throw new IllegalStateException(InternalMessages.conflictingEncodingType(
_encodingType,
encodingType));
Added: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/internal/InternalMessages.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/internal/InternalMessages.java?rev=580594&view=auto
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/internal/InternalMessages.java (added)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/internal/InternalMessages.java Sat Sep 29 08:14:27 2007
@@ -0,0 +1,46 @@
+// Copyright 2006, 2007 The Apache Software Foundation
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package org.apache.tapestry.corelib.internal;
+
+import org.apache.tapestry.ioc.Messages;
+import org.apache.tapestry.ioc.internal.util.MessagesImpl;
+import org.apache.tapestry.ioc.services.ClassFabUtils;
+
+public final class InternalMessages
+{
+ private static final Messages MESSAGES = MessagesImpl.forClass(InternalMessages.class);
+
+ public static String componentActionNotSerializable(String componentId, Throwable cause)
+ {
+ return MESSAGES.format("component-action-not-serializable", componentId, cause);
+ }
+
+ public static String encloseErrorsInForm()
+ {
+ return MESSAGES.get("enclose-errors-in-form");
+ }
+
+ public static String failureInstantiatingObject(Class objectType, String componentId,
+ Throwable cause)
+ {
+ return MESSAGES.format("failure-instantitating-object", ClassFabUtils
+ .toJavaClassName(objectType), componentId, cause);
+ }
+
+ public static String conflictingEncodingType(String existing, String conflicting)
+ {
+ return MESSAGES.format("conflicting-encoding-type", existing, conflicting);
+ }
+}
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/ComponentClassResolverImpl.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/ComponentClassResolverImpl.java?rev=580594&r1=580593&r2=580594&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/ComponentClassResolverImpl.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/ComponentClassResolverImpl.java Sat Sep 29 08:14:27 2007
@@ -17,10 +17,12 @@
import static org.apache.tapestry.ioc.internal.util.CollectionFactory.newCaseInsensitiveMap;
import static org.apache.tapestry.ioc.internal.util.CollectionFactory.newList;
import static org.apache.tapestry.ioc.internal.util.CollectionFactory.newMap;
+import static org.apache.tapestry.ioc.internal.util.CollectionFactory.newSet;
import java.util.Collection;
import java.util.List;
import java.util.Map;
+import java.util.Set;
import org.apache.tapestry.internal.InternalConstants;
import org.apache.tapestry.internal.events.InvalidationListener;
@@ -33,6 +35,8 @@
public class ComponentClassResolverImpl implements ComponentClassResolver, InvalidationListener
{
+ private static final String CORE_LIBRARY_PREFIX = "core/";
+
private static final String MIXINS_SUBPACKAGE = "mixins";
private static final String COMPONENTS_SUBPACKAGE = "components";
@@ -283,7 +287,7 @@
if (result == null)
throw new IllegalArgumentException(ServicesMessages.couldNotResolvePageName(
pageName,
- _pageToClassName.keySet()));
+ presentableNames(_pageToClassName)));
return result;
}
@@ -312,14 +316,34 @@
if (result == null)
throw new IllegalArgumentException(ServicesMessages
- .couldNotResolveComponentType(componentType, _componentToClassName
- .keySet()));
+ .couldNotResolveComponentType(
+ componentType,
+ presentableNames(_componentToClassName)));
return result;
}
});
}
+ public Collection<String> presentableNames(Map<String, ?> map)
+ {
+ Set<String> result = newSet();
+
+ for (String name : map.keySet())
+ {
+
+ if (name.startsWith(CORE_LIBRARY_PREFIX))
+ {
+ result.add(name.substring(CORE_LIBRARY_PREFIX.length()));
+ continue;
+ }
+
+ result.add(name);
+ }
+
+ return result;
+ }
+
public String resolveMixinTypeToClassName(final String mixinType)
{
return _barrier.withRead(new Invokable<String>()
@@ -331,7 +355,7 @@
if (result == null)
throw new IllegalArgumentException(ServicesMessages.couldNotResolveMixinType(
mixinType,
- _mixinToClassName.keySet()));
+ presentableNames(_mixinToClassName)));
return result;
}
@@ -357,7 +381,7 @@
// If not found, see if it exists under the core package. In this way,
// anything in core is "inherited" (but overridable) by the application.
- if (result == null) result = logicalNameToClassName.get("core/" + logicalName);
+ if (result == null) result = logicalNameToClassName.get(CORE_LIBRARY_PREFIX + logicalName);
return result;
}
@@ -391,8 +415,9 @@
if (result == null)
throw new IllegalArgumentException(ServicesMessages
- .couldNotCanonicalizePageName(pageName, _pageNameToCanonicalPageName
- .keySet()));
+ .couldNotCanonicalizePageName(
+ pageName,
+ presentableNames(_pageNameToCanonicalPageName)));
return result;
}
Added: tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/corelib/internal/InternalStrings.properties
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/corelib/internal/InternalStrings.properties?rev=580594&view=auto
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/corelib/internal/InternalStrings.properties (added)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/corelib/internal/InternalStrings.properties Sat Sep 29 08:14:27 2007
@@ -0,0 +1,18 @@
+# Copyright 2006, 2007 The Apache Software Foundation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+component-action-not-serializable=Error serializing component action for component %s: %s
+enclose-errors-in-form=The Errors component must be enclosed by a Form component.
+failure-instantitating-object=Exception instantiating instance of %s (for component '%s'): %s
+conflicting-encoding-type=Encoding type of form has already been set to '%s' and may not be changed to '%s'.
\ No newline at end of file
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/internal/services/ServicesStrings.properties
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/internal/services/ServicesStrings.properties?rev=580594&r1=580593&r2=580594&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/internal/services/ServicesStrings.properties (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/internal/services/ServicesStrings.properties Sat Sep 29 08:14:27 2007
@@ -45,11 +45,11 @@
context-index-out-of-range=Method %s has more parameters than there are context values for this component event.
exception-in-method-parameter=Exception in method %s, parameter #%d: %s
component-event-is-aborted=Can not store result from invoking method %s, because an event result value has already been obtained from some other event handler method.
-unknown-persistent-field-strategy='%s' is not a defined persistent strategy. Defined stategies: %s.
-could-not-resolve-page-name=Unable to resolve page '%s' to a component class name. Available page names: %s.
-could-not-canonicalize-page-name=Unable to resolve page '%s' to a known page name. Available page names: %s.
-could-not-resolve-component-type=Unable to resolve component type '%s' to a component class name. Available component types: %s.
-could-not-resolve-mixin-type=Unable to resolve mixin type '%s' to a component class name. Available mixin types: %s.
+unknown-persistent-field-strategy='%s' is not a defined persistent strategy. Defined strategies: %s.
+could-not-resolve-page-name=Unable to resolve '%s' to a page class name. Available page names: %s.
+could-not-canonicalize-page-name=Unable to resolve '%s' to a known page name. Available page names: %s.
+could-not-resolve-component-type=Unable to resolve '%s' to a component class name. Available component types: %s.
+could-not-resolve-mixin-type=Unable to resolve '%s' to a mixin class name. Available mixin types: %s.
parameter-name-must-be-unique=Parameter names are required to be unique. Parameter '%s' already has the value '%s'.
page-is-dirty=Page %s is dirty, and will be discarded (rather than returned to the page pool).
component-instance-is-not-a-page=Method %s (for component %s) returned component %s, which is not a page component. The page containing the component will render the client response.
Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/corelib/components/SubmitTest.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/corelib/components/SubmitTest.java?rev=580594&r1=580593&r2=580594&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/corelib/components/SubmitTest.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/corelib/components/SubmitTest.java Sat Sep 29 08:14:27 2007
@@ -15,6 +15,7 @@
package org.apache.tapestry.corelib.components;
import org.apache.tapestry.ComponentResources;
+import org.apache.tapestry.corelib.internal.FormSupportImpl;
import org.apache.tapestry.internal.services.HeartbeatImpl;
import org.apache.tapestry.internal.test.InternalBaseTestCase;
import org.apache.tapestry.services.FormSupport;
Copied: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/corelib/internal/FormSupportImplTest.java (from r579888, tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/corelib/components/FormSupportImplTest.java)
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/corelib/internal/FormSupportImplTest.java?p2=tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/corelib/internal/FormSupportImplTest.java&p1=tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/corelib/components/FormSupportImplTest.java&r1=579888&r2=580594&rev=580594&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/corelib/components/FormSupportImplTest.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/corelib/internal/FormSupportImplTest.java Sat Sep 29 08:14:27 2007
@@ -12,8 +12,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-package org.apache.tapestry.corelib.components;
+package org.apache.tapestry.corelib.internal;
+import org.apache.tapestry.corelib.internal.FormSupportImpl;
import org.apache.tapestry.internal.test.InternalBaseTestCase;
import org.testng.annotations.Test;
Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/services/ComponentClassResolverImplTest.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/services/ComponentClassResolverImplTest.java?rev=580594&r1=580593&r2=580594&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/services/ComponentClassResolverImplTest.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/services/ComponentClassResolverImplTest.java Sat Sep 29 08:14:27 2007
@@ -172,7 +172,40 @@
assertEquals(resolver.resolvePageNameToClassName("foo/Bar"), className);
verify();
+ }
+
+ @Test
+ public void core_prefix_stripped_from_exception_message()
+ {
+ ComponentInstantiatorSource source = mockComponentInstantiatorSource();
+ ClassNameLocator locator = newClassNameLocator();
+ train_for_packages(source, CORE_ROOT_PACKAGE);
+ train_for_app_packages(source);
+
+ train_locateComponentClassNames(locator, CORE_ROOT_PACKAGE + ".pages", CORE_ROOT_PACKAGE
+ + ".pages.Fred", CORE_ROOT_PACKAGE + ".pages.Barney");
+ train_locateComponentClassNames(locator, APP_ROOT_PACKAGE + ".pages", APP_ROOT_PACKAGE
+ + ".pages.Wilma", APP_ROOT_PACKAGE + ".pages.Betty");
+
+ replay();
+
+ ComponentClassResolver resolver = create(source, locator, new LibraryMapping(CORE_PREFIX,
+ CORE_ROOT_PACKAGE));
+
+ try
+ {
+ resolver.resolvePageNameToClassName("Unknown");
+ unreachable();
+ }
+ catch (RuntimeException ex)
+ {
+ assertEquals(
+ ex.getMessage(),
+ "Unable to resolve \'Unknown\' to a page class name. Available page names: Barney, Betty, Fred, Wilma.");
+ }
+
+ verify();
}
@Test
@@ -468,7 +501,7 @@
{
assertEquals(
ex.getMessage(),
- "Unable to resolve page \'MissingPage\' to a known page name. Available page names: Start.");
+ "Unable to resolve \'MissingPage\' to a known page name. Available page names: Start.");
}
verify();
@@ -562,8 +595,7 @@
}
catch (IllegalArgumentException ex)
{
- assertTrue(ex.getMessage().contains(
- "Unable to resolve page 'lib/deep/DeepPage' to a component class name."));
+ assertMessageContains(ex, "Unable to resolve 'lib/deep/DeepPage' to a page class name.");
}
verify();
@@ -648,8 +680,7 @@
}
catch (IllegalArgumentException ex)
{
- assertTrue(ex.getMessage().contains(
- "Unable to resolve mixin type 'SimpleMixin' to a component class name."));
+ assertMessageContains(ex, "Unable to resolve 'SimpleMixin' to a mixin class name.");
}
verify();
@@ -677,10 +708,8 @@
}
catch (IllegalArgumentException ex)
{
- assertTrue(ex
- .getMessage()
- .contains(
- "Unable to resolve component type 'SimpleComponent' to a component class name."));
+ assertTrue(ex.getMessage().contains(
+ "Unable to resolve 'SimpleComponent' to a component class name."));
}
verify();
Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/services/PersistentFieldManagerImplTest.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/services/PersistentFieldManagerImplTest.java?rev=580594&r1=580593&r2=580594&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/services/PersistentFieldManagerImplTest.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/services/PersistentFieldManagerImplTest.java Sat Sep 29 08:14:27 2007
@@ -63,7 +63,7 @@
{
assertEquals(
ex.getMessage(),
- "\'braveheart\' is not a defined persistent strategy. Defined stategies: bar, foo.");
+ "\'braveheart\' is not a defined persistent strategy. Defined strategies: bar, foo.");
}
verify();