Project

General

Profile

Revision 8139

Added by Jing Tao almost 8 years ago

Use the exact number of the index fields for testing.

View differences:

metacat-common/src/test/java/edu/ucsb/nceas/metacat/common/query/SolrQueryServiceControllerTest.java
30 30
    @Test
31 31
    public void testGetSolrSpecVersion() throws UnsupportedType, NotFound, ParserConfigurationException, IOException, SAXException {
32 32
        String version = SolrQueryServiceController.getInstance().getSolrSpecVersion();
33
        //System.out.println("version is ======================== "+version);
33 34
        assertTrue(version != null);
34
        assertTrue(!version.equals(""));
35
        assertTrue("The version should be 3.4.0.2011.09.09.09.06.42 rather than "+version, version.equals("3.4.0.2011.09.09.09.06.42"));
35 36
    }
36 37
    
37 38
    
......
47 48
    public void testGetValidSchemaFields() throws Exception {
48 49
       List<String> fields = SolrQueryServiceController.getInstance().getValidSchemaFields();
49 50
       assertTrue(fields != null);
50
       assertTrue(!fields.isEmpty());
51
       assertTrue("The number of valid schema fields should be 76 rather than "+fields.size(), fields.size() ==76);
51 52
    }
52 53
    
53 54
    /**
......
62 63
    public void testgetIndexSchemaFields() throws Exception {
63 64
       Map<String, SchemaField> fields = SolrQueryServiceController.getInstance().getIndexSchemaFields();
64 65
       assertTrue(fields != null);
65
       assertTrue(!fields.isEmpty());
66
       assertTrue("The number of index schema fields should be 93 rather than "+fields.size(), fields.size() == 93);
66 67
    }
67 68
    
68 69
    /**

Also available in: Unified diff