Changeset 29

Show
Ignore:
Timestamp:
10/04/07 01:16:31 (1 year ago)
Author:
max
Message:
 
Location:
branches/aspectj_planetsim
Files:
1 added
3 modified

Legend:

Unmodified
Added
Removed
  • branches/aspectj_planetsim/.classpath

    r23 r29  
    33        <classpathentry kind="src" path="src"/> 
    44        <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> 
    5         <classpathentry kind="lib" path="lib/junit.jar"/> 
    65        <classpathentry kind="con" path="org.eclipse.ajdt.core.ASPECTJRT_CONTAINER"/> 
     6        <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/3"/> 
    77        <classpathentry kind="output" path="out"/> 
    88</classpath> 
  • branches/aspectj_planetsim/bin/build.xml

    r2 r29  
    1 <project name="URV.PLANETSIM" default="targets" basedir="."> 
     1<project name="URV.PLANETSIM.AJ" default="targets" basedir="."> 
    22 
    3         <property environment="env"/> 
    4         <property file="planetsim.properties"/> 
     3        <property name="ajtools" value="C:/Programme/Java/aspectj1.5/lib/aspectjtools.jar" /> 
     4 
     5        <property name="ajruntime" value="C:/Programme/Java/aspectj1.5/lib/aspectjrt.jar" /> 
     6 
     7        <taskdef resource="org/aspectj/tools/ant/taskdefs/aspectjTaskdefs.properties"> 
     8                        <classpath> 
     9                                <pathelement location="${ajtools}" /> 
     10                        </classpath> 
     11                </taskdef> 
     12        <property environment="env" /> 
     13        <property file="planetsim.properties" /> 
    514 
    615 
    7   <path id="base.path"> 
    8       <pathelement path="${classpath}"/> 
    9       <fileset dir="../lib"> 
    10         <include name="**/*.jar"/> 
    11       </fileset> 
    12    </path> 
     16        <path id="base.path"> 
     17                <pathelement path="${classpath}" /> 
     18                <fileset dir="C:/Programme/Java/aspectj1.5/lib"> 
     19                                                        <include name="**/*.jar" /> 
     20                                </fileset> 
     21                <fileset dir="../lib"> 
     22                        <include name="**/*.jar" /> 
     23                </fileset> 
     24                 
     25        </path> 
    1326 
    1427 
    15     <target name="jar"> 
    16         <delete dir="../out"/> 
    17         <mkdir dir="../out"/> 
    18         <delete file="../lib/planetsim.jar"/> 
    19         <echo message="Compiling only with 1.4 compatibility (without debug options)"/> 
    20         <javac srcdir="../src" 
    21                    destdir="../out" 
    22                    source="1.4" 
    23                    target="1.4"> 
    24                 <classpath refid="base.path"/>       
    25         </javac>       
    26         <jar jarfile="../lib/planetsim.jar" 
    27                  basedir="../out" > 
    28             </jar> 
     28         
     29         
     30 
     31 
     32        <target name="jar_debug"> 
     33                <delete dir="../out" /> 
     34                <mkdir dir="../out" /> 
     35                <delete file="../lib/planetsim.jar" /> 
     36                <echo message="Compiling only with 1.4 compatibility (with activated debug options)" /> 
     37                <javac srcdir="../src" destdir="../out" source="1.4" target="1.4" debug="yes" debuglevel="lines,vars,source"> 
     38                        <classpath refid="base.path" /> 
     39                </javac> 
     40                <jar jarfile="../lib/planetsim.jar" basedir="../out"> 
     41                </jar> 
    2942        </target> 
    3043 
    3144 
    32     <target name="jar_debug"> 
    33         <delete dir="../out"/> 
    34         <mkdir dir="../out"/> 
    35         <delete file="../lib/planetsim.jar"/> 
    36         <echo message="Compiling only with 1.4 compatibility (with activated debug options)"/> 
    37         <javac  srcdir="../src" 
    38                 destdir="../out" 
    39                 source="1.4" 
    40                 target="1.4" 
    41                 debug="yes" 
    42                 debuglevel="lines,vars,source"> 
    43                 <classpath refid="base.path"/> 
    44         </javac> 
    45         <jar jarfile="../lib/planetsim.jar" basedir="../out"></jar> 
    46     </target> 
     45        <target name="api"> 
     46                <delete dir="../docs/api" /> 
     47                <javadoc destdir="../docs/api" author="true" version="true" use="true" windowtitle="PlanetSim"> 
     48                        <fileset dir="../src"> 
     49                                <include name="planet/**" /> 
     50                                <exclude name="**/*.lst" /> 
     51                        </fileset> 
     52                        <classpath refid="base.path" /> 
     53                </javadoc> 
     54        </target> 
    4755 
    48    
    49     <target name="api">  
    50           <delete dir="../docs/api"/> 
    51           <javadoc destdir="../docs/api" 
    52            author="true" 
    53            version="true" 
    54            use="true" 
    55            windowtitle="PlanetSim"> 
    56                 <fileset dir="../src"> 
    57               <include name="planet/**" /> 
    58               <exclude name="**/*.lst" /> 
    59             </fileset> 
    60                         <classpath refid="base.path"/> 
    61           </javadoc> 
    62         </target> 
    6356 
    64    
    65         <target name="run"> 
    66                 <java classname="planet.test.SimTest"> 
    67                         <arg value="${event_file}"/>  
    68                         <arg value="${steps}"/> 
    69                 <classpath refid="base.path"/>     
     57        <target name="run"> 
     58                <java classname="planet.test.SimTest"> 
     59                        <arg value="${event_file}" /> 
     60                        <arg value="${steps}" /> 
     61                        <classpath refid="base.path"> 
     62                                         
     63                        </classpath> 
    7064                </java> 
    71         </target> 
     65        </target> 
     66        <target name="run2" description="planet.test.helloworld.DHTPeerTest"> 
     67                        <java classname="planet.test.helloworld.DHTPeerTest"> 
     68                                 
     69                                <classpath refid="base.path"> 
     70                                                 
     71                                </classpath> 
     72                        </java> 
     73                 
     74                </target> 
     75        <target name="test"> 
     76                <mkdir dir="reports" /> 
     77                <junit printsummary="yes" fork="yes" haltonfailure="no" haltonerror="no"> 
     78                        <formatter type="xml" /> 
     79                        <test name="planet.test.SimpleTest" todir="./reports" /> 
     80                        <classpath> 
     81                                <path refid="base.path" /> 
     82                                <pathelement path="../lib/planetsim.jar" /> 
     83                                <pathelement path="../lib/junit.jar" /> 
     84                        </classpath> 
     85                </junit> 
    7286 
    73        <target name="test"> 
    74            <mkdir dir="reports"/> 
    75            <junit printsummary="yes" fork="yes" haltonfailure="no" haltonerror="no"> 
    76            <formatter type="xml" /> 
    77            <test name="planet.test.SimpleTest" todir="./reports"/> 
    78            <classpath> 
    79              <path refid="base.path" /> 
    80              <pathelement path="../lib/planetsim.jar" /> 
    81              <pathelement path="../lib/junit.jar" /> 
    82            </classpath> 
    83            </junit> 
    84     
    85            <junitreport todir="./reports"> 
    86              <fileset dir="./reports"> 
    87                <include name="TEST-*.xml"/> 
    88              </fileset> 
    89              <report format="frames" todir="./reports"/> 
    90            </junitreport> 
    91         <echo> 
     87                <junitreport todir="./reports"> 
     88                        <fileset dir="./reports"> 
     89                                <include name="TEST-*.xml" /> 
     90                        </fileset> 
     91                        <report format="frames" todir="./reports" /> 
     92                </junitreport> 
     93                <echo> 
    9294                See the results opening the file PLANETSIM/bin/reports/index.html 
    9395        </echo> 
    94        </target> 
    95    
    96    
    97   <!-- =============================== Help =============================== --> 
    98   <target name="targets"> 
    99     <echo message=""/> 
    100     <echo message="ANT build targets for P2P simulator"/> 
    101     <echo message=""/> 
    102     <echo message="The following targets are available:"/> 
    103     <echo message="  jar         Compile and create distribution, without debug options"/> 
    104     <echo message="  jar_debug   Compile and create distribution with activated debug options"/> 
    105     <echo message="  api         Generate api docs "/> 
    106     <echo message="  run         Run one simple command line test"/> 
    107     <echo message="  test        Execute a JUnit test. The output is in HTML format in 'reports' directory."/> 
    108   </target> 
     96        </target> 
     97 
     98 
     99        <!-- =============================== Help =============================== --> 
     100        <target name="targets"> 
     101                <echo message="" /> 
     102                <echo message="ANT build targets for P2P simulator" /> 
     103                <echo message="" /> 
     104                <echo message="The following targets are available:" /> 
     105                <echo message="  jar         Compile and create distribution, without debug options" /> 
     106                <echo message="  jar_debug   Compile and create distribution with activated debug options" /> 
     107                <echo message="  api         Generate api docs " /> 
     108                <echo message="  run         Run one simple command line test" /> 
     109                <echo message="  test        Execute a JUnit test. The output is in HTML format in 'reports' directory." /> 
     110        </target> 
     111 
     112 
     113        <target name="ajcompile"> 
     114                <delete dir="../out" /> 
     115                                        <mkdir dir="../out" /> 
     116                                        <delete file="../lib/planetsimaj.jar" /> 
     117                <iajc source="1.5" target="1.5" sourceroots="../src" classpath="${ajruntime};../lib/junit.jar;${ajtools}"  outjar="../lib/planetsimaj.jar" /> 
     118                 
     119        </target> 
    109120 
    110121</project> 
  • branches/aspectj_planetsim/src/planet/aspect/statistic/Statistics.aj

    r23 r29  
    2929        private final String LINETYPE = "lines"; 
    3030        private String domainName = "default"; 
    31         private final String RESULTFOLDER = "./statistics/"; 
     31        private final String RESULTFOLDER = "../statistics/"; 
    3232        private long currentStep = 0; 
    3333 
     
    4949                File f = new File(RESULTFOLDER); 
    5050                if (!f.exists()) { 
     51                         
    5152                        f.mkdir(); 
    5253                }