@Test public void testMatchesManifestEmptyLine() throws IOException { Set<MavenInfo> maven = new HashSet<MavenInfo>(); ManifestInfo manifest = new ManifestInfo(new java.util.jar.Manifest(this.getClass().getResourceAsStream("/org/hotswap/agent/versions/matcher/TEST_EMPTYLINE.MF"))); DeploymentInfo info = new DeploymentInfo(maven, Collections.singleton(manifest)); System.err.println(info); PluginMatcher p = new PluginMatcher(MatchingPlugin2.class); System.err.println(p); assertEquals("Matching",VersionMatchResult.MATCHED, p.matches(info)); }
public VersionMatchResult matches(DeploymentInfo info) { if(info.getManifest() == null || info.getManifest().size() == 0) { return VersionMatchResult.SKIPPED; } for (ManifestInfo manifest: info.getManifest()) { VersionMatchResult result = match(manifest); if(VersionMatchResult.MATCHED.equals(result)){ LOGGER.debug("Matched {} with {}", this, manifest); return VersionMatchResult.MATCHED; } if(VersionMatchResult.REJECTED.equals(result)){ LOGGER.debug("Rejected {} with {}", this, manifest); return VersionMatchResult.REJECTED; } } return VersionMatchResult.SKIPPED; }
ManifestMatcher implements VersionMatcher { public VersionMatchResult matches(DeploymentInfo info) { if(info.getManifest() == null || info.getManifest().size() == 0) { return VersionMatchResult.SKIPPED; } for (ManifestInfo manifest: info.getManifest()) { VersionMatchResult result = match(manifest); if(VersionMatchResult.MATCHED.equals(result)){ LOGGER.debug("Matched {} with {}", this, manifest); return VersionMatchResult.MATCHED; } if(VersionMatchResult.REJECTED.equals(result)){ LOGGER.debug("Rejected {} with {}", this, manifest); return VersionMatchResult.REJECTED; } } return VersionMatchResult.SKIPPED; } }
ManifestMatcher implements VersionMatcher { public VersionMatchResult matches(DeploymentInfo info) { if(info.getManifest() == null || info.getManifest().size() == 0) { return VersionMatchResult.SKIPPED; } for (ManifestInfo manifest: info.getManifest()) { VersionMatchResult result = match(manifest); if(VersionMatchResult.MATCHED.equals(result)){ LOGGER.debug("Matched {} with {}", this, manifest); return VersionMatchResult.MATCHED; } if(VersionMatchResult.REJECTED.equals(result)){ LOGGER.debug("Rejected {} with {}", this, manifest); return VersionMatchResult.REJECTED; } } return VersionMatchResult.SKIPPED; } ManifestMatcher(Manifest cfg); }
ManifestMatcher implements VersionMatcher { public VersionMatchResult matches(DeploymentInfo info) { if(info.getManifest() == null || info.getManifest().size() == 0) { return VersionMatchResult.SKIPPED; } for (ManifestInfo manifest: info.getManifest()) { VersionMatchResult result = match(manifest); if(VersionMatchResult.MATCHED.equals(result)){ LOGGER.debug("Matched {} with {}", this, manifest); return VersionMatchResult.MATCHED; } if(VersionMatchResult.REJECTED.equals(result)){ LOGGER.debug("Rejected {} with {}", this, manifest); return VersionMatchResult.REJECTED; } } return VersionMatchResult.SKIPPED; } ManifestMatcher(Manifest cfg); VersionRange getIncludes(); VersionRange getExcludes(); Map<Name, String> getProperties(); VersionMatchResult matches(DeploymentInfo info); @Override String toString(); @Override boolean isApply(); }
ManifestMatcher implements VersionMatcher { public VersionMatchResult matches(DeploymentInfo info) { if(info.getManifest() == null || info.getManifest().size() == 0) { return VersionMatchResult.SKIPPED; } for (ManifestInfo manifest: info.getManifest()) { VersionMatchResult result = match(manifest); if(VersionMatchResult.MATCHED.equals(result)){ LOGGER.debug("Matched {} with {}", this, manifest); return VersionMatchResult.MATCHED; } if(VersionMatchResult.REJECTED.equals(result)){ LOGGER.debug("Rejected {} with {}", this, manifest); return VersionMatchResult.REJECTED; } } return VersionMatchResult.SKIPPED; } ManifestMatcher(Manifest cfg); VersionRange getIncludes(); VersionRange getExcludes(); Map<Name, String> getProperties(); VersionMatchResult matches(DeploymentInfo info); @Override String toString(); @Override boolean isApply();  }