@@ -0,0 +1,2494 @@
+/*%0A * Copyright 2016-2020 Talsma ICT%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *        http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0Apackage nl.talsmasoftware.umldoclet.javadoc;%0A%0Aimport jdk.javadoc.doclet.Doclet;%0Aimport net.sourceforge.plantuml.OptionFlags;%0Aimport org.junit.jupiter.api.BeforeEach;%0Aimport org.junit.jupiter.api.Test;%0Aimport org.opentest4j.AssertionFailedError;%0A%0Aimport static java.util.Collections.emptySet;%0Aimport static java.util.Collections.singletonList;%0Aimport static org.hamcrest.MatcherAssert.assertThat;%0Aimport static org.hamcrest.Matchers.containsString;%0Aimport static org.hamcrest.Matchers.is;%0Aimport static org.junit.jupiter.api.Assertions.assertThrows;%0A%0Apublic class UMLOptionsTest %7B%0A    private DocletConfig config;%0A    private UMLOptions umlOptions;%0A%0A    @BeforeEach%0A    void setUpUmlOptions() %7B%0A        config = new DocletConfig();%0A        umlOptions = new UMLOptions(config);%0A    %7D%0A%0A    private Doclet.Option docletOption(String name) %7B%0A        return umlOptions.mergeWith(emptySet())%0A                .stream()%0A                .filter(o -%3E o.getNames().contains(name))%0A                .findFirst()%0A                .orElseThrow(() -%3E new AssertionFailedError(%22Doclet option %22 + name + %22 not found!%22));%0A    %7D%0A%0A    @Test%0A    void testUmlTimeoutOption() %7B%0A        // prepare%0A        Doclet.Option umlTimeoutOption = docletOption(%22--uml-timeout%22);%0A%0A        // execute%0A        umlTimeoutOption.process(%22--uml-timeout%22, singletonList(%221800%22));%0A%0A        // verify%0A        assertThat(OptionFlags.getInstance().getTimeoutMs(), is(1000L * 1800));%0A    %7D%0A%0A    @Test%0A    void testIllegalUmlTimeoutOption() %7B%0A        // prepare%0A        Doclet.Option umlTimeoutOption = docletOption(%22--uml-timeout%22);%0A%0A        // execute%0A        IllegalArgumentException expected = assertThrows(IllegalArgumentException.class, () -%3E%0A                umlTimeoutOption.process(%22--uml-timeout%22, singletonList(%2230 minutes%22)));%0A%0A        // verify%0A        assertThat(expected.getMessage(), containsString(%22timeout value%22));%0A    %7D%0A%7D%0A

Add unit test for new --uml-timeout option