@Test public void testActivation() throws Exception { assertTrue( featuresService.isInstalled( featuresService.getFeature( "hibernate-orm" ) ) ); assertTrue( featuresService.isInstalled( featuresService.getFeature( "hibernate-envers" ) ) ); assertActiveBundle( "org.hibernate.orm.core" ); assertActiveBundle( "org.hibernate.orm.envers" ); }
/** * @throws Exception */ @Test public void testAllBundlesActiveAndFeaturesInstalled() throws Exception { // Asssert all bundles except fragments are ACTIVE. for (Bundle b : bundleCtx.getBundles()) { System.out.println(String.format("Checking state of bundle [symbolicName=%s, state=%s]", b.getSymbolicName(), b.getState())); if (b.getHeaders().get(Constants.FRAGMENT_HOST) == null) assertTrue(b.getState() == Bundle.ACTIVE); } // Check that according to the FeaturesService, all Ignite features except ignite-log4j are installed. Feature[] features = featuresSvc.getFeatures(IGNITE_FEATURES_NAME_REGEX); assertNotNull(features); assertEquals(EXPECTED_FEATURES, features.length); for (Feature f : features) { if (IGNORED_FEATURES.contains(f.getName())) continue; boolean installed = featuresSvc.isInstalled(f); System.out.println(String.format("Checking if feature is installed [featureName=%s, installed=%s]", f.getName(), installed)); assertTrue(installed); assertEquals(PROJECT_VERSION.replaceAll("-", "."), f.getVersion().replaceAll("-", ".")); } }
@Override protected boolean acceptsFeature(Feature feature) { return !featuresService.isInstalled(feature) && !feature.isHidden() && !feature.isBlacklisted(); }
private TabularData infoFeature(Feature[] f) throws Exception { ArrayList<JmxFeature> features = new ArrayList<>(); for (Feature feature:f) { boolean installed = featuresService.isInstalled(feature); boolean required = featuresService.isRequired(feature); JmxFeature jmxFeature = new JmxFeature(feature, installed, required); features.add(jmxFeature); } return JmxFeature.tableFrom(features); }
@Override protected boolean acceptsFeature(Feature feature) { return !featuresService.isInstalled(feature) && !feature.isHidden() && !feature.isBlacklisted(); }
/** * Uninstalls a feature and checks that feature is properly uninstalled. */ public void unInstallAndCheckFeature(String feature) throws Exception { System.err.println(executeCommand("features:uninstall " + feature)); FeaturesService featuresService = ServiceLocator.awaitService(bundleContext, FeaturesService.class); System.err.println(executeCommand("osgi:list -t 0")); Assert.assertFalse("Expected " + feature + " feature to be installed.", featuresService.isInstalled(featuresService.getFeature(feature))); }
/** * Installs a feature and checks that feature is properly installed. */ public void installAndCheckFeature(String feature) throws Exception { System.err.println(executeCommand("features:install " + feature)); FeaturesService featuresService = ServiceLocator.awaitService(bundleContext, FeaturesService.class); System.err.println(executeCommand("osgi:list -t 0")); Assert.assertTrue("Expected " + feature + " feature to be installed.", featuresService.isInstalled(featuresService.getFeature(feature))); }
/** * Uninstalls a feature and checks that feature is properly uninstalled. * * @param feature * @throws Exception */ public void unInstallAndCheckFeature(String feature) throws Exception { System.err.println(executeCommand("features:uninstall " + feature)); FeaturesService featuresService = getOsgiService(FeaturesService.class); System.err.println(executeCommand("osgi:list -t 0")); Assert.assertFalse("Expected " + feature + " feature to be installed.", featuresService.isInstalled(featuresService.getFeature(feature))); }
/** * Installs a feature and checks that feature is properly installed. * * @param feature * @throws Exception */ public void installAndCheckFeature(String feature) throws Exception { System.err.println(executeCommand("features:install " + feature)); FeaturesService featuresService = getOsgiService(FeaturesService.class); System.err.println(executeCommand("osgi:list -t 0")); Assert.assertTrue("Expected " + feature + " feature to be installed.", featuresService.isInstalled(featuresService.getFeature(feature))); }
@Test public void testCoreInstallation() throws Exception { assertTrue("commons-rdf-jena not installed!", featuresService.isInstalled(featuresService.getFeature("commons-rdf-jena"))); assertTrue("trellis-io-jena not installed!", featuresService.isInstalled(featuresService.getFeature("trellis-io-jena"))); assertTrue("trellis-api not installed!", featuresService.isInstalled(featuresService.getFeature("trellis-api"))); assertTrue("trellis-vocabulary not installed!", featuresService.isInstalled(featuresService.getFeature("trellis-vocabulary"))); checkTrellisBundlesAreActive(); }
/** * Installs a feature and checks that feature is properly installed. */ public void installAndCheckFeature(String feature, String featureUrl) throws Exception { System.err.println(executeCommand("features:addUrl " + featureUrl)); System.err.println(executeCommand("features:install " + feature)); FeaturesService featuresService = ServiceLocator.getOsgiService(FeaturesService.class); System.err.println(executeCommand("osgi:list -t 0")); Assert.assertTrue("Expected " + feature + " feature to be installed.", featuresService.isInstalled(featuresService.getFeature(feature))); }
/** * Uninstalls a feature and checks that feature is properly uninstalled. */ public void unInstallAndCheckFeature(String feature) throws Exception { System.err.println(executeCommand("features:uninstall " + feature)); FeaturesService featuresService = ServiceLocator.getOsgiService(FeaturesService.class); System.err.println(executeCommand("osgi:list -t 0")); Assert.assertFalse("Expected " + feature + " feature to be installed.", featuresService.isInstalled(featuresService.getFeature(feature))); }
@Test public void testHttpInstallation() throws Exception { assertFalse("trellis-http already installed!", featuresService.isInstalled(featuresService.getFeature("trellis-http"))); featuresService.installFeature("trellis-http"); checkTrellisBundlesAreActive(); assertTrue("trellis-http not installed!", featuresService.isInstalled(featuresService.getFeature("trellis-http"))); }
@Test public void testFileInstallation() throws Exception { assertFalse("trellis-file already installed!", featuresService.isInstalled(featuresService.getFeature("trellis-file"))); featuresService.installFeature("trellis-file"); checkTrellisBundlesAreActive(); assertTrue("trellis-file not installed!", featuresService.isInstalled(featuresService.getFeature("trellis-file"))); }
@Test public void testOAuthAuthInstallation() throws Exception { assertFalse("trellis-auth-oauth already installed!", featuresService.isInstalled(featuresService.getFeature("trellis-auth-oauth"))); featuresService.installFeature("trellis-auth-oauth"); checkTrellisBundlesAreActive(); assertTrue("trellis-auth-oauth not installed!", featuresService.isInstalled(featuresService.getFeature("trellis-auth-oauth"))); }
@Test public void testBasicAuthInstallation() throws Exception { assertFalse("trellis-auth-basic already installed!", featuresService.isInstalled(featuresService.getFeature("trellis-auth-basic"))); featuresService.installFeature("trellis-auth-basic"); checkTrellisBundlesAreActive(); assertTrue("trellis-auth-basic not installed!", featuresService.isInstalled(featuresService.getFeature("trellis-auth-basic"))); }
@Test public void installFeature() throws Exception { LOG.info("Attempting to install feature {} {}", getFeatureName(),getFeatureVersion()); featuresService.installFeature(getFeatureName(), getFeatureVersion()); Feature f = featuresService.getFeature(getFeatureName(), getFeatureVersion()); Assert.assertNotNull("Attempt to get feature "+ getFeatureName() + " " + getFeatureVersion() + "resulted in null" , f); Assert.assertTrue("Failed to install Feature: " + getFeatureName() + " " + getFeatureVersion(),featuresService.isInstalled(f)); LOG.info("Successfull installed feature {} {}", getFeatureName(),getFeatureVersion()); } }
@Test public void testAmqpInstallation() throws Exception { assertFalse("trellis-amqp already installed!", featuresService.isInstalled(featuresService.getFeature("trellis-amqp"))); featuresService.installFeature("trellis-event-serialization"); featuresService.installFeature("trellis-amqp"); checkTrellisBundlesAreActive(); assertTrue("trellis-amqp not installed!", featuresService.isInstalled(featuresService.getFeature("trellis-amqp"))); }
@Test public void testJmsInstallation() throws Exception { assertFalse("trellis-jms already installed!", featuresService.isInstalled(featuresService.getFeature("trellis-jms"))); featuresService.installFeature("trellis-event-serialization"); featuresService.installFeature("trellis-jms"); checkTrellisBundlesAreActive(); assertTrue("trellis-jms not installed!", featuresService.isInstalled(featuresService.getFeature("trellis-jms"))); }
@Test public void testRDFaInstallation() throws Exception { featuresService.installFeature("trellis-rdfa"); checkTrellisBundlesAreActive(); assertTrue("trellis-rdfa not installed!", featuresService.isInstalled(featuresService.getFeature("trellis-rdfa"))); }