Author: norman
Date: Thu Sep  3 18:37:31 2009
New Revision: 811076

URL: http://svn.apache.org/viewvc?rev=811076&view=rev
Log:
Move Util class to other package
Add junit test for Util class

Added:
    labs/hupa/shared/src/main/java/org/apache/hupa/shared/Util.java
      - copied, changed from r809715, 
labs/hupa/shared/src/main/java/org/apache/hupa/shared/data/Util.java
    labs/hupa/shared/src/test/
    labs/hupa/shared/src/test/java/
    labs/hupa/shared/src/test/java/org/
    labs/hupa/shared/src/test/java/org/apache/
    labs/hupa/shared/src/test/java/org/apache/hupa/
    labs/hupa/shared/src/test/java/org/apache/hupa/shared/
    labs/hupa/shared/src/test/java/org/apache/hupa/shared/UtilTest.java
Removed:
    labs/hupa/shared/src/main/java/org/apache/hupa/shared/data/Util.java
Modified:
    
labs/hupa/client/src/main/java/org/apache/hupa/client/mvp/IMAPMessagePresenter.java
    
labs/hupa/client/src/main/java/org/apache/hupa/client/mvp/MessageSendPresenter.java
    labs/hupa/shared/pom.xml

Modified: 
labs/hupa/client/src/main/java/org/apache/hupa/client/mvp/IMAPMessagePresenter.java
URL: 
http://svn.apache.org/viewvc/labs/hupa/client/src/main/java/org/apache/hupa/client/mvp/IMAPMessagePresenter.java?rev=811076&r1=811075&r2=811076&view=diff
==============================================================================
--- 
labs/hupa/client/src/main/java/org/apache/hupa/client/mvp/IMAPMessagePresenter.java
 (original)
+++ 
labs/hupa/client/src/main/java/org/apache/hupa/client/mvp/IMAPMessagePresenter.java
 Thu Sep  3 18:37:31 2009
@@ -30,11 +30,11 @@
 import net.customware.gwt.presenter.client.widget.WidgetPresenter;
 
 import org.apache.hupa.client.MyAsyncCallback;
+import org.apache.hupa.shared.Util;
 import org.apache.hupa.shared.data.IMAPFolder;
 import org.apache.hupa.shared.data.IMAPMessage;
 import org.apache.hupa.shared.data.MessageAttachment;
 import org.apache.hupa.shared.data.User;
-import org.apache.hupa.shared.data.Util;
 import org.apache.hupa.shared.events.BackEvent;
 import org.apache.hupa.shared.events.ForwardMessageEvent;
 import org.apache.hupa.shared.events.LoadMessagesEvent;

Modified: 
labs/hupa/client/src/main/java/org/apache/hupa/client/mvp/MessageSendPresenter.java
URL: 
http://svn.apache.org/viewvc/labs/hupa/client/src/main/java/org/apache/hupa/client/mvp/MessageSendPresenter.java?rev=811076&r1=811075&r2=811076&view=diff
==============================================================================
--- 
labs/hupa/client/src/main/java/org/apache/hupa/client/mvp/MessageSendPresenter.java
 (original)
+++ 
labs/hupa/client/src/main/java/org/apache/hupa/client/mvp/MessageSendPresenter.java
 Thu Sep  3 18:37:31 2009
@@ -31,6 +31,7 @@
 import org.apache.hupa.client.MyAsyncCallback;
 import org.apache.hupa.client.validation.EmailListValidator;
 import org.apache.hupa.client.validation.NotEmptyValidator;
+import org.apache.hupa.shared.Util;
 import org.apache.hupa.shared.data.IMAPFolder;
 import org.apache.hupa.shared.data.IMAPMessage;
 import org.apache.hupa.shared.data.Message;
@@ -38,7 +39,6 @@
 import org.apache.hupa.shared.data.MessageContent;
 import org.apache.hupa.shared.data.MessageHeader;
 import org.apache.hupa.shared.data.User;
-import org.apache.hupa.shared.data.Util;
 import org.apache.hupa.shared.events.BackEvent;
 import org.apache.hupa.shared.events.FolderSelectionEvent;
 import org.apache.hupa.shared.events.FolderSelectionEventHandler;

Modified: labs/hupa/shared/pom.xml
URL: 
http://svn.apache.org/viewvc/labs/hupa/shared/pom.xml?rev=811076&r1=811075&r2=811076&view=diff
==============================================================================
--- labs/hupa/shared/pom.xml (original)
+++ labs/hupa/shared/pom.xml Thu Sep  3 18:37:31 2009
@@ -38,5 +38,10 @@
                        <groupId>net.customware.gwt.dispatch</groupId>
                        <artifactId>gwt-dispatch</artifactId>
                </dependency>
+               <dependency>
+                       <groupId>junit</groupId>
+                       <artifactId>junit</artifactId>
+                       <scope>test</scope>
+               </dependency>
        </dependencies>
 </project>
\ No newline at end of file

Copied: labs/hupa/shared/src/main/java/org/apache/hupa/shared/Util.java (from 
r809715, labs/hupa/shared/src/main/java/org/apache/hupa/shared/data/Util.java)
URL: 
http://svn.apache.org/viewvc/labs/hupa/shared/src/main/java/org/apache/hupa/shared/Util.java?p2=labs/hupa/shared/src/main/java/org/apache/hupa/shared/Util.java&p1=labs/hupa/shared/src/main/java/org/apache/hupa/shared/data/Util.java&r1=809715&r2=811076&rev=811076&view=diff
==============================================================================
--- labs/hupa/shared/src/main/java/org/apache/hupa/shared/data/Util.java 
(original)
+++ labs/hupa/shared/src/main/java/org/apache/hupa/shared/Util.java Thu Sep  3 
18:37:31 2009
@@ -17,7 +17,7 @@
  * under the License.                                           *
  ****************************************************************/
 
-package org.apache.hupa.shared.data;
+package org.apache.hupa.shared;
 
 import java.util.ArrayList;
 

Added: labs/hupa/shared/src/test/java/org/apache/hupa/shared/UtilTest.java
URL: 
http://svn.apache.org/viewvc/labs/hupa/shared/src/test/java/org/apache/hupa/shared/UtilTest.java?rev=811076&view=auto
==============================================================================
--- labs/hupa/shared/src/test/java/org/apache/hupa/shared/UtilTest.java (added)
+++ labs/hupa/shared/src/test/java/org/apache/hupa/shared/UtilTest.java Thu Sep 
 3 18:37:31 2009
@@ -0,0 +1,35 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+
+package org.apache.hupa.shared;
+
+import junit.framework.TestCase;
+
+public class UtilTest extends TestCase{
+       private String html = 
"&lt&ltblah&gt&ltwhatever&gt&gt&ltblub&gt<br>lala&lt";
+       private String text = "<<blah><whatever>><blub>\nlala<";
+       
+       public void testText2HTML() {
+               assertEquals(Util.toHtml(text),html);
+       }
+       
+       public void testHTML2Text() {
+               assertEquals(Util.toString(html),text);
+       }
+}



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to