Changeset 4713


Ignore:
Timestamp:
Jan 7, 2009, 2:42:28 PM (13 years ago)
Author:
Nicklas Nordborg
Message:

References #1225: Base1PluginExecuter crashes with "The connection has been closed"

Added test-case where the plug-in creates a subdirectory.

Location:
branches/2.9-stable/src/test
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/2.9-stable/src/test/Base1TestPlugin.java

    r4631 r4713  
    2020  along with BASE. If not, see <http://www.gnu.org/licenses/>.
    2121*/
     22import java.io.File;
    2223import java.io.IOException;
    2324import java.io.InputStream;
     
    4849    boolean offsetPositions = false;
    4950    boolean reporterList = false;
     51    boolean createSubdir = false;
    5052    int numSpotSections = 0;
    5153    while (ffp.hasMoreSections())
     
    6062        offsetPositions = Values.getBoolean(ffp.getHeader("offsetPositions"));
    6163        reporterList = Values.getBoolean(ffp.getHeader("reporterList"));
     64        createSubdir = Values.getBoolean(ffp.getHeader("createSubdir"));
    6265        //System.out.println("merge: " + mergeAssays + "; offset: " + offsetPositions);
     66        //System.out.println("createSubdir: " + createSubdir);
    6367      }
    6468      else if ("assays".equals(section.name()) && !reporterList)
     
    135139          System.out.println();
    136140        }
    137       }
    138      
     141      }
    139142    }
    140    
     143    if (createSubdir)
     144    {
     145      File tmpDir = new File(System.getProperty("java.io.tmpdir"));
     146      File subdir = new File(tmpDir, "subdir");
     147      File subFile = new File(subdir, "file.txt");
     148      subFile.createNewFile();
     149    }
    141150  }
    142151 
  • branches/2.9-stable/src/test/TestBase1PluginExecuter.java

    r4605 r4713  
    110110    ok &= TestJob.test_execute(jobId2);
    111111
    112     // Merge assays
     112    // Merge assays +  create subdir
    113113    int jobId3 = test_create_job(pluginConfigurationId2, experimentId, rootBioAssaySetId, directoryId,
    114         new Parameter("mergeAssays", "1"));
     114        new Parameter("mergeAssays", "1"), new Parameter("createSubdir", "1"));
    115115    ok &= TestJob.test_execute(jobId3);
    116116
  • branches/2.9-stable/src/test/data/test.base1plugin.base

    r4266 r4713  
    23233 e offsetPositions Offset positions  30  0 0\tNo\t1\tYes 0
    24244 e reporterList  Create reporter list  30  0 0\tNo\t1\tYes 0
     255 e createSubdir  Create sub-directory  30  0 0\tNo\t1\tYes 0
  • branches/2.9-stable/src/test/testbase1plugin.sh

    r4232 r4713  
    11#!/bin/bash -
     2tmpdir="`pwd`"
    23progdir="`dirname \"$0\"`"
    34cd $progdir
    4 
    55. ./set_classpath.sh
    66
    7 java -Xmx512M -Xms128M -ea -server -cp $CP Base1TestPlugin
     7java -Xmx512M -Xms128M -ea -server -Djava.io.tmpdir=$tmpdir -cp $CP Base1TestPlugin
Note: See TracChangeset for help on using the changeset viewer.