Revision 8507
Added by Jing Tao almost 11 years ago
test/edu/ucsb/nceas/MCTestCase.java | ||
---|---|---|
74 | 74 |
protected static String EML2_1_0 = "EML2_1_0"; |
75 | 75 |
protected static String EML2_1_1 = "EML2_1_1"; |
76 | 76 |
protected static final String AUTHFILECLASSNAME = "edu.ucsb.nceas.metacat.authentication.AuthFile"; |
77 |
private static final String KNBUSERGOURP = "cn=knb-usr,o=NCEAS,dc=ecoinformatics,dc=org"; |
|
77 | 78 |
|
78 | 79 |
|
79 | 80 |
protected boolean SUCCESS = true; |
... | ... | |
125 | 126 |
referralpassword = PropertyService.getProperty("test.referralPassword"); |
126 | 127 |
String authenClass = PropertyService.getProperty("auth.class"); |
127 | 128 |
if(authenClass != null && authenClass.equals(AUTHFILECLASSNAME)) { |
129 |
|
|
128 | 130 |
//add those test users to the authentication file |
129 | 131 |
AuthFile authFile = new AuthFile(); |
132 |
try { |
|
133 |
String description = null; |
|
134 |
authFile.addGroup(KNBUSERGOURP, description); |
|
135 |
} catch (Exception e) { |
|
136 |
System.out.println("Couldn't add the group "+KNBUSERGOURP+" to the password file since "+e.getMessage()); |
|
137 |
} |
|
130 | 138 |
String[] groups = null; |
131 | 139 |
try { |
132 | 140 |
authFile.addUser(username, groups, password, null, null, null, null, null); |
... | ... | |
135 | 143 |
} |
136 | 144 |
|
137 | 145 |
try { |
138 |
authFile.addUser(anotheruser, groups, anotherpassword, null, null, null, null, null); |
|
146 |
String[] anotherGroup = {KNBUSERGOURP}; |
|
147 |
authFile.addUser(anotheruser, anotherGroup, anotherpassword, null, null, null, null, null); |
|
139 | 148 |
} catch (Exception e) { |
140 | 149 |
System.out.println("Couldn't add the user "+anotheruser+" to the password file since "+e.getMessage()); |
141 | 150 |
} |
Also available in: Unified diff
Add a group for the testing.