View Javadoc

1   /**
2    * Copyright 2010 The Kuali Foundation Licensed under the
3    * Educational Community License, Version 2.0 (the "License"); you may
4    * not use this file except in compliance with the License. You may
5    * obtain a copy of the License at
6    *
7    * http://www.osedu.org/licenses/ECL-2.0
8    *
9    * Unless required by applicable law or agreed to in writing,
10   * software distributed under the License is distributed on an "AS IS"
11   * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
12   * or implied. See the License for the specific language governing
13   * permissions and limitations under the License.
14   */
15  
16  package org.kuali.student.core.web;
17  
18  import static org.junit.Assert.assertTrue;
19  
20  import java.io.IOException;
21  import java.net.MalformedURLException;
22  
23  import org.junit.Test;
24  
25  import com.gargoylesoftware.htmlunit.FailingHttpStatusCodeException;
26  
27  public class TestLogIn {
28  	
29  	Page page;
30  	
31  	@Test
32  	public void loadPage() throws FailingHttpStatusCodeException, MalformedURLException, IOException{
33  		page = new Page("http://localhost:8181/ks-core-web/spring_security_login");
34  		assertTrue(page.getPage().getTitleText().equals("Login Page"));
35  	}
36  	
37  	@Test
38  	public void testLogIn() throws FailingHttpStatusCodeException, MalformedURLException, IOException{
39  		Page toLogIn = new Page("http://localhost:8181/ks-core-web/spring_security_login");
40  		toLogIn.logIn("same", "same");
41  		assertTrue(toLogIn.getPage().getTitleText().contains("Kuali Student: Organization"));
42  	}
43  
44  }