Project

General

Profile

Revision 8095

Added by Jing Tao almost 8 years ago

fixed a bug that the setup method deleted a result file.

View differences:

metacat-index/src/test/java/edu/ucsb/nceas/metacat/index/SolrMetacatIdsComparatorIT.java
32 32
   
33 33
    
34 34
    @Before
35
    public void setUp() throws Exception {
36
        metacatIdsFile = new File( metacatIDFileName);
37
        notInSolrFile = new File(NOTINSOLR);
38
        if(notInSolrFile.exists()) {
39
            notInSolrFile.delete();
40
        }
41
        notInSolrFile.createNewFile();
42
        numberOfIdsFile = new File(NUMBEROFIDS);
43
        if(numberOfIdsFile.exists()) {
44
            numberOfIdsFile.delete();
45
        }
46
        numberOfIdsFile.createNewFile();
35
    public void setUp() throws Exception {    
47 36
        /*notInMetacatFile = new File(NOTINMETACAT);
48 37
        if(notInMetacatFile.exists()) {
49 38
            notInMetacatFile.delete();
......
57 46
     */
58 47
    @Test
59 48
    public void figureIdsNotIndexed() throws Exception {
49
        metacatIdsFile = new File( metacatIDFileName);
50
        notInSolrFile = new File(NOTINSOLR);
51
        if(notInSolrFile.exists()) {
52
            notInSolrFile.delete();
53
        }
54
        notInSolrFile.createNewFile();
60 55
        List<String> metacatIds = FileUtils.readLines(metacatIdsFile, "UTF-8");
61 56
        boolean appending = true;
62 57
        if(metacatIds != null) {
......
79 74
     */
80 75
    @Test
81 76
    public void getNumberOfIdsInSolr() throws Exception {
77
        numberOfIdsFile = new File(NUMBEROFIDS);
78
        if(numberOfIdsFile.exists()) {
79
            numberOfIdsFile.delete();
80
        }
81
        numberOfIdsFile.createNewFile();
82 82
        String query = "q=*:*";
83 83
        SolrParams solrParams = SolrRequestParsers.parseQueryString(query);
84 84
        SolrServer solrServer = SolrServerFactory.createSolrServer();

Also available in: Unified diff