Skip to content

Commit

Permalink
HV-1429 Some minor improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
gsmet committed Jul 7, 2017
1 parent a555c67 commit 99cd11b
Showing 1 changed file with 22 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,25 @@
*/
package org.hibernate.validator.osgi.integrationtest;

import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import static org.ops4j.pax.exam.CoreOptions.maven;
import static org.ops4j.pax.exam.CoreOptions.options;
import static org.ops4j.pax.exam.CoreOptions.systemProperty;
import static org.ops4j.pax.exam.CoreOptions.when;
import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.configureConsole;
import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.debugConfiguration;
import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.editConfigurationFilePut;
import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.karafDistributionConfiguration;
import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.keepRuntimeFolder;
import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.logLevel;

import java.io.File;
import java.net.URI;
import java.util.Locale;

import javax.inject.Inject;

import org.apache.karaf.features.Feature;
import org.apache.karaf.features.FeaturesService;
import org.junit.BeforeClass;
Expand All @@ -23,22 +38,13 @@
import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy;
import org.ops4j.pax.exam.spi.reactors.PerClass;

import static org.junit.Assert.assertTrue;
import static org.ops4j.pax.exam.CoreOptions.maven;
import static org.ops4j.pax.exam.CoreOptions.options;
import static org.ops4j.pax.exam.CoreOptions.systemProperty;
import static org.ops4j.pax.exam.CoreOptions.when;
import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.configureConsole;
import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.debugConfiguration;
import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.editConfigurationFilePut;
import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.karafDistributionConfiguration;
import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.keepRuntimeFolder;
import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.logLevel;

/**
* Integration test for Bean Validation and Hibernate Validator under OSGi.
* <p>
* This test makes sure that the karaf features provided by this project are installable.
* This test makes sure that the Karaf features provided by this project are installable.
* <p>
* Note that if a feature is not installable, the test gets stuck for a while but it is a
* good indication that something is wrong.
*
* @author Toni Menzel (toni@rebaze.com)
*/
Expand All @@ -47,7 +53,7 @@
public class KarafFeaturesAreInstallableTest {

@Inject
protected FeaturesService featuresService;
private FeaturesService featuresService;

private static final boolean DEBUG = false;

Expand Down Expand Up @@ -107,8 +113,8 @@ public void canInstallFeatureHibernateValidatorParanamer() throws Exception {

public void canInstallFeature(String featureName) throws Exception {
Feature feature = featuresService.getFeature( featureName );
assertTrue( featureName + " feature is not available from features list", feature != null );
assertNotNull( "Feature " + featureName + " is not available from features list", feature );
featuresService.installFeature( featureName );
assertTrue( featureName + " feature isn't installed, though available from features list", featuresService.isInstalled( feature ) );
assertTrue( "Feature " + featureName + " isn't installed, though available from features list", featuresService.isInstalled( feature ) );
}
}

0 comments on commit 99cd11b

Please sign in to comment.