geronimo-xbean-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r896317 - in /geronimo/xbean/trunk/xbean-blueprint/src/test: java/org/apache/xbean/blueprint/context/ resources/META-INF/services/org/apache/xbean/blueprint/http/xbean.apache.org/schemas/ resources/org/apache/xbean/blueprint/context/ resour...
Date Wed, 06 Jan 2010 03:46:56 GMT
Author: djencks
Date: Wed Jan  6 03:46:55 2010
New Revision: 896317

URL: http://svn.apache.org/viewvc?rev=896317&view=rev
Log:
XBEAN-142 one more test fixes

Removed:
    geronimo/xbean/trunk/xbean-blueprint/src/test/resources/org/apache/xbean/spring/
Modified:
    geronimo/xbean/trunk/xbean-blueprint/src/test/java/org/apache/xbean/blueprint/context/BeerNullTest.java
    geronimo/xbean/trunk/xbean-blueprint/src/test/java/org/apache/xbean/blueprint/context/BeerUsingBlueprintTest.java
    geronimo/xbean/trunk/xbean-blueprint/src/test/java/org/apache/xbean/blueprint/context/BlueprintTestSupport.java
    geronimo/xbean/trunk/xbean-blueprint/src/test/java/org/apache/xbean/blueprint/context/SoupUsingXBeanTest.java
    geronimo/xbean/trunk/xbean-blueprint/src/test/resources/META-INF/services/org/apache/xbean/blueprint/http/xbean.apache.org/schemas/soup
    geronimo/xbean/trunk/xbean-blueprint/src/test/resources/org/apache/xbean/blueprint/context/soup-xbean.xml

Modified: geronimo/xbean/trunk/xbean-blueprint/src/test/java/org/apache/xbean/blueprint/context/BeerNullTest.java
URL: http://svn.apache.org/viewvc/geronimo/xbean/trunk/xbean-blueprint/src/test/java/org/apache/xbean/blueprint/context/BeerNullTest.java?rev=896317&r1=896316&r2=896317&view=diff
==============================================================================
--- geronimo/xbean/trunk/xbean-blueprint/src/test/java/org/apache/xbean/blueprint/context/BeerNullTest.java
(original)
+++ geronimo/xbean/trunk/xbean-blueprint/src/test/java/org/apache/xbean/blueprint/context/BeerNullTest.java
Wed Jan  6 03:46:55 2010
@@ -28,7 +28,6 @@
 public class BeerNullTest extends BlueprintTestSupport {
 
     public void testBeer() throws Exception {
-        ComponentDefinitionRegistry reg = parse(getPlan());
         BeanMetadataImpl meta = (BeanMetadataImpl) reg.getComponentDefinition("beerService");
 
         checkPropertyValue("name", "Stella", meta);

Modified: geronimo/xbean/trunk/xbean-blueprint/src/test/java/org/apache/xbean/blueprint/context/BeerUsingBlueprintTest.java
URL: http://svn.apache.org/viewvc/geronimo/xbean/trunk/xbean-blueprint/src/test/java/org/apache/xbean/blueprint/context/BeerUsingBlueprintTest.java?rev=896317&r1=896316&r2=896317&view=diff
==============================================================================
--- geronimo/xbean/trunk/xbean-blueprint/src/test/java/org/apache/xbean/blueprint/context/BeerUsingBlueprintTest.java
(original)
+++ geronimo/xbean/trunk/xbean-blueprint/src/test/java/org/apache/xbean/blueprint/context/BeerUsingBlueprintTest.java
Wed Jan  6 03:46:55 2010
@@ -27,7 +27,6 @@
 public class BeerUsingBlueprintTest extends BlueprintTestSupport {
     
     public void testBeer() throws Exception {
-        ComponentDefinitionRegistry reg = parse(getPlan());
         BeanMetadataImpl meta = (BeanMetadataImpl) reg.getComponentDefinition("beerService");
         checkPropertyValue("name", "Stella", meta);
         checkPropertyValue("id", "123", meta);

Modified: geronimo/xbean/trunk/xbean-blueprint/src/test/java/org/apache/xbean/blueprint/context/BlueprintTestSupport.java
URL: http://svn.apache.org/viewvc/geronimo/xbean/trunk/xbean-blueprint/src/test/java/org/apache/xbean/blueprint/context/BlueprintTestSupport.java?rev=896317&r1=896316&r2=896317&view=diff
==============================================================================
--- geronimo/xbean/trunk/xbean-blueprint/src/test/java/org/apache/xbean/blueprint/context/BlueprintTestSupport.java
(original)
+++ geronimo/xbean/trunk/xbean-blueprint/src/test/java/org/apache/xbean/blueprint/context/BlueprintTestSupport.java
Wed Jan  6 03:46:55 2010
@@ -63,8 +63,13 @@
     }
 
     protected static ComponentDefinitionRegistryImpl parse(String plan) throws Exception
{
+        String schema = "META-INF/services/org/apache/xbean/blueprint/http/xbean.apache.org/schemas/pizza";
+        return parse(plan, schema);
+    }
+
+    protected static ComponentDefinitionRegistryImpl parse(String plan, String schema) throws
Exception {
         Properties properties = new Properties();
-        URL propUrl = BlueprintTestSupport.class.getClassLoader().getResource("META-INF/services/org/apache/xbean/blueprint/http/xbean.apache.org/schemas/pizza");
+        URL propUrl = BlueprintTestSupport.class.getClassLoader().getResource(schema);
         InputStream in = propUrl.openStream();
         try {
             properties.load(in);
@@ -124,12 +129,12 @@
 
     protected abstract String getPlan();
 
-    protected void checkPropertyValue(String name, Object expectedValued, BeanMetadataImpl
meta) {
+    protected static void checkPropertyValue(String name, Object expectedValued, BeanMetadataImpl
meta) {
         BeanProperty prop = propertyByName(name, meta);
         assertEquals(expectedValued, ((ValueMetadata) prop.getValue()).getStringValue());
     }
 
-    protected BeanProperty propertyByName(String name, BeanMetadataImpl meta) {
+    protected static BeanProperty propertyByName(String name, BeanMetadataImpl meta) {
         List<BeanProperty> props = meta.getProperties();
         for (BeanProperty prop : props) {
             if (name.equals(prop.getName())) {
@@ -140,7 +145,7 @@
 
     }
 
-    protected void checkArgumentValue(int index, String expectedValued, BeanMetadataImpl
meta, boolean allowNesting) {
+    protected static void checkArgumentValue(int index, String expectedValued, BeanMetadataImpl
meta, boolean allowNesting) {
         List<BeanArgument> props = meta.getArguments();
         Metadata metadata = props.get(index).getValue();
         if (allowNesting && metadata instanceof BeanMetadata) {

Modified: geronimo/xbean/trunk/xbean-blueprint/src/test/java/org/apache/xbean/blueprint/context/SoupUsingXBeanTest.java
URL: http://svn.apache.org/viewvc/geronimo/xbean/trunk/xbean-blueprint/src/test/java/org/apache/xbean/blueprint/context/SoupUsingXBeanTest.java?rev=896317&r1=896316&r2=896317&view=diff
==============================================================================
--- geronimo/xbean/trunk/xbean-blueprint/src/test/java/org/apache/xbean/blueprint/context/SoupUsingXBeanTest.java
(original)
+++ geronimo/xbean/trunk/xbean-blueprint/src/test/java/org/apache/xbean/blueprint/context/SoupUsingXBeanTest.java
Wed Jan  6 03:46:55 2010
@@ -23,6 +23,11 @@
  */
 public class SoupUsingXBeanTest extends SoupUsingBlueprintTest {
 
+    @Override
+    protected void setUp() throws Exception {
+        reg = parse(getPlan(), "META-INF/services/org/apache/xbean/blueprint/http/xbean.apache.org/schemas/soup");
+    }
+
     protected String getPlan() {
         return "org/apache/xbean/blueprint/context/soup-xbean.xml";
     }

Modified: geronimo/xbean/trunk/xbean-blueprint/src/test/resources/META-INF/services/org/apache/xbean/blueprint/http/xbean.apache.org/schemas/soup
URL: http://svn.apache.org/viewvc/geronimo/xbean/trunk/xbean-blueprint/src/test/resources/META-INF/services/org/apache/xbean/blueprint/http/xbean.apache.org/schemas/soup?rev=896317&r1=896316&r2=896317&view=diff
==============================================================================
--- geronimo/xbean/trunk/xbean-blueprint/src/test/resources/META-INF/services/org/apache/xbean/blueprint/http/xbean.apache.org/schemas/soup
(original)
+++ geronimo/xbean/trunk/xbean-blueprint/src/test/resources/META-INF/services/org/apache/xbean/blueprint/http/xbean.apache.org/schemas/soup
Wed Jan  6 03:46:55 2010
@@ -20,10 +20,11 @@
 # START SNIPPET: config
 
 # the default package that POJOs are in
-package = org.apache.xbean.spring.example
+#TODO blueprint support this??
+#package = org.apache.xbean.blueprint.example
 
 # Mapping of XML Element localNames to classes 
-soup = org.apache.xbean.spring.example.SoupService
+soup = org.apache.xbean.blueprint.example.SoupService
 
 # Mapping of life-cycle methods
 soup.initMethod = make
@@ -31,6 +32,6 @@
 soup.factoryMethod = newSoup
 
 # Mapping of constructor argument names
-org.apache.xbean.spring.example.SoupService.newSoup(java.lang.String).parameterNames=type
+org.apache.xbean.blueprint.example.SoupService.newSoup(java.lang.String).parameterNames =
type
 
 # END SNIPPET: config

Modified: geronimo/xbean/trunk/xbean-blueprint/src/test/resources/org/apache/xbean/blueprint/context/soup-xbean.xml
URL: http://svn.apache.org/viewvc/geronimo/xbean/trunk/xbean-blueprint/src/test/resources/org/apache/xbean/blueprint/context/soup-xbean.xml?rev=896317&r1=896316&r2=896317&view=diff
==============================================================================
--- geronimo/xbean/trunk/xbean-blueprint/src/test/resources/org/apache/xbean/blueprint/context/soup-xbean.xml
(original)
+++ geronimo/xbean/trunk/xbean-blueprint/src/test/resources/org/apache/xbean/blueprint/context/soup-xbean.xml
Wed Jan  6 03:46:55 2010
@@ -18,11 +18,11 @@
 
 -->
 <!-- START SNIPPET: xml -->
-<b:blueprint xmlns:b="http://www.osgi.org/xmlns/blueprint/v1.0.0" xmlns:s="http://xbean.apache.org/schemas/soup">
+<b:blueprint xmlns:b="http://www.osgi.org/xmlns/blueprint/v1.0.0" xmlns:s="http://xbean.apache.org/schemas/pizza">
 
-  <s:soup b:id="soupService" id="soupService" type="French Onion"/>
+  <s:soup b:id="soupService" s:id="soupService" s:type="French Onion"/>
 
-  <s:soup b:id="nestedBean" id="nestedBean">
+  <s:soup b:id="nestedBean" s:id="nestedBean">
     <s:type>
       <b:bean class="java.lang.String">
         <b:argument index="0" value="French Onion"/>
@@ -30,7 +30,7 @@
     </s:type>
   </s:soup>
 
-  <s:soup b:id="nestedValue" id="nestedValue">
+  <s:soup b:id="nestedValue" s:id="nestedValue">
     <s:type>
       <b:value>French Onion</b:value>
     </s:type>



Mime
View raw message