Changeset 7169
- Timestamp:
- 02/01/18 10:49:20 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
FCSEndpointTester/trunk/src/main/java/eu/clarin/fcs/tester/FCSEndpointTester.java
r7116 r7169 225 225 if (ed.getVersion() == 1) { 226 226 profile = FCSTestProfile.CLARIN_FCS_1_0; 227 } else if (ed.getVersion() == 2) {228 throw new SRUClientException("CLARIN-FCS version 2.0 " +229 "MUST use SRU 2.0. Endpoint used SRU 1.2 " +230 "but claimed to support FCS 2.0 in it's " +231 "endpoint description!");232 227 } 233 228 } else { 229 logger.debug("assume legacy"); 234 230 profile = FCSTestProfile.CLARIN_FCS_LEGACY; 235 231 } … … 243 239 ClarinFCSConstants.TRUE); 244 240 request.setParseRecordDataEnabled(true); 245 response = client.explain(request); 246 247 ed = response.getFirstExtraResponseData( 248 ClarinFCSEndpointDescription.class); 249 if (ed != null) { 250 if (ed.getVersion() == 2) { 251 profile = FCSTestProfile.CLARIN_FCS_2_0; 241 try { 242 response = client.explain(request); 243 244 ed = response.getFirstExtraResponseData( 245 ClarinFCSEndpointDescription.class); 246 if (ed != null) { 247 if (ed.getVersion() == 2) { 248 profile = FCSTestProfile.CLARIN_FCS_2_0; 249 } 250 } 251 } catch (SRUClientException e) { 252 if ((e.getMessage() != null) && (e.getMessage() 253 .contains("responded with different version"))) { 254 throw new SRUClientException( 255 "Seriously broken Endpoint: when trying to " + 256 "detect FCS 2.0 the Endpoint illegally " + 257 "responded with a SRU 1.2 reponse to a " + 258 "SRU 2.0 request!"); 259 } else { 260 throw e; 252 261 } 253 262 } … … 325 334 try { 326 335 handler.reset(); 336 logcapturehandler.publish(new LogRecord(Level.FINE, 337 "running test class " + test.getClass().getName())); 327 338 result = test.perform(context, client, handler); 328 339 result.setLogRecords(logcapturehandler.getLogRecords());
Note: See TracChangeset
for help on using the changeset viewer.