@@ -0,0 +1,3067 @@
+/*%0A * Copyright 2016 Red Hat, Inc. and/or its affiliates%0A * and other contributors as indicated by the @author tags.%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 */%0A%0Apackage org.jboss.provisioning.featurepack.descr.test;%0A%0Aimport org.jboss.provisioning.ArtifactCoords;%0Aimport org.jboss.provisioning.descr.FeaturePackDescription;%0Aimport org.jboss.provisioning.descr.PackageDescription;%0Aimport org.jboss.provisioning.descr.ProvisioningDescriptionException;%0Aimport org.junit.Assert;%0Aimport org.junit.Test;%0A%0A/**%0A *%0A * @author Alexey Loubyansky%0A */%0Apublic class ConsistencyOfPackageDependenciesTestCase %7B%0A%0A    @Test%0A    public void testInvalidRequiredDependency() throws Exception %7B%0A%0A        final FeaturePackDescription.Builder builder = FeaturePackDescription%0A                .builder(ArtifactCoords.newGav(%22g%22, %22a%22, %22v%22))%0A                .addDefaultPackage(%0A                        PackageDescription.builder(%22p1%22)%0A                        .addDependency(%22p2%22)%0A                        .build())%0A                .addPackage(%0A                        PackageDescription.builder(%22p2%22)%0A                        .addDependency(%22p3%22)%0A                        .build())%0A                .addPackage(%0A                        PackageDescription.builder(%22p3%22)%0A                        .addDependency(%22p4%22)%0A                        .build());%0A%0A        try %7B%0A            builder.build();%0A            Assert.fail(%22Cannot build feature-pack description with inconsistent package dependencies.%22);%0A        %7D catch (ProvisioningDescriptionException e) %7B%0A            // expected%0A        %7D%0A    %7D%0A%0A    @Test%0A    public void testInvalidOptionalDependency() throws Exception %7B%0A%0A        final FeaturePackDescription.Builder builder = FeaturePackDescription%0A                .builder(ArtifactCoords.newGav(%22g%22, %22a%22, %22v%22))%0A                .addDefaultPackage(%0A                        PackageDescription.builder(%22p1%22)%0A                        .addDependency(%22p2%22, true)%0A                        .build())%0A                .addPackage(%0A                        PackageDescription.builder(%22p2%22)%0A                        .addDependency(%22p3%22, true)%0A                        .build())%0A                .addPackage(%0A                        PackageDescription.builder(%22p3%22)%0A                        .addDependency(%22p4%22, true)%0A                        .build());%0A%0A        try %7B%0A            builder.build();%0A            Assert.fail(%22Cannot build feature-pack description with inconsistent package dependencies.%22);%0A        %7D catch (ProvisioningDescriptionException e) %7B%0A            // expected%0A        %7D%0A    %7D%0A%7D%0A

package dependencies consistency check when building feature-pack description test