本文整理汇总了Java中com.openpojo.validation.test.impl.DefaultValuesNullTester类的典型用法代码示例。如果您正苦于以下问题:Java DefaultValuesNullTester类的具体用法?Java DefaultValuesNullTester怎么用?Java DefaultValuesNullTester使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
DefaultValuesNullTester类属于com.openpojo.validation.test.impl包,在下文中一共展示了DefaultValuesNullTester类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setUp
import com.openpojo.validation.test.impl.DefaultValuesNullTester; //导入依赖的package包/类
@Before
public void setUp() {
AttributeHelper.registerFieldPrefix("_");
_validator = ValidatorBuilder.create(
).with(
new GetterMustExistRule()
).with(
new NoStaticExceptFinalRule()
).with(
new NoFieldShadowingRule()
).with(
new NoPublicFieldsRule()
).with(
new GetterTester()
).with(
new DefaultValuesNullTester()
).build();
}
示例2: testPojoStructureAndBehavior
import com.openpojo.validation.test.impl.DefaultValuesNullTester; //导入依赖的package包/类
@Test
public void testPojoStructureAndBehavior() {
Validator validator = ValidatorBuilder.create()
// Add Rules to validate structure for POJO_PACKAGE
// See com.openpojo.validation.rule.impl for more ...
.with(new GetterMustExistRule())
// Add Testers to validate behaviour for POJO_PACKAGE
// See com.openpojo.validation.test.impl for more ...
.with(new GetterTester())
.with(new DefaultValuesNullTester())
.build();
for (String pojoPackage : POJO_PACKAGE) {
LOGGER.info("Testing package: {}", pojoPackage);
validator.validate(pojoPackage, new FilterPackageInfo());
}
}
示例3: setUp
import com.openpojo.validation.test.impl.DefaultValuesNullTester; //导入依赖的package包/类
@Before
public void setUp() {
AttributeHelper.registerFieldPrefix("_");
_validator = ValidatorBuilder.create(
).with(
new NoStaticExceptFinalRule()
).with(
new NoFieldShadowingRule()
).with(
new NoPublicFieldsRule()
).with(
new DefaultValuesNullTester()
).build();
}
示例4: testPojoStructureAndBehavior
import com.openpojo.validation.test.impl.DefaultValuesNullTester; //导入依赖的package包/类
@Test
public final void testPojoStructureAndBehavior() {
final PojoClass pc = PojoClassFactory.getPojoClass(Target.class);
final PojoValidator pv = new PojoValidator();
pv.addRule(new NoPublicFieldsRule());
pv.addRule(new NoFieldShadowingRule());
pv.addTester(new DefaultValuesNullTester());
pv.addTester(new SetterTester());
pv.addTester(new GetterTester());
pv.runValidation(pc);
}
示例5: createPojoValidator
import com.openpojo.validation.test.impl.DefaultValuesNullTester; //导入依赖的package包/类
/**
* Creates a configured POJO validator.
*
* @return New instance.
*/
protected final PojoValidator createPojoValidator() {
final PojoValidator pv = new PojoValidator();
pv.addRule(new NoPublicFieldsRule());
pv.addRule(new NoFieldShadowingRule());
pv.addTester(new DefaultValuesNullTester());
pv.addTester(new GetterTester());
return pv;
}