gatein SVN: r5014 - in portal/branches/navcontroller/component/web/controller/src: main/java/org/exoplatform/web/controller/router and 1 other directories.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2010-11-10 09:57:31 -0500 (Wed, 10 Nov 2010)
New Revision: 5014
Added:
portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/metadata/RouteParamDescriptor.java
portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/router/RouteParam.java
Modified:
portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/metadata/DescriptorBuilder.java
portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/metadata/RouteDescriptor.java
portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/router/Route.java
portal/branches/navcontroller/component/web/controller/src/test/java/org/exoplatform/web/controller/router/TestDescriptorBuilder.java
portal/branches/navcontroller/component/web/controller/src/test/java/org/exoplatform/web/controller/router/TestHierarchy.java
portal/branches/navcontroller/component/web/controller/src/test/java/org/exoplatform/web/controller/router/TestLegacyPortal.java
portal/branches/navcontroller/component/web/controller/src/test/java/org/exoplatform/web/controller/router/TestMatch.java
portal/branches/navcontroller/component/web/controller/src/test/java/org/exoplatform/web/controller/router/TestPortalConfiguration.java
Log:
make route param a real param
Modified: portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/metadata/DescriptorBuilder.java
===================================================================
--- portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/metadata/DescriptorBuilder.java 2010-11-10 14:00:56 UTC (rev 5013)
+++ portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/metadata/DescriptorBuilder.java 2010-11-10 14:57:31 UTC (rev 5014)
@@ -95,7 +95,7 @@
{
String name = reader.getAttributeValue(null, "name");
String value = reader.getAttributeValue(null, "value");
- routeDesc.addParam(QualifiedName.parse(name), value);
+ routeDesc.addRouteParam(QualifiedName.parse(name), value);
}
else if (requestParamQN.equals(reader.getName()))
{
Modified: portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/metadata/RouteDescriptor.java
===================================================================
--- portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/metadata/RouteDescriptor.java 2010-11-10 14:00:56 UTC (rev 5013)
+++ portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/metadata/RouteDescriptor.java 2010-11-10 14:57:31 UTC (rev 5014)
@@ -23,9 +23,11 @@
import org.exoplatform.web.controller.router.EncodingMode;
import java.util.ArrayList;
+import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
+import java.util.Set;
/**
* Describes a route.
@@ -40,7 +42,7 @@
private final String path;
/** . */
- private final Map<QualifiedName, String> params;
+ private final Map<QualifiedName, RouteParamDescriptor> routeParams;
/** . */
private final Map<QualifiedName, PathParamDescriptor> pathParams;
@@ -54,7 +56,7 @@
public RouteDescriptor(String path)
{
this.path = path;
- this.params = new HashMap<QualifiedName, String>();
+ this.routeParams = new HashMap<QualifiedName, RouteParamDescriptor>();
this.pathParams = new HashMap<QualifiedName, PathParamDescriptor>();
this.requestParams = new HashMap<String, RequestParamDescriptor>();
this.children = new ArrayList<RouteDescriptor>();
@@ -65,22 +67,32 @@
return path;
}
- public RouteDescriptor addParam(QualifiedName name, String value)
+ public RouteDescriptor addRouteParam(QualifiedName name, String value)
{
- params.put(name, value);
+ routeParams.put(name, new RouteParamDescriptor(name, value));
return this;
}
- public RouteDescriptor addParam(String name, String value)
+ public RouteDescriptor addRouteParam(String name, String value)
{
- return addParam(QualifiedName.parse(name), value);
+ return addRouteParam(QualifiedName.parse(name), value);
}
- public Map<QualifiedName, String> getParams()
+ public Set<QualifiedName> getRouteParamNames()
{
- return params;
+ return routeParams.keySet();
}
+ public Collection<RouteParamDescriptor> getRouteParams()
+ {
+ return routeParams.values();
+ }
+
+ public RouteParamDescriptor getRouteParam(QualifiedName name)
+ {
+ return routeParams.get(name);
+ }
+
public RouteDescriptor addRequestParam(QualifiedName name, String matchName, String matchValue, boolean required)
{
return addRequestParam(new RequestParamDescriptor(name, matchName, matchValue, required));
@@ -103,11 +115,21 @@
return this;
}
- public Map<String, RequestParamDescriptor> getRequestParams()
+ public Collection<RequestParamDescriptor> getRequestParams()
{
- return requestParams;
+ return requestParams.values();
}
+ public Set<String> getRequestParamMatchNames()
+ {
+ return requestParams.keySet();
+ }
+
+ public RequestParamDescriptor getRequestParam(String matchName)
+ {
+ return requestParams.get(matchName);
+ }
+
public Map<QualifiedName, PathParamDescriptor> getPathParams()
{
return pathParams;
Added: portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/metadata/RouteParamDescriptor.java
===================================================================
--- portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/metadata/RouteParamDescriptor.java (rev 0)
+++ portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/metadata/RouteParamDescriptor.java 2010-11-10 14:57:31 UTC (rev 5014)
@@ -0,0 +1,62 @@
+/*
+ * Copyright (C) 2010 eXo Platform SAS.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.exoplatform.web.controller.metadata;
+
+import org.exoplatform.web.controller.QualifiedName;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+public class RouteParamDescriptor
+{
+
+ /** . */
+ private final QualifiedName name;
+
+ /** . */
+ private final String value;
+
+ public RouteParamDescriptor(QualifiedName name, String value)
+ {
+ if (name == null)
+ {
+ throw new NullPointerException("No null name accepted");
+ }
+ if (value == null)
+ {
+ throw new NullPointerException("No null value accepted");
+ }
+
+ //
+ this.name = name;
+ this.value = value;
+ }
+
+ public QualifiedName getName()
+ {
+ return name;
+ }
+
+ public String getValue()
+ {
+ return value;
+ }
+}
Modified: portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/router/Route.java
===================================================================
--- portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/router/Route.java 2010-11-10 14:00:56 UTC (rev 5013)
+++ portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/router/Route.java 2010-11-10 14:57:31 UTC (rev 5014)
@@ -23,6 +23,7 @@
import org.exoplatform.web.controller.metadata.PathParamDescriptor;
import org.exoplatform.web.controller.metadata.RequestParamDescriptor;
import org.exoplatform.web.controller.metadata.RouteDescriptor;
+import org.exoplatform.web.controller.metadata.RouteParamDescriptor;
import java.util.ArrayList;
import java.util.Collections;
@@ -59,7 +60,7 @@
private final List<PatternRoute> patterns;
/** . */
- private final Map<QualifiedName, String> routeParameters;
+ private final Map<QualifiedName, RouteParam> routeParams;
/** . */
private final Map<String, RequestParam> requestParams;
@@ -70,7 +71,7 @@
this.terminal = false;
this.segments = new LinkedHashMap<String, List<SegmentRoute>>();
this.patterns = new ArrayList<PatternRoute>();
- this.routeParameters = new HashMap<QualifiedName, String>();
+ this.routeParams = new HashMap<QualifiedName, RouteParam>();
this.requestParams = new HashMap<String, RequestParam>();
}
@@ -164,12 +165,12 @@
Map<QualifiedName, String> abc = new HashMap<QualifiedName, String>(blah);
// Match first the static parameteters
- for (Map.Entry<QualifiedName, String> a : routeParameters.entrySet())
+ for (RouteParam param : routeParams.values())
{
- String s = blah.get(a.getKey());
- if (a.getValue().equals(s))
+ String value = blah.get(param.name);
+ if (param.value.equals(value))
{
- abc.remove(a.getKey());
+ abc.remove(param.name);
}
else
{
@@ -414,13 +415,13 @@
// Update parameters if it is possible
if (ret != null)
{
- if (routeParameters.size() > 0)
+ if (routeParams.size() > 0)
{
- for (Map.Entry<QualifiedName, String> entry : routeParameters.entrySet())
+ for (RouteParam param : routeParams.values())
{
- if (!ret.containsKey(entry.getKey()))
+ if (!ret.containsKey(param.name))
{
- ret.put(entry.getKey(), entry.getValue());
+ ret.put(param.name, param.value);
}
}
}
@@ -508,15 +509,25 @@
Route route = append(descriptor.getPathParams(), descriptor.getPath());
//
- route.terminal = true;
- route.routeParameters.putAll(descriptor.getParams());
- for (RequestParamDescriptor requestParamDescriptor : descriptor.getRequestParams().values())
+ Map<QualifiedName, RouteParam> routeParams = new HashMap<QualifiedName, RouteParam>();
+ for (RouteParamDescriptor routeParamDesc : descriptor.getRouteParams())
{
- RequestParam requestParamDef = new RequestParam(requestParamDescriptor);
- route.requestParams.put(requestParamDef.getMatchName(), requestParamDef);
+ routeParams.put(routeParamDesc.getName(), new RouteParam(routeParamDesc.getName(), routeParamDesc.getValue()));
}
//
+ Map<String, RequestParam> requestParams = new HashMap<String, RequestParam>();
+ for (RequestParamDescriptor requestParamDesc : descriptor.getRequestParams())
+ {
+ requestParams.put(requestParamDesc.getMatchName(), new RequestParam(requestParamDesc));
+ }
+
+ //
+ route.terminal = true;
+ route.routeParams.putAll(routeParams);
+ route.requestParams.putAll(requestParams);
+
+ //
for (RouteDescriptor childDescriptor : descriptor.getChildren())
{
route.append(childDescriptor);
@@ -526,17 +537,6 @@
return route;
}
- final Route append(
- Map<QualifiedName, PathParamDescriptor> pathParamDescriptors,
- String path,
- Map<QualifiedName, String> parameters)
- {
- Route route = append(pathParamDescriptors, path);
- route.terminal = true;
- route.routeParameters.putAll(parameters);
- return route;
- }
-
/**
* Append a path, creates the necessary routes and returns the last route added.
*
Added: portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/router/RouteParam.java
===================================================================
--- portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/router/RouteParam.java (rev 0)
+++ portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/router/RouteParam.java 2010-11-10 14:57:31 UTC (rev 5014)
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2010 eXo Platform SAS.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.exoplatform.web.controller.router;
+
+import org.exoplatform.web.controller.QualifiedName;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+class RouteParam
+{
+
+ /** . */
+ final QualifiedName name;
+
+ /** . */
+ final String value;
+
+ public RouteParam(QualifiedName name, String value)
+ {
+ this.name = name;
+ this.value = value;
+ }
+
+ @Override
+ public String toString()
+ {
+ return "RouteParam[name=" + name + ",value=" + value + "]";
+ }
+}
Modified: portal/branches/navcontroller/component/web/controller/src/test/java/org/exoplatform/web/controller/router/TestDescriptorBuilder.java
===================================================================
--- portal/branches/navcontroller/component/web/controller/src/test/java/org/exoplatform/web/controller/router/TestDescriptorBuilder.java 2010-11-10 14:00:56 UTC (rev 5013)
+++ portal/branches/navcontroller/component/web/controller/src/test/java/org/exoplatform/web/controller/router/TestDescriptorBuilder.java 2010-11-10 14:57:31 UTC (rev 5014)
@@ -54,7 +54,9 @@
assertTrue(i.hasNext());
RouteDescriptor route1 = i.next();
assertEquals("/public/{gtn:sitetype}/{gtn:sitename}{gtn:path}", route1.getPath());
- assertEquals(Collections.singletonMap(WebAppController.HANDLER_PARAM, "portal"), route1.getParams());
+ assertEquals(Collections.singleton(WebAppController.HANDLER_PARAM), route1.getRouteParamNames());
+ assertEquals(WebAppController.HANDLER_PARAM, route1.getRouteParam(WebAppController.HANDLER_PARAM).getName());
+ assertEquals("portal", route1.getRouteParam(WebAppController.HANDLER_PARAM).getValue());
assertEquals(Collections.singleton(QualifiedName.parse("gtn:path")), route1.getPathParams().keySet());
assertEquals(QualifiedName.parse("gtn:path"), route1.getPathParams().get(QualifiedName.parse("gtn:path")).getName());
assertEquals(".*", route1.getPathParams().get(QualifiedName.parse("gtn:path")).getPattern());
@@ -64,7 +66,9 @@
assertTrue(i.hasNext());
RouteDescriptor route2 = i.next();
assertEquals("/private/{gtn:sitetype}/{gtn:sitename}{gtn:path}", route2.getPath());
- assertEquals(Collections.singletonMap(WebAppController.HANDLER_PARAM, "portal"), route2.getParams());
+ assertEquals(Collections.singleton(WebAppController.HANDLER_PARAM), route2.getRouteParamNames());
+ assertEquals(WebAppController.HANDLER_PARAM, route2.getRouteParam(WebAppController.HANDLER_PARAM).getName());
+ assertEquals("portal", route2.getRouteParam(WebAppController.HANDLER_PARAM).getValue());
assertEquals(Collections.singleton(QualifiedName.parse("gtn:path")), route2.getPathParams().keySet());
assertEquals(QualifiedName.parse("gtn:path"), route2.getPathParams().get(QualifiedName.parse("gtn:path")).getName());
assertEquals(".*", route2.getPathParams().get(QualifiedName.parse("gtn:path")).getPattern());
@@ -74,41 +78,49 @@
assertTrue(i.hasNext());
RouteDescriptor route3 = i.next();
assertEquals("/upload", route3.getPath());
- assertEquals(Collections.singletonMap(WebAppController.HANDLER_PARAM, "upload"), route3.getParams());
+ assertEquals(Collections.singleton(WebAppController.HANDLER_PARAM), route3.getRouteParamNames());
+ assertEquals(WebAppController.HANDLER_PARAM, route3.getRouteParam(WebAppController.HANDLER_PARAM).getName());
+ assertEquals("upload", route3.getRouteParam(WebAppController.HANDLER_PARAM).getValue());
//
assertTrue(i.hasNext());
RouteDescriptor route4 = i.next();
assertEquals("/download", route4.getPath());
- assertEquals(Collections.singletonMap(WebAppController.HANDLER_PARAM, "download"), route4.getParams());
+ assertEquals(Collections.singleton(WebAppController.HANDLER_PARAM), route4.getRouteParamNames());
+ assertEquals(WebAppController.HANDLER_PARAM, route4.getRouteParam(WebAppController.HANDLER_PARAM).getName());
+ assertEquals("download", route4.getRouteParam(WebAppController.HANDLER_PARAM).getValue());
//
assertTrue(i.hasNext());
RouteDescriptor route5 = i.next();
assertEquals("/a", route5.getPath());
- assertEquals(Collections.singletonMap(QualifiedName.create("a"), "a_value"), route5.getParams());
+ assertEquals(Collections.singleton(QualifiedName.create("a")), route5.getRouteParamNames());
+ assertEquals(QualifiedName.create("a"), route5.getRouteParam(QualifiedName.create("a")).getName());
+ assertEquals("a_value", route5.getRouteParam(QualifiedName.create("a")).getValue());
assertEquals(1, route5.getChildren().size());
RouteDescriptor route5_1 = route5.getChildren().get(0);
assertEquals("/b", route5_1.getPath());
- assertEquals(Collections.singletonMap(QualifiedName.create("b"), "b_value"), route5_1.getParams());
+ assertEquals(Collections.singleton(QualifiedName.create("b")), route5_1.getRouteParamNames());
+ assertEquals(QualifiedName.create("b"), route5_1.getRouteParam(QualifiedName.create("b")).getName());
+ assertEquals("b_value", route5_1.getRouteParam(QualifiedName.create("b")).getValue());
//
assertTrue(i.hasNext());
RouteDescriptor route6 = i.next();
assertEquals("/b", route6.getPath());
- assertEquals(new HashSet<String>(Arrays.asList("foo", "bar", "juu")), route6.getRequestParams().keySet());
- assertEquals(QualifiedName.parse("foo"), route6.getRequestParams().get("foo").getName());
- assertEquals("foo", route6.getRequestParams().get("foo").getMatchName());
- assertEquals(null, route6.getRequestParams().get("foo").getMatchValue());
- assertEquals(false, route6.getRequestParams().get("foo").isRequired());
- assertEquals(QualifiedName.parse("bar"), route6.getRequestParams().get("bar").getName());
- assertEquals("bar", route6.getRequestParams().get("bar").getMatchName());
- assertEquals("bar", route6.getRequestParams().get("bar").getMatchValue());
- assertEquals(false, route6.getRequestParams().get("bar").isRequired());
- assertEquals(QualifiedName.parse("juu"), route6.getRequestParams().get("juu").getName());
- assertEquals("juu", route6.getRequestParams().get("juu").getMatchName());
- assertEquals("juu", route6.getRequestParams().get("juu").getMatchValue());
- assertEquals(true, route6.getRequestParams().get("juu").isRequired());
+ assertEquals(new HashSet<String>(Arrays.asList("foo", "bar", "juu")), route6.getRequestParamMatchNames());
+ assertEquals(QualifiedName.parse("foo"), route6.getRequestParam("foo").getName());
+ assertEquals("foo", route6.getRequestParam("foo").getMatchName());
+ assertEquals(null, route6.getRequestParam("foo").getMatchValue());
+ assertEquals(false, route6.getRequestParam("foo").isRequired());
+ assertEquals(QualifiedName.parse("bar"), route6.getRequestParam("bar").getName());
+ assertEquals("bar", route6.getRequestParam("bar").getMatchName());
+ assertEquals("bar", route6.getRequestParam("bar").getMatchValue());
+ assertEquals(false, route6.getRequestParam("bar").isRequired());
+ assertEquals(QualifiedName.parse("juu"), route6.getRequestParam("juu").getName());
+ assertEquals("juu", route6.getRequestParam("juu").getMatchName());
+ assertEquals("juu", route6.getRequestParam("juu").getMatchValue());
+ assertEquals(true, route6.getRequestParam("juu").isRequired());
//
assertFalse(i.hasNext());
Modified: portal/branches/navcontroller/component/web/controller/src/test/java/org/exoplatform/web/controller/router/TestHierarchy.java
===================================================================
--- portal/branches/navcontroller/component/web/controller/src/test/java/org/exoplatform/web/controller/router/TestHierarchy.java 2010-11-10 14:00:56 UTC (rev 5013)
+++ portal/branches/navcontroller/component/web/controller/src/test/java/org/exoplatform/web/controller/router/TestHierarchy.java 2010-11-10 14:57:31 UTC (rev 5014)
@@ -38,8 +38,8 @@
{
RouteDescriptor descriptor = new RouteDescriptor("/a").
- addParam("foo", "bar").
- addRoute(new RouteDescriptor("/b").addParam("juu", "daa"));
+ addRouteParam("foo", "bar").
+ addRoute(new RouteDescriptor("/b").addRouteParam("juu", "daa"));
//
Router router = new Router(new RouterDescriptor().addRoute(descriptor));
Modified: portal/branches/navcontroller/component/web/controller/src/test/java/org/exoplatform/web/controller/router/TestLegacyPortal.java
===================================================================
--- portal/branches/navcontroller/component/web/controller/src/test/java/org/exoplatform/web/controller/router/TestLegacyPortal.java 2010-11-10 14:00:56 UTC (rev 5013)
+++ portal/branches/navcontroller/component/web/controller/src/test/java/org/exoplatform/web/controller/router/TestLegacyPortal.java 2010-11-10 14:57:31 UTC (rev 5014)
@@ -44,14 +44,14 @@
RouterDescriptor routerMD = new RouterDescriptor();
RouteDescriptor portal = new RouteDescriptor("/").
- addParam(QualifiedName.parse("gtn:handler"), "portal").
+ addRouteParam(QualifiedName.parse("gtn:handler"), "portal").
addRequestParam(QualifiedName.parse("gtn:componentid"), "portal:componentId", null, false).
addRequestParam(QualifiedName.parse("gtn:action"), "portal:action", null, false).
addRequestParam(QualifiedName.parse("gtn:objectid"), "portal:objectId", null, false).
addRoute(new RouteDescriptor("/public/{gtn:sitename}{gtn:path}").
- addParam(QualifiedName.parse("gtn:access"), "public")).addPathParam(QualifiedName.parse("gtn:path"), ".*", EncodingMode.PRESERVE_PATH).
+ addRouteParam(QualifiedName.parse("gtn:access"), "public")).addPathParam(QualifiedName.parse("gtn:path"), ".*", EncodingMode.PRESERVE_PATH).
addRoute(new RouteDescriptor("/private/{gtn:sitename}{gtn:path}").addPathParam(QualifiedName.parse("gtn:path"), ".*", EncodingMode.PRESERVE_PATH).
- addParam(QualifiedName.parse("gtn:access"), "private"));
+ addRouteParam(QualifiedName.parse("gtn:access"), "private"));
//
routerMD.addRoute(portal);
Modified: portal/branches/navcontroller/component/web/controller/src/test/java/org/exoplatform/web/controller/router/TestMatch.java
===================================================================
--- portal/branches/navcontroller/component/web/controller/src/test/java/org/exoplatform/web/controller/router/TestMatch.java 2010-11-10 14:00:56 UTC (rev 5013)
+++ portal/branches/navcontroller/component/web/controller/src/test/java/org/exoplatform/web/controller/router/TestMatch.java 2010-11-10 14:57:31 UTC (rev 5014)
@@ -96,7 +96,7 @@
public void testParameterPropagationToDescendants() throws Exception
{
RouterDescriptor routerMD = new RouterDescriptor();
- routerMD.addRoute(new RouteDescriptor("/").addParam("p", "a"));
+ routerMD.addRoute(new RouteDescriptor("/").addRouteParam("p", "a"));
routerMD.addRoute(new RouteDescriptor("/a"));
Router router = new Router(routerMD);
@@ -168,7 +168,7 @@
public void testTwoRules1() throws Exception
{
RouterDescriptor routerMD = new RouterDescriptor();
- routerMD.addRoute(new RouteDescriptor("/a").addParam("b", "b"));
+ routerMD.addRoute(new RouteDescriptor("/a").addRouteParam("b", "b"));
routerMD.addRoute(new RouteDescriptor("/a/b"));
Router router = new Router(routerMD);
@@ -180,7 +180,7 @@
public void testTwoRules2() throws Exception
{
RouterDescriptor routerMD = new RouterDescriptor();
- routerMD.addRoute(new RouteDescriptor("/{a}").addParam("b", "b"));
+ routerMD.addRoute(new RouteDescriptor("/{a}").addRouteParam("b", "b"));
routerMD.addRoute(new RouteDescriptor("/{a}/b"));
Router router = new Router(routerMD);
Modified: portal/branches/navcontroller/component/web/controller/src/test/java/org/exoplatform/web/controller/router/TestPortalConfiguration.java
===================================================================
--- portal/branches/navcontroller/component/web/controller/src/test/java/org/exoplatform/web/controller/router/TestPortalConfiguration.java 2010-11-10 14:00:56 UTC (rev 5013)
+++ portal/branches/navcontroller/component/web/controller/src/test/java/org/exoplatform/web/controller/router/TestPortalConfiguration.java 2010-11-10 14:57:31 UTC (rev 5014)
@@ -44,26 +44,26 @@
//
RouteDescriptor portalRouteMD = new RouteDescriptor("/private/{gtn:sitetype}/{gtn:sitename}{gtn:path}");
- portalRouteMD.addParam(QualifiedName.create("gtn", "controller"), "site");
+ portalRouteMD.addRouteParam(QualifiedName.create("gtn", "controller"), "site");
portalRouteMD.addRequestParam(QualifiedName.create("gtn", "componentid"), "portal:componentId", null, false);
portalRouteMD.addPathParam(QualifiedName.create("gtn", "path"), ".*", EncodingMode.PRESERVE_PATH);
routerMD.addRoute(portalRouteMD);
//
RouteDescriptor portalRouteMD2 = new RouteDescriptor("/private/{gtn:sitetype}/{gtn:sitename}{gtn:path}");
- portalRouteMD2.addParam(QualifiedName.create("gtn", "controller"), "site");
+ portalRouteMD2.addRouteParam(QualifiedName.create("gtn", "controller"), "site");
portalRouteMD2.addPathParam(QualifiedName.create("gtn", "path"), ".*", EncodingMode.PRESERVE_PATH);
routerMD.addRoute(portalRouteMD2);
//
RouteDescriptor groupRouteMD = new RouteDescriptor("/groups/{gtn:sitetype}/{gtn:sitename}{gtn:path}");
- groupRouteMD.addParam(QualifiedName.create("gtn", "controller"), "site");
+ groupRouteMD.addRouteParam(QualifiedName.create("gtn", "controller"), "site");
groupRouteMD.addPathParam(QualifiedName.create("gtn", "path"), ".*", EncodingMode.PRESERVE_PATH);
routerMD.addRoute(groupRouteMD);
//
RouteDescriptor userRouteMD = new RouteDescriptor("/users/{gtn:sitetype}/{gtn:sitename}{gtn:path}");
- userRouteMD.addParam(QualifiedName.create("gtn", "controller"), "site");
+ userRouteMD.addRouteParam(QualifiedName.create("gtn", "controller"), "site");
userRouteMD.addPathParam(QualifiedName.create("gtn", "path"), ".*", EncodingMode.PRESERVE_PATH);
routerMD.addRoute(userRouteMD);
15 years, 5 months
gatein SVN: r5013 - in portal/branches/navcontroller: webui/portal/src/main/java/org/exoplatform/portal/url and 1 other directory.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2010-11-10 09:00:56 -0500 (Wed, 10 Nov 2010)
New Revision: 5013
Added:
portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/url/MediaType.java
Removed:
portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/url/MimeType.java
Modified:
portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/url/ControllerURL.java
portal/branches/navcontroller/webui/portal/src/main/java/org/exoplatform/portal/url/PortalURLRenderContext.java
Log:
rename MimeType to MediaType
Modified: portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/url/ControllerURL.java
===================================================================
--- portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/url/ControllerURL.java 2010-11-10 13:29:48 UTC (rev 5012)
+++ portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/url/ControllerURL.java 2010-11-10 14:00:56 UTC (rev 5013)
@@ -48,7 +48,7 @@
protected ParameterMap queryParams;
/** . */
- protected MimeType mimeType;
+ protected MediaType mimeType;
/**
* Create a resource URL instance.
@@ -150,11 +150,11 @@
/**
* Returns the current mime type that this URL will be generated for, or null if none is set (which means
- * there is no guarantees about the mime type that will be used as target but it's likely to be {@link MimeType#XHTML}}).
+ * there is no guarantees about the mime type that will be used as target but it's likely to be {@link MediaType#XHTML}}).
*
* @return the current mime type
*/
- public MimeType getMimeType()
+ public MediaType getMimeType()
{
return mimeType;
}
@@ -165,7 +165,7 @@
*
* @param mimeType the new mime type
*/
- public void setMimeType(MimeType mimeType)
+ public void setMimeType(MediaType mimeType)
{
this.mimeType = mimeType;
}
Copied: portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/url/MediaType.java (from rev 4981, portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/url/MimeType.java)
===================================================================
--- portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/url/MediaType.java (rev 0)
+++ portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/url/MediaType.java 2010-11-10 14:00:56 UTC (rev 5013)
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2010 eXo Platform SAS.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.exoplatform.web.url;
+
+/**
+ * A simple media type enumeration that is used when a URL is generated.
+ *
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+public enum MediaType
+{
+
+ XHTML, PLAIN
+
+}
Deleted: portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/url/MimeType.java
===================================================================
--- portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/url/MimeType.java 2010-11-10 13:29:48 UTC (rev 5012)
+++ portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/url/MimeType.java 2010-11-10 14:00:56 UTC (rev 5013)
@@ -1,33 +0,0 @@
-/*
- * Copyright (C) 2010 eXo Platform SAS.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-package org.exoplatform.web.url;
-
-/**
- * A simple mime type enumeration that is used when a URL is generated.
- *
- * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
- * @version $Revision$
- */
-public enum MimeType
-{
-
- XHTML, PLAIN
-
-}
Modified: portal/branches/navcontroller/webui/portal/src/main/java/org/exoplatform/portal/url/PortalURLRenderContext.java
===================================================================
--- portal/branches/navcontroller/webui/portal/src/main/java/org/exoplatform/portal/url/PortalURLRenderContext.java 2010-11-10 13:29:48 UTC (rev 5012)
+++ portal/branches/navcontroller/webui/portal/src/main/java/org/exoplatform/portal/url/PortalURLRenderContext.java 2010-11-10 14:00:56 UTC (rev 5013)
@@ -22,7 +22,7 @@
import org.exoplatform.commons.utils.CharEncoder;
import org.exoplatform.commons.utils.CharsetCharEncoder;
import org.exoplatform.web.controller.router.RenderContext;
-import org.exoplatform.web.url.MimeType;
+import org.exoplatform.web.url.MediaType;
import java.util.ArrayList;
import java.util.Collections;
@@ -38,12 +38,12 @@
{
/** . */
- private static final Map<MimeType, String> AMP_MAP = new EnumMap<MimeType, String>(MimeType.class);
+ private static final Map<MediaType, String> AMP_MAP = new EnumMap<MediaType, String>(MediaType.class);
static
{
- AMP_MAP.put(MimeType.XHTML, "&");
- AMP_MAP.put(MimeType.PLAIN, "&");
+ AMP_MAP.put(MediaType.XHTML, "&");
+ AMP_MAP.put(MediaType.PLAIN, "&");
}
/** . */
@@ -62,7 +62,7 @@
private List<String[]> queryParams;
/** . */
- private MimeType mimeType;
+ private MediaType mimeType;
PortalURLRenderContext(StringBuilder buffer)
@@ -71,12 +71,12 @@
this.queryParams = EMPTY;
}
- public MimeType getMimeType()
+ public MediaType getMimeType()
{
return mimeType;
}
- public void setMimeType(MimeType mimeType)
+ public void setMimeType(MediaType mimeType)
{
this.mimeType = mimeType;
}
@@ -128,10 +128,10 @@
*/
void flush()
{
- MimeType mt = mimeType;
+ MediaType mt = mimeType;
if (mt == null)
{
- mt = MimeType.XHTML;
+ mt = MediaType.XHTML;
}
String amp = AMP_MAP.get(mt);
15 years, 5 months
gatein SVN: r5012 - in components/pc/trunk: api and 12 other directories.
by do-not-reply@jboss.org
Author: thomas.heute(a)jboss.com
Date: 2010-11-10 08:29:48 -0500 (Wed, 10 Nov 2010)
New Revision: 5012
Modified:
components/pc/trunk/api/pom.xml
components/pc/trunk/bridge/pom.xml
components/pc/trunk/controller/pom.xml
components/pc/trunk/docs/pom.xml
components/pc/trunk/docs/user-guide/pom.xml
components/pc/trunk/federation/pom.xml
components/pc/trunk/jsr168api/pom.xml
components/pc/trunk/management/pom.xml
components/pc/trunk/mc/pom.xml
components/pc/trunk/pom.xml
components/pc/trunk/portal/pom.xml
components/pc/trunk/portlet/pom.xml
components/pc/trunk/samples/pom.xml
components/pc/trunk/test/pom.xml
Log:
[maven-release-plugin] prepare for next development iteration
Modified: components/pc/trunk/api/pom.xml
===================================================================
--- components/pc/trunk/api/pom.xml 2010-11-10 13:29:13 UTC (rev 5011)
+++ components/pc/trunk/api/pom.xml 2010-11-10 13:29:48 UTC (rev 5012)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.pc</groupId>
<artifactId>pc-parent</artifactId>
- <version>2.2.0-CR02</version>
+ <version>2.2.0-CR03-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.gatein.pc</groupId>
Modified: components/pc/trunk/bridge/pom.xml
===================================================================
--- components/pc/trunk/bridge/pom.xml 2010-11-10 13:29:13 UTC (rev 5011)
+++ components/pc/trunk/bridge/pom.xml 2010-11-10 13:29:48 UTC (rev 5012)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.pc</groupId>
<artifactId>pc-parent</artifactId>
- <version>2.2.0-CR02</version>
+ <version>2.2.0-CR03-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>pc-bridge</artifactId>
Modified: components/pc/trunk/controller/pom.xml
===================================================================
--- components/pc/trunk/controller/pom.xml 2010-11-10 13:29:13 UTC (rev 5011)
+++ components/pc/trunk/controller/pom.xml 2010-11-10 13:29:48 UTC (rev 5012)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.pc</groupId>
<artifactId>pc-parent</artifactId>
- <version>2.2.0-CR02</version>
+ <version>2.2.0-CR03-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>pc-controller</artifactId>
Modified: components/pc/trunk/docs/pom.xml
===================================================================
--- components/pc/trunk/docs/pom.xml 2010-11-10 13:29:13 UTC (rev 5011)
+++ components/pc/trunk/docs/pom.xml 2010-11-10 13:29:48 UTC (rev 5012)
@@ -3,7 +3,7 @@
<parent>
<groupId>org.gatein.pc</groupId>
<artifactId>pc-parent</artifactId>
- <version>2.2.0-CR02</version>
+ <version>2.2.0-CR03-SNAPSHOT</version>
</parent>
<artifactId>docs-aggregator</artifactId>
<packaging>pom</packaging>
Modified: components/pc/trunk/docs/user-guide/pom.xml
===================================================================
--- components/pc/trunk/docs/user-guide/pom.xml 2010-11-10 13:29:13 UTC (rev 5011)
+++ components/pc/trunk/docs/user-guide/pom.xml 2010-11-10 13:29:48 UTC (rev 5012)
@@ -5,7 +5,7 @@
<parent>
<groupId>org.gatein.pc</groupId>
<artifactId>pc-parent</artifactId>
- <version>2.2.0-CR02</version>
+ <version>2.2.0-CR03-SNAPSHOT</version>
</parent>
<groupId>org.gatein.pc</groupId>
<artifactId>user-guide-${translation}</artifactId>
Modified: components/pc/trunk/federation/pom.xml
===================================================================
--- components/pc/trunk/federation/pom.xml 2010-11-10 13:29:13 UTC (rev 5011)
+++ components/pc/trunk/federation/pom.xml 2010-11-10 13:29:48 UTC (rev 5012)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.pc</groupId>
<artifactId>pc-parent</artifactId>
- <version>2.2.0-CR02</version>
+ <version>2.2.0-CR03-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>pc-federation</artifactId>
Modified: components/pc/trunk/jsr168api/pom.xml
===================================================================
--- components/pc/trunk/jsr168api/pom.xml 2010-11-10 13:29:13 UTC (rev 5011)
+++ components/pc/trunk/jsr168api/pom.xml 2010-11-10 13:29:48 UTC (rev 5012)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.pc</groupId>
<artifactId>pc-parent</artifactId>
- <version>2.2.0-CR02</version>
+ <version>2.2.0-CR03-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>pc-jsr168api</artifactId>
Modified: components/pc/trunk/management/pom.xml
===================================================================
--- components/pc/trunk/management/pom.xml 2010-11-10 13:29:13 UTC (rev 5011)
+++ components/pc/trunk/management/pom.xml 2010-11-10 13:29:48 UTC (rev 5012)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.pc</groupId>
<artifactId>pc-parent</artifactId>
- <version>2.2.0-CR02</version>
+ <version>2.2.0-CR03-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>pc-management</artifactId>
Modified: components/pc/trunk/mc/pom.xml
===================================================================
--- components/pc/trunk/mc/pom.xml 2010-11-10 13:29:13 UTC (rev 5011)
+++ components/pc/trunk/mc/pom.xml 2010-11-10 13:29:48 UTC (rev 5012)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.pc</groupId>
<artifactId>pc-parent</artifactId>
- <version>2.2.0-CR02</version>
+ <version>2.2.0-CR03-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>pc-mc</artifactId>
Modified: components/pc/trunk/pom.xml
===================================================================
--- components/pc/trunk/pom.xml 2010-11-10 13:29:13 UTC (rev 5011)
+++ components/pc/trunk/pom.xml 2010-11-10 13:29:48 UTC (rev 5012)
@@ -29,7 +29,7 @@
<groupId>org.gatein.pc</groupId>
<artifactId>pc-parent</artifactId>
- <version>2.2.0-CR02</version>
+ <version>2.2.0-CR03-SNAPSHOT</version>
<packaging>pom</packaging>
<parent>
@@ -39,9 +39,9 @@
</parent>
<scm>
- <connection>scm:svn:http://anonsvn.jboss.org/repos/gatein/components/pc/tags/2.2.0-CR02</connection>
- <developerConnection>scm:svn:https://svn.jboss.org/repos/gatein/components/pc/tags/2.2.0-CR02</developerConnection>
- <url>http://fisheye.jboss.org/browse/gatein/components/pc/tags/2.2.0-CR02</url>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/gatein/components/pc/trunk</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/gatein/components/pc/trunk</developerConnection>
+ <url>http://fisheye.jboss.org/browse/gatein/components/pc/trunk</url>
</scm>
<properties>
Modified: components/pc/trunk/portal/pom.xml
===================================================================
--- components/pc/trunk/portal/pom.xml 2010-11-10 13:29:13 UTC (rev 5011)
+++ components/pc/trunk/portal/pom.xml 2010-11-10 13:29:48 UTC (rev 5012)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.pc</groupId>
<artifactId>pc-parent</artifactId>
- <version>2.2.0-CR02</version>
+ <version>2.2.0-CR03-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>pc-portal</artifactId>
Modified: components/pc/trunk/portlet/pom.xml
===================================================================
--- components/pc/trunk/portlet/pom.xml 2010-11-10 13:29:13 UTC (rev 5011)
+++ components/pc/trunk/portlet/pom.xml 2010-11-10 13:29:48 UTC (rev 5012)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.pc</groupId>
<artifactId>pc-parent</artifactId>
- <version>2.2.0-CR02</version>
+ <version>2.2.0-CR03-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>pc-portlet</artifactId>
Modified: components/pc/trunk/samples/pom.xml
===================================================================
--- components/pc/trunk/samples/pom.xml 2010-11-10 13:29:13 UTC (rev 5011)
+++ components/pc/trunk/samples/pom.xml 2010-11-10 13:29:48 UTC (rev 5012)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.pc</groupId>
<artifactId>pc-parent</artifactId>
- <version>2.2.0-CR02</version>
+ <version>2.2.0-CR03-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>pc-samples</artifactId>
Modified: components/pc/trunk/test/pom.xml
===================================================================
--- components/pc/trunk/test/pom.xml 2010-11-10 13:29:13 UTC (rev 5011)
+++ components/pc/trunk/test/pom.xml 2010-11-10 13:29:48 UTC (rev 5012)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.pc</groupId>
<artifactId>pc-parent</artifactId>
- <version>2.2.0-CR02</version>
+ <version>2.2.0-CR03-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>pc-test</artifactId>
15 years, 5 months
gatein SVN: r5011 - components/pc/tags.
by do-not-reply@jboss.org
Author: thomas.heute(a)jboss.com
Date: 2010-11-10 08:29:13 -0500 (Wed, 10 Nov 2010)
New Revision: 5011
Added:
components/pc/tags/2.2.0-CR02/
Log:
[maven-scm] copy for tag 2.2.0-CR02
Copied: components/pc/tags/2.2.0-CR02 (from rev 5010, components/pc/trunk)
15 years, 5 months
gatein SVN: r5010 - in components/pc/trunk: api and 12 other directories.
by do-not-reply@jboss.org
Author: thomas.heute(a)jboss.com
Date: 2010-11-10 08:28:47 -0500 (Wed, 10 Nov 2010)
New Revision: 5010
Modified:
components/pc/trunk/api/pom.xml
components/pc/trunk/bridge/pom.xml
components/pc/trunk/controller/pom.xml
components/pc/trunk/docs/pom.xml
components/pc/trunk/docs/user-guide/pom.xml
components/pc/trunk/federation/pom.xml
components/pc/trunk/jsr168api/pom.xml
components/pc/trunk/management/pom.xml
components/pc/trunk/mc/pom.xml
components/pc/trunk/pom.xml
components/pc/trunk/portal/pom.xml
components/pc/trunk/portlet/pom.xml
components/pc/trunk/samples/pom.xml
components/pc/trunk/test/pom.xml
Log:
[maven-release-plugin] prepare release 2.2.0-CR02
Modified: components/pc/trunk/api/pom.xml
===================================================================
--- components/pc/trunk/api/pom.xml 2010-11-10 12:45:39 UTC (rev 5009)
+++ components/pc/trunk/api/pom.xml 2010-11-10 13:28:47 UTC (rev 5010)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.pc</groupId>
<artifactId>pc-parent</artifactId>
- <version>2.2.0-CR02-SNAPSHOT</version>
+ <version>2.2.0-CR02</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.gatein.pc</groupId>
Modified: components/pc/trunk/bridge/pom.xml
===================================================================
--- components/pc/trunk/bridge/pom.xml 2010-11-10 12:45:39 UTC (rev 5009)
+++ components/pc/trunk/bridge/pom.xml 2010-11-10 13:28:47 UTC (rev 5010)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.pc</groupId>
<artifactId>pc-parent</artifactId>
- <version>2.2.0-CR02-SNAPSHOT</version>
+ <version>2.2.0-CR02</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>pc-bridge</artifactId>
Modified: components/pc/trunk/controller/pom.xml
===================================================================
--- components/pc/trunk/controller/pom.xml 2010-11-10 12:45:39 UTC (rev 5009)
+++ components/pc/trunk/controller/pom.xml 2010-11-10 13:28:47 UTC (rev 5010)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.pc</groupId>
<artifactId>pc-parent</artifactId>
- <version>2.2.0-CR02-SNAPSHOT</version>
+ <version>2.2.0-CR02</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>pc-controller</artifactId>
Modified: components/pc/trunk/docs/pom.xml
===================================================================
--- components/pc/trunk/docs/pom.xml 2010-11-10 12:45:39 UTC (rev 5009)
+++ components/pc/trunk/docs/pom.xml 2010-11-10 13:28:47 UTC (rev 5010)
@@ -3,7 +3,7 @@
<parent>
<groupId>org.gatein.pc</groupId>
<artifactId>pc-parent</artifactId>
- <version>2.2.0-CR02-SNAPSHOT</version>
+ <version>2.2.0-CR02</version>
</parent>
<artifactId>docs-aggregator</artifactId>
<packaging>pom</packaging>
Modified: components/pc/trunk/docs/user-guide/pom.xml
===================================================================
--- components/pc/trunk/docs/user-guide/pom.xml 2010-11-10 12:45:39 UTC (rev 5009)
+++ components/pc/trunk/docs/user-guide/pom.xml 2010-11-10 13:28:47 UTC (rev 5010)
@@ -5,7 +5,7 @@
<parent>
<groupId>org.gatein.pc</groupId>
<artifactId>pc-parent</artifactId>
- <version>2.2.0-CR02-SNAPSHOT</version>
+ <version>2.2.0-CR02</version>
</parent>
<groupId>org.gatein.pc</groupId>
<artifactId>user-guide-${translation}</artifactId>
Modified: components/pc/trunk/federation/pom.xml
===================================================================
--- components/pc/trunk/federation/pom.xml 2010-11-10 12:45:39 UTC (rev 5009)
+++ components/pc/trunk/federation/pom.xml 2010-11-10 13:28:47 UTC (rev 5010)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.pc</groupId>
<artifactId>pc-parent</artifactId>
- <version>2.2.0-CR02-SNAPSHOT</version>
+ <version>2.2.0-CR02</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>pc-federation</artifactId>
Modified: components/pc/trunk/jsr168api/pom.xml
===================================================================
--- components/pc/trunk/jsr168api/pom.xml 2010-11-10 12:45:39 UTC (rev 5009)
+++ components/pc/trunk/jsr168api/pom.xml 2010-11-10 13:28:47 UTC (rev 5010)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.pc</groupId>
<artifactId>pc-parent</artifactId>
- <version>2.2.0-CR02-SNAPSHOT</version>
+ <version>2.2.0-CR02</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>pc-jsr168api</artifactId>
Modified: components/pc/trunk/management/pom.xml
===================================================================
--- components/pc/trunk/management/pom.xml 2010-11-10 12:45:39 UTC (rev 5009)
+++ components/pc/trunk/management/pom.xml 2010-11-10 13:28:47 UTC (rev 5010)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.pc</groupId>
<artifactId>pc-parent</artifactId>
- <version>2.2.0-CR02-SNAPSHOT</version>
+ <version>2.2.0-CR02</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>pc-management</artifactId>
Modified: components/pc/trunk/mc/pom.xml
===================================================================
--- components/pc/trunk/mc/pom.xml 2010-11-10 12:45:39 UTC (rev 5009)
+++ components/pc/trunk/mc/pom.xml 2010-11-10 13:28:47 UTC (rev 5010)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.pc</groupId>
<artifactId>pc-parent</artifactId>
- <version>2.2.0-CR02-SNAPSHOT</version>
+ <version>2.2.0-CR02</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>pc-mc</artifactId>
Modified: components/pc/trunk/pom.xml
===================================================================
--- components/pc/trunk/pom.xml 2010-11-10 12:45:39 UTC (rev 5009)
+++ components/pc/trunk/pom.xml 2010-11-10 13:28:47 UTC (rev 5010)
@@ -29,7 +29,7 @@
<groupId>org.gatein.pc</groupId>
<artifactId>pc-parent</artifactId>
- <version>2.2.0-CR02-SNAPSHOT</version>
+ <version>2.2.0-CR02</version>
<packaging>pom</packaging>
<parent>
@@ -39,9 +39,9 @@
</parent>
<scm>
- <connection>scm:svn:http://anonsvn.jboss.org/repos/gatein/components/pc/trunk</connection>
- <developerConnection>scm:svn:https://svn.jboss.org/repos/gatein/components/pc/trunk</developerConnection>
- <url>http://fisheye.jboss.org/browse/gatein/components/pc/trunk</url>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/gatein/components/pc/tags/2.2.0-CR02</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/gatein/components/pc/tags/2.2.0-CR02</developerConnection>
+ <url>http://fisheye.jboss.org/browse/gatein/components/pc/tags/2.2.0-CR02</url>
</scm>
<properties>
Modified: components/pc/trunk/portal/pom.xml
===================================================================
--- components/pc/trunk/portal/pom.xml 2010-11-10 12:45:39 UTC (rev 5009)
+++ components/pc/trunk/portal/pom.xml 2010-11-10 13:28:47 UTC (rev 5010)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.pc</groupId>
<artifactId>pc-parent</artifactId>
- <version>2.2.0-CR02-SNAPSHOT</version>
+ <version>2.2.0-CR02</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>pc-portal</artifactId>
Modified: components/pc/trunk/portlet/pom.xml
===================================================================
--- components/pc/trunk/portlet/pom.xml 2010-11-10 12:45:39 UTC (rev 5009)
+++ components/pc/trunk/portlet/pom.xml 2010-11-10 13:28:47 UTC (rev 5010)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.pc</groupId>
<artifactId>pc-parent</artifactId>
- <version>2.2.0-CR02-SNAPSHOT</version>
+ <version>2.2.0-CR02</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>pc-portlet</artifactId>
Modified: components/pc/trunk/samples/pom.xml
===================================================================
--- components/pc/trunk/samples/pom.xml 2010-11-10 12:45:39 UTC (rev 5009)
+++ components/pc/trunk/samples/pom.xml 2010-11-10 13:28:47 UTC (rev 5010)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.pc</groupId>
<artifactId>pc-parent</artifactId>
- <version>2.2.0-CR02-SNAPSHOT</version>
+ <version>2.2.0-CR02</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>pc-samples</artifactId>
Modified: components/pc/trunk/test/pom.xml
===================================================================
--- components/pc/trunk/test/pom.xml 2010-11-10 12:45:39 UTC (rev 5009)
+++ components/pc/trunk/test/pom.xml 2010-11-10 13:28:47 UTC (rev 5010)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.pc</groupId>
<artifactId>pc-parent</artifactId>
- <version>2.2.0-CR02-SNAPSHOT</version>
+ <version>2.2.0-CR02</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>pc-test</artifactId>
15 years, 5 months
gatein SVN: r5009 - components/sso/trunk/agent/src/main/java/org/gatein/sso/agent/login.
by do-not-reply@jboss.org
Author: sohil.shah(a)jboss.com
Date: 2010-11-10 07:45:39 -0500 (Wed, 10 Nov 2010)
New Revision: 5009
Modified:
components/sso/trunk/agent/src/main/java/org/gatein/sso/agent/login/SPNEGORolesModule.java
Log:
JBEPP-562: EPP5+SPNEGO : NullPointerException when automated logout during session expiration
Modified: components/sso/trunk/agent/src/main/java/org/gatein/sso/agent/login/SPNEGORolesModule.java
===================================================================
--- components/sso/trunk/agent/src/main/java/org/gatein/sso/agent/login/SPNEGORolesModule.java 2010-11-10 12:35:49 UTC (rev 5008)
+++ components/sso/trunk/agent/src/main/java/org/gatein/sso/agent/login/SPNEGORolesModule.java 2010-11-10 12:45:39 UTC (rev 5009)
@@ -222,6 +222,11 @@
//Obtain the httpsession key
HttpServletRequest request = (HttpServletRequest) PolicyContext.getContext("javax.servlet.http.HttpServletRequest");
+ if(request == null)
+ {
+ return true;
+ }
+
HttpSession session = request.getSession(false);
String sessionId = session.getId();
@@ -280,7 +285,7 @@
}
catch (Exception e)
{
- log.error("Could not perform JBoss security manager cache eviction", e);
+ log.debug("Could not perform JBoss security manager cache eviction", e);
}
}
else
15 years, 5 months
gatein SVN: r5008 - in portal/trunk/component/wsrp/src: test/java/org/gatein/portal/wsrp/structure and 1 other directory.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2010-11-10 07:35:49 -0500 (Wed, 10 Nov 2010)
New Revision: 5008
Modified:
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/structure/MOPConsumerStructureProvider.java
portal/trunk/component/wsrp/src/test/java/org/gatein/portal/wsrp/structure/MOPConsumerStructureProviderTestCase.java
Log:
- GTNWSRP-112: we only get page deletion events after the JCR page has already been removed so had to work around this. Adapted tests.
Modified: portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/structure/MOPConsumerStructureProvider.java
===================================================================
--- portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/structure/MOPConsumerStructureProvider.java 2010-11-10 12:09:59 UTC (rev 5007)
+++ portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/structure/MOPConsumerStructureProvider.java 2010-11-10 12:35:49 UTC (rev 5008)
@@ -88,7 +88,7 @@
private void addPage(Page page)
{
Described described = page.adapt(Described.class);
- PageInfo pageInfo = new PageInfo(page.getObjectId(), described.getName());
+ PageInfo pageInfo = new PageInfo(page.getObjectId(), described.getName(), page.getName());
pageInfos.put(pageInfo.getName(), pageInfo);
UIContainer container = page.getRootComponent();
processContainer(container, pageInfo);
@@ -194,6 +194,16 @@
org.exoplatform.portal.config.model.Page portalPage = event.getData();
Page page = structureAccess.getPageFrom(portalPage);
+ if (page == null && DataStorage.PAGE_REMOVED.equals(eventName))
+ {
+ // if we try to remove a page, when we get this event, the page has already been removed from JCR
+ // so we need to work around that fact by retrieving the corresponding PageInfo from the portal page title
+ // which should match the Described name and check that it matches the internal name before removing it
+ removePage(portalPage.getTitle(), portalPage.getName());
+
+ return;
+ }
+
if (page != null)
{
if (DataStorage.PAGE_CREATED.equals(eventName))
@@ -201,10 +211,6 @@
// add information for new page
addPage(page);
}
- else if (DataStorage.PAGE_REMOVED.equals(eventName))
- {
- removePage(page);
- }
else if (DataStorage.PAGE_UPDATED.equals(eventName))
{
removePage(page);
@@ -218,8 +224,13 @@
Described described = page.adapt(Described.class);
String name = described.getName();
+ removePage(name, page.getName());
+ }
+
+ private void removePage(String name, String internalName)
+ {
PageInfo pageInfo = pageInfos.get(name);
- if (pageInfo != null)
+ if (pageInfo != null && internalName.equals(pageInfo.getInternalName()))
{
// remove page info
pageInfos.remove(name);
@@ -230,12 +241,18 @@
{
private final String uuid;
private final Map<String, String> childrenWindows = new HashMap<String, String>();
+
+ /** Name as provided by Described */
private final String name;
- private PageInfo(String uuid, String name)
+ /** Name as automatically generated */
+ private final String internalName;
+
+ private PageInfo(String uuid, String name, String internalName)
{
this.uuid = uuid;
this.name = name;
+ this.internalName = internalName;
}
public String getUUID()
@@ -243,6 +260,11 @@
return uuid;
}
+ public String getInternalName()
+ {
+ return internalName;
+ }
+
public List<String> getChildrenWindows()
{
return new ArrayList<String>(childrenWindows.keySet());
Modified: portal/trunk/component/wsrp/src/test/java/org/gatein/portal/wsrp/structure/MOPConsumerStructureProviderTestCase.java
===================================================================
--- portal/trunk/component/wsrp/src/test/java/org/gatein/portal/wsrp/structure/MOPConsumerStructureProviderTestCase.java 2010-11-10 12:09:59 UTC (rev 5007)
+++ portal/trunk/component/wsrp/src/test/java/org/gatein/portal/wsrp/structure/MOPConsumerStructureProviderTestCase.java 2010-11-10 12:35:49 UTC (rev 5008)
@@ -132,9 +132,15 @@
public void testPageDeletionEvent() throws Exception
{
+ String pageToRemove = "page1";
+
org.exoplatform.portal.config.model.Page portalPage = mock(org.exoplatform.portal.config.model.Page.class);
- when(structureAccess.getPageFrom(portalPage)).thenReturn(page1);
+ when(portalPage.getName()).thenReturn(createInternalNameFrom(pageToRemove));
+ when(portalPage.getTitle()).thenReturn(pageToRemove);
+ // on delete, we actually get the event after the page has been removed from JCR so we don't have an actual page
+ when(structureAccess.getPageFrom(portalPage)).thenReturn(null);
+
int pageNumber = provider.getPageIdentifiers().size();
provider.onEvent(new Event<DataStorage, org.exoplatform.portal.config.model.Page>(DataStorage.PAGE_REMOVED, null, portalPage));
@@ -142,7 +148,7 @@
List<String> identifiers = provider.getPageIdentifiers();
assertEquals(pageNumber - 1, identifiers.size());
// deleting a page doesn't delete its children, see GTNPORTAL-1630
- assertFalse(identifiers.contains("page1"));
+ assertFalse(identifiers.contains(pageToRemove));
assertTrue(identifiers.contains("page11"));
assertTrue(identifiers.contains("page12"));
}
@@ -201,7 +207,7 @@
{
Page page = mock(Page.class);
- when(page.getName()).thenThrow(new RuntimeException("Page.getName returns the internal name, not the human readable one"));
+ when(page.getName()).thenReturn(createInternalNameFrom(name));
// mock call to adapt
Described described = mock(Described.class);
@@ -227,6 +233,11 @@
return page;
}
+ private String createInternalNameFrom(String name)
+ {
+ return name + "internal";
+ }
+
private void addWindows(Page page, String... windowNames)
{
if (windowNames != null)
15 years, 5 months
gatein SVN: r5007 - portal/branches/branch-GTNPORTAL-1643/component/portal/src/test/java/org/exoplatform/portal/config.
by do-not-reply@jboss.org
Author: hoang_to
Date: 2010-11-10 07:09:59 -0500 (Wed, 10 Nov 2010)
New Revision: 5007
Added:
portal/branches/branch-GTNPORTAL-1643/component/portal/src/test/java/org/exoplatform/portal/config/TestConcurrencyDataStorage.java
Log:
GTNPORTAL-1582: Add JUnit tests illustrating page creation in multi threads
Added: portal/branches/branch-GTNPORTAL-1643/component/portal/src/test/java/org/exoplatform/portal/config/TestConcurrencyDataStorage.java
===================================================================
--- portal/branches/branch-GTNPORTAL-1643/component/portal/src/test/java/org/exoplatform/portal/config/TestConcurrencyDataStorage.java (rev 0)
+++ portal/branches/branch-GTNPORTAL-1643/component/portal/src/test/java/org/exoplatform/portal/config/TestConcurrencyDataStorage.java 2010-11-10 12:09:59 UTC (rev 5007)
@@ -0,0 +1,138 @@
+/*
+ * Copyright (C) 2009 eXo Platform SAS.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.exoplatform.portal.config;
+
+import java.util.concurrent.CountDownLatch;
+
+import org.exoplatform.container.PortalContainer;
+import org.exoplatform.portal.config.model.Page;
+import org.exoplatform.portal.config.model.PortalConfig;
+import org.exoplatform.portal.pom.config.POMSessionManager;
+
+/**
+ * @author <a href="mailto:hoang281283@gmail.com">Minh Hoang TO</a>
+ * Nov 10, 2010
+ */
+
+public class TestConcurrencyDataStorage extends AbstractPortalTest
+{
+
+ private DataStorage storage_;
+
+ private POMSessionManager mgr;
+
+ public TestConcurrencyDataStorage(String name)
+ {
+ super(name);
+ }
+
+ public void setUp() throws Exception
+ {
+ super.setUp();
+ begin();
+ PortalContainer container = PortalContainer.getInstance();
+ storage_ = (DataStorage)container.getComponentInstanceOfType(DataStorage.class);
+ mgr = (POMSessionManager)container.getComponentInstanceOfType(POMSessionManager.class);
+
+ }
+
+ public void testCreatePageConcurrently() throws Exception
+ {
+ CountDownLatch startSignal = new CountDownLatch(1);
+
+ for (int i = 0; i < 5; i++)
+ {
+ Thread thread = new Thread(new CreatePageTask(mgr, storage_, startSignal, "test" + i, "foo" + i));
+ thread.start();
+ }
+
+ startSignal.countDown();
+ }
+
+ public void testCreatePageSequentially() throws Exception
+ {
+ for (int i = 5; i < 10; i++)
+ {
+ Thread thread = new Thread(new CreatePageTask(mgr, storage_, null, "test" + i, "foo" + i));
+ thread.start();
+ thread.join();
+ }
+ }
+
+ protected void tearDown() throws Exception
+ {
+ end();
+ super.tearDown();
+ }
+
+ public class CreatePageTask implements Runnable
+ {
+ private DataStorage dataStorage;
+
+ private POMSessionManager sessionManager;
+
+ private String pageName;
+
+ private String pageTitle;
+
+ private CountDownLatch startSignal;
+
+ public CreatePageTask(POMSessionManager _sessionManager, DataStorage _dataStorage, CountDownLatch _startSignal, String _pageName, String _pageTitle)
+ {
+ dataStorage = _dataStorage;
+ pageName = _pageName;
+ pageTitle = _pageTitle;
+ sessionManager = _sessionManager;
+ startSignal = _startSignal;
+ }
+
+ @Override
+ public void run()
+ {
+ try
+ {
+ if(startSignal != null)
+ startSignal.await();
+
+ sessionManager.openSession();
+
+ Page page = new Page();
+ page.setOwnerType(PortalConfig.PORTAL_TYPE);
+ page.setOwnerId("test");
+ page.setTitle(pageTitle);
+ page.setName(pageName);
+
+ dataStorage.create(page);
+
+ Page createdPage = dataStorage.getPage(page.getPageId());
+ assertNotNull(createdPage);
+ assertEquals(pageName, createdPage.getName());
+ assertEquals(pageTitle, createdPage.getTitle());
+
+ System.out.println("Current POMSession: " + sessionManager.getSession().toString());
+ }
+ catch (Exception ex)
+ {
+ ex.printStackTrace();
+ System.out.println("Could not create the page: " + pageName + " , " + pageTitle);
+ }
+ }
+ }
+
+}
15 years, 5 months
gatein SVN: r5006 - in components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/protocol: v2 and 1 other directory.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2010-11-10 06:53:29 -0500 (Wed, 10 Nov 2010)
New Revision: 5006
Modified:
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/protocol/v1/WSRP1ConsumerBaseTest.java
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/protocol/v2/WSRP2ConsumerBaseTest.java
Log:
- GTNWSRP-156: Quick fix. The real issue will be addressed by fixing GTNWSRP-157.
Modified: components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/protocol/v1/WSRP1ConsumerBaseTest.java
===================================================================
--- components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/protocol/v1/WSRP1ConsumerBaseTest.java 2010-11-10 11:42:57 UTC (rev 5005)
+++ components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/protocol/v1/WSRP1ConsumerBaseTest.java 2010-11-10 11:53:29 UTC (rev 5006)
@@ -91,9 +91,12 @@
// use a fresh ConsumerRegistry
producerInfo.setRegistry(new MockConsumerRegistry());
- // use
+ // use a fresh endpoint using a behavior-backed service factory
producerInfo.setEndpointConfigurationInfo(new EndpointConfigurationInfo(new BehaviorBackedServiceFactory(registry)));
+ // todo: remove, this is a quick fix for GTNWSRP-156
+ producerInfo.setExpirationCacheSeconds(null);
+
// make sure we use clean producer info for each test
consumer.refreshProducerInfo();
Modified: components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/protocol/v2/WSRP2ConsumerBaseTest.java
===================================================================
--- components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/protocol/v2/WSRP2ConsumerBaseTest.java 2010-11-10 11:42:57 UTC (rev 5005)
+++ components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/protocol/v2/WSRP2ConsumerBaseTest.java 2010-11-10 11:53:29 UTC (rev 5006)
@@ -91,9 +91,12 @@
// use a fresh ConsumerRegistry
producerInfo.setRegistry(new MockConsumerRegistry());
- // use
+ // use a fresh endpoint using a behavior-backed service factory
producerInfo.setEndpointConfigurationInfo(new EndpointConfigurationInfo(new BehaviorBackedServiceFactory(registry)));
+ // todo: remove, this is a quick fix for GTNWSRP-156
+ producerInfo.setExpirationCacheSeconds(null);
+
// make sure we use clean producer info for each test
consumer.refreshProducerInfo();
15 years, 5 months
gatein SVN: r5005 - components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/consumer.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2010-11-10 06:42:57 -0500 (Wed, 10 Nov 2010)
New Revision: 5005
Modified:
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/consumer/ProducerInfoTestCase.java
Log:
- Adapted test case to the fact that we now have a cache by default.
Modified: components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/consumer/ProducerInfoTestCase.java
===================================================================
--- components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/consumer/ProducerInfoTestCase.java 2010-11-10 10:52:44 UTC (rev 5004)
+++ components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/consumer/ProducerInfoTestCase.java 2010-11-10 11:42:57 UTC (rev 5005)
@@ -131,8 +131,12 @@
ServiceDescriptionBehavior behavior = new ServiceDescriptionBehavior();
serviceFactory.getRegistry().setServiceDescriptionBehavior(behavior);
+ // we now have a default value for cache
+ assertEquals(ProducerInfo.DEFAULT_CACHE_VALUE, info.getExpirationCacheSeconds());
+
+ // check behavior when no cache has been set
+ info.setExpirationCacheSeconds(null);
assertNull(info.getExpirationCacheSeconds());
-
assertTrue(info.isRefreshNeeded(false));
assertFalse(info.isRegistrationChecked());
assertTrue(info.refresh(false));
15 years, 5 months