Author: husted Date: Wed Apr 5 16:50:33 2006 New Revision: 391850 URL: http://svn.apache.org/viewcvs?rev=391850&view=rev Log: (empty)
Added: struts/sandbox/trunk/mailreader-course/action2/lab-1-2-src/lab-1-2-src.iml struts/sandbox/trunk/mailreader-course/action2/lab-1-2-src/src/test/RetainTest.java (with props) struts/sandbox/trunk/mailreader-course/action2/lab-1-2-src/src/webapp/pages/Missing.jsp (with props) struts/sandbox/trunk/mailreader-course/action2/lab-1-2-src/src/webapp/pages/Welcome.jsp (with props) Removed: struts/sandbox/trunk/mailreader-course/action2/lab-1-2-src/lab-1-1-src.iml Added: struts/sandbox/trunk/mailreader-course/action2/lab-1-2-src/lab-1-2-src.iml URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/mailreader-course/action2/lab-1-2-src/lab-1-2-src.iml?rev=391850&view=auto ============================================================================== --- struts/sandbox/trunk/mailreader-course/action2/lab-1-2-src/lab-1-2-src.iml (added) +++ struts/sandbox/trunk/mailreader-course/action2/lab-1-2-src/lab-1-2-src.iml Wed Apr 5 16:50:33 2006 @@ -0,0 +1,262 @@ +<?xml version="1.0" encoding="UTF-8"?> +<module version="4" relativePaths="true" type="J2EE_WEB_MODULE" j2ee-integration="Tomcat Server"> + <component name="ModuleRootManager" /> + <component name="NewModuleRootManager"> + <output url="file://C:/opt/Apache/Tomcat-5.0/webapps/lab-1-2-src/WEB-INF/classes" /> + <exclude-output /> + <exploded url="file://C:/opt/Apache/Tomcat-5.0/webapps/lab-1-2-src" /> + <exclude-exploded /> + <content url="file://$MODULE_DIR$"> + <sourceFolder url="file://$MODULE_DIR$/src/java" isTestSource="false" /> + <sourceFolder url="file://$MODULE_DIR$/src/test" isTestSource="true" /> + </content> + <orderEntry type="inheritedJdk" /> + <orderEntry type="sourceFolder" forTests="false" /> + <orderEntry type="library" name="Tomcat" level="application_server_libraries" /> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/../../lib/oscore.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/../../lib/commons-collections-3.1.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/../../lib/struts-mailreader-dao-1.3.0-dev.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/../../lib/webwork-2.2.2.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/../../lib/spring-core.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/../../lib/ognl.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/../../lib/spring-context.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/../../lib/commons-logging-1.0.4.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/../../lib/freemarker.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/../../lib/struts-taglib-1.3.0.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/../../lib/rife-continuations.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/../../lib/commons-digester-1.6.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/../../lib/spring-beans.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/../../lib/spring-web.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/../../lib/xwork-1.1.2.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$APPLICATION_HOME_DIR$/lib/junit.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntryProperties /> + </component> + <component name="WebModuleBuildComponent"> + <setting name="EXPLODED_URL" value="file://C:/opt/Apache/Tomcat-5.0/webapps/lab-1-2-src" /> + <setting name="EXPLODED_ENABLED" value="true" /> + <setting name="JAR_URL" value="file://" /> + <setting name="JAR_ENABLED" value="false" /> + <setting name="SYNC_EXPLODED_DIR" value="true" /> + <setting name="BUILD_ON_FRAME_DEACTIVATION" value="false" /> + <setting name="RUN_JASPER_VALIDATION" value="false" /> + </component> + <component name="WebModuleProperties"> + <containerElement type="library" level="module"> + <attribute name="method" value="1" /> + <attribute name="URI" value="/WEB-INF/lib/junit.jar" /> + <url>jar://$APPLICATION_HOME_DIR$/lib/junit.jar!/</url> + </containerElement> + <containerElement type="library" level="module"> + <attribute name="method" value="1" /> + <attribute name="URI" value="/WEB-INF/lib/commons-collections-3.1.jar" /> + <url>jar://$MODULE_DIR$/../../lib/commons-collections-3.1.jar!/</url> + </containerElement> + <containerElement type="library" level="module"> + <attribute name="method" value="1" /> + <attribute name="URI" value="/WEB-INF/lib/commons-digester-1.6.jar" /> + <url>jar://$MODULE_DIR$/../../lib/commons-digester-1.6.jar!/</url> + </containerElement> + <containerElement type="library" level="module"> + <attribute name="method" value="1" /> + <attribute name="URI" value="/WEB-INF/lib/commons-logging-1.0.4.jar" /> + <url>jar://$MODULE_DIR$/../../lib/commons-logging-1.0.4.jar!/</url> + </containerElement> + <containerElement type="library" level="module"> + <attribute name="method" value="1" /> + <attribute name="URI" value="/WEB-INF/lib/freemarker.jar" /> + <url>jar://$MODULE_DIR$/../../lib/freemarker.jar!/</url> + </containerElement> + <containerElement type="library" level="module"> + <attribute name="method" value="1" /> + <attribute name="URI" value="/WEB-INF/lib/ognl.jar" /> + <url>jar://$MODULE_DIR$/../../lib/ognl.jar!/</url> + </containerElement> + <containerElement type="library" level="module"> + <attribute name="method" value="1" /> + <attribute name="URI" value="/WEB-INF/lib/oscore.jar" /> + <url>jar://$MODULE_DIR$/../../lib/oscore.jar!/</url> + </containerElement> + <containerElement type="library" level="module"> + <attribute name="method" value="1" /> + <attribute name="URI" value="/WEB-INF/lib/rife-continuations.jar" /> + <url>jar://$MODULE_DIR$/../../lib/rife-continuations.jar!/</url> + </containerElement> + <containerElement type="library" level="module"> + <attribute name="method" value="1" /> + <attribute name="URI" value="/WEB-INF/lib/spring-beans.jar" /> + <url>jar://$MODULE_DIR$/../../lib/spring-beans.jar!/</url> + </containerElement> + <containerElement type="library" level="module"> + <attribute name="method" value="1" /> + <attribute name="URI" value="/WEB-INF/lib/spring-context.jar" /> + <url>jar://$MODULE_DIR$/../../lib/spring-context.jar!/</url> + </containerElement> + <containerElement type="library" level="module"> + <attribute name="method" value="1" /> + <attribute name="URI" value="/WEB-INF/lib/spring-core.jar" /> + <url>jar://$MODULE_DIR$/../../lib/spring-core.jar!/</url> + </containerElement> + <containerElement type="library" level="module"> + <attribute name="method" value="1" /> + <attribute name="URI" value="/WEB-INF/lib/spring-web.jar" /> + <url>jar://$MODULE_DIR$/../../lib/spring-web.jar!/</url> + </containerElement> + <containerElement type="library" level="module"> + <attribute name="method" value="1" /> + <attribute name="URI" value="/WEB-INF/lib/struts-mailreader-dao-1.3.0-dev.jar" /> + <url>jar://$MODULE_DIR$/../../lib/struts-mailreader-dao-1.3.0-dev.jar!/</url> + </containerElement> + <containerElement type="library" level="module"> + <attribute name="method" value="1" /> + <attribute name="URI" value="/WEB-INF/lib/struts-taglib-1.3.0.jar" /> + <url>jar://$MODULE_DIR$/../../lib/struts-taglib-1.3.0.jar!/</url> + </containerElement> + <containerElement type="library" level="module"> + <attribute name="method" value="1" /> + <attribute name="URI" value="/WEB-INF/lib/webwork-2.2.2.jar" /> + <url>jar://$MODULE_DIR$/../../lib/webwork-2.2.2.jar!/</url> + </containerElement> + <containerElement type="library" level="module"> + <attribute name="method" value="1" /> + <attribute name="URI" value="/WEB-INF/lib/xwork-1.1.2.jar" /> + <url>jar://$MODULE_DIR$/../../lib/xwork-1.1.2.jar!/</url> + </containerElement> + <deploymentDescriptor name="web.xml" url="file://$MODULE_DIR$/src/webapp/WEB-INF/web.xml" optional="false" version="2.3" /> + <deploymentDescriptor name="context.xml" url="file://$MODULE_DIR$/META-INF/context.xml" optional="false" version="5.x" /> + <webroots> + <root url="file://$MODULE_DIR$/src/webapp" relative="/" /> + </webroots> + </component> + <component name="WeblogicWebModuleProperties"> + <option name="IS_RUN_APPC" value="false" /> + </component> +</module> + Added: struts/sandbox/trunk/mailreader-course/action2/lab-1-2-src/src/test/RetainTest.java URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/mailreader-course/action2/lab-1-2-src/src/test/RetainTest.java?rev=391850&view=auto ============================================================================== --- struts/sandbox/trunk/mailreader-course/action2/lab-1-2-src/src/test/RetainTest.java (added) +++ struts/sandbox/trunk/mailreader-course/action2/lab-1-2-src/src/test/RetainTest.java Wed Apr 5 16:50:33 2006 @@ -0,0 +1,97 @@ +import junit.framework.TestCase; +import org.apache.struts.apps.mailreader.dao.User; +import org.apache.struts.apps.mailreader.dao.UserDatabase; +import org.apache.struts.apps.mailreader.dao.Subscription; +import org.apache.struts.apps.mailreader.dao.impl.memory.MemoryUserDatabase; + +public class RetainTest extends TestCase { + + protected UserDatabase database; + protected String testName = "test-database.xml"; + + public void setUp() throws Exception { + super.setUp(); + MemoryUserDatabase memoryUserDatabase = new MemoryUserDatabase(); + memoryUserDatabase.setPathname(testName); + database = memoryUserDatabase; + } + + public void testDatabaseClean() throws Exception { + User user = database.findUser("user"); + assertNull("Expected user to be created",user); + } + + // Add your test methods here. + // The setUp method will run between each test. + + public void testCreateUser() throws Exception { + User user = database.createUser("user"); + assertNotNull(user); + } + + public void testFindUser() throws Exception { + User user1 = database.createUser("user"); + User user2 = database.findUser("user"); + assertSame("Expected users to match",user1,user2); + } + + public void testCreateSubscription() throws Exception { + Subscription sub = database.createUser("user").createSubscription("mail.yahoo.com"); + assertNotNull("Expected subscription to be created", sub); + } + + public void testFindSubscription() throws Exception { + Subscription sub1 = database.createUser("user").createSubscription("mail.yahoo.com"); + Subscription sub2 = database.findUser("user").findSubscription("mail.yahoo.com"); + assertSame("Expected Subscriptions to match",sub1,sub2); + } + + public void testDatabsaeSave() throws Exception { + + User user = database.createUser("user"); + user.setPassword("pass"); + user.setFullName("John Q. User"); + user.setFromAddress("[EMAIL PROTECTED]"); + + Subscription sub1 = user.createSubscription("mail.hotmail.com"); + sub1.setUsername("user1234"); + sub1.setAutoConnect(false); + sub1.setType("pop3"); + sub1.setPassword("bar"); + + Subscription sub2 = user.createSubscription("mail.yahoo.com"); + sub2.setUsername("jquser"); + sub2.setAutoConnect(false); + sub2.setType("imap"); + sub2.setPassword("foo"); + + database.save(); + + } + + // Extra credit + + public void testFinderUserBogus() throws Exception { + User user1 = database.findUser("bogus"); + assertNull("Expected bogus user to be not found",user1); + User user2 = database.createUser("user"); + assertNotNull("Expected user to be created", user2); + user1 = database.findUser("bogus"); + assertNull("Expected bogus user to be not found",user1); + user1 = database.findUser("user"); + assertNotNull("Expected user to be found",user1); + } + + public void testFindSubBogus() throws Exception { + User user =database.createUser("user"); + Subscription sub = user.findSubscription("mail.bogus.com"); + assertNull(sub); + sub = database.findUser("user").createSubscription("mail.hotmail.com"); + assertNotNull(sub); + Subscription sub2 = user.findSubscription("mail.bogus.com"); + assertNull(sub2); + Subscription sub3 =user.findSubscription("mail.hotmail.com"); + assertSame(sub,sub3); + } + +} \ No newline at end of file Propchange: struts/sandbox/trunk/mailreader-course/action2/lab-1-2-src/src/test/RetainTest.java ------------------------------------------------------------------------------ svn:eol-style = native Added: struts/sandbox/trunk/mailreader-course/action2/lab-1-2-src/src/webapp/pages/Missing.jsp URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/mailreader-course/action2/lab-1-2-src/src/webapp/pages/Missing.jsp?rev=391850&view=auto ============================================================================== --- struts/sandbox/trunk/mailreader-course/action2/lab-1-2-src/src/webapp/pages/Missing.jsp (added) +++ struts/sandbox/trunk/mailreader-course/action2/lab-1-2-src/src/webapp/pages/Missing.jsp Wed Apr 5 16:50:33 2006 @@ -0,0 +1,10 @@ +<html> +<head><title>Missing Feature</title></head> + +<body> +<p> + This feature is under construction. + Please try again in the next interation. +</p> +</body> +</html> Propchange: struts/sandbox/trunk/mailreader-course/action2/lab-1-2-src/src/webapp/pages/Missing.jsp ------------------------------------------------------------------------------ svn:eol-style = native Added: struts/sandbox/trunk/mailreader-course/action2/lab-1-2-src/src/webapp/pages/Welcome.jsp URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/mailreader-course/action2/lab-1-2-src/src/webapp/pages/Welcome.jsp?rev=391850&view=auto ============================================================================== --- struts/sandbox/trunk/mailreader-course/action2/lab-1-2-src/src/webapp/pages/Welcome.jsp (added) +++ struts/sandbox/trunk/mailreader-course/action2/lab-1-2-src/src/webapp/pages/Welcome.jsp Wed Apr 5 16:50:33 2006 @@ -0,0 +1,24 @@ +<%@ taglib uri="/webwork" prefix="ww" %> +<html> +<head> + <title>MailReader Application</title> +</head> + +<body> +<h3>MailReader Options</h3> + +<ul> + <li><a href="<ww:url action="Missing"/>">Register with the MailReader</a></li> + <li><a href="<ww:url action="Missing"/>">Log on to the MailReader</a></li> +</ul> + +<h3>Language Options</h3> +<ul> + <li><a href="<ww:url action="Missing"/>">English</a></li> + <li><a href="<ww:url action="Missing"/>">Japanese</a></li> + <li><a href="<ww:url action="Missing"/>">Russian</a></li> +</ul> + +</body> +</html> + Propchange: struts/sandbox/trunk/mailreader-course/action2/lab-1-2-src/src/webapp/pages/Welcome.jsp ------------------------------------------------------------------------------ svn:eol-style = native --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]