avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hamm...@apache.org
Subject cvs commit: jakarta-avalon-phoenix/src/test/org/apache/avalon/phoenix/tools/metagenerate/test IntegrationTestCase.java TestBlock.java
Date Sun, 20 Oct 2002 12:12:34 GMT
hammant     2002/10/20 05:12:34

  Modified:    src/java/org/apache/avalon/phoenix/tools/metagenerate
                        XinfoFactory.java XinfoHelper.java
               src/test/org/apache/avalon/phoenix/tools/metagenerate/test
                        IntegrationTestCase.java TestBlock.java
  Log:
  Role added
  
  Revision  Changes    Path
  1.7       +14 -1     jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/tools/metagenerate/XinfoFactory.java
  
  Index: XinfoFactory.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/tools/metagenerate/XinfoFactory.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- XinfoFactory.java	20 Oct 2002 11:55:38 -0000	1.6
  +++ XinfoFactory.java	20 Oct 2002 12:12:34 -0000	1.7
  @@ -175,8 +175,21 @@
           {
               String dependencyName = (String) it.next();
               DocletTag dependency = (DocletTag) m_dependencies.get( dependencyName );
  +            String role = dependency.getNamedParameter( "role" );
  +            if (role != null)
  +            {
  +                if (role.startsWith("\""))
  +                {
  +                    role = role.substring(1,role.length());
  +                }
  +                if (role.endsWith("\""))
  +                {
  +                    role = role.substring(0,role.length()-1);
  +                }
  +            }
               xinfo.writeDependencyLines( dependencyName,
  -                            dependency.getNamedParameter( "version" ) );
  +                    dependency.getNamedParameter( "version" ),
  +                    role);
           }
       }
   
  
  
  
  1.4       +10 -2     jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/tools/metagenerate/XinfoHelper.java
  
  Index: XinfoHelper.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/tools/metagenerate/XinfoHelper.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- XinfoHelper.java	20 Oct 2002 09:19:29 -0000	1.3
  +++ XinfoHelper.java	20 Oct 2002 12:12:34 -0000	1.4
  @@ -61,6 +61,7 @@
       private static final String[] DEPENDENCY_SECTION = new String[]{
   
           "    <dependency>",
  +        "      <role>@ROLE-NAME@</role>",
           "      <service name=\"@SERVICE-CLASS@\"@VERSION@/>",
           "    </dependency>"};
   
  @@ -161,9 +162,12 @@
       /**
        * Write Dependency Lines
        * @param dependency The Dependency
  +     * @param version The version
  +     * @param role The role name
        * @throws IOException If a problem writing output
        */
  -    public void writeDependencyLines(String dependency, String version) throws IOException
  +    public void writeDependencyLines(String dependency, String version, String role)
  +            throws IOException
       {
           version = version == null ? "" : " version=" + version;
           for (int i = 0; i < DEPENDENCY_SECTION.length; i++)
  @@ -171,7 +175,11 @@
               String line = DEPENDENCY_SECTION[i];
               line = replaceString(line, "\"@SERVICE-CLASS@\"", dependency);
               line = replaceString(line, "@VERSION@", version);
  -            m_output.write(line + "\n");
  +            line = replaceString(line, "@ROLE-NAME@", role);
  +            if (line.indexOf("<role>") == -1 | role != null)
  +            {
  +                m_output.write(line + "\n");
  +            }
           }
       }
   
  
  
  
  1.6       +1 -0      jakarta-avalon-phoenix/src/test/org/apache/avalon/phoenix/tools/metagenerate/test/IntegrationTestCase.java
  
  Index: IntegrationTestCase.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-phoenix/src/test/org/apache/avalon/phoenix/tools/metagenerate/test/IntegrationTestCase.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- IntegrationTestCase.java	20 Oct 2002 11:55:38 -0000	1.5
  +++ IntegrationTestCase.java	20 Oct 2002 12:12:34 -0000	1.6
  @@ -124,6 +124,7 @@
       "          <service name=\"blah.OtherFooService\"/>",
       "        </dependency>",
       "        <dependency>",
  +    "          <role>my-service</role>",
       "          <service name=\"blah.OtherBlahService\" version=\"1.2\"/>",
       "        </dependency>",
       "      </dependencies>",
  
  
  
  1.4       +1 -1      jakarta-avalon-phoenix/src/test/org/apache/avalon/phoenix/tools/metagenerate/test/TestBlock.java
  
  Index: TestBlock.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-phoenix/src/test/org/apache/avalon/phoenix/tools/metagenerate/test/TestBlock.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- TestBlock.java	20 Oct 2002 10:25:51 -0000	1.3
  +++ TestBlock.java	20 Oct 2002 12:12:34 -0000	1.4
  @@ -25,7 +25,7 @@
   public class TestBlock extends TestParentBlock implements Serviceable, Configurable
   {
       /**
  -     * @phoenix:dependency name="blah.OtherBlahService" version="1.2"
  +     * @phoenix:dependency name="blah.OtherBlahService" role="my-service" version="1.2"
        */
       public void service( final ServiceManager serviceManager )
           throws ServiceException
  
  
  

--
To unsubscribe, e-mail:   <mailto:avalon-cvs-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:avalon-cvs-help@jakarta.apache.org>


Mime
View raw message