[jboss-cvs] JBossRemoting/src/tests/org/jboss/test/remoting/locator ...
Ron Sigal
ron_sigal at yahoo.com
Tue May 22 04:27:04 EDT 2007
User: rsigal
Date: 07/05/22 04:27:04
Modified: src/tests/org/jboss/test/remoting/locator Tag: remoting_2_x
InvokerLocatorTestCase.java
Log:
JBREM-645: Added test for ways to configure legacy parsing.
Revision Changes Path
No revision
No revision
1.7.4.2 +33 -0 JBossRemoting/src/tests/org/jboss/test/remoting/locator/InvokerLocatorTestCase.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: InvokerLocatorTestCase.java
===================================================================
RCS file: /cvsroot/jboss/JBossRemoting/src/tests/org/jboss/test/remoting/locator/InvokerLocatorTestCase.java,v
retrieving revision 1.7.4.1
retrieving revision 1.7.4.2
diff -u -b -r1.7.4.1 -r1.7.4.2
--- InvokerLocatorTestCase.java 22 May 2007 07:42:45 -0000 1.7.4.1
+++ InvokerLocatorTestCase.java 22 May 2007 08:27:04 -0000 1.7.4.2
@@ -32,6 +32,37 @@
*/
public class InvokerLocatorTestCase extends TestCase
{
+
+ public void testLegacyParsingFlag() throws Exception
+ {
+ // Test no legacy flag configuration.
+ InvokerLocator locator = new InvokerLocator("http://localhost:1234/services");
+ assertEquals("/services", locator.getPath());
+
+ // Test setting legacy parsing by System property
+ System.setProperty(InvokerLocator.LEGACY_PARSING, "true");
+ locator = new InvokerLocator("http://localhost:1234/services");
+ assertEquals("services", locator.getPath());
+
+ // Test setting legacy parsing by InvokerLocator static field.
+ System.setProperty(InvokerLocator.LEGACY_PARSING, "");
+ InvokerLocator.setUseLegacyParsing(true);
+ locator = new InvokerLocator("http://localhost:1234/services");
+ assertEquals("services", locator.getPath());
+
+ // Test that static field overrides System property.
+ InvokerLocator.setUseLegacyParsing(true);
+ System.setProperty(InvokerLocator.LEGACY_PARSING, "false");
+ locator = new InvokerLocator("http://localhost:1234/services");
+ assertEquals("services", locator.getPath());
+
+ // Test that static field overrides System property.
+ InvokerLocator.setUseLegacyParsing(false);
+ System.setProperty(InvokerLocator.LEGACY_PARSING, "true");
+ locator = new InvokerLocator("http://localhost:1234/services");
+ assertEquals("/services", locator.getPath());
+ }
+
/**
* testLegacyLocatorConfig tests the original version of InvokerLocator parsing.
*/
@@ -121,6 +152,7 @@
*/
public void testURILocatorConfig() throws Exception
{
+ InvokerLocator.setUseLegacyParsing(false);
System.setProperty(InvokerLocator.LEGACY_PARSING, "false");
InvokerLocator locator = new InvokerLocator("http://localhost:1234/services/uri:Test");
InvokerLocator locator2 = new InvokerLocator("http://localhost:1234");
@@ -209,6 +241,7 @@
public void testJBREM645() throws MalformedURLException
{
+ InvokerLocator.setUseLegacyParsing(false);
System.setProperty(InvokerLocator.LEGACY_PARSING, "false");
String locatorURI ="socket://succubus.starkinternational.com:4446?datatype=invocation";
InvokerLocator locator = new InvokerLocator(locatorURI);
More information about the jboss-cvs-commits
mailing list