avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dona...@apache.org
Subject cvs commit: jakarta-avalon-apps/simpleserver/src/java/org/apache/avalon/simpleserver SimpleServer.java
Date Fri, 06 Sep 2002 09:45:07 GMT
donaldp     2002/09/06 02:45:07

  Modified:    common/lib phoenix-client.jar
               simpleserver build.xml
               simpleserver/src/java/org/apache/avalon/simpleserver
                        SimpleServer.java
  Added:       simpleserver README.txt
  Removed:     simpleserver readme.txt
  Log:
  Test out resource aquisition from sar file.
  
  Revision  Changes    Path
  1.7       +67 -69    jakarta-avalon-apps/common/lib/phoenix-client.jar
  
  	<<Binary file>>
  
  
  1.16      +29 -26    jakarta-avalon-apps/simpleserver/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-apps/simpleserver/build.xml,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- build.xml	3 Sep 2002 07:37:25 -0000	1.15
  +++ build.xml	6 Sep 2002 09:45:07 -0000	1.16
  @@ -26,24 +26,24 @@
     <property name="build.xdoclet" value="${build.dir}/xdoclet"/>
     <property name="build.src" value="${build.dir}/src"/>
     <property name="build.classes" value="${build.dir}/classes"/>
  -  <property name="build.javadocs" value="${build.dir}/javadocs"/>  
  +  <property name="build.javadocs" value="${build.dir}/javadocs"/>
     <property name="build.docs" value="${build.dir}/docs"/>
  -  <property name="build.context" value="${build.dir}/documentation"/>  
  -  <property name="build.xdocs" value="${build.context}/content/xdocs"/>  
  +  <property name="build.context" value="${build.dir}/documentation"/>
  +  <property name="build.xdocs" value="${build.context}/content/xdocs"/>
   
     <!-- Set the properties for source directories -->
     <property name="src.dir" value="src"/>
     <property name="java.dir" value="${src.dir}/java"/>
     <property name="manifest.dir" value="${src.dir}/manifest"/>
     <property name="conf.dir" value="${src.dir}/conf"/>
  -  <property name="context.dir" value="../../jakarta-avalon/src/documentation"/> 

  -  <property name="xdocs.dir" value="${src.dir}/xdocs"/>   
  +  <property name="context.dir" value="../../jakarta-avalon/src/documentation"/>
  +  <property name="xdocs.dir" value="${src.dir}/xdocs"/>
     <property name="tools.dir" location="../../jakarta-avalon/tools"/>
   
     <property name="dist.base" value="distributions"/>
   
     <path id="project.class.path">
  -    <pathelement path="${java.class.path}" /> 
  +    <pathelement path="${java.class.path}" />
       <pathelement path="${build.classes}" />
       <fileset dir="../common/lib">
         <include name="**/*.jar" />
  @@ -99,7 +99,7 @@
     </target>
   
     <!-- Compiles project -->
  -  <target name="compile"> 
  +  <target name="compile">
   
       <mkdir dir="${build.classes}"/>
   
  @@ -109,7 +109,7 @@
              optimize="${build.optimize}"
              deprecation="${build.deprecation}">
         <classpath refid="project.class.path" />
  -      
  +
       </javac>
   
       <copy todir="${build.classes}">
  @@ -121,15 +121,15 @@
   
     </target>
   
  -  <target name="test-xdoclet">  
  -    <available classname="xdoclet.XDocletMain" classpathref="project.class.path" property="xdoclet.present"/>
   
  +  <target name="test-xdoclet">
  +    <available classname="xdoclet.XDocletMain" classpathref="project.class.path" property="xdoclet.present"/>
     </target>
   
     <!-- Make .xinfo and manifest automatically for blocks -->
     <target name="phoenix-xdoclet" depends="compile" if="xdoclet.present">
  -  
  +
       <mkdir dir="${build.xdoclet}"/>
  -  
  +
       <taskdef name="phoenix-blocks"
                classname="org.apache.avalon.phoenix.tools.xdoclet.PhoenixXDoclet"
                classpathref="project.class.path"/>
  @@ -148,9 +148,9 @@
   
     <!-- Make .xinfo and manifest automatically for blocks -->
     <target name="no-phoenix-xdoclet" depends="compile" unless="xdoclet.present">
  -  
  +
       <mkdir dir="${build.xdoclet}"/>
  -  
  +
       <unzip src="${src.dir}/generated-by-xdoclet.zip" dest="${build.xdoclet}" />
   
     </target>
  @@ -167,7 +167,7 @@
           <include name="org/apache/avalon/simpleserver/**"/>
           <exclude name="org/apache/avalon/cornerstone/demos/simpleserver/extension1/*"/>
           <exclude name="org/apache/avalon/cornerstone/demos/simpleserver/extension2/*"/>
  -        <exclude name="org/apache/avalon/cornerstone/demos/simpleserver/classes/*"/>
       
  +        <exclude name="org/apache/avalon/cornerstone/demos/simpleserver/classes/*"/>
         </fileset>
         <fileset dir="${build.xdoclet}">
           <include name="**/*.xinfo"/>
  @@ -190,7 +190,7 @@
   
     <target name="main" depends="sars" description="Default target to generate build products
minus docs"/>
     <target name="all" depends="main,docs" description="Generate build products including
docs"/>
  - 
  +
     <target name="sars" depends="jars">
   
       <sar sarfile="${build.lib}/avalon-${name}.sar"
  @@ -201,6 +201,9 @@
         <zipfileset dir="${build.classes}" prefix="SAR-INF/classes">
           <include name="org/apache/avalon/cornerstone/demos/simpleserver/classes/*"/>
         </zipfileset>
  +      <fileset dir=".">
  +          <include name="README.txt"/>
  +      </fileset>
   
         <lib dir="${build.lib}/">
           <include name="*.jar"/>
  @@ -227,7 +230,7 @@
     <!-- Performs unit tests -->
     <target name="check" depends="compile" description="Perform any built in tests">
     </target>
  -  
  +
     <!-- Completely build all dists -->
     <target name="dist" depends="sars" description="Generates the distribution">
   
  @@ -281,7 +284,7 @@
           <include name="common/lib/avalon-*"/>
           <include name="common/lib/cornerstone.jar"/>
           <include name="common/lib/phoenix-*"/>
  -      </tarfileset>      
  +      </tarfileset>
       </tar>
   
       <gzip zipfile="${dist.base}/${dist.name}-src.tar.gz"
  @@ -291,7 +294,7 @@
   
     </target>
   
  -  <!-- Creates all the .sar files -->  
  +  <!-- Creates all the .sar files -->
     <target name="bin-dist" depends="all">
   
       <!-- bin.dist.dir usually set before this target is called -->
  @@ -301,7 +304,7 @@
   
       <mkdir dir="${bin.dist.docs}"/>
       <copy todir="${bin.dist.docs}">
  -      <fileset dir="${build.docs}"/> 
  +      <fileset dir="${build.docs}"/>
       </copy>
   
       <copy file="${build.lib}/avalon-simpleserver.sar" tofile="${bin.dist.dir}/avalon-simpleserver-${version}.sar"/>
  @@ -318,7 +321,7 @@
       <mkdir dir="${src.dist.docs}"/>
   
       <copy todir="${src.dist.docs}">
  -      <fileset dir="${build.docs}"/> 
  +      <fileset dir="${build.docs}"/>
       </copy>
   
       <copy todir="${src.dist.src}">
  @@ -327,20 +330,20 @@
   
       <zip zipfile="${src.dist.src}/generated-by-xdoclet.zip"
            basedir="${build.xdoclet}"/>
  -    
  +
       <copy todir="${src.dist.dir}">
         <fileset dir=".">
           <include name="build.xml"/>
         </fileset>
       </copy>
  -    
  +
       <mkdir dir="${src.dist.dir}/lib"/>
       <copy todir="${src.dist.dir}/lib">
         <fileset dir="lib">
           <include name="**"/>
         </fileset>
       </copy>
  -    
  +
       <fixcrlf srcdir="${src.dist.src}/java" includes="**/*.java" eol="lf"/>
   
       <chmod dir="${src.dist.dir}" perm="go-rwx" />
  @@ -351,9 +354,9 @@
       <echo message="Installing to ${install.dir}" />
       <delete dir="${install.dir}/avalon-simpleserver" />
       <copy file="${build.lib}/avalon-simpleserver.sar" todir="${install.dir}" />
  -    <copy file="${build.lib}/demo-test-extension2.jar" 
  +    <copy file="${build.lib}/demo-test-extension2.jar"
             tofile="${phoenix.home}/ext/demo-test-extension2.jar"
  -          overwrite="true" />    
  +          overwrite="true" />
     </target>
   
     <target name="uninstall" description="Uninstalls from Phoenix">
  
  
  
  1.1                  jakarta-avalon-apps/simpleserver/README.txt
  
  	<<Binary file>>
  
  
  1.10      +24 -0     jakarta-avalon-apps/simpleserver/src/java/org/apache/avalon/simpleserver/SimpleServer.java
  
  Index: SimpleServer.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-apps/simpleserver/src/java/org/apache/avalon/simpleserver/SimpleServer.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- SimpleServer.java	22 May 2002 20:58:36 -0000	1.9
  +++ SimpleServer.java	6 Sep 2002 09:45:07 -0000	1.10
  @@ -13,6 +13,7 @@
   import java.io.InputStreamReader;
   import java.io.InterruptedIOException;
   import java.io.PrintWriter;
  +import java.io.InputStream;
   import java.net.DatagramPacket;
   import java.net.DatagramSocket;
   import java.net.ProtocolException;
  @@ -169,7 +170,30 @@
           ClassesTest.doClassesTest();
           getLogger().info( "...successful" );
   
  +        testResource( "/README.txt" );
  +        testResource( "README.txt" );
  +        testResource( "SAR-INF/config.xml" );
  +        testResource( "SAR-INF/lib/cornerstone.jar" );
  +
           getLogger().info( "...Demo init" );
  +    }
  +
  +    private void testResource( String resourceName ) throws Exception
  +    {
  +        final InputStream resourceAsStream =
  +            m_context.getResourceAsStream( resourceName );
  +        if( null == resourceAsStream )
  +        {
  +            final String message = "Unable to load resource named: " + resourceName;
  +            throw new Exception( message );
  +        }
  +        else
  +        {
  +            final String message =
  +                "Loaded resource named " + resourceName +
  +                " as " + resourceAsStream;
  +            System.out.println( message );
  +        }
       }
   
       /**
  
  
  

--
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