Changeset 3985 for TI01-discovery


Ignore:
Timestamp:
03/06/08 16:50:08 (11 years ago)
Author:
cbyrom
Message:

Add a few more test cases to test the search ws with all parameters being
exercised at onces.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TI01-discovery/branches/ws-Discovery2-upgrade/src/unittests/ndg/testclient/discovery/DiscoveryServiceClientTest.java

    r3982 r3985  
    2929        private static final String VALID_TERM = "circulation";  
    3030 
     31        private static final String VALID_TERM2 = "computing";   
     32 
    3133        private static final String INVALID_BIT = "XXXXXXXXXXFDS";       
    3234         
     
    5456         
    5557        private static final String INVALID_END_DATE = "3055-02-02"; 
     58 
     59        private static final String ASCENDING_TERM = "ascending"; 
     60 
     61        private static final String DESCENDING_TERM = "descending"; 
    5662 
    5763        @BeforeClass 
     
    332338        public void orderByDirectionSearch()  
    333339        { 
    334                 String results = client.runSearch(null, null, null, null, null, "ascending", null,  
     340                String results = client.runSearch(null, null, null, null, null, ASCENDING_TERM, null,  
    335341                                null, null, null, null, null, null, null, null); 
    336342                assertNotNull(results); 
     
    350356        public void orderByDefaultDirectionSearchCompare()  
    351357        { 
    352                 String results = client.runSearch(null, null, null, null, VALID_COLUMN_NAME2, "ascending", null,  
     358                String results = client.runSearch(null, null, null, null, VALID_COLUMN_NAME2, ASCENDING_TERM, null,  
    353359                                null, null, null, null, null, null, null, null); 
    354360                assertNotNull(results); 
     
    364370        public void orderByDifferentDirectionSearch()  
    365371        { 
    366                 String results = client.runSearch(null, null, null, null, VALID_COLUMN_NAME1, "descending", null,  
     372                String results = client.runSearch(null, null, null, null, VALID_COLUMN_NAME1, DESCENDING_TERM, null,  
    367373                                null, null, null, null, null, null, null, null); 
    368374                assertNotNull(results); 
     
    373379        public void orderByDifferentDirectionSearchCompare()  
    374380        { 
    375                 String results = client.runSearch(null, null, null, null, VALID_COLUMN_NAME1, "descending", null,  
    376                                 null, null, null, null, null, null, null, null); 
    377                 assertNotNull(results); 
    378                 assertFalse(results.contains("<urn:status>false</urn:status>")); 
    379                 String results1 = client.runSearch(null, null, null, null, VALID_COLUMN_NAME1, "ascending", null,  
     381                String results = client.runSearch(null, null, null, null, VALID_COLUMN_NAME1, DESCENDING_TERM, null,  
     382                                null, null, null, null, null, null, null, null); 
     383                assertNotNull(results); 
     384                assertFalse(results.contains("<urn:status>false</urn:status>")); 
     385                String results1 = client.runSearch(null, null, null, null, VALID_COLUMN_NAME1, ASCENDING_TERM, null,  
    380386                                null, null, null, null, null, null, null, null); 
    381387                assertNotNull(results1); 
     
    662668                assertTrue(results.contains("<urn:status>false</urn:status>")); 
    663669        } 
     670         
     671 
     672        @Test 
     673        public void withinOperatorWithValidBBoxSearchAndValidDateSearch()  
     674        { 
     675                String results = client.runSearch(null, null, null, null, null, null, null,  
     676                                DiscoveryServiceSkeleton.WITHIN_OPERATOR_TYPE, "80", "-80", "-170.", "170.", null, VALID_WIDE_START_DATE, VALID_END_DATE); 
     677                assertNotNull(results); 
     678                assertFalse(results.contains("<urn:status>false</urn:status>")); 
     679        } 
     680         
     681 
     682        @Test 
     683        public void withinOperatorWithValidBBoxSearchAndInvalidDateSearch()  
     684        { 
     685                String results = client.runSearch(null, null, null, null, null, null, null,  
     686                                DiscoveryServiceSkeleton.WITHIN_OPERATOR_TYPE, "80", "-80", "-170.", "170.", null, INVALID_START_DATE, INVALID_END_DATE); 
     687                assertNotNull(results); 
     688                assertTrue(results.contains("<urn:status>false</urn:status>")); 
     689        } 
     690         
     691 
     692        @Test 
     693        public void withinOperatorWithValidBBoxSearchAndValidDateSearchAndValidScope()  
     694        { 
     695                String results = client.runSearch(null, null, null, null, null, null, getVector(VALID_SCOPE2),  
     696                                DiscoveryServiceSkeleton.WITHIN_OPERATOR_TYPE, "80", "-80", "-170.", "170.", null, VALID_WIDE_START_DATE, VALID_END_DATE); 
     697                assertNotNull(results); 
     698                assertFalse(results.contains("<urn:status>false</urn:status>")); 
     699        } 
     700         
     701 
     702        @Test 
     703        public void withinOperatorWithValidBBoxSearchAndValidDateSearchAndInvalidScope()  
     704        { 
     705                String results = client.runSearch(null, null, null, null, null, null, getVector(VALID_SCOPE1),  
     706                                DiscoveryServiceSkeleton.WITHIN_OPERATOR_TYPE, "80", "-80", "-170.", "170.", null, VALID_WIDE_START_DATE, VALID_END_DATE); 
     707                assertNotNull(results); 
     708                assertTrue(results.contains("<urn:status>false</urn:status>")); 
     709        } 
     710         
     711 
     712        @Test 
     713        public void withinOperatorWithValidBBoxSearchAndValidDateSearchAndValidScopeAndValidFullTextTerm()  
     714        { 
     715                String results = client.runSearch(VALID_TERM2, DiscoveryServiceSkeleton.FULL_TEXT_TERM_TYPE, null,  
     716                                null, null, null, getVector(VALID_SCOPE2),  
     717                                DiscoveryServiceSkeleton.WITHIN_OPERATOR_TYPE, "80", "-80", "-170.", "170.", null, VALID_WIDE_START_DATE, VALID_END_DATE); 
     718                assertNotNull(results); 
     719                assertFalse(results.contains("<urn:status>false</urn:status>")); 
     720        } 
     721         
     722 
     723        @Test 
     724        public void withinOperatorWithValidBBoxSearchAndValidDateSearchAndValidScopeAndValidFullTextTermAndValidStartandHowMany()  
     725        { 
     726                String results = client.runSearch(VALID_TERM2, DiscoveryServiceSkeleton.FULL_TEXT_TERM_TYPE, "0",  
     727                                "3", null, null, getVector(VALID_SCOPE2),  
     728                                DiscoveryServiceSkeleton.WITHIN_OPERATOR_TYPE, "80", "-80", "-170.", "170.", null, VALID_WIDE_START_DATE, VALID_END_DATE); 
     729                assertNotNull(results); 
     730                assertFalse(results.contains("<urn:status>false</urn:status>")); 
     731        } 
     732         
     733 
     734        @Test 
     735        public void allSearchParamsSetValidly()  
     736        { 
     737                String results = client.runSearch(VALID_TERM2, DiscoveryServiceSkeleton.FULL_TEXT_TERM_TYPE, "0",  
     738                                "3", VALID_COLUMN_NAME1, DESCENDING_TERM, getVector(VALID_SCOPE2),  
     739                                DiscoveryServiceSkeleton.WITHIN_OPERATOR_TYPE, "80", "-80", "-170.", "170.", "blah",  
     740                                VALID_WIDE_START_DATE, VALID_END_DATE); 
     741                assertNotNull(results); 
     742                assertFalse(results.contains("<urn:status>false</urn:status>")); 
     743        } 
     744 
    664745 
    665746        @Test 
Note: See TracChangeset for help on using the changeset viewer.