source: FCSEndpointTester/trunk/src/main/java/eu/clarin/fcs/tester/tests/TestExplain1.java @ 7196

Last change on this file since 7196 was 7196, checked in by Oliver Schonefeld, 6 years ago
  • rewrite to use SRUClient instead of SRUSimpleClient
  • add Tests for Endpoint Description (FCS 1.0 and FCS 2.0)
  • Property svn:eol-style set to native
File size: 1.8 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.FCSTestResult;
24import eu.clarin.sru.client.SRUClient;
25import eu.clarin.sru.client.SRUClientException;
26import eu.clarin.sru.client.SRUExplainRequest;
27import eu.clarin.sru.client.SRUExplainResponse;
28
29
30@FCSTestCase(priority = 1000, profiles = {
31        FCSTestProfile.CLARIN_FCS_1_0,
32        FCSTestProfile.CLARIN_FCS_2_0,
33        FCSTestProfile.CLARIN_FCS_LEGACY
34})
35public class TestExplain1 extends FCSTest {
36    @Override
37    public String getName() {
38        return "Explain";
39    }
40
41
42    @Override
43    public String getDescription() {
44        return "Regular explain request using default version";
45    }
46
47
48    @Override
49    public String getExpected() {
50        return "No errors or diagnostics";
51    }
52
53
54    @Override
55    public FCSTestResult perform(FCSTestContext context, SRUClient client)
56            throws SRUClientException {
57        SRUExplainRequest req = context.createExplainRequest();
58        SRUExplainResponse res = client.explain(req);
59        return res.getDiagnosticsCount() == 0
60                ? makeSuccess()
61                : makeWarningUnexpectedDiagnostics();
62    }
63
64}
Note: See TracBrowser for help on using the repository browser.