Changeset 75

Show
Ignore:
Timestamp:
05/26/07 10:03:58 (3 years ago)
Author:
chris
Message:

r7771@flan: chris | 2007-05-26 10:03:50 -0700
added an ant target "run-mock" that runs the application using a MockModel?

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/bin/build.xml

    r59 r75  
    180180  </target> 
    181181 
     182  <target name="run-mock" depends="compile,run-debug" 
     183      description="Runs the dist jar file with debugging enabled."> 
     184 
     185    <property name="lastpod.debug" value="Debugging is not enabled."/> 
     186    <property name="lastpod.arg1" value="-D"/> 
     187    <property name="lastpod.arg2" value="-D"/> 
     188    <property name="lastpod.arg3" value="-D"/> 
     189    <property name="lastpod.arg4" value="-D"/> 
     190 
     191    <echo message="${lastpod.debug}"/> 
     192    <java classname="org.lastpod.LastPodMock" fork="true"> 
     193      <classpath refid="project.classpath"/> 
     194      <jvmarg value="${lastpod.arg1}"/> 
     195      <jvmarg value="${lastpod.arg2}"/> 
     196      <jvmarg value="${lastpod.arg3}"/> 
     197      <jvmarg value="${lastpod.arg4}"/> 
     198    </java> 
     199  </target> 
     200 
    182201  <!-- create a jar file for deployment. --> 
    183202  <target name="dist" depends="prepare,compile" 
  • trunk/src/main/org/lastpod/LastPod.java

    r71 r75  
    4242     * Loads the recent played information from the iPod and constructs the 
    4343     * GUI to display it. 
     44     * @param model  The application's model. 
    4445     */ 
    45     private void load() { 
     46    protected void load(Model model) { 
    4647        recentplayed = new ArrayList(); 
    4748 
    48         Model model = new ModelImpl(); 
    4949        model.setRecentlyPlayed(recentplayed); 
    5050        userInterface = new UI(model); 
     
    6363        javax.swing.SwingUtilities.invokeLater(new Runnable() { 
    6464                public void run() { 
     65                    /* Use this application model. */ 
     66                    Model model = new ModelImpl(); 
     67 
    6568                    LastPod lastPod = new LastPod(); 
    66                     lastPod.load(); 
     69                    lastPod.load(model); 
    6770                } 
    6871            });