You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@avalon.apache.org by ha...@apache.org on 2002/09/29 14:12:04 UTC

cvs commit: jakarta-avalon-excalibur/metagenerate/src/test/org/apache/avalon/excalibur/metagenerate IntegrationTestCase.java TestBlock.java

hammant     2002/09/29 05:12:04

  Modified:    metagenerate default.properties
               metagenerate/src/java/org/apache/avalon/excalibur/metagenerate
                        XinfoFactory.java XinfoHelper.java
               metagenerate/src/test/org/apache/avalon/excalibur/metagenerate
                        IntegrationTestCase.java TestBlock.java
  Log:
  Now blocks refer to management interface
  
  Revision  Changes    Path
  1.3       +2 -2      jakarta-avalon-excalibur/metagenerate/default.properties
  
  Index: default.properties
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/metagenerate/default.properties,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- default.properties	29 Sep 2002 00:19:13 -0000	1.2
  +++ default.properties	29 Sep 2002 12:12:04 -0000	1.3
  @@ -8,8 +8,8 @@
   name=excalibur-meta-generate
   Name=Excalibur MetaGenerate
   dir-name=metagenerate
  -version=0.8
  -package-version=0.8
  +version=0.9
  +package-version=0.9
   year=2002
   
   # --------------------------------------------------
  
  
  
  1.3       +23 -15    jakarta-avalon-excalibur/metagenerate/src/java/org/apache/avalon/excalibur/metagenerate/XinfoFactory.java
  
  Index: XinfoFactory.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/metagenerate/src/java/org/apache/avalon/excalibur/metagenerate/XinfoFactory.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- XinfoFactory.java	28 Sep 2002 21:43:39 -0000	1.2
  +++ XinfoFactory.java	29 Sep 2002 12:12:04 -0000	1.3
  @@ -47,23 +47,31 @@
                   m_javaClass.getFullyQualifiedName().replace('.',File.separatorChar) + ".xinfo");
           file.getParentFile().mkdirs();
           XinfoHelper xinfo = new XinfoHelper(file);
  -        JavaMethod[] methods = m_javaClass.getMethods();
  -        for (int j = 0; j < methods.length; j++)
  -        {
   
  -            xinfo.writeHeader();
  +        xinfo.writeHeader();
   
  -            // services
  +        // services
   
  -            DocletTag[] services = m_javaClass.getTagsByName("phoenix:service");
  -            for (int i = 0; i < services.length; i++)
  -            {
  -                DocletTag service = services[i];
  -                xinfo.writeServiceLines(service.getNamedParameter("name"));
  -            }
  +        DocletTag[] services = m_javaClass.getTagsByName("phoenix:service");
  +        for (int i = 0; i < services.length; i++)
  +        {
  +            DocletTag service = services[i];
  +            xinfo.writeServiceLines(service.getNamedParameter("name"));
  +        }
  +
  +        xinfo.writeEndOfServicesSection();
   
  -            xinfo.writeMidSection();
  +        DocletTag[] managementInterfaces = m_javaClass.getTagsByName("phoenix:mx");
  +        for (int i = 0; i < managementInterfaces.length; i++)
  +        {
  +            xinfo.writeManagementLine(managementInterfaces[i].getNamedParameter("name"));
  +        }
   
  +        xinfo.writeEndOfManagementSection();
  +
  +        JavaMethod[] methods = m_javaClass.getMethods();
  +        for (int j = 0; j < methods.length; j++)
  +        {
               // dependencies
   
               JavaMethod method = methods[j];
  @@ -80,10 +88,10 @@
                       xinfo.writeDependencyLines(dependency.getNamedParameter("name"));
                   }
               }
  -
  -            xinfo.writeFooter();
  -            xinfo.close();
           }
  +        xinfo.writeFooter();
  +        xinfo.close();
  +
       }
   
   
  
  
  
  1.3       +36 -8     jakarta-avalon-excalibur/metagenerate/src/java/org/apache/avalon/excalibur/metagenerate/XinfoHelper.java
  
  Index: XinfoHelper.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/metagenerate/src/java/org/apache/avalon/excalibur/metagenerate/XinfoHelper.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- XinfoHelper.java	28 Sep 2002 21:43:39 -0000	1.2
  +++ XinfoHelper.java	29 Sep 2002 12:12:04 -0000	1.3
  @@ -38,12 +38,16 @@
       private static final String[] SERVICE_LINES = new String[] {
       "    <service name=\"@SERVICE-CLASS@\"/>" };
   
  -    private static final String[] MID_SECTION = new String[] {
  -
  +    private static final String[] END_OF_SERVICES = new String[] {
       "  </services>",
       "",
       "  <!-- interfaces that may be exported to manange this block -->",
  -    "  <management-access-points>",
  +    "  <management-access-points>" };
  +
  +    private static final String[] MANAGEMENT_LINE = new String[] {
  +    "     <service name=@INTERFACE-NAME@/>" };
  +
  +    private static final String[] END_OF_MGMT = new String[] {
       "  </management-access-points>",
       "",
       "  <!-- services that are required by this block -->",
  @@ -56,7 +60,6 @@
       "    </dependency>" };
   
       private static final String[] FOOTER = new String[] {
  -
       "  </dependencies>",
       "</blockinfo>" };
   
  @@ -98,17 +101,41 @@
       }
   
       /**
  -     * Write the mid section
  +     * Write the end of services section
        * @throws IOException If a problem writing output
        */
  -    public void writeMidSection() throws IOException
  +    public void writeEndOfServicesSection() throws IOException
       {
  -        for (int i = 0; i < MID_SECTION.length; i++)
  +        for (int i = 0; i < END_OF_SERVICES.length; i++)
           {
  -            m_output.write(MID_SECTION[i] + "\n");
  +            m_output.write(END_OF_SERVICES[i] + "\n");
           }
       }
   
  +    public void writeManagementLine(String interfaceName) throws IOException
  +    {
  +        for (int i = 0; i < MANAGEMENT_LINE.length; i++)
  +        {
  +            String line =  MANAGEMENT_LINE[i];
  +            line = replaceString(line, "@INTERFACE-NAME@", interfaceName);
  +            m_output.write(line + "\n");
  +        }
  +
  +    }
  +
  +    /**
  +     * Write the end of management section
  +     * @throws IOException If a problem writing output
  +     */
  +    public void writeEndOfManagementSection() throws IOException
  +    {
  +        for (int i = 0; i < END_OF_MGMT.length; i++)
  +        {
  +            m_output.write(END_OF_MGMT[i] + "\n");
  +        }
  +    }
  +
  +
       /**
        * Write Dependency Lines
        * @param dependency The Dependency
  @@ -144,5 +171,6 @@
       {
           m_output.close();
       }
  +
   
   }
  
  
  
  1.5       +4 -3      jakarta-avalon-excalibur/metagenerate/src/test/org/apache/avalon/excalibur/metagenerate/IntegrationTestCase.java
  
  Index: IntegrationTestCase.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/metagenerate/src/test/org/apache/avalon/excalibur/metagenerate/IntegrationTestCase.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- IntegrationTestCase.java	29 Sep 2002 00:19:13 -0000	1.4
  +++ IntegrationTestCase.java	29 Sep 2002 12:12:04 -0000	1.5
  @@ -42,7 +42,7 @@
           int ix =0;
           while (line != null)
           {
  -            assertEquals("Line not expected", line.trim(), XINFO[ix].trim());
  +            assertEquals("Line not expected", XINFO[ix].trim(), line.trim());
               ix++;
               line = reader.readLine();
           }
  @@ -88,7 +88,7 @@
           int ix =0;
           while (line != null)
           {
  -            assertEquals("Line not expected", line.trim(), MXINFO[ix].trim());
  +            assertEquals("Line not expected", MXINFO[ix].trim(), line.trim());
               ix++;
               line = reader.readLine();
           }
  @@ -114,7 +114,7 @@
           int ix =0;
           while (line != null)
           {
  -            assertEquals("Line not expected", line.trim(), MANIFEST[ix].trim());
  +            assertEquals("Line not expected", MANIFEST[ix].trim(), line.trim());
               ix++;
               line = reader.readLine();
           }
  @@ -140,6 +140,7 @@
       "",
       "      <!-- interfaces that may be exported to manange this block -->",
       "      <management-access-points>",
  +    "        <service name=\"YeeeHaaa\"/>",
       "      </management-access-points>",
       "",
       "      <!-- services that are required by this block -->",
  
  
  
  1.2       +1 -0      jakarta-avalon-excalibur/metagenerate/src/test/org/apache/avalon/excalibur/metagenerate/TestBlock.java
  
  Index: TestBlock.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/metagenerate/src/test/org/apache/avalon/excalibur/metagenerate/TestBlock.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- TestBlock.java	28 Sep 2002 10:37:50 -0000	1.1
  +++ TestBlock.java	29 Sep 2002 12:12:04 -0000	1.2
  @@ -16,6 +16,7 @@
    *
    * @phoenix:block
    * @phoenix:service name="blah.BlahService"
  + * @phoenix:mx name="YeeeHaaa"
    *
    */
   public class TestBlock implements Serviceable
  
  
  

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>