当前位置: 首页>>代码示例>>Java>>正文


Java SetterMustExistRule类代码示例

本文整理汇总了Java中com.openpojo.validation.rule.impl.SetterMustExistRule的典型用法代码示例。如果您正苦于以下问题:Java SetterMustExistRule类的具体用法?Java SetterMustExistRule怎么用?Java SetterMustExistRule使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


SetterMustExistRule类属于com.openpojo.validation.rule.impl包,在下文中一共展示了SetterMustExistRule类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: test_pojo_structure_and_behavior

import com.openpojo.validation.rule.impl.SetterMustExistRule; //导入依赖的package包/类
@Test
public void test_pojo_structure_and_behavior() {

    List<Class> classes = Lists.newArrayList(
            AuthData.class,
            AuthMfaDevice.class,
            AuthResponse.class
    );

    List<PojoClass> pojoClasses = classes.stream().map(PojoClassFactory::getPojoClass).collect(Collectors.toList());

    Validator validator = ValidatorBuilder.create()
            .with(new GetterMustExistRule())
            .with(new SetterMustExistRule())
            .with(new SetterTester())
            .with(new GetterTester())
            .build();

    validator.validate(pojoClasses);
}
 
开发者ID:Nike-Inc,项目名称:cerberus-management-service,代码行数:21,代码来源:AuthConnectorPojoTest.java

示例2: test_pojo_structure_and_behavior

import com.openpojo.validation.rule.impl.SetterMustExistRule; //导入依赖的package包/类
@Test
public void test_pojo_structure_and_behavior() {

    List<Class> classes = Lists.newArrayList(
            CreateSessionLoginTokenRequest.class,
            CreateSessionLoginTokenResponse.class,
            GenerateTokenRequest.class,
            GenerateTokenResponse.class,
            GenerateTokenResponseData.class,
            GetUserResponse.class,
            MfaDevice.class,
            ResponseStatus.class,
            SessionLoginTokenData.class,
            SessionUser.class,
            UserData.class,
            VerifyFactorRequest.class,
            VerifyFactorResponse.class
    );

    List<PojoClass> pojoClasses = classes.stream().map(PojoClassFactory::getPojoClass).collect(Collectors.toList());

    Validator validator = ValidatorBuilder.create()
            .with(new GetterMustExistRule())
            .with(new SetterMustExistRule())
            .with(new SetterTester())
            .with(new GetterTester())
            .build();

    validator.validate(pojoClasses);
}
 
开发者ID:Nike-Inc,项目名称:cerberus-management-service,代码行数:31,代码来源:OneLoginPojoTest.java

示例3: test_pojo_structure_and_behavior

import com.openpojo.validation.rule.impl.SetterMustExistRule; //导入依赖的package包/类
@Test
public void test_pojo_structure_and_behavior() {

    List<PojoClass> pojoClasses = PojoClassFactory.getPojoClasses("com.nike.cerberus.record");

    Assert.assertEquals(10, pojoClasses.size());

    Validator validator = ValidatorBuilder.create()
            .with(new GetterMustExistRule())
            .with(new SetterMustExistRule())
            .with(new SetterTester())
            .with(new GetterTester())
            .build();

    validator.validate(pojoClasses);
}
 
开发者ID:Nike-Inc,项目名称:cerberus-management-service,代码行数:17,代码来源:RecordPojoTest.java

示例4: test_pojo_structure_and_behavior

import com.openpojo.validation.rule.impl.SetterMustExistRule; //导入依赖的package包/类
@Test
public void test_pojo_structure_and_behavior() {

    List<PojoClass> pojoClasses = PojoClassFactory.getPojoClasses("com.nike.cerberus.domain");

    // exclude this class because it does not need getters and setters for every constructor parameter
    pojoClasses.remove(PojoClassFactory.getPojoClass(AssetResourceFile.class));

    Assert.assertEquals(19, pojoClasses.size());

    Validator validator = ValidatorBuilder.create()
            .with(new GetterMustExistRule())
            .with(new SetterMustExistRule())
            .with(new SetterTester())
            .with(new GetterTester())
            .build();

    validator.validate(pojoClasses);
}
 
开发者ID:Nike-Inc,项目名称:cerberus-management-service,代码行数:20,代码来源:DomainPojoTest.java

示例5: should_only_have_get_correct_pojo_in_bean_package

import com.openpojo.validation.rule.impl.SetterMustExistRule; //导入依赖的package包/类
@Test
public void should_only_have_get_correct_pojo_in_bean_package() {
    Validator validator = create()
            // Add Rules to validate structure for POJO_PACKAGE
            // See com.openpojo.validation.rule.impl for more ...
            .with(new GetterMustExistRule())
            .with(new SetterMustExistRule())
            .with(new NoPublicFieldsExceptStaticFinalRule())
            .with(new NoFieldShadowingRule())
            // Add Testers to validate behaviour for POJO_PACKAGE
            // See com.openpojo.validation.test.impl for more ...
            .with(new SetterTester())
            .with(new GetterTester())
            .build();

    validator.validate(POJO_PACKAGE, new FilterPackageInfo());
}
 
开发者ID:Eulbobo,项目名称:java-samples,代码行数:18,代码来源:PojoTest.java

示例6: beanSimple_should_be_a_correct_pojo

import com.openpojo.validation.rule.impl.SetterMustExistRule; //导入依赖的package包/类
@Test
public void beanSimple_should_be_a_correct_pojo() {
    Validator validator = create()
            // Add Rules to validate structure for POJO_PACKAGE
            // See com.openpojo.validation.rule.impl for more ...
            .with(new GetterMustExistRule())
            .with(new SetterMustExistRule())
            .with(new NoPublicFieldsExceptStaticFinalRule())
            .with(new NoFieldShadowingRule())
            // Add Testers to validate behaviour for POJO_PACKAGE
            // See com.openpojo.validation.test.impl for more ...
            .with(new SetterTester())
            .with(new GetterTester())
            .build();

    validator.validate(PojoClassFactory.getPojoClass(BeanSimple.class));
}
 
开发者ID:Eulbobo,项目名称:java-samples,代码行数:18,代码来源:PojoTest.java

示例7: userBean_should_be_a_correct_bean

import com.openpojo.validation.rule.impl.SetterMustExistRule; //导入依赖的package包/类
@Test
public void userBean_should_be_a_correct_bean() {
    Validator validator = create()
            // Add Rules to validate structure for POJO_PACKAGE
            // See com.openpojo.validation.rule.impl for more ...
            .with(new GetterMustExistRule())
            .with(new SetterMustExistRule())
            .with(new NoPublicFieldsExceptStaticFinalRule())
            .with(new NoFieldShadowingRule())
            // Add Testers to validate behaviour for POJO_PACKAGE
            // See com.openpojo.validation.test.impl for more ...
            .with(new SetterTester())
            .with(new GetterTester())
            .build();


    validator.validate(PojoClassFactory.getPojoClass(User.class));
}
 
开发者ID:Eulbobo,项目名称:java-samples,代码行数:19,代码来源:PojoTest.java

示例8: testPojoStructureAndBehavior

import com.openpojo.validation.rule.impl.SetterMustExistRule; //导入依赖的package包/类
@Test
@Category(UnitTest.class)
@SuppressWarnings("unchecked")
public void testPojoStructureAndBehavior() {
    if (this.getClass() == PojoTest.class) {
        return;
    }
    Class<T> typeParameterClass = (Class<T>) ((ParameterizedType) getClass().getGenericSuperclass()).getActualTypeArguments()[0];
    
    PojoValidator pojoValidator = new PojoValidator();

    // Create Rules to validate structure for POJO_PACKAGE
    pojoValidator.addRule(new NoPublicFieldsRule());
    pojoValidator.addRule(new NoPrimitivesRule());
    pojoValidator.addRule(new NoStaticExceptFinalRule());
    pojoValidator.addRule(new GetterMustExistRule());
    pojoValidator.addRule(new SetterMustExistRule());
    pojoValidator.addRule(new NoNestedClassRule());

    // Create Testers to validate behaviour for POJO_PACKAGE
    pojoValidator.addTester(new SetterTester());
    pojoValidator.addTester(new GetterTester());
    
    PojoClass pojoClass = PojoClassFactory.getPojoClass(typeParameterClass);
    pojoValidator.runValidation(pojoClass);
}
 
开发者ID:Livefyre,项目名称:livefyre-java-utils,代码行数:27,代码来源:PojoTest.java

示例9: testPojo

import com.openpojo.validation.rule.impl.SetterMustExistRule; //导入依赖的package包/类
@Test
public void testPojo() {
	PojoValidator pojoValidator = new PojoValidator();

	// Create Rules to validate structure for POJO_PACKAGE
	pojoValidator.addRule(new NoPublicFieldsRule());
	pojoValidator.addRule(new NoPrimitivesRule());
	pojoValidator.addRule(new NoStaticExceptFinalRule());
	pojoValidator.addRule(new GetterMustExistRule());
	pojoValidator.addRule(new SetterMustExistRule());
	pojoValidator.addRule(new NoNestedClassRule());
	pojoValidator.addRule(new NoPublicFieldsExceptStaticFinalRule());
	pojoValidator.addRule(new NoStaticExceptFinalRule());
	pojoValidator.addRule(new SerializableMustHaveSerialVersionUIDRule());

	// Create Testers to validate behaviour for POJO_PACKAGE
	pojoValidator.addTester(new SetterTester());
	pojoValidator.addTester(new GetterTester());
	PojoClass pojoClass = PojoClassFactory.getPojoClass(getPojoClass());
	pojoValidator.runValidation(pojoClass);
}
 
开发者ID:aracrown,项目名称:ara-commons,代码行数:22,代码来源:AbstractSinglePojoClassTest.java

示例10: testPojoStructureAndBehavior

import com.openpojo.validation.rule.impl.SetterMustExistRule; //导入依赖的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())
            .with(new SetterMustExistRule())
            // Add Testers to validate behaviour for POJO_PACKAGE
            // See com.openpojo.validation.test.impl for more ...
            .with(new SetterTester())
            .with(new GetterTester())
            .build();

    validator.validate("com.adyen.core.exceptions", new FilterPackageInfo());
}
 
开发者ID:Adyen,项目名称:adyen-android,代码行数:16,代码来源:ExceptionsUnitTest.java

示例11: testPojoStructureAndBehavior

import com.openpojo.validation.rule.impl.SetterMustExistRule; //导入依赖的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())
            .with(new SetterMustExistRule())
            // Add Testers to validate behaviour for POJO_PACKAGE
            // See com.openpojo.validation.test.impl for more ...
            .with(new SetterTester())
            .with(new GetterTester())
            .build();

    validator.validate("com.adyen.core.interfaces", new FilterPackageInfo());
}
 
开发者ID:Adyen,项目名称:adyen-android,代码行数:16,代码来源:InterfacesUnitTest.java

示例12: testGetterAndSetter

import com.openpojo.validation.rule.impl.SetterMustExistRule; //导入依赖的package包/类
@Test(timeout = 1_000)
public void testGetterAndSetter() {
    final PojoClass activityPojo = PojoClassFactory.getPojoClass(AccountUser.class);
    final Validator validator = ValidatorBuilder.create()
        .with(new SetterMustExistRule()).with(new GetterMustExistRule())
        .with(new SetterTester()).with(new GetterTester()).build();
    validator.validate(activityPojo);
}
 
开发者ID:sweIhm,项目名称:sweiproject-tg2b-1,代码行数:9,代码来源:AccountUserTest.java

示例13: validateSettersAndGetters

import com.openpojo.validation.rule.impl.SetterMustExistRule; //导入依赖的package包/类
@Test
public void validateSettersAndGetters() {
    PojoClass activityPojo = PojoClassFactory.getPojoClass(Activity.class);
    Validator validator = ValidatorBuilder.create()
            // Lets make sure that we have a getter and a setter for every field defined.
            .with(new SetterMustExistRule()).with(new GetterMustExistRule())
            // Lets also validate that they are behaving as expected
            .with(new SetterTester()).with(new GetterTester()).build();
    // Start the Test
    validator.validate(activityPojo);
}
 
开发者ID:sweIhm,项目名称:sweiproject-tg2b-1,代码行数:12,代码来源:ActivityTest.java

示例14: testPojo

import com.openpojo.validation.rule.impl.SetterMustExistRule; //导入依赖的package包/类
@Test
public void testPojo() {
  ValidatorBuilder
      .create()
      .with(new GetterMustExistRule())
      .with(new SetterMustExistRule())
      .with(new SetterTester())
      .with(new GetterTester())
      .build()
      .validate(Lists.transform(
          ImmutableList
              .<Class<?>> builder()
              .add(MetastoreTunnel.class)
              .add(ReplicaTable.class)
              .add(ReplicaCatalog.class)
              .add(Security.class)
              .add(SourceCatalog.class)
              .add(SourceTable.class)
              .add(TableReplication.class)
              .add(TableReplications.class)
              .add(MetricsReporter.class)
              .build(),
          new Function<Class<?>, PojoClass>() {
            @Override
            public PojoClass apply(Class<?> input) {
              return PojoClassFactory.getPojoClass(input);
            }
          }));
}
 
开发者ID:HotelsDotCom,项目名称:circus-train,代码行数:30,代码来源:ConfigurationPojosTest.java

示例15: testStructure

import com.openpojo.validation.rule.impl.SetterMustExistRule; //导入依赖的package包/类
@Test
public void testStructure() throws NoSuchMethodException {
    final Validator validator = ValidatorBuilder.create()
            .with(new GetterMustExistRule())
            .with(new SetterMustExistRule())
            .with(new BusinessKeyMustExistRule())
            .with(new GetterTester())
            .with(new SetterTester())
            .with(new BusinessIdentityTester())
            .build();
    validator.validate(PojoClassFactory.getPojoClass(RestServiceMethod.class));
}
 
开发者ID:tcurrie,项目名称:rest-factory,代码行数:13,代码来源:RestServiceMethodTest.java


注:本文中的com.openpojo.validation.rule.impl.SetterMustExistRule类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。