lipog-commit Mailing List for Little Portal Gizmo (Page 4)
Status: Beta
Brought to you by:
jbu
You can subscribe to this list here.
2009 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(94) |
Jun
(14) |
Jul
(168) |
Aug
(39) |
Sep
|
Oct
|
Nov
|
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(6) |
Dec
|
From: Joerg B. <jb...@us...> - 2009-07-26 15:28:48
|
Update of /cvsroot/lipog/net.heilancoo.portal.documentation/doc In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv4983/doc Modified Files: change-log.html Log Message: PortalTest class Index: change-log.html =================================================================== RCS file: /cvsroot/lipog/net.heilancoo.portal.documentation/doc/change-log.html,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** change-log.html 25 Jul 2009 06:26:24 -0000 1.28 --- change-log.html 26 Jul 2009 15:28:38 -0000 1.29 *************** *** 11,14 **** --- 11,16 ---- <h2>Release 4 (upcoming)</h2> <ul> + <li>Methods like PortalTest.getSessionForPage(HtmlPage) that allows finding + session, application and controller objects in automated tests.</li> <li>Integrated HtmlUnit for automated web application testing. See net.heilancoo.portal.examples.test for an example for an application test fragment.</li> |
From: Joerg B. <jb...@us...> - 2009-07-26 15:27:49
|
Update of /cvsroot/lipog/net.heilancoo.portal.examples.test/src/net/heilancoo/portal/examples/redirect/test In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv4669/src/net/heilancoo/portal/examples/redirect/test Modified Files: WebTests.java Log Message: access to application, session and controller objects (mainly intended for automated application tests) Index: WebTests.java =================================================================== RCS file: /cvsroot/lipog/net.heilancoo.portal.examples.test/src/net/heilancoo/portal/examples/redirect/test/WebTests.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** WebTests.java 25 Jul 2009 06:19:17 -0000 1.1 --- WebTests.java 26 Jul 2009 15:27:39 -0000 1.2 *************** *** 17,21 **** import java.net.MalformedURLException; ! import net.heilancoo.portal.testutils.TestUtilsPlugin; import org.junit.BeforeClass; --- 17,24 ---- import java.net.MalformedURLException; ! import net.heilancoo.portal.application.ApplicationException; ! import net.heilancoo.portal.examples.redirect.ToDoSession; ! import net.heilancoo.portal.session.SessionException; ! import net.heilancoo.portal.testutils.PortalTest; import org.junit.BeforeClass; *************** *** 32,40 **** @BeforeClass public static void setUpBeforeClass() throws Exception { ! TestUtilsPlugin.getDefault().startPortal(500); } @Test ! public void loginAndAddAnItem() throws FailingHttpStatusCodeException, MalformedURLException, IOException { WebClient cl = new WebClient(); HtmlPage pg = cl.getPage("http://127.0.0.1:8080/todo"); --- 35,45 ---- @BeforeClass public static void setUpBeforeClass() throws Exception { ! PortalTest.startPortal(500); } @Test ! public void loginAndAddItemLogout() throws FailingHttpStatusCodeException, MalformedURLException, IOException, SessionException, ApplicationException { ! // =========================================================== ! // Log into the web application. This is client side activity. WebClient cl = new WebClient(); HtmlPage pg = cl.getPage("http://127.0.0.1:8080/todo"); *************** *** 42,49 **** HtmlForm login = pg.getFormByName("input"); ! login.getInputByName("user").setTextContent("joerg"); ! login.getInputByName("password").setTextContent("joerg"); HtmlPage loggedIn = login.getInputByName("button").click(); HtmlPage addPage = loggedIn.getFormByName("addForm").getInputByName("add").click(); HtmlForm addForm = addPage.getFormByName("addForm"); --- 47,63 ---- HtmlForm login = pg.getFormByName("input"); ! login.getInputByName("user").setValueAttribute("joerg"); ! login.getInputByName("password").setValueAttribute("joerg"); HtmlPage loggedIn = login.getInputByName("button").click(); + + // ========================================================== + // Now peep directly into the server side of the application: + ToDoSession s = (ToDoSession) PortalTest.getSessionForPage(loggedIn); + assertEquals("joerg", s.getUser().getName()); + assertEquals("joerg", s.getUser().getPasswd()); + + // ===================================================== + // Back on the client side. Continue with some activity. HtmlPage addPage = loggedIn.getFormByName("addForm").getInputByName("add").click(); HtmlForm addForm = addPage.getFormByName("addForm"); *************** *** 54,60 **** assertEquals("make a cup of tea", txt.getValueAttribute()); list = editPage.getFormByName("editForm").getInputByName("cancel").click(); ! HtmlPage logout = list.getHtmlElementById("logout").click(); assertEquals("Logout", logout.getTitleText()); } } --- 68,99 ---- assertEquals("make a cup of tea", txt.getValueAttribute()); list = editPage.getFormByName("editForm").getInputByName("cancel").click(); ! HtmlPage logout = list.getAnchorByHref("logout").click(); assertEquals("Logout", logout.getTitleText()); } + @Test(expected=SessionException.class) + public void loginLogoutGetSession() throws FailingHttpStatusCodeException, MalformedURLException, IOException, SessionException, ApplicationException { + WebClient cl = new WebClient(); + HtmlPage pg = cl.getPage("http://127.0.0.1:8080/todo"); + assertEquals("Login", pg.getTitleText()); + + HtmlForm login = pg.getFormByName("input"); + login.getInputByName("user").setValueAttribute("joerg"); + login.getInputByName("password").setValueAttribute("joerg"); + + HtmlPage loggedIn = login.getInputByName("button").click(); + + ToDoSession s = (ToDoSession) PortalTest.getSessionForPage(loggedIn); + assertEquals("joerg", s.getUser().getName()); + assertEquals("joerg", s.getUser().getPasswd()); + + HtmlPage logout = loggedIn.getAnchorByHref("logout").click(); + assertEquals("Logout", logout.getTitleText()); + + // =========================================================== + // We have logged out and the session is gone from the server. + // Trying to access it now will result in a SessionException + PortalTest.getSessionForPage(loggedIn); + } + } |
From: Joerg B. <jb...@us...> - 2009-07-26 15:27:45
|
Update of /cvsroot/lipog/net.heilancoo.portal.testutils/src/net/heilancoo/portal/testutils In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv4660/src/net/heilancoo/portal/testutils Added Files: PortalTest.java PageUtils.java Log Message: access to application, session and controller objects (mainly intended for automated application tests) --- NEW FILE: PageUtils.java --- /* * Copyright (c) 2009 Heilan' Coo -- Joerg Bullmann * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which is available at http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Joerg Bullmann <jb...@he...> */ package net.heilancoo.portal.testutils; import com.gargoylesoftware.htmlunit.html.HtmlPage; /** * @author joerg * */ public class PageUtils { private static String [] getUriPathComponents(HtmlPage page) { return page.getWebResponse().getRequestUrl().getPath().substring(1).split("/"); } public static String getApplicationName(HtmlPage page) { return getUriPathComponents(page)[0]; } public static String getSessionKey(HtmlPage page) { return getUriPathComponents(page)[1]; } public static String getControllerKey(HtmlPage page) { String [] comps = getUriPathComponents(page); if(comps.length == 4) return comps[3]; else return null; } } --- NEW FILE: PortalTest.java --- /* * Copyright (c) 2009 Heilan' Coo -- Joerg Bullmann * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which is available at http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Joerg Bullmann <jb...@he...> */ package net.heilancoo.portal.testutils; import net.heilancoo.portal.PortalPlugin; import net.heilancoo.portal.application.Application; import net.heilancoo.portal.application.ApplicationException; import net.heilancoo.portal.controller.Controller; import net.heilancoo.portal.session.Session; import net.heilancoo.portal.session.SessionException; import com.gargoylesoftware.htmlunit.html.HtmlPage; /** * @author joerg * */ public class PortalTest { public static void startPortal(int waitAfterStart) { TestUtilsPlugin.getDefault().startPortal(waitAfterStart); } public static Application getApplicationForPage(HtmlPage page) throws ApplicationException { String name = PageUtils.getApplicationName(page); return PortalPlugin.getDefault().getApplication(name); } public static Session getSessionForPage(HtmlPage page) throws SessionException, ApplicationException { String name = PageUtils.getApplicationName(page); String key = PageUtils.getSessionKey(page); return PortalPlugin.getDefault().getSession(name, key); } public static Controller getControllerForPage(HtmlPage page) throws SessionException, ApplicationException { String name = PageUtils.getApplicationName(page); String key = PageUtils.getSessionKey(page); String subKey = PageUtils.getControllerKey(page); return PortalPlugin.getDefault().getController(name, key, subKey); } } |
From: Joerg B. <jb...@us...> - 2009-07-26 15:27:45
|
Update of /cvsroot/lipog/net.heilancoo.portal/src/net/heilancoo/portal/application In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv4607/src/net/heilancoo/portal/application Modified Files: ApplicationInfo.java ApplicationRequestHandler.java Added Files: ApplicationException.java Log Message: access to application, session and controller objects (mainly intended for automated application tests) --- NEW FILE: ApplicationException.java --- /* * Copyright (c) 2009 Heilan' Coo -- Joerg Bullmann * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which is available at http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Joerg Bullmann <jb...@he...> */ package net.heilancoo.portal.application; /** * @author joerg * */ public class ApplicationException extends Exception { /** * */ private static final long serialVersionUID = -6149268188984041225L; /** * @param message */ public ApplicationException(String message) { super(message); } /** * @param cause */ public ApplicationException(Throwable cause) { super(cause); } /** * @param message * @param cause */ public ApplicationException(String message, Throwable cause) { super(message, cause); } } Index: ApplicationInfo.java =================================================================== RCS file: /cvsroot/lipog/net.heilancoo.portal/src/net/heilancoo/portal/application/ApplicationInfo.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ApplicationInfo.java 13 Jul 2009 18:22:18 -0000 1.1 --- ApplicationInfo.java 26 Jul 2009 15:27:33 -0000 1.2 *************** *** 15,19 **** --- 15,22 ---- import java.util.Set; + import net.heilancoo.portal.controller.Controller; import net.heilancoo.portal.session.Session; + import net.heilancoo.portal.session.SessionCompound; + import net.heilancoo.portal.session.SessionException; /** *************** *** 51,64 **** */ public Set<String> getSessionKeys() { return handler.getSessionKeys(); } /** ! * The returned session keys is bound to be changed by other threads and * access to it must be synchronised. * @return the session for the given key or null if the key is not in use. */ ! public Session getSessionFor(String key) { ! return handler.getSessionFor(key).getSession(); } } --- 54,93 ---- */ public Set<String> getSessionKeys() { + // TODO synchronisation on this session key set is still a bit broken + // because the ApplicationRequestHandler.getSessionKeys() (and others + // session map related methods) synchronise on the session map itself + // and not on the session map's key set. How this is resolved best I + // don't quite know yet. return handler.getSessionKeys(); } /** ! * The returned session is bound to be changed by other threads and * access to it must be synchronised. * @return the session for the given key or null if the key is not in use. + * @throws SessionException */ ! public Session getSessionFor(String key) throws SessionException { ! SessionCompound c = handler.getSessionFor(key); ! ! if(c == null) ! throw new SessionException("No session for key '" + key + "'."); ! ! return c.getSession(); ! } ! ! /** ! * The returned session is bound to be changed by other threads and ! * access to it must be synchronised. ! * @return the controller for the given key/subKey or null if none is found. ! * @throws SessionException ! */ ! public Controller getControllerFor(String key, String subKey) throws SessionException { ! SessionCompound c = handler.getSessionFor(key); ! ! if(c == null) ! throw new SessionException("No session for key '" + key + "'."); ! ! return c.getController(subKey); } } Index: ApplicationRequestHandler.java =================================================================== RCS file: /cvsroot/lipog/net.heilancoo.portal/src/net/heilancoo/portal/application/ApplicationRequestHandler.java,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** ApplicationRequestHandler.java 24 Jul 2009 06:58:41 -0000 1.30 --- ApplicationRequestHandler.java 26 Jul 2009 15:27:33 -0000 1.31 *************** *** 519,522 **** --- 519,526 ---- response.setStatusCode(HttpStatus.SC_MOVED_PERMANENTLY); } + + public Application getApplication() { + return application; + } } |
From: Joerg B. <jb...@us...> - 2009-07-26 15:27:45
|
Update of /cvsroot/lipog/net.heilancoo.portal/src/net/heilancoo/portal/session In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv4607/src/net/heilancoo/portal/session Added Files: SessionException.java Log Message: access to application, session and controller objects (mainly intended for automated application tests) --- NEW FILE: SessionException.java --- /* * Copyright (c) 2009 Heilan' Coo -- Joerg Bullmann * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which is available at http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Joerg Bullmann <jb...@he...> */ package net.heilancoo.portal.session; /** * @author joerg * */ public class SessionException extends Exception { /** * */ private static final long serialVersionUID = -501676769545330038L; /** * @param message */ public SessionException(String message) { super(message); } /** * @param cause */ public SessionException(Throwable cause) { super(cause); } /** * @param message * @param cause */ public SessionException(String message, Throwable cause) { super(message, cause); } } |
From: Joerg B. <jb...@us...> - 2009-07-26 15:27:44
|
Update of /cvsroot/lipog/net.heilancoo.portal/src/net/heilancoo/portal In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv4607/src/net/heilancoo/portal Modified Files: PortalPlugin.java Log Message: access to application, session and controller objects (mainly intended for automated application tests) Index: PortalPlugin.java =================================================================== RCS file: /cvsroot/lipog/net.heilancoo.portal/src/net/heilancoo/portal/PortalPlugin.java,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** PortalPlugin.java 25 Jul 2009 06:16:18 -0000 1.23 --- PortalPlugin.java 26 Jul 2009 15:27:33 -0000 1.24 *************** *** 25,29 **** --- 25,31 ---- import net.heilancoo.portal.application.Application; + import net.heilancoo.portal.application.ApplicationException; import net.heilancoo.portal.application.ApplicationRequestHandler; + import net.heilancoo.portal.controller.Controller; import net.heilancoo.portal.htmlforms.FormReadingRequest; import net.heilancoo.portal.requests.FileRequestHandler; *************** *** 32,35 **** --- 34,39 ---- import net.heilancoo.portal.responders.Responder; import net.heilancoo.portal.responders.ResponderFactory; + import net.heilancoo.portal.session.Session; + import net.heilancoo.portal.session.SessionException; import net.heilancoo.utils.Utils; *************** *** 351,354 **** --- 355,385 ---- } + public Application getApplication(String name) throws ApplicationException { + ApplicationRequestHandler h = webAppMap.get(name); + + if(h == null) + throw new ApplicationException("No application with URI prefix '" + name + "'"); + + return h.getApplication(); + } + + public Session getSession(String name, String key) throws SessionException, ApplicationException { + ApplicationRequestHandler h = webAppMap.get(name); + + if(h == null) + throw new ApplicationException("No application with URI prefix '" + name + "'"); + + return h.getApplicationInfo().getSessionFor(key); + } + + public Controller getController(String name, String key, String subKey) throws SessionException, ApplicationException { + ApplicationRequestHandler h = webAppMap.get(name); + + if(h == null) + throw new ApplicationException("No application with URI prefix '" + name + "'"); + + return h.getApplicationInfo().getControllerFor(key, subKey); + } + /** * Returns the shared instance |
From: Joerg B. <jb...@us...> - 2009-07-26 15:19:50
|
Update of /cvsroot/lipog/net.heilancoo.portal.examples/src/net/heilancoo/portal/examples/multicontrollers In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv3266/src/net/heilancoo/portal/examples/multicontrollers Modified Files: TheApplication.java Log Message: cleaned away "TODO auto-generated" Index: TheApplication.java =================================================================== RCS file: /cvsroot/lipog/net.heilancoo.portal.examples/src/net/heilancoo/portal/examples/multicontrollers/TheApplication.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TheApplication.java 13 Jul 2009 18:22:06 -0000 1.2 --- TheApplication.java 26 Jul 2009 15:19:36 -0000 1.3 *************** *** 30,34 **** */ public TheApplication() { - // TODO Auto-generated constructor stub } --- 30,33 ---- *************** *** 48,52 **** @Override public void initialise(ApplicationInfo info) { - // TODO Auto-generated method stub } --- 47,50 ---- |
From: Joerg B. <jb...@us...> - 2009-07-26 15:19:44
|
Update of /cvsroot/lipog/net.heilancoo.portal.examples/src/net/heilancoo/portal/examples/redirect In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv3266/src/net/heilancoo/portal/examples/redirect Modified Files: ToDoApplication.java Log Message: cleaned away "TODO auto-generated" Index: ToDoApplication.java =================================================================== RCS file: /cvsroot/lipog/net.heilancoo.portal.examples/src/net/heilancoo/portal/examples/redirect/ToDoApplication.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ToDoApplication.java 24 Jul 2009 06:40:36 -0000 1.1 --- ToDoApplication.java 26 Jul 2009 15:19:36 -0000 1.2 *************** *** 49,53 **** @Override public String getVersion() { - // TODO Auto-generated method stub return "1.0-alpha"; } --- 49,52 ---- *************** *** 58,63 **** @Override public void initialise(ApplicationInfo info) { - // TODO Auto-generated method stub - } --- 57,60 ---- |
From: Joerg B. <jb...@us...> - 2009-07-26 15:19:44
|
Update of /cvsroot/lipog/net.heilancoo.portal.examples/src/net/heilancoo/portal/examples/customentrypoint In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv3266/src/net/heilancoo/portal/examples/customentrypoint Modified Files: CustomEntryPointApplication.java Log Message: cleaned away "TODO auto-generated" Index: CustomEntryPointApplication.java =================================================================== RCS file: /cvsroot/lipog/net.heilancoo.portal.examples/src/net/heilancoo/portal/examples/customentrypoint/CustomEntryPointApplication.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** CustomEntryPointApplication.java 13 Jul 2009 18:22:06 -0000 1.2 --- CustomEntryPointApplication.java 26 Jul 2009 15:19:36 -0000 1.3 *************** *** 45,49 **** @Override public String getVersion() { - // TODO Auto-generated method stub return null; } --- 45,48 ---- |
From: Joerg B. <jb...@us...> - 2009-07-26 15:19:43
|
Update of /cvsroot/lipog/net.heilancoo.portal.examples/src/net/heilancoo/portal/examples/json In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv3266/src/net/heilancoo/portal/examples/json Modified Files: JsonApplication.java Log Message: cleaned away "TODO auto-generated" Index: JsonApplication.java =================================================================== RCS file: /cvsroot/lipog/net.heilancoo.portal.examples/src/net/heilancoo/portal/examples/json/JsonApplication.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** JsonApplication.java 13 Jul 2009 18:22:05 -0000 1.3 --- JsonApplication.java 26 Jul 2009 15:19:36 -0000 1.4 *************** *** 33,37 **** @Override public String getVersion() { - // TODO Auto-generated method stub return null; } --- 33,36 ---- *************** *** 42,47 **** @Override public void initialise(ApplicationInfo info) { - // TODO Auto-generated method stub - } --- 41,44 ---- |
From: Joerg B. <jb...@us...> - 2009-07-26 15:18:59
|
Update of /cvsroot/lipog/net.heilancoo.portal.json/src/net/heilancoo/portal/json In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv3138/src/net/heilancoo/portal/json Modified Files: JsonPlugin.java Log Message: cleaned away "TODO auto-generated" Index: JsonPlugin.java =================================================================== RCS file: /cvsroot/lipog/net.heilancoo.portal.json/src/net/heilancoo/portal/json/JsonPlugin.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** JsonPlugin.java 10 Apr 2009 15:08:37 -0000 1.2 --- JsonPlugin.java 26 Jul 2009 15:18:47 -0000 1.3 *************** *** 24,28 **** */ public JsonPlugin() { - // TODO Auto-generated constructor stub } --- 24,27 ---- |
From: Joerg B. <jb...@us...> - 2009-07-26 15:18:44
|
Update of /cvsroot/lipog/net.heilancoo.portal.test/src/net/heilancoo/portal/webapps/test In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv3066/src/net/heilancoo/portal/webapps/test Modified Files: TestWebApp6.java TestWebApp4.java TestWebApp.java TestWebAppProps.java TestWebApp7.java TestWebApp8.java TestWebApp5.java TestWebApp2.java TestWebApp3.java TestWebApp9.java Log Message: cleaned away "TODO auto-generated" Index: TestWebApp8.java =================================================================== RCS file: /cvsroot/lipog/net.heilancoo.portal.test/src/net/heilancoo/portal/webapps/test/TestWebApp8.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** TestWebApp8.java 13 Jul 2009 18:22:15 -0000 1.4 --- TestWebApp8.java 26 Jul 2009 15:18:32 -0000 1.5 *************** *** 31,35 **** @Override public String getVersion() { - // TODO Auto-generated method stub return null; } --- 31,34 ---- *************** *** 41,46 **** @Override public void initialise(ApplicationInfo info) { - // TODO Auto-generated method stub - } --- 40,43 ---- *************** *** 52,56 **** public Session validateCredentialsAndMakeNewSession( FormFieldContainer fields) { - // TODO Auto-generated method stub return null; } --- 49,52 ---- Index: TestWebApp2.java =================================================================== RCS file: /cvsroot/lipog/net.heilancoo.portal.test/src/net/heilancoo/portal/webapps/test/TestWebApp2.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** TestWebApp2.java 13 Jul 2009 18:22:15 -0000 1.7 --- TestWebApp2.java 26 Jul 2009 15:18:32 -0000 1.8 *************** *** 31,35 **** @Override public String getVersion() { - // TODO Auto-generated method stub return null; } --- 31,34 ---- *************** *** 41,45 **** @Override public void initialise(ApplicationInfo info) { - // TODO Auto-generated method stub } --- 40,43 ---- *************** *** 51,55 **** public Session validateCredentialsAndMakeNewSession( FormFieldContainer fields) { - // TODO Auto-generated method stub return null; } --- 49,52 ---- Index: TestWebApp4.java =================================================================== RCS file: /cvsroot/lipog/net.heilancoo.portal.test/src/net/heilancoo/portal/webapps/test/TestWebApp4.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** TestWebApp4.java 13 Jul 2009 18:22:15 -0000 1.7 --- TestWebApp4.java 26 Jul 2009 15:18:32 -0000 1.8 *************** *** 31,35 **** @Override public String getVersion() { - // TODO Auto-generated method stub return null; } --- 31,34 ---- *************** *** 41,45 **** @Override public void initialise(ApplicationInfo info) { - // TODO Auto-generated method stub } --- 40,43 ---- *************** *** 51,55 **** public Session validateCredentialsAndMakeNewSession( FormFieldContainer fields) { - // TODO Auto-generated method stub return null; } --- 49,52 ---- Index: TestWebApp5.java =================================================================== RCS file: /cvsroot/lipog/net.heilancoo.portal.test/src/net/heilancoo/portal/webapps/test/TestWebApp5.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** TestWebApp5.java 13 Jul 2009 18:22:15 -0000 1.7 --- TestWebApp5.java 26 Jul 2009 15:18:32 -0000 1.8 *************** *** 31,35 **** @Override public String getVersion() { - // TODO Auto-generated method stub return null; } --- 31,34 ---- *************** *** 41,45 **** @Override public void initialise(ApplicationInfo info) { - // TODO Auto-generated method stub } --- 40,43 ---- *************** *** 51,55 **** public Session validateCredentialsAndMakeNewSession( FormFieldContainer fields) { - // TODO Auto-generated method stub return null; } --- 49,52 ---- Index: TestWebApp.java =================================================================== RCS file: /cvsroot/lipog/net.heilancoo.portal.test/src/net/heilancoo/portal/webapps/test/TestWebApp.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** TestWebApp.java 13 Jul 2009 18:22:15 -0000 1.9 --- TestWebApp.java 26 Jul 2009 15:18:32 -0000 1.10 *************** *** 29,33 **** @Override public String getVersion() { - // TODO Auto-generated method stub return null; } --- 29,32 ---- *************** *** 39,44 **** @Override public void initialise(ApplicationInfo info) { - // TODO Auto-generated method stub - } --- 38,41 ---- *************** *** 50,54 **** public Session validateCredentialsAndMakeNewSession( FormFieldContainer fields) { - // TODO Auto-generated method stub return null; } --- 47,50 ---- Index: TestWebApp6.java =================================================================== RCS file: /cvsroot/lipog/net.heilancoo.portal.test/src/net/heilancoo/portal/webapps/test/TestWebApp6.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** TestWebApp6.java 13 Jul 2009 18:22:15 -0000 1.7 --- TestWebApp6.java 26 Jul 2009 15:18:32 -0000 1.8 *************** *** 31,35 **** @Override public String getVersion() { - // TODO Auto-generated method stub return null; } --- 31,34 ---- *************** *** 41,46 **** @Override public void initialise(ApplicationInfo info) { - // TODO Auto-generated method stub - } --- 40,43 ---- *************** *** 52,56 **** public Session validateCredentialsAndMakeNewSession( FormFieldContainer fields) { - // TODO Auto-generated method stub return null; } --- 49,52 ---- Index: TestWebApp7.java =================================================================== RCS file: /cvsroot/lipog/net.heilancoo.portal.test/src/net/heilancoo/portal/webapps/test/TestWebApp7.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** TestWebApp7.java 13 Jul 2009 18:22:15 -0000 1.7 --- TestWebApp7.java 26 Jul 2009 15:18:32 -0000 1.8 *************** *** 31,35 **** @Override public String getVersion() { - // TODO Auto-generated method stub return null; } --- 31,34 ---- *************** *** 41,46 **** @Override public void initialise(ApplicationInfo info) { - // TODO Auto-generated method stub - } --- 40,43 ---- *************** *** 52,56 **** public Session validateCredentialsAndMakeNewSession( FormFieldContainer fields) { - // TODO Auto-generated method stub return null; } --- 49,52 ---- Index: TestWebApp9.java =================================================================== RCS file: /cvsroot/lipog/net.heilancoo.portal.test/src/net/heilancoo/portal/webapps/test/TestWebApp9.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TestWebApp9.java 13 Jul 2009 18:22:15 -0000 1.2 --- TestWebApp9.java 26 Jul 2009 15:18:32 -0000 1.3 *************** *** 34,38 **** @Override public String getVersion() { - // TODO Auto-generated method stub return null; } --- 34,37 ---- *************** *** 44,49 **** @Override public void initialise(ApplicationInfo info) { - // TODO Auto-generated method stub - } --- 43,46 ---- *************** *** 55,59 **** public Session validateCredentialsAndMakeNewSession( FormFieldContainer fields) { - // TODO Auto-generated method stub return null; } --- 52,55 ---- Index: TestWebApp3.java =================================================================== RCS file: /cvsroot/lipog/net.heilancoo.portal.test/src/net/heilancoo/portal/webapps/test/TestWebApp3.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** TestWebApp3.java 13 Jul 2009 18:22:15 -0000 1.7 --- TestWebApp3.java 26 Jul 2009 15:18:32 -0000 1.8 *************** *** 31,35 **** @Override public String getVersion() { - // TODO Auto-generated method stub return null; } --- 31,34 ---- *************** *** 41,45 **** @Override public void initialise(ApplicationInfo info) { - // TODO Auto-generated method stub } --- 40,43 ---- *************** *** 51,55 **** public Session validateCredentialsAndMakeNewSession( FormFieldContainer fields) { - // TODO Auto-generated method stub return null; } --- 49,52 ---- Index: TestWebAppProps.java =================================================================== RCS file: /cvsroot/lipog/net.heilancoo.portal.test/src/net/heilancoo/portal/webapps/test/TestWebAppProps.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TestWebAppProps.java 13 Jul 2009 18:22:15 -0000 1.2 --- TestWebAppProps.java 26 Jul 2009 15:18:32 -0000 1.3 *************** *** 33,37 **** @Override public String getVersion() { - // TODO Auto-generated method stub return null; } --- 33,36 ---- *************** *** 57,61 **** public Session validateCredentialsAndMakeNewSession( FormFieldContainer fields) { - // TODO Auto-generated method stub return null; } --- 56,59 ---- |
From: Joerg B. <jb...@us...> - 2009-07-26 15:17:20
|
Update of /cvsroot/lipog/net.heilancoo.bingo/src/net/heilancoo/bingo In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv2936/src/net/heilancoo/bingo Modified Files: BingoApplication.java Log Message: cleaned away "TODO auto-generated" Index: BingoApplication.java =================================================================== RCS file: /cvsroot/lipog/net.heilancoo.bingo/src/net/heilancoo/bingo/BingoApplication.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** BingoApplication.java 13 Jul 2009 18:22:12 -0000 1.5 --- BingoApplication.java 26 Jul 2009 15:17:04 -0000 1.6 *************** *** 30,34 **** */ public BingoApplication() { - // TODO Auto-generated constructor stub } --- 30,33 ---- *************** *** 48,52 **** @Override public void initialise(ApplicationInfo info) { - // TODO Auto-generated method stub } --- 47,50 ---- |
From: Joerg B. <jb...@us...> - 2009-07-25 06:26:37
|
Update of /cvsroot/lipog/net.heilancoo.portal.documentation/doc In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv11633/doc Modified Files: change-log.html getting-ready.html index.html Log Message: HtmlUnit integration Index: index.html =================================================================== RCS file: /cvsroot/lipog/net.heilancoo.portal.documentation/doc/index.html,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** index.html 13 Jul 2009 18:37:16 -0000 1.18 --- index.html 25 Jul 2009 06:26:24 -0000 1.19 *************** *** 48,51 **** --- 48,52 ---- <li><a class="ext" href="http://www.freemarker.org/">FreeMarker</a> template engine 2.3.15</li> <li><a class="ext" href="http://www.json.org/">JSON</a> implementation for Java</li> + <li><a class="ext" href="http://htmlunit.sourceforge.net/">HtmlUnit</a> 2.5 for integrated automated testing</li> <li>the Gizmo is currently being developed against <a class="ext" href="http://java.sun.com/javase/">Sun Java SE</a> 1.6.</li> </ul> Index: getting-ready.html =================================================================== RCS file: /cvsroot/lipog/net.heilancoo.portal.documentation/doc/getting-ready.html,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** getting-ready.html 17 May 2009 15:17:13 -0000 1.8 --- getting-ready.html 25 Jul 2009 06:26:24 -0000 1.9 *************** *** 47,50 **** --- 47,55 ---- </tr> <tr> + <td>net.heilancoo.portal.testutils</td> + <td>Utility classes to set up and run automatic unit tests with JUnit/HtmlUnit + for Gizmo based web applications.</td> + </tr> + <tr> <td>net.heilancoo.utils</td> <td>Utility classes not strictly related to the portal related *************** *** 57,69 **** </tr> <tr> - <td>org.dojotoolkit</td> - <td>The Dojo JavaScript library files packaged in an Eclipse - plug-in. This is not necessary on a technical level for the Gizmo to - work. I have used it in a web app I have written in the Gizmo. So I - just include it here. It also gives an example of how non-Java - (static) content can be packaged in an Eclipse plug-in to be used with - (or served from) the Gizmo.</td> - </tr> - <tr> <td>org.freemarker</td> <td>The Freemarker template engine jar file, just packaged up as --- 62,65 ---- *************** *** 76,79 **** --- 72,80 ---- </tr> <tr> + <td>com.gargoylesoftware.htmlunit</td> + <td>The jar files that make up the HtmlUnit binary delivery, + just packaged up as an Eclipse plug-in.</td> + </tr> + <tr> <td>net.heilancoo.portal.documentation</td> <td>The project documentation, including this file here. When *************** *** 88,95 **** --- 89,111 ---- </tr> <tr> + <td>net.heilancoo.portal.examples.test</td> + <td>HtmlUnit examples testing the example web apps in net.heilancoo.portal.examples. + Not needed for development.</td> + </tr> + <tr> <td>net.heilancoo.portal.bingo</td> <td>The bingo web app used as example in the tutorials. Not needed for development.</td> </tr> + <tr> + <td>org.dojotoolkit</td> + <td>The Dojo JavaScript library files packaged in an Eclipse + plug-in. This is not necessary on a technical level for the Gizmo to + work. I have used it in a web app I have written in the Gizmo. So I + just include it here. It also gives an example of how non-Java + (static) content can be packaged in an Eclipse plug-in to be used with + (or served from) the Gizmo. <b>Probably, this will eventually go away here + as it is not really integral element of the Gizmo.</b></td> + </tr> </table> <h2>Checking Out Gizmo Plug-ins From CVS</h2> Index: change-log.html =================================================================== RCS file: /cvsroot/lipog/net.heilancoo.portal.documentation/doc/change-log.html,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** change-log.html 24 Jul 2009 06:40:00 -0000 1.27 --- change-log.html 25 Jul 2009 06:26:24 -0000 1.28 *************** *** 11,14 **** --- 11,16 ---- <h2>Release 4 (upcoming)</h2> <ul> + <li>Integrated HtmlUnit for automated web application testing. See net.heilancoo.portal.examples.test for + an example for an application test fragment.</li> <li>Handle HTTP 302/303 redirects using return values in @Request methods. See the To Do List application example.</li> <li>Application objects have a little bit of an insight now what's going on: existing sessions |
From: Joerg B. <jb...@us...> - 2009-07-25 06:19:26
|
Update of /cvsroot/lipog/net.heilancoo.portal.examples.test/src/net/heilancoo/portal In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv10723/src/net/heilancoo/portal Log Message: Directory /cvsroot/lipog/net.heilancoo.portal.examples.test/src/net/heilancoo/portal added to the repository |
From: Joerg B. <jb...@us...> - 2009-07-25 06:19:26
|
Update of /cvsroot/lipog/net.heilancoo.portal.examples.test/src/net/heilancoo/portal/examples/redirect/test In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv10834/src/net/heilancoo/portal/examples/redirect/test Added Files: WebTests.java Log Message: example HtmlUnit testing of a web app --- NEW FILE: WebTests.java --- /* * Copyright (c) 2009 Heilan' Coo -- Joerg Bullmann * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which is available at http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Joerg Bullmann <jb...@he...> */ package net.heilancoo.portal.examples.redirect.test; import static org.junit.Assert.assertEquals; import java.io.IOException; import java.net.MalformedURLException; import net.heilancoo.portal.testutils.TestUtilsPlugin; import org.junit.BeforeClass; import org.junit.Test; import com.gargoylesoftware.htmlunit.FailingHttpStatusCodeException; import com.gargoylesoftware.htmlunit.WebClient; import com.gargoylesoftware.htmlunit.html.HtmlForm; import com.gargoylesoftware.htmlunit.html.HtmlPage; import com.gargoylesoftware.htmlunit.html.HtmlTextInput; public class WebTests { @BeforeClass public static void setUpBeforeClass() throws Exception { TestUtilsPlugin.getDefault().startPortal(500); } @Test public void loginAndAddAnItem() throws FailingHttpStatusCodeException, MalformedURLException, IOException { WebClient cl = new WebClient(); HtmlPage pg = cl.getPage("http://127.0.0.1:8080/todo"); assertEquals("Login", pg.getTitleText()); HtmlForm login = pg.getFormByName("input"); login.getInputByName("user").setTextContent("joerg"); login.getInputByName("password").setTextContent("joerg"); HtmlPage loggedIn = login.getInputByName("button").click(); HtmlPage addPage = loggedIn.getFormByName("addForm").getInputByName("add").click(); HtmlForm addForm = addPage.getFormByName("addForm"); addForm.getInputByName("text").setValueAttribute("make a cup of tea"); HtmlPage list = addForm.getInputByName("add").click(); HtmlPage editPage = list.getFormByName("delEditForm0").getInputByName("edit").click(); HtmlTextInput txt = editPage.getFormByName("editForm").getInputByName("text"); assertEquals("make a cup of tea", txt.getValueAttribute()); list = editPage.getFormByName("editForm").getInputByName("cancel").click(); HtmlPage logout = list.getHtmlElementById("logout").click(); assertEquals("Logout", logout.getTitleText()); } } |
From: Joerg B. <jb...@us...> - 2009-07-25 06:19:26
|
Update of /cvsroot/lipog/net.heilancoo.portal.examples.test/META-INF In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv10834/META-INF Added Files: MANIFEST.MF Log Message: example HtmlUnit testing of a web app --- NEW FILE: MANIFEST.MF --- Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Test Examples Bundle-SymbolicName: net.heilancoo.portal.examples.test Bundle-Version: 1.0.0.qualifier Bundle-Vendor: Heilan' Coo Fragment-Host: net.heilancoo.portal.examples;bundle-version="1.0.0" Bundle-RequiredExecutionEnvironment: JavaSE-1.6 Require-Bundle: net.heilancoo.portal.testutils;bundle-version="1.0.0" |
From: Joerg B. <jb...@us...> - 2009-07-25 06:19:26
|
Update of /cvsroot/lipog/net.heilancoo.portal.examples.test/.settings In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv10834/.settings Added Files: org.eclipse.jdt.core.prefs Log Message: example HtmlUnit testing of a web app --- NEW FILE: org.eclipse.jdt.core.prefs --- #Fri Jul 24 12:10:38 CEST 2009 eclipse.preferences.version=1 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 org.eclipse.jdt.core.compiler.compliance=1.6 org.eclipse.jdt.core.compiler.problem.assertIdentifier=error org.eclipse.jdt.core.compiler.problem.enumIdentifier=error org.eclipse.jdt.core.compiler.source=1.6 |
From: Joerg B. <jb...@us...> - 2009-07-25 06:19:26
|
Update of /cvsroot/lipog/net.heilancoo.portal.examples.test In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv10834 Added Files: build.properties .classpath .project Log Message: example HtmlUnit testing of a web app --- NEW FILE: .project --- <?xml version="1.0" encoding="UTF-8"?> <projectDescription> <name>net.heilancoo.portal.examples.test</name> <comment></comment> <projects> </projects> <buildSpec> <buildCommand> <name>org.eclipse.jdt.core.javabuilder</name> <arguments> </arguments> </buildCommand> <buildCommand> <name>org.eclipse.pde.ManifestBuilder</name> <arguments> </arguments> </buildCommand> <buildCommand> <name>org.eclipse.pde.SchemaBuilder</name> <arguments> </arguments> </buildCommand> </buildSpec> <natures> <nature>org.eclipse.pde.PluginNature</nature> <nature>org.eclipse.jdt.core.javanature</nature> </natures> </projectDescription> --- NEW FILE: build.properties --- source.. = src/ output.. = bin/ bin.includes = META-INF/,\ . --- NEW FILE: .classpath --- <?xml version="1.0" encoding="UTF-8"?> <classpath> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/> <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> <classpathentry kind="src" path="src"/> <classpathentry kind="output" path="bin"/> </classpath> |
From: Joerg B. <jb...@us...> - 2009-07-25 06:19:25
|
Update of /cvsroot/lipog/net.heilancoo.portal.examples.test/src/net/heilancoo/portal/examples/redirect/test In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv10723/src/net/heilancoo/portal/examples/redirect/test Log Message: Directory /cvsroot/lipog/net.heilancoo.portal.examples.test/src/net/heilancoo/portal/examples/redirect/test added to the repository |
From: Joerg B. <jb...@us...> - 2009-07-25 06:19:24
|
Update of /cvsroot/lipog/net.heilancoo.portal.examples.test/src/net/heilancoo/portal/examples In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv10723/src/net/heilancoo/portal/examples Log Message: Directory /cvsroot/lipog/net.heilancoo.portal.examples.test/src/net/heilancoo/portal/examples added to the repository |
From: Joerg B. <jb...@us...> - 2009-07-25 06:19:24
|
Update of /cvsroot/lipog/net.heilancoo.portal.examples.test/META-INF In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv10723/META-INF Log Message: Directory /cvsroot/lipog/net.heilancoo.portal.examples.test/META-INF added to the repository |
From: Joerg B. <jb...@us...> - 2009-07-25 06:19:23
|
Update of /cvsroot/lipog/net.heilancoo.portal.examples.test/src/net/heilancoo/portal/examples/redirect In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv10723/src/net/heilancoo/portal/examples/redirect Log Message: Directory /cvsroot/lipog/net.heilancoo.portal.examples.test/src/net/heilancoo/portal/examples/redirect added to the repository |
From: Joerg B. <jb...@us...> - 2009-07-25 06:19:23
|
Update of /cvsroot/lipog/net.heilancoo.portal.examples.test/.settings In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv10723/.settings Log Message: Directory /cvsroot/lipog/net.heilancoo.portal.examples.test/.settings added to the repository |
From: Joerg B. <jb...@us...> - 2009-07-25 06:19:22
|
Update of /cvsroot/lipog/net.heilancoo.portal.examples.test/src/net/heilancoo In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv10723/src/net/heilancoo Log Message: Directory /cvsroot/lipog/net.heilancoo.portal.examples.test/src/net/heilancoo added to the repository |