Ignore:
Timestamp:
24/05/11 10:38:14 (9 years ago)
Author:
mnagni
Message:

fixed the \' (apostrophe) parsing bug

Location:
TI01-discovery-API/trunk/MEDINDiscoveryService
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • TI01-discovery-API/trunk/MEDINDiscoveryService/pom.xml

    r7913 r7915  
    44        <groupId>ndg.services.discovery</groupId> 
    55        <artifactId>MedinDiscoveryService</artifactId> 
    6         <version>1.2.7</version> 
     6        <version>1.2.8</version> 
    77        <packaging>aar</packaging> 
    88 
  • TI01-discovery-API/trunk/MEDINDiscoveryService/src/main/java/ndg/common/TermParser.java

    r7754 r7915  
    140140 
    141141                term = nsb.toString(); 
     142                term = term.replaceAll("\\'", "\\\\'");  
    142143                return term.replaceAll(":", "\\\\\\\\:"); 
    143144        } 
  • TI01-discovery-API/trunk/MEDINDiscoveryService/src/test/java/ndg/common/SearchAgentTest.java

    r7334 r7915  
    7979                test = "one & - \"\"two ring\"\""; 
    8080                try { 
    81                         assertTrue(tp.parseTerm(test).trim().equals("one & ! ''two ring''")); 
     81                        assertTrue(tp.parseTerm(test).trim().equals("one & ! \\\'\\\'two ring\\\'\\\'")); 
     82                } catch (AssembleQueryException e) { 
     83                        fail(new MessageFormatter().getFormattedText(e.getBundlMessage())); 
     84                } 
     85                 
     86                test = "1970's"; 
     87                try { 
     88                        assertTrue(tp.parseTerm(test).trim().equals("1970\\\'s")); 
    8289                } catch (AssembleQueryException e) { 
    8390                        fail(new MessageFormatter().getFormattedText(e.getBundlMessage())); 
Note: See TracChangeset for help on using the changeset viewer.