Project

General

Profile

« Previous | Next » 

Revision 6038

Added by Matt Jones about 13 years ago

Remove hardcoded LDAP usernames from testing so that MetaCatServletNetTest will work even using alternate
LDAP servers.

View differences:

MetaCatServletNetTest.java
148 148
	 */
149 149
	public void testNCEASLogin() {
150 150
	    System.out.println("Testing nceas login");
151
		debug("\nRunning: testNCEASLogin test");
152
		String user = "uid=john,o=NCEAS,dc=ecoinformatics,dc=org";
153
		String passwd = "123456";
154
		assertTrue(logIn(user, passwd));
155
		//assertTrue( withProtocol.getProtocol().equals("http"));
151
	    debug("\nRunning: testNCEASLogin test");
152
        try {
153
            String user = PropertyService.getProperty("test.mcUser");
154
            String passwd = PropertyService.getProperty("test.mcPassword");
155
            assertTrue(logIn(user, passwd));
156
            //assertTrue( withProtocol.getProtocol().equals("http"));
157
        } catch (PropertyNotFoundException e) {
158
            fail(e.getMessage());
159
        }
160
	   
156 161
	}
157 162

  
158 163
	/**
159 164
	 * Test the login to nceas failed
160 165
	 */
161
	public void testNCEASLoginFail() {
162
		debug("\nRunning: testNCEASLoginFail test");
163
		System.out.println("Testing nceas login fail");
164
		String user = "uid=john,o=NCEAS,dc=ecoinformatics,dc=org";
165
		String passwd = "12345678";
166
		assertTrue(!logIn(user, passwd));
166
    public void testNCEASLoginFail() {
167
        debug("\nRunning: testNCEASLoginFail test");
168
        try {
169
            String user = PropertyService.getProperty("test.mcUser");
170
            System.out.println("Testing nceas login fail");
171
            String passwd = "thisPasswordIsInvalidAndShouldFail";
172
            assertTrue(!logIn(user, passwd));
167 173

  
168
	}
174
        } catch (PropertyNotFoundException e) {
175
            fail(e.getMessage());
176
        }
177
    }
169 178

  
170 179
	/**
171 180
	 * Test the login to lter failed
172 181
	 */
173 182
	public void testLterReferralLoginFail() {
174 183
		debug("\nRunning: testLterReferralLoginFail test");
175
		String user = "uid=jtao,o=LTER,dc=ecoinformatics,dc=org";
176
		String passwd = "qVyGpveb";
177
		assertTrue(!logIn(user, passwd));
178
		//assertTrue( withProtocol.getProtocol().equals("http"));
184
        try {
185
            String user = PropertyService.getProperty("test.lterUser");
186
            String passwd = "thisPasswordIsInvalidAndShouldFail";
187
            assertTrue(!logIn(user, passwd));
188
            //assertTrue( withProtocol.getProtocol().equals("http"));
189
        } catch (PropertyNotFoundException e) {
190
            fail(e.getMessage());
191
        }
179 192
	}
180 193

  
181 194
	/**

Also available in: Unified diff