source: FCSEndpointTester/trunk/src/main/java/eu/clarin/fcs/tester/tests/TestScan1.java @ 7167

Last change on this file since 7167 was 7167, checked in by Oliver Schonefeld, 6 years ago
  • tests are only applicable for Legacy FCS
  • Property svn:eol-style set to native
File size: 1.9 KB
Line 
1/**
2 * This software is copyright (c) 2013 by
3 *  - Institut fuer Deutsche Sprache (http://www.ids-mannheim.de)
4 * This is free software. You can redistribute it
5 * and/or modify it under the terms described in
6 * the GNU General Public License v3 of which you
7 * should have received a copy. Otherwise you can download
8 * it from
9 *
10 *   http://www.gnu.org/licenses/gpl-3.0.txt
11 *
12 * @copyright Institut fuer Deutsche Sprache (http://www.ids-mannheim.de)
13 *
14 * @license http://www.gnu.org/licenses/gpl-3.0.txt
15 *  GNU General Public License v3
16 */
17package eu.clarin.fcs.tester.tests;
18
19import eu.clarin.fcs.tester.FCSTest;
20import eu.clarin.fcs.tester.FCSTestCase;
21import eu.clarin.fcs.tester.FCSTestContext;
22import eu.clarin.fcs.tester.FCSTestProfile;
23import eu.clarin.fcs.tester.FCSTestHandler;
24import eu.clarin.fcs.tester.FCSTestResult;
25import eu.clarin.sru.client.SRUClientException;
26import eu.clarin.sru.client.SRUScanRequest;
27import eu.clarin.sru.client.SRUSimpleClient;
28
29@FCSTestCase(priority=2000, profiles = {
30        FCSTestProfile.CLARIN_FCS_LEGACY
31})
32public class TestScan1 extends FCSTest {
33
34    @Override
35    public String getName() {
36        return "Scan";
37    }
38
39
40    @Override
41    public String getDescription() {
42        return "Scan with missing 'scanClause' argument";
43    }
44
45
46    @Override
47    public String getExpected() {
48        return "Expecting diagnostic \"info:srw/diagnostic/1/7\"";
49    }
50
51
52    @Override
53    public FCSTestResult perform(FCSTestContext context, SRUSimpleClient client,
54            FCSTestHandler handler) throws SRUClientException {
55        SRUScanRequest req = context.createScanRequest();
56        req.setExtraRequestData(SRUScanRequest.X_MALFORMED_SCAN_CLAUSE,
57                SRUScanRequest.MALFORMED_OMIT);
58        client.scan(req, handler);
59        return handler.findDiagnostic("info:srw/diagnostic/1/7")
60                ? makeSuccess()
61                : makeErrorNoDiagnostic("info:srw/diagnostic/1/7");
62    }
63
64}
Note: See TracBrowser for help on using the repository browser.