本文整理了Java中com.mesosphere.sdk.config.validate.ZoneValidator.validate()
方法的一些代码示例,展示了ZoneValidator.validate()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZoneValidator.validate()
方法的具体详情如下:
包路径:com.mesosphere.sdk.config.validate.ZoneValidator
类名称:ZoneValidator
方法名:validate
暂无
代码示例来源:origin: mesosphere/dcos-commons
@Override
public Collection<ConfigValidationError> validate(
Optional<ServiceSpec> oldConfig,
ServiceSpec newConfig)
{
return ZoneValidator
.validate(oldConfig, newConfig, NAME_POD_TYPE, JOURNAL_POD_TYPE, DATA_POD_TYPE);
}
}
代码示例来源:origin: mesosphere/dcos-commons
@Override
public Collection<ConfigValidationError> validate(
Optional<ServiceSpec> oldConfig,
ServiceSpec newConfig)
{
return ZoneValidator.validate(oldConfig, newConfig, POD_TYPE);
}
}
代码示例来源:origin: mesosphere/dcos-commons
@Override
public Collection<ConfigValidationError> validate(
Optional<ServiceSpec> oldConfig,
ServiceSpec newConfig)
{
return ZoneValidator.validate(
oldConfig,
newConfig,
MASTER_POD_TYPE,
DATA_POD_TYPE,
INGEST_POD_TYPE,
COORDINATOR_POD_TYPE);
}
}
代码示例来源:origin: mesosphere/dcos-commons
public static Collection<ConfigValidationError> validate(
Optional<ServiceSpec> oldConfig,
ServiceSpec newConfig,
String... podTypes)
{
return Arrays.stream(podTypes)
.flatMap(p -> validate(oldConfig, newConfig, p).stream())
.collect(Collectors.toList());
}
代码示例来源:origin: mesosphere/dcos-commons
@Test
public void noOldConfig() {
Collection<ConfigValidationError> errors = ZoneValidator.validate(
Optional.empty(), null, POD_TYPE);
Assert.assertTrue(errors.isEmpty());
}
代码示例来源:origin: mesosphere/dcos-commons
@Test
public void falseToTrueShouldFail() {
ServiceSpec oldSpec = getServiceSpec(false);
ServiceSpec newSpec = getServiceSpec(true);
Collection<ConfigValidationError> errors = ZoneValidator.validate(Optional.of(oldSpec), newSpec, POD_TYPE);
Assert.assertEquals(1, errors.size());
}
代码示例来源:origin: mesosphere/dcos-commons
@Test
public void trueToTrueShouldSucceed() {
ServiceSpec oldSpec = getServiceSpec(true);
ServiceSpec newSpec = getServiceSpec(true);
Collection<ConfigValidationError> errors = ZoneValidator.validate(Optional.of(oldSpec), newSpec, POD_TYPE);
Assert.assertTrue(errors.isEmpty());
}
代码示例来源:origin: mesosphere/dcos-commons
@Test
public void trueToFalseShouldFail() {
ServiceSpec oldSpec = getServiceSpec(true);
ServiceSpec newSpec = getServiceSpec(false);
Collection<ConfigValidationError> errors = ZoneValidator.validate(Optional.of(oldSpec), newSpec, POD_TYPE);
Assert.assertEquals(1, errors.size());
}
代码示例来源:origin: mesosphere/dcos-commons
@Test
public void emptyToFalseShouldSucceed() {
TaskSpec oldTaskSpec = getTaskSpec(Collections.emptyMap());
ServiceSpec oldSpec = getServiceSpec(oldTaskSpec);
ServiceSpec newSpec = getServiceSpec(false);
Collection<ConfigValidationError> errors = ZoneValidator.validate(Optional.of(oldSpec), newSpec, POD_TYPE);
Assert.assertTrue(errors.isEmpty());
}
代码示例来源:origin: mesosphere/dcos-commons
@Test
public void emptyToTrueShouldFail() {
TaskSpec oldTaskSpec = getTaskSpec(Collections.emptyMap());
ServiceSpec oldSpec = getServiceSpec(oldTaskSpec);
ServiceSpec newSpec = getServiceSpec(true);
Collection<ConfigValidationError> errors = ZoneValidator.validate(Optional.of(oldSpec), newSpec, POD_TYPE);
Assert.assertEquals(1, errors.size());
}
代码示例来源:origin: mesosphere/dcos-commons
@Test
public void taskTypeMissingInOldSpec() {
TaskSpec oldTaskSpec = getTaskSpec(TASK_NAME, Collections.emptyMap());
TaskSpec newTaskSpec = getTaskSpec(Collections.emptyMap());
ServiceSpec oldSpec = getServiceSpec(oldTaskSpec);
ServiceSpec newSpec = getServiceSpec(newTaskSpec);
Collection<ConfigValidationError> errors = ZoneValidator.validate(Optional.of(oldSpec), newSpec, POD_TYPE);
Assert.assertTrue(errors.isEmpty());
}
内容来源于网络,如有侵权,请联系作者删除!