View Javadoc

1   /*
2    * Copyright 2012-2013 smartics, Kronseder & Reiner GmbH
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *     http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package test.de.smartics.properties.api.core.app;
17  
18  import static org.hamcrest.MatcherAssert.assertThat;
19  import static org.hamcrest.Matchers.is;
20  
21  import org.junit.Test;
22  import org.junit.experimental.categories.Category;
23  
24  import de.smartics.properties.api.core.app.PropertyRootException;
25  import de.smartics.properties.api.core.domain.PropertyCode;
26  import de.smartics.testdoc.annotations.Uut;
27  import de.smartics.testdoc.categories.type.Coverage;
28  
29  /**
30   * Tests {@link PropertyRootException}.
31   */
32  @Uut(type = PropertyRootException.class)
33  public class PropertyRootExceptionTest
34  {
35    // ********************************* Fields *********************************
36  
37    // --- constants ------------------------------------------------------------
38  
39    // --- members --------------------------------------------------------------
40  
41    // ****************************** Inner Classes *****************************
42  
43    // ********************************* Methods ********************************
44  
45    // --- prepare --------------------------------------------------------------
46  
47    // --- helper ---------------------------------------------------------------
48  
49    // --- tests ----------------------------------------------------------------
50  
51    @Test
52    @Category(Coverage.class)
53    public void providesAccessToInformation()
54    {
55      final Throwable cause = new NullPointerException("Test Exception");
56      final PropertyRootException uut =
57          new PropertyRootException(cause, PropertyCode.RESOLVE_PROBLEM);
58  
59      assertThat(uut.getCause(), is(cause));
60    }
61  }