some cleanup

This commit is contained in:
Andreas Penski 2020-05-03 16:52:55 +02:00
parent 1a001a1af4
commit 7dc62012a6
22 changed files with 144 additions and 50 deletions

View file

@ -38,8 +38,6 @@ public class CreateReportActionTest {
private ContentRepository repository;
@Rule
public ExpectedException expectedException = ExpectedException.none();
@Before
public void setup() {
@ -72,15 +70,15 @@ public class CreateReportActionTest {
@Test
public void testExecutionException() throws SaxonApiException {
this.expectedException.expect(IllegalStateException.class);
this.expectedException.expectMessage(Matchers.containsString("Can not create final report"));
final Processor p = mock(Processor.class);
final DocumentBuilder documentBuilder = mock(DocumentBuilder.class);
this.action = new CreateReportAction(p, new ConversionService(), null);
when(p.newDocumentBuilder()).thenReturn(documentBuilder);
when(documentBuilder.build(any(Source.class))).thenThrow(new SaxonApiException("mocked"));
this.action.check(TestBagBuilder.createBag(InputFactory.read(Simple.SIMPLE_VALID), true));
final Bag bag = TestBagBuilder.createBag(InputFactory.read(Simple.SIMPLE_VALID), true);
this.action.check(bag);
assertThat(bag.isStopped()).isTrue();
}
}

View file

@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Licensed to the Koordinierungsstelle für IT-Standards (KoSIT) under
~ one or more contributor license agreements. See the NOTICE file
~ distributed with this work for additional information
~ regarding copyright ownership. KoSIT licenses this file
~ to you under the Apache License, Version 2.0 (the
~ "License"); you may not use this file except in compliance
~ with the License. You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing,
~ software distributed under the License is distributed on an
~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
~ KIND, either express or implied. See the License for the
~ specific language governing permissions and limitations
~ under the License.
-->
<assertions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.xoev.de/de/validator/framework/1/assertions"
xsi:schemaLocation="http://www.xoev.de/de/validator/framework/1/assertions file:/C:/fb/svn/xoev/produkte/prueftool/trunk/xsd/assertions.xsd">
<namespace prefix="rep">http://www.xoev.de/de/validator/varl/1</namespace>
<assertion report-doc="ubl-0001.xml" test="/rep:report/rep:scenarioMatched/rep:validationStepResult/@id = 'xsd'">
Schema wurde validiert
</assertion>
</assertions>