aries-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rwo...@apache.org
Subject svn commit: r1163525 - in /aries/branches/0.3-RCx/blueprint: blueprint-core/src/test/java/org/apache/aries/blueprint/ext/AbstractPropertyPlaceholderTest.java blueprint-core/src/test/java/org/apache/aries/blueprint/ext/PropertyPlaceholderTest.java pom.xml
Date Wed, 31 Aug 2011 08:36:11 GMT
Author: rwonly
Date: Wed Aug 31 08:36:10 2011
New Revision: 1163525

URL: http://svn.apache.org/viewvc?rev=1163525&view=rev
Log:
ARIES-727 add unit test for this new feature

Added:
    aries/branches/0.3-RCx/blueprint/blueprint-core/src/test/java/org/apache/aries/blueprint/ext/PropertyPlaceholderTest.java
      - copied, changed from r1161978, aries/branches/0.3-RCx/blueprint/blueprint-core/src/test/java/org/apache/aries/blueprint/ext/AbstractPropertyPlaceholderTest.java
Modified:
    aries/branches/0.3-RCx/blueprint/blueprint-core/src/test/java/org/apache/aries/blueprint/ext/AbstractPropertyPlaceholderTest.java
    aries/branches/0.3-RCx/blueprint/pom.xml

Copied: aries/branches/0.3-RCx/blueprint/blueprint-core/src/test/java/org/apache/aries/blueprint/ext/PropertyPlaceholderTest.java
(from r1161978, aries/branches/0.3-RCx/blueprint/blueprint-core/src/test/java/org/apache/aries/blueprint/ext/AbstractPropertyPlaceholderTest.java)
URL: http://svn.apache.org/viewvc/aries/branches/0.3-RCx/blueprint/blueprint-core/src/test/java/org/apache/aries/blueprint/ext/PropertyPlaceholderTest.java?p2=aries/branches/0.3-RCx/blueprint/blueprint-core/src/test/java/org/apache/aries/blueprint/ext/PropertyPlaceholderTest.java&p1=aries/branches/0.3-RCx/blueprint/blueprint-core/src/test/java/org/apache/aries/blueprint/ext/AbstractPropertyPlaceholderTest.java&r1=1161978&r2=1163525&rev=1163525&view=diff
==============================================================================
--- aries/branches/0.3-RCx/blueprint/blueprint-core/src/test/java/org/apache/aries/blueprint/ext/AbstractPropertyPlaceholderTest.java
(original)
+++ aries/branches/0.3-RCx/blueprint/blueprint-core/src/test/java/org/apache/aries/blueprint/ext/PropertyPlaceholderTest.java
Wed Aug 31 08:36:10 2011
@@ -27,29 +27,45 @@ import org.junit.Before;
 import org.junit.Test;
 import org.osgi.service.blueprint.reflect.ValueMetadata;
 
-public class AbstractPropertyPlaceholderTest extends AbstractPropertyPlaceholder {
+public class PropertyPlaceholderTest extends PropertyPlaceholder {
     private final Map<String,String> values = new HashMap<String,String>();
     private LateBindingValueMetadata sut;
     
     @Before
     public void setup() {
         values.clear();
-        bind("prop","value");
-        bind("prop2","other");
+        bind("prop1","hello");
+        bind("prop2","world");
+        bind("prop3","10");
+        bind("prop4","20");
     }
     
     @Test
     public void singleProp() {
-        sut = makeProperty("${prop}");
-        assertEquals("value", sut.getStringValue());
+        sut = makeProperty("${prop1}");
+        assertEquals("hello", sut.getStringValue());
     }
     
     @Test
     public void multipleProps() {
-        sut = makeProperty("the ${prop2} ${prop}");
-        assertEquals("the other value", sut.getStringValue());
+        sut = makeProperty("say ${prop1} ${prop2}");
+        assertEquals("say hello world", sut.getStringValue());
     }
     
+    @Test
+    public void evaluateStringProps() {
+        sut = makeProperty("${prop1+prop2}");
+        assertEquals("helloworld", sut.getStringValue());
+    }
+    
+    @Test
+    public void evaluateIntProps() {
+        sut = makeProperty("${prop3+prop4}");
+        assertEquals("30", sut.getStringValue());
+    }
+    
+    
+    
     /*
      * Test helper methods
      */

Modified: aries/branches/0.3-RCx/blueprint/pom.xml
URL: http://svn.apache.org/viewvc/aries/branches/0.3-RCx/blueprint/pom.xml?rev=1163525&r1=1163524&r2=1163525&view=diff
==============================================================================
--- aries/branches/0.3-RCx/blueprint/pom.xml (original)
+++ aries/branches/0.3-RCx/blueprint/pom.xml Wed Aug 31 08:36:10 2011
@@ -164,12 +164,6 @@
                 <groupId>org.apache.commons</groupId>
                 <artifactId>commons-jexl</artifactId>
                 <version>2.0</version>
-                <exclusions>
-                    <exclusion>
-                        <groupId>commons-logging</groupId>
-                        <artifactId>commons-logging</artifactId>
-                    </exclusion>
-                </exclusions>
             </dependency>
         </dependencies>
     </dependencyManagement>



Mime
View raw message