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 | */ |
---|
17 | package eu.clarin.fcs.tester.tests; |
---|
18 | |
---|
19 | import eu.clarin.fcs.tester.FCSTest; |
---|
20 | import eu.clarin.fcs.tester.FCSTestCase; |
---|
21 | import eu.clarin.fcs.tester.FCSTestContext; |
---|
22 | import eu.clarin.fcs.tester.FCSTestProfile; |
---|
23 | import eu.clarin.fcs.tester.FCSTestHandler; |
---|
24 | import eu.clarin.fcs.tester.FCSTestResult; |
---|
25 | import eu.clarin.sru.client.SRUClientException; |
---|
26 | import eu.clarin.sru.client.SRUScanRequest; |
---|
27 | import eu.clarin.sru.client.SRUSimpleClient; |
---|
28 | |
---|
29 | @FCSTestCase(priority=2000, profiles = { |
---|
30 | FCSTestProfile.CLARIN_FCS_LEGACY |
---|
31 | }) |
---|
32 | public 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 | } |
---|