本文整理汇总了Java中org.kuali.rice.krad.datadictionary.validation.ValidationTestUtils类的典型用法代码示例。如果您正苦于以下问题:Java ValidationTestUtils类的具体用法?Java ValidationTestUtils怎么用?Java ValidationTestUtils使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ValidationTestUtils类属于org.kuali.rice.krad.datadictionary.validation包,在下文中一共展示了ValidationTestUtils类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testMatch_allowDefault
import org.kuali.rice.krad.datadictionary.validation.ValidationTestUtils; //导入依赖的package包/类
/**
* tests that only numbers and letters of the alphabet are allowed
*/
@Test public final void testMatch_allowDefault() {
boolean[] expected = { true, // ""
false, // "!!!"
false, // "[a-9]"
false, // "^A-Z"
true, // "abc"
false, // "a bc"
false, // "a_bc"
true, // "123"
false, // "12 3"
false, // "12_3"
true, // "a1b2c3"
false, // "a1b2_c3"
false, // "a 1b2c3"
false, // "a 1b2_c3"
false, //"foo.bar"
false, //"foo.bar_baz"
false, //".bar_foo baz"
};
ValidationTestUtils.assertPatternMatches(pattern, expected);
}
示例2: testMatch_allowUnderscore
import org.kuali.rice.krad.datadictionary.validation.ValidationTestUtils; //导入依赖的package包/类
/**
* tests that underscores, numbers and letters of the alphabet are allowed
*/
@Test public final void testMatch_allowUnderscore() {
boolean[] expected = { true, // ""
false, // "!!!"
false, // "[a-9]"
false, // "^A-Z"
true, // "abc"
false, // "a bc"
true, // "a_bc"
true, // "123"
false, // "12 3"
true, // "12_3"
true, // "a1b2c3"
true, // "a1b2_c3"
false, // "a 1b2c3"
false, // "a 1b2_c3"
false, //"foo.bar"
false, //"foo.bar_baz"
false, //".bar_foo baz"
};
pattern.setAllowUnderscore(true);
ValidationTestUtils.assertPatternMatches(pattern, expected);
}
示例3: testMatch_allowWhitespace
import org.kuali.rice.krad.datadictionary.validation.ValidationTestUtils; //导入依赖的package包/类
/**
* tests that white space, numbers and letters of the alphabet are allowed
*/
@Test public final void testMatch_allowWhitespace() {
boolean[] expected = { true, // ""
false, // "!!!"
false, // "[a-9]"
false, // "^A-Z"
true, // "abc"
true, // "a bc"
false, // "a_bc"
true, // "123"
true, // "12 3"
false, // "12_3"
true, // "a1b2c3"
false, // "a1b2_c3"
true, // "a 1b2c3"
false, // "a 1b2_c3"
false, //"foo.bar"
false, //"foo.bar_baz"
false, //".bar_foo baz"
};
pattern.setAllowWhitespace(true);
ValidationTestUtils.assertPatternMatches(pattern, expected);
}
示例4: testMatch_allowUnderScoreAndWhiteSpace
import org.kuali.rice.krad.datadictionary.validation.ValidationTestUtils; //导入依赖的package包/类
/**
* tests that white space, underscores, numbers and letters of the alphabet are allowed
*/
@Test public final void testMatch_allowUnderScoreAndWhiteSpace() {
boolean[] expected = { true, // ""
false, // "!!!"
false, // "[a-9]"
false, // "^A-Z"
true, // "abc"
true, // "a bc"
true, // "a_bc"
true, // "123"
true, // "12 3"
true, // "12_3"
true, // "a1b2c3"
true, // "a1b2_c3"
true, // "a 1b2c3"
true, // "a 1b2_c3"
false, //"foo.bar"
false, //"foo.bar_baz"
false, //".bar_foo baz"
};
pattern.setAllowUnderscore(true);
pattern.setAllowWhitespace(true);
ValidationTestUtils.assertPatternMatches(pattern, expected);
}
示例5: testMatch_allowPeriod
import org.kuali.rice.krad.datadictionary.validation.ValidationTestUtils; //导入依赖的package包/类
/**
* tests that periods, numbers and letters of the alphabet are allowed
*/
@Test public final void testMatch_allowPeriod() {
boolean[] expected = { true, // ""
false, // "!!!"
false, // "[a-9]"
false, // "^A-Z"
true, // "abc"
false, // "a bc"
false, // "a_bc"
true, // "123"
false, // "12 3"
false, // "12_3"
true, // "a1b2c3"
false, // "a1b2_c3"
false, // "a 1b2c3"
false, // "a 1b2_c3"
true, //"foo.bar"
false, //"foo.bar_baz"
false, //".bar_foo baz"
};
pattern.setAllowPeriod(true);
ValidationTestUtils.assertPatternMatches(pattern, expected);
}
示例6: testMatch_allowPeriodAndUnderscore
import org.kuali.rice.krad.datadictionary.validation.ValidationTestUtils; //导入依赖的package包/类
/**
* tests that periods, underscores, numbers and letters of the alphabet are allowed
*/
@Test public final void testMatch_allowPeriodAndUnderscore() {
boolean[] expected = { true, // ""
false, // "!!!"
false, // "[a-9]"
false, // "^A-Z"
true, // "abc"
false, // "a bc"
true, // "a_bc"
true, // "123"
false, // "12 3"
true, // "12_3"
true, // "a1b2c3"
true, // "a1b2_c3"
false, // "a 1b2c3"
false, // "a 1b2_c3"
true, //"foo.bar"
true, //"foo.bar_baz"
false, //".bar_foo baz"
};
pattern.setAllowPeriod(true);
pattern.setAllowUnderscore(true);
ValidationTestUtils.assertPatternMatches(pattern, expected);
}
示例7: testMatch_allowDefault
import org.kuali.rice.krad.datadictionary.validation.ValidationTestUtils; //导入依赖的package包/类
/**
* tests that any sequence not containing white space matches
*/
@Test public final void testMatch_allowDefault() {
boolean[] expected = { true, // ""
true, // "!!!"
true, // "[a-9]"
true, // "^A-Z"
true, // "abc"
false, // "a bc"
true, // "a_bc"
true, // "123"
false, // "12 3"
true, // "12_3"
true, // "a1b2c3"
true, // "a1b2_c3"
false, // "a 1b2c3"
false, // "a 1b2_c3"
true, //"foo.bar"
true, //"foo.bar_baz"
false, //".bar_foo baz"
};
ValidationTestUtils.assertPatternMatches(pattern, expected);
}
示例8: testMatch_allowWhitespace
import org.kuali.rice.krad.datadictionary.validation.ValidationTestUtils; //导入依赖的package包/类
/**
* tests that sequences containing white space are allowed
*/
@Test public final void testMatch_allowWhitespace() {
boolean[] expected = { true, // ""
true, // "!!!"
true, // "[a-9]"
true, // "^A-Z"
true, // "abc"
true, // "a bc"
true, // "a_bc"
true, // "123"
true, // "12 3"
true, // "12_3"
true, // "a1b2c3"
true, // "a1b2_c3"
true, // "a 1b2c3"
true, // "a 1b2_c3"
true, //"foo.bar"
true, //"foo.bar_baz"
true, //".bar_foo baz"
};
pattern.setAllowWhitespace(true);
ValidationTestUtils.assertPatternMatches(pattern, expected);
}
示例9: testMatch_allowDefault
import org.kuali.rice.krad.datadictionary.validation.ValidationTestUtils; //导入依赖的package包/类
/**
* tests that sequences containing only numbers match
*/
@Test public final void testMatch_allowDefault() {
boolean[] expected = { true, // ""
false, // "!!!"
false, // "[a-9]"
false, // "^A-Z"
false, // "abc"
false, // "a bc"
false, // "a_bc"
true, // "123"
false, // "12 3"
false, // "12_3"
false, // "a1b2c3"
false, // "a1b2_c3"
false, // "a 1b2c3"
false, // "a 1b2_c3"
false, //"foo.bar"
false, //"foo.bar_baz"
false, //".bar_foo baz"
};
ValidationTestUtils.assertPatternMatches(pattern, expected);
}
示例10: testMatch_allowDefault
import org.kuali.rice.krad.datadictionary.validation.ValidationTestUtils; //导入依赖的package包/类
@Test public final void testMatch_allowDefault() {
boolean[] expected = { true, // ""
false, // "!!!"
false, // "[a-9]"
false, // "^A-Z"
true, // "abc"
false, // "a bc"
false, // "a_bc"
false, // "123"
false, // "12 3"
false, // "12_3"
false, // "a1b2c3"
false, // "a1b2_c3"
false, // "a 1b2c3"
false, // "a 1b2_c3"
false, //"foo.bar"
false, //"foo.bar_baz"
false, //".bar_foo baz"
};
ValidationTestUtils.assertPatternMatches(pattern, expected);
}
示例11: testMatch_allowWhitespace
import org.kuali.rice.krad.datadictionary.validation.ValidationTestUtils; //导入依赖的package包/类
@Test public final void testMatch_allowWhitespace() {
boolean[] expected = { true, // ""
false, // "!!!"
false, // "[a-9]"
false, // "^A-Z"
true, // "abc"
true, // "a bc"
false, // "a_bc"
false, // "123"
false, // "12 3"
false, // "12_3"
false, // "a1b2c3"
false, // "a1b2_c3"
false, // "a 1b2c3"
false, // "a 1b2_c3"
false, //"foo.bar"
false, //"foo.bar_baz"
false, //".bar_foo baz"
};
pattern.setAllowWhitespace(true);
ValidationTestUtils.assertPatternMatches(pattern, expected);
}
示例12: testMatch_allowPeriodAndUnderscoreAndSpace
import org.kuali.rice.krad.datadictionary.validation.ValidationTestUtils; //导入依赖的package包/类
/**
* tests that periods, underscores, white space, numbers and letters of the alphabet are allowed
*/
@Test public final void testMatch_allowPeriodAndUnderscoreAndSpace() {
boolean[] expected = { true, // ""
false, // "!!!"
false, // "[a-9]"
false, // "^A-Z"
true, // "abc"
true, // "a bc"
true, // "a_bc"
true, // "123"
true, // "12 3"
true, // "12_3"
true, // "a1b2c3"
true, // "a1b2_c3"
true, // "a 1b2c3"
true, // "a 1b2_c3"
true, //"foo.bar"
true, //"foo.bar_baz"
true, //".bar_foo baz"
};
pattern.setAllowPeriod(true);
pattern.setAllowUnderscore(true);
pattern.setAllowWhitespace(true);
ValidationTestUtils.assertPatternMatches(pattern, expected);
}