EJBModeller implements ServiceModeller { public ParsedServiceElements modelServices(BundleManifest manifest, IDirectory bundle) throws ModellerException { logger.debug("modelServices", new Object[] {manifest, bundle}); ParsedEJBServices ejbServices = new ParsedEJBServices(); String header = manifest.getRawAttributes().getValue("Export-EJB"); logger.debug("Export-EJB header is " + header); if(header == null) return ejbServices; Collection<String> allowedNames = getNames(header.trim()); if(allowedNames.contains("NONE")) return ejbServices; ejbServices.setAllowedNames(allowedNames); locator.findEJBs(manifest, bundle, ejbServices); logger.debug("ejbServices", ejbServices); return ejbServices; }  void setLocator(EJBLocator locator); ParsedServiceElements modelServices(BundleManifest manifest, IDirectory bundle);  }
@Test public void testModelServicesNoExportEJB() throws ModellerException { Manifest man = new Manifest(); setBasicHeaders(man); modeller.modelServices(new BundleManifest(man), bundleLocation); ejbLocator.assertSkeletonNotCalled(); }
@Test public void testModelServicesEmptyExportEJB() throws ModellerException { Manifest man = new Manifest(); setBasicHeaders(man); man.getMainAttributes().putValue("Export-EJB", ""); modeller.modelServices(new BundleManifest(man), bundleLocation); ejbLocator.assertCalled(new MethodCall(EJBLocator.class, "findEJBs", BundleManifest.class, bundleLocation, ParsedEJBServices.class)); }
@Test public void testModelServicesNoneExportEJB() throws ModellerException { Manifest man = new Manifest(); setBasicHeaders(man); man.getMainAttributes().putValue("Export-EJB", "NONE,anEJB , another"); modeller.modelServices(new BundleManifest(man), bundleLocation); ejbLocator.assertSkeletonNotCalled(); }
@Test public void testModelServicesExportEJB() throws ModellerException { Manifest man = new Manifest(); setBasicHeaders(man); man.getMainAttributes().putValue("Export-EJB", "anEJB , another"); modeller.modelServices(new BundleManifest(man), bundleLocation); ejbLocator.assertCalled(new MethodCall(EJBLocator.class, "findEJBs", BundleManifest.class, bundleLocation, ParsedEJBServices.class)); }