hivemind-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From k...@apache.org
Subject cvs commit: jakarta-hivemind/framework/src/test/org/apache/hivemind/impl TestSchemaProcessor.java
Date Mon, 31 Jan 2005 10:38:28 GMT
knut        2005/01/31 02:38:27

  Modified:    framework/src/java/org/apache/hivemind/impl
                        SchemaProcessorImpl.java
               framework/src/test/org/apache/hivemind/impl
                        TestSchemaProcessor.java
  Log:
  Make sure key attribute value is symbol expanded prior to translation
  
  Revision  Changes    Path
  1.14      +9 -3      jakarta-hivemind/framework/src/java/org/apache/hivemind/impl/SchemaProcessorImpl.java
  
  Index: SchemaProcessorImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-hivemind/framework/src/java/org/apache/hivemind/impl/SchemaProcessorImpl.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- SchemaProcessorImpl.java	31 Jan 2005 10:10:54 -0000	1.13
  +++ SchemaProcessorImpl.java	31 Jan 2005 10:38:27 -0000	1.14
  @@ -95,13 +95,19 @@
           if (_canElementsBeMapped)
           {
               Element currentElement = peekElement();
  -
               String keyAttribute = _activeElement.getKeyAttribute();
   
  +            String expandedKey = getContributingModule().expandSymbols(
  +                    currentElement.getAttributeValue(keyAttribute),
  +                    currentElement.getLocation());
  +
               Translator t = getAttributeTranslator(keyAttribute);
   
  -            Object finalValue = t.translate(getContributingModule(), Object.class, currentElement
  -                    .getAttributeValue(keyAttribute), currentElement.getLocation());
  +            Object finalValue = t.translate(
  +                    getContributingModule(),
  +                    Object.class,
  +                    expandedKey,
  +                    currentElement.getLocation());
   
               _mappedElements.put(finalValue, element);
           }
  
  
  
  1.11      +6 -3      jakarta-hivemind/framework/src/test/org/apache/hivemind/impl/TestSchemaProcessor.java
  
  Index: TestSchemaProcessor.java
  ===================================================================
  RCS file: /home/cvs/jakarta-hivemind/framework/src/test/org/apache/hivemind/impl/TestSchemaProcessor.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- TestSchemaProcessor.java	31 Jan 2005 10:10:54 -0000	1.10
  +++ TestSchemaProcessor.java	31 Jan 2005 10:38:27 -0000	1.11
  @@ -266,8 +266,8 @@
   
           ElementImpl element = new ElementImpl();
           element.setElementName("cartoon");
  -        element.setContent("fred");
  -        element.addAttribute(new AttributeImpl("name", "flintstone"));
  +        element.setContent("${fred}");
  +        element.addAttribute(new AttributeImpl("name", "${flintstone}"));
   
           List elements = Collections.singletonList(element);
   
  @@ -277,9 +277,12 @@
           m.getClassResolver();
           control.setReturnValue(new DefaultClassResolver());
   
  -        m.expandSymbols("fred", null);
  +        m.expandSymbols("${fred}", null);
           control.setReturnValue("fred");
   
  +        m.expandSymbols("${flintstone}", null);
  +        control.setReturnValue("flintstone");
  +
           MockControl tControl = newControl(Translator.class);
           Translator t = (Translator) tControl.getMock();
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-cvs-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-cvs-help@jakarta.apache.org


Mime
View raw message