JBoss Portal SVN: r6315 - trunk/build.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-02-16 09:34:37 -0500 (Fri, 16 Feb 2007)
New Revision: 6315
Modified:
trunk/build/build.xml
Log:
added core-admin to global build
Modified: trunk/build/build.xml
===================================================================
--- trunk/build/build.xml 2007-02-16 14:28:54 UTC (rev 6314)
+++ trunk/build/build.xml 2007-02-16 14:34:37 UTC (rev 6315)
@@ -129,6 +129,7 @@
<module name="core"/>
<module name="core-cms"/>
<module name="core-management"/>
+ <module name="core-admin"/>
<module name="search"/>
<module name="core-samples"/>
<module name="wsrp"/>
@@ -140,7 +141,7 @@
<group name="portal">
<include
- modules="common, test, api, faces, jems, server, security, identity, search, format, portlet, portlet-federation, theme, workflow, cms, bridge, samples, registration, wsrp, core, core-cms, core-management, core-samples"/>
+ modules="common, test, api, faces, jems, server, security, identity, search, format, portlet, portlet-federation, theme, workflow, cms, bridge, samples, registration, wsrp, core, core-admin, core-cms, core-management, core-samples"/>
</group>
<group name="cms">
19 years, 2 months
JBoss Portal SVN: r6314 - trunk/wsrp/src/main/org/jboss/portal/wsrp/producer.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-02-16 09:28:54 -0500 (Fri, 16 Feb 2007)
New Revision: 6314
Modified:
trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/RenderRequestProcessor.java
Log:
fix compilation issue
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/RenderRequestProcessor.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/RenderRequestProcessor.java 2007-02-16 14:18:28 UTC (rev 6313)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/RenderRequestProcessor.java 2007-02-16 14:28:54 UTC (rev 6314)
@@ -183,7 +183,10 @@
*/
private String processFragmentString(String renderString)
{
- return Tools.replaceBoundedString(renderString, PortletUtils.PREFIX, PortletUtils.SUFFIX,
+ return Tools.replaceAllInstancesOfBoundedString(
+ renderString,
+ PortletUtils.PREFIX,
+ PortletUtils.SUFFIX,
WSRPRewritingConstants.WSRP_REWRITE_TOKEN);
}
}
19 years, 2 months
JBoss Portal SVN: r6313 - trunk/core/src/resources/portal-core-sar/dtd.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-02-16 09:18:28 -0500 (Fri, 16 Feb 2007)
New Revision: 6313
Modified:
trunk/core/src/resources/portal-core-sar/dtd/portal-object_2_6.dtd
trunk/core/src/resources/portal-core-sar/dtd/portlet-instances_2_6.dtd
Log:
JBPORTAL-1277 : Mistake in portal-object_2_6.dtd
Modified: trunk/core/src/resources/portal-core-sar/dtd/portal-object_2_6.dtd
===================================================================
--- trunk/core/src/resources/portal-core-sar/dtd/portal-object_2_6.dtd 2007-02-16 14:15:32 UTC (rev 6312)
+++ trunk/core/src/resources/portal-core-sar/dtd/portal-object_2_6.dtd 2007-02-16 14:18:28 UTC (rev 6313)
@@ -251,7 +251,7 @@
<!--
-->
-<!ELEMENT security-constraint (policy-permission)>
+<!ELEMENT security-constraint (policy-permission*)>
<!--
-->
Modified: trunk/core/src/resources/portal-core-sar/dtd/portlet-instances_2_6.dtd
===================================================================
--- trunk/core/src/resources/portal-core-sar/dtd/portlet-instances_2_6.dtd 2007-02-16 14:15:32 UTC (rev 6312)
+++ trunk/core/src/resources/portal-core-sar/dtd/portlet-instances_2_6.dtd 2007-02-16 14:18:28 UTC (rev 6313)
@@ -103,7 +103,7 @@
<!--
todo
-->
-<!ELEMENT security-constraint (policy-permission)>
+<!ELEMENT security-constraint (policy-permission*)>
<!--
todo
19 years, 2 months
JBoss Portal SVN: r6312 - trunk/core/src/bin.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-02-16 09:15:32 -0500 (Fri, 16 Feb 2007)
New Revision: 6312
Removed:
trunk/core/src/bin/setup/
Log:
removed obsolete cms default content
19 years, 2 months
JBoss Portal SVN: r6311 - trunk/core/src/bin/portal-core-war/images.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-02-16 09:13:36 -0500 (Fri, 16 Feb 2007)
New Revision: 6311
Removed:
trunk/core/src/bin/portal-core-war/images/maximized.png
trunk/core/src/bin/portal-core-war/images/minimized.png
trunk/core/src/bin/portal-core-war/images/normal.png
Log:
removed obsolete icons
Deleted: trunk/core/src/bin/portal-core-war/images/maximized.png
===================================================================
(Binary files differ)
Deleted: trunk/core/src/bin/portal-core-war/images/minimized.png
===================================================================
(Binary files differ)
Deleted: trunk/core/src/bin/portal-core-war/images/normal.png
===================================================================
(Binary files differ)
19 years, 2 months
JBoss Portal SVN: r6307 - trunk/identity/src/main/org/jboss/portal/identity/db.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2007-02-15 20:58:17 -0500 (Thu, 15 Feb 2007)
New Revision: 6307
Modified:
trunk/identity/src/main/org/jboss/portal/identity/db/HibernateUserImpl.java
Log:
Make user date-registration writable so that it doesn't complain on registration.
Modified: trunk/identity/src/main/org/jboss/portal/identity/db/HibernateUserImpl.java
===================================================================
--- trunk/identity/src/main/org/jboss/portal/identity/db/HibernateUserImpl.java 2007-02-16 01:52:08 UTC (rev 6306)
+++ trunk/identity/src/main/org/jboss/portal/identity/db/HibernateUserImpl.java 2007-02-16 01:58:17 UTC (rev 6307)
@@ -67,7 +67,7 @@
// Map attributes specific to JBoss Portal
map.put(org.jboss.portal.identity.User.INFO_USER_EMAIL_FAKE, new StringPropertyAccessor(org.jboss.portal.identity.User.INFO_USER_EMAIL_FAKE, "fakeEmail", true, true));
- map.put(org.jboss.portal.identity.User.INFO_USER_REGISTRATION_DATE, new DatePropertyAccessor(org.jboss.portal.identity.User.INFO_USER_REGISTRATION_DATE, "registrationDate", false, false));
+ map.put(org.jboss.portal.identity.User.INFO_USER_REGISTRATION_DATE, new DatePropertyAccessor(org.jboss.portal.identity.User.INFO_USER_REGISTRATION_DATE, "registrationDate", true, false));
map.put(org.jboss.portal.identity.User.INFO_USER_VIEW_EMAIL_VIEW_REAL, new BooleanPropertyAccessor(org.jboss.portal.identity.User.INFO_USER_VIEW_EMAIL_VIEW_REAL, "viewRealEmail", true, false));
map.put(org.jboss.portal.identity.User.INFO_USER_ENABLED, new BooleanPropertyAccessor(org.jboss.portal.identity.User.INFO_USER_ENABLED, "enabled", true, false));
19 years, 2 months
JBoss Portal SVN: r6306 - docs/trunk/referenceGuide/en/modules.
by portal-commits@lists.jboss.org
Author: bdaw
Date: 2007-02-15 20:52:08 -0500 (Thu, 15 Feb 2007)
New Revision: 6306
Modified:
docs/trunk/referenceGuide/en/modules/identity.xml
Log:
minor doc update for options naming changes
Modified: docs/trunk/referenceGuide/en/modules/identity.xml
===================================================================
--- docs/trunk/referenceGuide/en/modules/identity.xml 2007-02-16 01:51:36 UTC (rev 6305)
+++ docs/trunk/referenceGuide/en/modules/identity.xml 2007-02-16 01:52:08 UTC (rev 6306)
@@ -443,11 +443,11 @@
<option-group>
<group-name>common</group-name>
<option>
- <name>userContainerDN</name>
+ <name>userCtxDN</name>
<value>ou=People,dc=portal26,dc=jboss,dc=com</value>
</option>
<option>
- <name>roleContainerDN</name>
+ <name>roleCtxDN</name>
<value>ou=Roles,dc=portal26,dc=jboss,dc=com</value>
</option>
</option-group>]]></programlisting>
@@ -728,7 +728,7 @@
<option-group>
<group-name>common</group-name>
<option>
- <name>userContainerDN</name>
+ <name>userCtxDN</name>
<value>ou=People,dc=example,dc=com</value>
</option>
<option>
@@ -740,7 +740,7 @@
<value>userPassword</value>
</option>
<option>
- <name>roleContainerDN</name>
+ <name>roleCtxDN</name>
<value>ou=Roles,dc=example,dc=com</value>
</option>
<option>
19 years, 2 months
JBoss Portal SVN: r6305 - in trunk/common/src/main/org/jboss/portal: test/common and 1 other directory.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2007-02-15 20:51:36 -0500 (Thu, 15 Feb 2007)
New Revision: 6305
Modified:
trunk/common/src/main/org/jboss/portal/common/util/Tools.java
trunk/common/src/main/org/jboss/portal/common/util/URLTools.java
trunk/common/src/main/org/jboss/portal/test/common/StringTestCase.java
trunk/common/src/main/org/jboss/portal/test/common/URLToolsTestCase.java
Log:
- Renamed replaceBoundedString to replaceAllInstancesOfBoundedString.
- Added version with more options.
- Added replaceServerPortInURL method.
- Added URLReplacementGenerator to replace the port in detected URLs.
- Updated tests.
Modified: trunk/common/src/main/org/jboss/portal/common/util/Tools.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/util/Tools.java 2007-02-16 01:07:08 UTC (rev 6304)
+++ trunk/common/src/main/org/jboss/portal/common/util/Tools.java 2007-02-16 01:51:36 UTC (rev 6305)
@@ -999,8 +999,14 @@
}
}
- public static String replaceBoundedString(String initial, String prefix, String suffix, String replacement)
+ public static String replaceAllInstancesOfBoundedString(String initial, String prefix, String suffix, String replacement)
{
+ return replaceBoundedString(initial, prefix, suffix, replacement, true, false);
+ }
+
+ public static String replaceBoundedString(String initial, String prefix, String suffix, String replacement,
+ boolean replaceIfBoundedStringEmpty, boolean keepBoundaries)
+ {
if (initial == null || initial.length() == 0)
{
return initial;
@@ -1021,14 +1027,25 @@
if (suffixIndex != -1)
{
- tmp.delete(prefixIndex, suffixIndex + suffixLength);
- tmp.insert(prefixIndex, replacement);
+ // we don't care about empty bounded strings or prefix and suffix don't delimit an empty String => replace!
+ if (replaceIfBoundedStringEmpty || suffixIndex != prefixIndex + prefixLength)
+ {
+ if (keepBoundaries)
+ {
+ tmp.delete(prefixIndex + prefixLength, suffixIndex);
+ tmp.insert(prefixIndex + prefixLength, replacement);
+ }
+ else
+ {
+ tmp.delete(prefixIndex, suffixIndex + suffixLength);
+ tmp.insert(prefixIndex, replacement);
+ }
+ }
}
prefixIndex = tmp.indexOf(prefix, prefixIndex + prefixLength);
}
return tmp.toString();
-
}
}
\ No newline at end of file
Modified: trunk/common/src/main/org/jboss/portal/common/util/URLTools.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/util/URLTools.java 2007-02-16 01:07:08 UTC (rev 6304)
+++ trunk/common/src/main/org/jboss/portal/common/util/URLTools.java 2007-02-16 01:51:36 UTC (rev 6305)
@@ -40,18 +40,29 @@
public class URLTools
{
public static final String RE_EMAIL_VALIDATION = "^([a-zA-Z0-9]+(([\\.\\-\\_]?[a-zA-Z0-9]+)+)?)\\(a)(([a-zA-Z0-9]+[\\.\\-\\_])+[a-zA-Z]{2,4})$";
- private static final Pattern LINK = Pattern.compile("(?:href|action|src)\\s*=\\s*('|\")\\s*([^'\"]*)\\s*('|\")",
+ private static final Pattern LINK = Pattern.compile("(?:href|action|src|location)\\s*=\\s*('|\")\\s*([^'\"]*)\\s*('|\")",
Pattern.CASE_INSENSITIVE);
public static final String HTTP_PREFIX = "http://";
public static final String HTTPS_PREFIX = "https://";
+ public static final String FTP_PREFIX = "ftp://";
public static final String FILE_PREFIX = "/";
public static boolean isURLAbsolute(String url)
{
- return url.startsWith(HTTP_PREFIX) || url.startsWith(HTTPS_PREFIX) || url.startsWith(FILE_PREFIX);
+ return isNetworkURL(url) || url.startsWith(FILE_PREFIX);
}
+ public static boolean isNetworkURL(String url)
+ {
+ if (url == null || url.length() == 0)
+ {
+ return false;
+ }
+
+ return url.startsWith(HTTP_PREFIX) || url.startsWith(HTTPS_PREFIX) || url.startsWith(FTP_PREFIX);
+ }
+
/**
* Enforces that the given URL is absolute
*
@@ -231,4 +242,48 @@
{
public abstract String getReplacementFor(int currentIndex, URLMatch currentMatch);
}
+
+ public static class PortReplacementGenerator extends URLReplacementGenerator
+ {
+ private int replacementPort;
+
+ public PortReplacementGenerator(int replacementPort)
+ {
+ this.replacementPort = replacementPort;
+ }
+
+ public String getReplacementFor(int currentIndex, URLMatch currentMatch)
+ {
+ return replaceServerPortInURL(currentMatch.getURLAsString(), replacementPort);
+ }
+ }
+
+ public static String replaceServerPortInURL(String url, int newPort)
+ {
+ if (!isNetworkURL(url))
+ {
+ return url;
+ }
+
+ StringBuffer buf = new StringBuffer(url);
+ int afterProtocol = url.indexOf("://") + 3;
+ int beforePort = url.indexOf(':', afterProtocol);
+ int afterPort;
+
+ if (beforePort != -1)
+ {
+ afterPort = url.indexOf('/', beforePort);
+ buf.delete(beforePort + 1, afterPort);
+ buf.insert(beforePort + 1, newPort);
+ }
+ else
+ {
+ // port number was not present
+ afterPort = url.indexOf('/', afterProtocol);
+ buf.insert(afterPort, ":" + newPort);
+ }
+
+ return buf.toString();
+ }
+
}
Modified: trunk/common/src/main/org/jboss/portal/test/common/StringTestCase.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/test/common/StringTestCase.java 2007-02-16 01:07:08 UTC (rev 6304)
+++ trunk/common/src/main/org/jboss/portal/test/common/StringTestCase.java 2007-02-16 01:51:36 UTC (rev 6305)
@@ -48,11 +48,13 @@
public void testReplaceBoundedString()
{
- assertEquals("", Tools.replaceBoundedString("", "PREFIX", "SUFFIX", "REPLACEMENT"));
- assertEquals("REPLACEMENT", Tools.replaceBoundedString("PREFIXSUFFIX", "PREFIX", "SUFFIX", "REPLACEMENT"));
- assertEquals("aaaaREPLACEMENTccccc", Tools.replaceBoundedString("aaaaPREFIXbbbbbSUFFIXccccc", "PREFIX", "SUFFIX", "REPLACEMENT"));
- assertEquals("aaaPREFIXbbbbSUFF", Tools.replaceBoundedString("aaaPREFIXbbbbSUFF", "PREFIX", "SUFFIX", "REPLACEMENT"));
- assertEquals("aRcccReeeR", Tools.replaceBoundedString("aPbbScccPdSeeePS", "P", "S", "R"));
+ assertEquals("", Tools.replaceAllInstancesOfBoundedString("", "PREFIX", "SUFFIX", "REPLACEMENT"));
+ assertEquals("REPLACEMENT", Tools.replaceAllInstancesOfBoundedString("PREFIXSUFFIX", "PREFIX", "SUFFIX", "REPLACEMENT"));
+ assertEquals("PREFIXSUFFIX", Tools.replaceBoundedString("PREFIXSUFFIX", "PREFIX", "SUFFIX", "REPLACEMENT", false, true));
+ assertEquals("PREFIXSUFFIX", Tools.replaceBoundedString("PREFIXSUFFIX", "PREFIX", "SUFFIX", "REPLACEMENT", false, false));
+ assertEquals("aaaaREPLACEMENTccccc", Tools.replaceAllInstancesOfBoundedString("aaaaPREFIXbbbbbSUFFIXccccc", "PREFIX", "SUFFIX", "REPLACEMENT"));
+ assertEquals("aaaPREFIXbbbbSUFF", Tools.replaceAllInstancesOfBoundedString("aaaPREFIXbbbbSUFF", "PREFIX", "SUFFIX", "REPLACEMENT"));
+ assertEquals("aRcccReeeR", Tools.replaceAllInstancesOfBoundedString("aPbbScccPdSeeePS", "P", "S", "R"));
+ assertEquals("PSaPScccReeePS", Tools.replaceBoundedString("PSaPScccPdSeeePS", "P", "S", "R", false, false));
}
-
}
Modified: trunk/common/src/main/org/jboss/portal/test/common/URLToolsTestCase.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/test/common/URLToolsTestCase.java 2007-02-16 01:07:08 UTC (rev 6304)
+++ trunk/common/src/main/org/jboss/portal/test/common/URLToolsTestCase.java 2007-02-16 01:51:36 UTC (rev 6305)
@@ -23,6 +23,7 @@
package org.jboss.portal.test.common;
import junit.framework.TestCase;
+import org.jboss.portal.common.util.URLTools;
/**
* @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
@@ -52,9 +53,9 @@
{
String markup = MARKUP;
- org.jboss.portal.common.util.URLTools.URLMatch[] links = org.jboss.portal.common.util.URLTools.extractURLsFrom(markup);
+ URLTools.URLMatch[] links = URLTools.extractURLsFrom(markup);
assertEquals(4, links.length);
- org.jboss.portal.common.util.URLTools.URLMatch link = links[0];
+ URLTools.URLMatch link = links[0];
assertEquals("wsrp_rewrite?wsrp-urlType=render&wsrp-navigationalState=rO0ABXNyACdvcmcuamJvc3MucG9ydGFsLnNl" +
"cnZlci51dGlsLlBhcmFtZXRlcnOJoAlMQZGhngIAAUwAA21hcHQAD0xqYXZhL3V0aWwvTWFwO3hwc3IAEWphdmEudXRpbC5IYXNoTWFwBQ" +
"fawcMWYNEDAAJGAApsb2FkRmFjdG9ySQAJdGhyZXNob2xkeHA_QAAAAAAADHcIAAAAEAAAAAF0AARuYW1ldXIAE1tMamF2YS5sYW5nLlN0" +
@@ -66,7 +67,7 @@
String url = "wsrp_rewrite?wsrp-urlType=render&wsrp-mode=help/wsrp_rewrite";
markup = "12345href='" + url + "'76";
- links = org.jboss.portal.common.util.URLTools.extractURLsFrom(markup);
+ links = URLTools.extractURLsFrom(markup);
link = links[0];
int startIndex = 11;
assertEquals(startIndex, link.getStart());
@@ -77,18 +78,18 @@
public void testReplaceURLs()
{
- String markup = org.jboss.portal.common.util.URLTools.replaceURLsBy(MARKUP, new String[]{"foo", "bar", "baz", "buz"});
+ String markup = URLTools.replaceURLsBy(MARKUP, new String[]{"foo", "bar", "baz", "buz"});
String replaced = "Hello, Anonymous!\nCounter: 0<a href='foo'>My name is Julien</a><a href='bar'>My name is Roy</a>" +
"<action='baz'>counter++</a><a href='buz'>counter--</a>";
assertEquals(replaced, markup);
- assertEquals(replaced, org.jboss.portal.common.util.URLTools.replaceURLsBy(replaced, (String[])null));
+ assertEquals(replaced, URLTools.replaceURLsBy(replaced, (String[])null));
String mixed = "<a href='wsrp_rewrite?wsrp-urlType=render&wsrp-mode=help/wsrp_rewrite'>My name is Julien</a>" +
"<a href='bar'>My name is Roy</a>";
assertEquals("<a href='foo'>My name is Julien</a><a href='bar'>My name is Roy</a>",
- org.jboss.portal.common.util.URLTools.replaceURLsBy(mixed, new org.jboss.portal.common.util.URLTools.URLReplacementGenerator()
+ URLTools.replaceURLsBy(mixed, new URLTools.URLReplacementGenerator()
{
- public String getReplacementFor(int currentIndex, org.jboss.portal.common.util.URLTools.URLMatch currentMatch)
+ public String getReplacementFor(int currentIndex, URLTools.URLMatch currentMatch)
{
String urlAsString = currentMatch.getURLAsString();
if (urlAsString.startsWith("wsrp_rewrite"))
@@ -99,4 +100,64 @@
}
}));
}
+
+ public void testReplaceAllPorts()
+ {
+ String original = "<wsdl:definitions targetNamespace='urn:oasis:names:tc:wsrp:v1:wsdl'\n" +
+ " xmlns:bind='urn:oasis:names:tc:wsrp:v1:bind'\n" +
+ " xmlns='http://schemas.xmlsoap.org/wsdl/'\n" +
+ " xmlns:wsdl='http://schemas.xmlsoap.org/wsdl/'\n" +
+ " xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/'\n" +
+ " xmlns:intf='urn:oasis:names:tc:wsrp:v1:intf'\n" +
+ " xmlns:tns='urn:oasis:names:tc:wsrp:v1:wsdl'>\n" +
+ " <import namespace='urn:oasis:names:tc:wsrp:v1:bind' location='wsrp_v1_bindings.wsdl'/>\n" +
+ " <wsdl:service name='WSRPService'>\n" +
+ " <wsdl:port binding='bind:WSRP_v1_Markup_Binding_SOAP' name='WSRPBaseService'>\n" +
+ " <soap:address location='http://localhost/portal-wsrp/ServiceDescriptionService'/>\n" +
+ " </wsdl:port>\n" +
+ " <wsdl:port binding='bind:WSRP_v1_ServiceDescription_Binding_SOAP' name='WSRPServiceDescriptionService'>\n" +
+ " <soap:address location='http://localhost/portal-wsrp/MarkupService'/>\n" +
+ " </wsdl:port>\n" +
+ " <wsdl:port binding='bind:WSRP_v1_Registration_Binding_SOAP' name='WSRPRegistrationService'>\n" +
+ " <soap:address location='http://localhost/portal-wsrp/RegistrationService'/>\n" +
+ " </wsdl:port>\n" +
+ " <wsdl:port binding='bind:WSRP_v1_PortletManagement_Binding_SOAP' name='WSRPPortletManagementService'>\n" +
+ " <soap:address location='http://localhost/portal-wsrp/PortletManagementService'/>\n" +
+ " </wsdl:port>\n" +
+ " </wsdl:service>\n" +
+ "</wsdl:definitions>";
+ String result = "<wsdl:definitions targetNamespace='urn:oasis:names:tc:wsrp:v1:wsdl'\n" +
+ " xmlns:bind='urn:oasis:names:tc:wsrp:v1:bind'\n" +
+ " xmlns='http://schemas.xmlsoap.org/wsdl/'\n" +
+ " xmlns:wsdl='http://schemas.xmlsoap.org/wsdl/'\n" +
+ " xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/'\n" +
+ " xmlns:intf='urn:oasis:names:tc:wsrp:v1:intf'\n" +
+ " xmlns:tns='urn:oasis:names:tc:wsrp:v1:wsdl'>\n" +
+ " <import namespace='urn:oasis:names:tc:wsrp:v1:bind' location='wsrp_v1_bindings.wsdl'/>\n" +
+ " <wsdl:service name='WSRPService'>\n" +
+ " <wsdl:port binding='bind:WSRP_v1_Markup_Binding_SOAP' name='WSRPBaseService'>\n" +
+ " <soap:address location='http://localhost:8888/portal-wsrp/ServiceDescriptionService'/>\n" +
+ " </wsdl:port>\n" +
+ " <wsdl:port binding='bind:WSRP_v1_ServiceDescription_Binding_SOAP' name='WSRPServiceDescriptionService'>\n" +
+ " <soap:address location='http://localhost:8888/portal-wsrp/MarkupService'/>\n" +
+ " </wsdl:port>\n" +
+ " <wsdl:port binding='bind:WSRP_v1_Registration_Binding_SOAP' name='WSRPRegistrationService'>\n" +
+ " <soap:address location='http://localhost:8888/portal-wsrp/RegistrationService'/>\n" +
+ " </wsdl:port>\n" +
+ " <wsdl:port binding='bind:WSRP_v1_PortletManagement_Binding_SOAP' name='WSRPPortletManagementService'>\n" +
+ " <soap:address location='http://localhost:8888/portal-wsrp/PortletManagementService'/>\n" +
+ " </wsdl:port>\n" +
+ " </wsdl:service>\n" +
+ "</wsdl:definitions>";
+
+ assertEquals(result, URLTools.replaceURLsBy(original, new URLTools.PortReplacementGenerator(8888)));
+ }
+
+ public void testReplaceServerPort()
+ {
+ assertEquals("http://hostname:8088/some/path", URLTools.replaceServerPortInURL("http://hostname:8080/some/path", 8088));
+ assertEquals("https://hostname:8088/some/path", URLTools.replaceServerPortInURL("https://hostname:8080/some/path", 8088));
+ assertEquals("http://hostname:8088/some/path", URLTools.replaceServerPortInURL("http://hostname/some/path", 8088));
+ assertEquals("https://hostname:8088/some/path", URLTools.replaceServerPortInURL("https://hostname/some/path", 8088));
+ }
}
19 years, 2 months