Skip to content

Commit 99cd11b

Browse files
committed
HV-1429 Some minor improvements
1 parent a555c67 commit 99cd11b

File tree

1 file changed

+22
-16
lines changed

1 file changed

+22
-16
lines changed

osgi/integrationtest/src/test/java/org/hibernate/validator/osgi/integrationtest/KarafFeaturesAreInstallableTest.java

+22-16
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,25 @@
66
*/
77
package org.hibernate.validator.osgi.integrationtest;
88

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+
922
import java.io.File;
1023
import java.net.URI;
1124
import java.util.Locale;
25+
1226
import javax.inject.Inject;
27+
1328
import org.apache.karaf.features.Feature;
1429
import org.apache.karaf.features.FeaturesService;
1530
import org.junit.BeforeClass;
@@ -23,22 +38,13 @@
2338
import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy;
2439
import org.ops4j.pax.exam.spi.reactors.PerClass;
2540

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-
3841
/**
3942
* Integration test for Bean Validation and Hibernate Validator under OSGi.
4043
* <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.
4248
*
4349
* @author Toni Menzel ([email protected])
4450
*/
@@ -47,7 +53,7 @@
4753
public class KarafFeaturesAreInstallableTest {
4854

4955
@Inject
50-
protected FeaturesService featuresService;
56+
private FeaturesService featuresService;
5157

5258
private static final boolean DEBUG = false;
5359

@@ -107,8 +113,8 @@ public void canInstallFeatureHibernateValidatorParanamer() throws Exception {
107113

108114
public void canInstallFeature(String featureName) throws Exception {
109115
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 );
111117
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 ) );
113119
}
114120
}

0 commit comments

Comments
 (0)