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.resource.repository;
17  
18  import org.junit.experimental.categories.Category;
19  import org.junit.experimental.theories.DataPoint;
20  
21  import de.smartics.properties.resource.domain.ArtifactId;
22  import de.smartics.testdoc.annotations.Uut;
23  import de.smartics.testdoc.categories.type.ObjectBasics;
24  import de.smartics.util.test.theories.CompareToTheory;
25  
26  /**
27   * Tests {@link ArtifactId#compareTo(ArtifactId)}.
28   */
29  @Category(ObjectBasics.class)
30  @Uut(type = ArtifactId.class)
31  public class ArtifactIdCompareToTest extends CompareToTheory<ArtifactId>
32  {
33    private static final String GROUP_ID_1 = "com.example.ones";
34  
35    private static final String ARTIFACT_ID_1 = "artifact-one";
36  
37    private static final String VERSION_1 = "1.0";
38  
39    private static final String ARCHIVE_TYPE_1 = "jar";
40  
41    private static final String CLASSIFIER_1 = "app";
42  
43    private static final String GROUP_ID_2 = "com.example.twos";
44  
45    private static final String ARTIFACT_ID_2 = "artifact-two";
46  
47    private static final String VERSION_2 = "1.1";
48  
49    private static final String ARCHIVE_TYPE_2 = "ear";
50  
51    private static final String CLASSIFIER_2 = null;
52  
53    @DataPoint
54    public static final ArtifactId DEFAULT = ArtifactId.create(
55        GROUP_ID_1, ARTIFACT_ID_1, VERSION_1, ARCHIVE_TYPE_1, CLASSIFIER_1);
56  
57    @DataPoint
58    public static final ArtifactId IDENTICAL = ArtifactId.create(
59        GROUP_ID_1, ARTIFACT_ID_1, VERSION_1, ARCHIVE_TYPE_1, CLASSIFIER_1);
60  
61    @DataPoint
62    public static final ArtifactId OTHER_GROUP = ArtifactId.create(
63        GROUP_ID_2, ARTIFACT_ID_1, VERSION_1, ARCHIVE_TYPE_1, CLASSIFIER_1);
64  
65    @DataPoint
66    public static final ArtifactId OTHER_ARTIFACT = ArtifactId
67        .create(GROUP_ID_1, ARTIFACT_ID_2, VERSION_1, ARCHIVE_TYPE_1,
68            CLASSIFIER_1);
69  
70    @DataPoint
71    public static final ArtifactId OTHER_VERSION = ArtifactId
72        .create(GROUP_ID_1, ARTIFACT_ID_1, VERSION_2, ARCHIVE_TYPE_1,
73            CLASSIFIER_1);
74  
75    @DataPoint
76    public static final ArtifactId OTHER_ARCHIVE_TYPE = ArtifactId
77        .create(GROUP_ID_1, ARTIFACT_ID_1, VERSION_1, ARCHIVE_TYPE_2,
78            CLASSIFIER_1);
79  
80    @DataPoint
81    public static final ArtifactId OTHER_CLASSIFIER = ArtifactId
82        .create(GROUP_ID_1, ARTIFACT_ID_1, VERSION_1, ARCHIVE_TYPE_1,
83            CLASSIFIER_2);
84  }