@Test public void testFindFeatureServiceNullServiceRef() { BundleContext context = niceMock(BundleContext.class); replay(context); RunMojo mojo = new RunMojo(); Object service = mojo.findFeatureService(context); assertNull(service); }
@SuppressWarnings({ "rawtypes", "unchecked" }) Object findFeatureService(BundleContext bundleContext) { ServiceReference ref = bundleContext.getServiceReference(FeaturesService.class); if (ref != null) { Object featureService = bundleContext.getService(ref); return featureService; } return null; }
RunMojo extends MojoSupport { @SuppressWarnings({ "rawtypes", "unchecked" }) Object findFeatureService(BundleContext bundleContext) { ServiceReference ref = bundleContext.getServiceReference(FeaturesService.class); if (ref != null) { Object featureService = bundleContext.getService(ref); return featureService; } return null; } }
RunMojo extends MojoSupport { @SuppressWarnings({ "rawtypes", "unchecked" }) Object findFeatureService(BundleContext bundleContext) { ServiceReference ref = bundleContext.getServiceReference(FeaturesService.class); if (ref != null) { Object featureService = bundleContext.getService(ref); return featureService; } return null; }  }
RunMojo extends MojoSupport { @SuppressWarnings({ "rawtypes", "unchecked" }) Object findFeatureService(BundleContext bundleContext) { ServiceReference ref = bundleContext.getServiceReference(FeaturesService.class); if (ref != null) { Object featureService = bundleContext.getService(ref); return featureService; } return null; }  void execute(); static void extract(File sourceFile, File targetFolder); }
RunMojo extends MojoSupport { @SuppressWarnings({ "rawtypes", "unchecked" }) Object findFeatureService(BundleContext bundleContext) { ServiceReference ref = bundleContext.getServiceReference(FeaturesService.class); if (ref != null) { Object featureService = bundleContext.getService(ref); return featureService; } return null; }  void execute(); static void extract(File sourceFile, File targetFolder);  }