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.config.domain.key;
17  
18  import org.junit.experimental.categories.Category;
19  import org.junit.experimental.theories.DataPoint;
20  
21  import de.smartics.properties.api.config.domain.key.ApplicationId;
22  import de.smartics.properties.api.config.domain.key.ConfigurationKey;
23  import de.smartics.properties.api.config.domain.key.EnvironmentId;
24  import de.smartics.testdoc.annotations.Uut;
25  import de.smartics.testdoc.categories.type.ObjectBasics;
26  import de.smartics.util.test.theories.CompareToTheory;
27  
28  /**
29   * Tests {@link ConfigurationKey#compareTo(ConfigurationKey)}.
30   */
31  @Category(ObjectBasics.class)
32  @Uut(type = ConfigurationKey.class)
33  public class ConfigurationKeyCompareToTest extends
34      CompareToTheory<ConfigurationKey>
35  {
36    public static final EnvironmentId ENV_MIN = new EnvironmentId("test1");
37  
38    public static final EnvironmentId ENV_MAX = new EnvironmentId("test2");
39  
40    public static final ApplicationId APP_MIN = new ApplicationId("group",
41        "artifactId", "1.0");
42  
43    public static final ApplicationId APP_MAX = new ApplicationId("group",
44        "artifactId", "2.0");
45  
46    @DataPoint
47    public static final ConfigurationKey DEFAULT = new ConfigurationKey(ENV_MIN,
48        APP_MIN);
49  
50    @DataPoint
51    public static final ConfigurationKey IDENTICAL = new ConfigurationKey(
52        ENV_MIN, APP_MIN);
53  
54    @DataPoint
55    public static final ConfigurationKey KEY_ENV_MAX = new ConfigurationKey(
56        ENV_MAX, APP_MIN);
57  
58    @DataPoint
59    public static final ConfigurationKey KEY_APP_MAX = new ConfigurationKey(
60        ENV_MIN, APP_MAX);
61  
62    @DataPoint
63    public static final ConfigurationKey KEY_MAX = new ConfigurationKey(ENV_MAX,
64        APP_MAX);
65  }