ComponentValidator extends Validator { public void validateAll(DeployLogger deployLogger) throws IOException { validateOSGIHeaders(deployLogger); } ComponentValidator();  ComponentValidator(JarFile jarFile); @Override void validate(VespaModel model, DeployState deployState); void validateAll(DeployLogger deployLogger); void validateOSGIHeaders(DeployLogger deployLogger);  }
@Test public void basicComponentValidation() throws Exception { JarFile ok = new JarFile(new File(JARS_DIR + "ok.jar")); ComponentValidator componentValidator = new ComponentValidator(ok); componentValidator.validateAll(new BaseDeployLogger()); validateWithException("nomanifest.jar", "Non-existing or invalid manifest in " + JARS_DIR + "nomanifest.jar"); }
@Test public void require_that_deploying_snapshot_bundle_gives_warning() throws IOException { final StringBuffer buffer = new StringBuffer(); DeployLogger logger = new DeployLogger() { @Override public void log(Level level, String message) { buffer.append(message).append('\n'); } }; new ComponentValidator(new JarFile(JARS_DIR + "snapshot_bundle.jar")).validateAll(logger); assertThat(buffer.toString(), containsString("Deploying snapshot bundle")); }