|
6 | 6 | */ |
7 | 7 | package org.hibernate.validator.osgi.integrationtest; |
8 | 8 |
|
| 9 | +import static org.junit.Assert.assertNotNull; |
| 10 | +import static org.junit.Assert.assertTrue; |
| 11 | +import static org.ops4j.pax.exam.CoreOptions.maven; |
| 12 | +import static org.ops4j.pax.exam.CoreOptions.options; |
| 13 | +import static org.ops4j.pax.exam.CoreOptions.systemProperty; |
| 14 | +import static org.ops4j.pax.exam.CoreOptions.when; |
| 15 | +import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.configureConsole; |
| 16 | +import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.debugConfiguration; |
| 17 | +import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.editConfigurationFilePut; |
| 18 | +import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.karafDistributionConfiguration; |
| 19 | +import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.keepRuntimeFolder; |
| 20 | +import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.logLevel; |
| 21 | + |
9 | 22 | import java.io.File; |
10 | 23 | import java.net.URI; |
11 | 24 | import java.util.Locale; |
| 25 | + |
12 | 26 | import javax.inject.Inject; |
| 27 | + |
13 | 28 | import org.apache.karaf.features.Feature; |
14 | 29 | import org.apache.karaf.features.FeaturesService; |
15 | 30 | import org.junit.BeforeClass; |
|
23 | 38 | import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy; |
24 | 39 | import org.ops4j.pax.exam.spi.reactors.PerClass; |
25 | 40 |
|
26 | | -import static org.junit.Assert.assertTrue; |
27 | | -import static org.ops4j.pax.exam.CoreOptions.maven; |
28 | | -import static org.ops4j.pax.exam.CoreOptions.options; |
29 | | -import static org.ops4j.pax.exam.CoreOptions.systemProperty; |
30 | | -import static org.ops4j.pax.exam.CoreOptions.when; |
31 | | -import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.configureConsole; |
32 | | -import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.debugConfiguration; |
33 | | -import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.editConfigurationFilePut; |
34 | | -import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.karafDistributionConfiguration; |
35 | | -import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.keepRuntimeFolder; |
36 | | -import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.logLevel; |
37 | | - |
38 | 41 | /** |
39 | 42 | * Integration test for Bean Validation and Hibernate Validator under OSGi. |
40 | 43 | * <p> |
41 | | - * This test makes sure that the karaf features provided by this project are installable. |
| 44 | + * This test makes sure that the Karaf features provided by this project are installable. |
| 45 | + * <p> |
| 46 | + * Note that if a feature is not installable, the test gets stuck for a while but it is a |
| 47 | + * good indication that something is wrong. |
42 | 48 | * |
43 | 49 | * @author Toni Menzel ([email protected]) |
44 | 50 | */ |
|
47 | 53 | public class KarafFeaturesAreInstallableTest { |
48 | 54 |
|
49 | 55 | @Inject |
50 | | - protected FeaturesService featuresService; |
| 56 | + private FeaturesService featuresService; |
51 | 57 |
|
52 | 58 | private static final boolean DEBUG = false; |
53 | 59 |
|
@@ -107,8 +113,8 @@ public void canInstallFeatureHibernateValidatorParanamer() throws Exception { |
107 | 113 |
|
108 | 114 | public void canInstallFeature(String featureName) throws Exception { |
109 | 115 | Feature feature = featuresService.getFeature( featureName ); |
110 | | - assertTrue( featureName + " feature is not available from features list", feature != null ); |
| 116 | + assertNotNull( "Feature " + featureName + " is not available from features list", feature ); |
111 | 117 | featuresService.installFeature( featureName ); |
112 | | - assertTrue( featureName + " feature isn't installed, though available from features list", featuresService.isInstalled( feature ) ); |
| 118 | + assertTrue( "Feature " + featureName + " isn't installed, though available from features list", featuresService.isInstalled( feature ) ); |
113 | 119 | } |
114 | 120 | } |
0 commit comments