tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dblev...@apache.org
Subject svn commit: r1029529 - in /openejb/trunk/openejb3: ./ container/openejb-core/src/main/java/org/apache/openejb/config/ container/openejb-core/src/test/java/org/apache/openejb/config/ examples/alternate-descriptors/src/main/resources/META-INF/
Date Mon, 01 Nov 2010 02:14:50 GMT
Author: dblevins
Date: Mon Nov  1 02:14:50 2010
New Revision: 1029529

URL: http://svn.apache.org/viewvc?rev=1029529&view=rev
Log:
svn merge -r 1027753:1027754 https://svn.apache.org/repos/asf/openejb/branches/openejb-3.1.x

http://svn.apache.org/viewvc?view=revision&revision=1027754
------------------------------------------------------------------------
r1027754 | dblevins | 2010-10-26 14:59:44 -0700 (Tue, 26 Oct 2010) | 2 lines

OPENEJB-1389: Automatically encode # in provider attribute of "new://Resource?provider=org.acme#FooResource"
URIs

------------------------------------------------------------------------

Modified:
    openejb/trunk/openejb3/   (props changed)
    openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/ConfigurationFactory.java
    openejb/trunk/openejb3/container/openejb-core/src/test/java/org/apache/openejb/config/BusinessInterfacesTest.java
  (props changed)
    openejb/trunk/openejb3/container/openejb-core/src/test/java/org/apache/openejb/config/ConfigureServiceTest.java
    openejb/trunk/openejb3/examples/alternate-descriptors/src/main/resources/META-INF/test.ejb-jar.xml
  (props changed)

Propchange: openejb/trunk/openejb3/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Nov  1 02:14:50 2010
@@ -1,3 +1,3 @@
 /openejb/branches/openejb-3.1.1:779593
-/openejb/branches/openejb-3.1.x:945409,945448,1004381,1005322,1021880,1021903,1021955,1021961,1021965,1021975,1021979,1021990,1022375,1022393,1023096,1023116,1023125,1026527
+/openejb/branches/openejb-3.1.x:945409,945448,1004381,1005322,1021880,1021903,1021955,1021961,1021965,1021975,1021979,1021990,1022375,1022393,1023096,1023116,1023125,1026527,1027754
 /openejb/branches/openejb-jcdi:984659-985270

Modified: openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/ConfigurationFactory.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/ConfigurationFactory.java?rev=1029529&r1=1029528&r2=1029529&view=diff
==============================================================================
--- openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/ConfigurationFactory.java
(original)
+++ openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/ConfigurationFactory.java
Mon Nov  1 02:14:50 2010
@@ -466,9 +466,9 @@ public class ConfigurationFactory implem
             String value = (String) entry.getValue();
 
             try {
-                URI uri = new URI(value);
+                final Object service = toConfigDeclaration(name, value);
 
-                openejb.add(toConfigDeclaration(name, uri));
+                openejb.add(service);
             } catch (URISyntaxException e) {
                 logger.error("Error declaring service '" + name + "'. Invalid Service URI
'" + value + "'.  java.net.URISyntaxException: " + e.getMessage());
             } catch (OpenEJBException e) {
@@ -477,6 +477,16 @@ public class ConfigurationFactory implem
         }
     }
 
+    protected Object toConfigDeclaration(String name, String value) throws URISyntaxException,
OpenEJBException {
+//        value = value.replaceFirst("(.)#", "$1%23");
+            value = value.replaceFirst("(provider=[^#=&]+)#", "$1%23");
+
+        URI uri = new URI(value);
+
+        final Object service = toConfigDeclaration(name, uri);
+        return service;
+    }
+
     public Object toConfigDeclaration(String id, URI uri) throws OpenEJBException {
         String serviceType = null;
         try {

Propchange: openejb/trunk/openejb3/container/openejb-core/src/test/java/org/apache/openejb/config/BusinessInterfacesTest.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Nov  1 02:14:50 2010
@@ -1,3 +1,3 @@
 /openejb/branches/openejb-3.1.1/container/openejb-core/src/test/java/org/apache/openejb/config/UberInterfaceTest.java:779593
-/openejb/branches/openejb-3.1.x/container/openejb-core/src/test/java/org/apache/openejb/config/BusinessInterfacesTest.java:945409,945448,1005322,1021880,1021903,1021955,1021961,1021965,1021975,1021979,1021990,1022375,1022393,1023096,1023116,1023125,1026527
+/openejb/branches/openejb-3.1.x/container/openejb-core/src/test/java/org/apache/openejb/config/BusinessInterfacesTest.java:945409,945448,1005322,1021880,1021903,1021955,1021961,1021965,1021975,1021979,1021990,1022375,1022393,1023096,1023116,1023125,1026527,1027754
 /openejb/branches/openejb-jcdi/container/openejb-core/src/test/java/org/apache/openejb/config/BusinessInterfacesTest.java:984659-985270

Modified: openejb/trunk/openejb3/container/openejb-core/src/test/java/org/apache/openejb/config/ConfigureServiceTest.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-core/src/test/java/org/apache/openejb/config/ConfigureServiceTest.java?rev=1029529&r1=1029528&r2=1029529&view=diff
==============================================================================
--- openejb/trunk/openejb3/container/openejb-core/src/test/java/org/apache/openejb/config/ConfigureServiceTest.java
(original)
+++ openejb/trunk/openejb3/container/openejb-core/src/test/java/org/apache/openejb/config/ConfigureServiceTest.java
Mon Nov  1 02:14:50 2010
@@ -137,6 +137,25 @@ public class ConfigureServiceTest extend
         assertEquals("Cheese is good", myStatelessContainer.properties.getProperty("anotherProperty"));
     }
 
+    public void testConfigureServiceAddedPropertyViaURI_Unencoded() throws Exception {
+        ConfigurationFactory factory = new ConfigurationFactory();
+
+        Container container = (Container) factory.toConfigDeclaration("MyContainer", "new://Container?type=STATELESS&provider=org.acme#CheddarContainer");
+
+        container.getProperties().setProperty("anotherProperty", "Cheese is good");
+        StatelessSessionContainerInfo myStatelessContainer = factory.configureService(container,
 StatelessSessionContainerInfo.class);
+
+        assertNotNull(myStatelessContainer);
+        assertEquals("MyContainer", myStatelessContainer.id);
+        assertEquals("org.acme.SuperContainer", myStatelessContainer.className);
+        assertNotNull(myStatelessContainer.constructorArgs);
+        assertNotNull(myStatelessContainer.properties);
+        assertNotNull(myStatelessContainer.properties.getProperty("myProperty"));
+        assertEquals("Yummy Cheese", myStatelessContainer.properties.getProperty("myProperty"));
+        assertNotNull(myStatelessContainer.properties.getProperty("anotherProperty"));
+        assertEquals("Cheese is good", myStatelessContainer.properties.getProperty("anotherProperty"));
+    }
+
     public void testQueue() throws Exception {
         ConfigurationFactory factory = new ConfigurationFactory();
 

Propchange: openejb/trunk/openejb3/examples/alternate-descriptors/src/main/resources/META-INF/test.ejb-jar.xml
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Nov  1 02:14:50 2010
@@ -1,3 +1,3 @@
 /openejb/branches/openejb-3.1.1/examples/alternate-descriptors/src/main/resources/META-INF/ejb-jar.xml:779593
-/openejb/branches/openejb-3.1.x/examples/alternate-descriptors/src/main/resources/META-INF/test.ejb-jar.xml:945409,945448,1005322,1021880,1021903,1021955,1021961,1021965,1021975,1021979,1021990,1022375,1022393,1023096,1023116,1023125,1026527
+/openejb/branches/openejb-3.1.x/examples/alternate-descriptors/src/main/resources/META-INF/test.ejb-jar.xml:945409,945448,1005322,1021880,1021903,1021955,1021961,1021965,1021975,1021979,1021990,1022375,1022393,1023096,1023116,1023125,1026527,1027754
 /openejb/branches/openejb-jcdi/examples/alternate-descriptors/src/main/resources/META-INF/test.ejb-jar.xml:984659-985270



Mime
View raw message