@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" ); }
@Override public Extension getExtension(String id, Locale locale) { Feature feature; try { feature = featuresService.getFeature(FeatureInstaller.PREFIX + id); return getExtension(feature); } catch (Exception e) { logger.error("Exception while querying feature '{}'", id); return null; } }
ChildAwareFeatureWrapper(Feature f, FeaturesService s) throws Exception { super(s.getFeature(f.getName(), f.getVersion())); Preconditions.checkNotNull(s, "FeatureWrapper requires non-null FeatureService in constructor"); this.featuresService = s; }
/** * 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))); }
/** * 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))); }
/** * 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. */ 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 testEventSerializationInstallation() throws Exception { if (!featuresService.isInstalled(featuresService.getFeature("trellis-event-serialization"))) { featuresService.installFeature("trellis-event-serialization"); } checkTrellisBundlesAreActive(); assertTrue("trellis-event-serialization not installed!", featuresService.isInstalled(featuresService.getFeature("trellis-event-serialization"))); }
@Test public void testAgentInstallation() throws Exception { assertFalse("trellis-agent already installed!", featuresService.isInstalled(featuresService.getFeature("trellis-agent"))); featuresService.installFeature("trellis-agent"); checkTrellisBundlesAreActive(); assertTrue("trellis-agent not installed!", featuresService.isInstalled(featuresService.getFeature("trellis-agent"))); }
@Test public void testConstraintsInstallation() throws Exception { assertFalse("trellis-constraint-rules already installed!", featuresService.isInstalled(featuresService.getFeature("trellis-constraint-rules"))); featuresService.installFeature("trellis-constraint-rules"); checkTrellisBundlesAreActive(); assertTrue("trellis-constraint-rules not installed!", featuresService.isInstalled(featuresService.getFeature("trellis-constraint-rules"))); }
@Test public void testKafkaInstallation() throws Exception { assertFalse("trellis-kafka already installed!", featuresService.isInstalled(featuresService.getFeature("trellis-kafka"))); featuresService.installFeature("trellis-event-serialization"); featuresService.installFeature("trellis-kafka"); assertTrue("trellis-kafka not installed!", featuresService.isInstalled(featuresService.getFeature("trellis-kafka"))); }
@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 testNamespacesInstallation() throws Exception { assertFalse("trellis-namespace already installed!", featuresService.isInstalled(featuresService.getFeature("trellis-namespaces"))); featuresService.installFeature("trellis-namespaces"); checkTrellisBundlesAreActive(); assertTrue("trellis-namespace not installed!", featuresService.isInstalled(featuresService.getFeature("trellis-namespaces"))); }
@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 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 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"))); }