forked from liangrui1988/java-admin
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSimpleTest2.java
More file actions
66 lines (46 loc) · 1.34 KB
/
Copy pathSimpleTest2.java
File metadata and controls
66 lines (46 loc) · 1.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
package com.huiwan.gdata.vail;
import static org.junit.Assert.assertNotNull;
import javax.validation.Validation;
import javax.validation.Validator;
import javax.validation.ValidatorFactory;
import org.hibernate.validator.HibernateValidator;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.internal.engine.ValidatorImpl;
import org.junit.BeforeClass;
import org.junit.Test;
public class SimpleTest2 {
private static Validator validator;
private static ValidatorImpl ValidatorImpl;
@BeforeClass
public static void setUp() {
ValidatorFactory factory = Validation.buildDefaultValidatorFactory();
validator = factory.getValidator();
}
@Test
public void testBuildDefaultValidatorFactory() {
ValidatorFactory factory = Validation.buildDefaultValidatorFactory();
Validator validator = factory.getValidator();
assertNotNull(validator);
}
String ss;
@Length(min = 2, max = 6)
public String getSs() {
return ss;
}
public void setSs(String ss) {
this.ss = ss;
}
@Test
public void testString()
{
// MethodValidator methodValidator = Validation.byProvider( HibernateValidator.class )
// .configure()
// .buildValidatorFactory()
// .getValidator()
// .unwrap( MethodValidator.class );
}
@Test
public void test(@Length(min = 2, max = 6) String ss)
{
}
}