Author: norman
Date: Fri Aug 28 00:34:14 2009
New Revision: 808690

URL: http://svn.apache.org/viewvc?rev=808690&view=rev
Log:
Simple test for noop

Added:
    labs/hupa/src/test/java/org/apache/hupa/server/handler/NoopHandlerTest.java

Added: 
labs/hupa/src/test/java/org/apache/hupa/server/handler/NoopHandlerTest.java
URL: 
http://svn.apache.org/viewvc/labs/hupa/src/test/java/org/apache/hupa/server/handler/NoopHandlerTest.java?rev=808690&view=auto
==============================================================================
--- labs/hupa/src/test/java/org/apache/hupa/server/handler/NoopHandlerTest.java 
(added)
+++ labs/hupa/src/test/java/org/apache/hupa/server/handler/NoopHandlerTest.java 
Fri Aug 28 00:34:14 2009
@@ -0,0 +1,47 @@
+/****************************************************************
+ * 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.server.handler;
+
+import net.customware.gwt.dispatch.shared.ActionException;
+
+import org.apache.hupa.server.mock.MockLog;
+import org.apache.hupa.shared.data.User;
+import org.apache.hupa.shared.rpc.Noop;
+import org.apache.hupa.shared.rpc.NoopResult;
+
+public class NoopHandlerTest extends AbstractHandlerTest{
+
+       public void testNoop() {
+               NoopHandler handler = new NoopHandler(storeCache,new 
MockLog(),sessionProvider);
+               User user = createUser();
+               Noop action = new Noop(user.getSessionId());
+               storeCache.addValidUser(user.getName(), user.getPassword());
+               session.setAttribute("user", user);
+               try {
+                       NoopResult result = handler.execute(action, null);
+                       assertNotNull(result);
+               } catch (ActionException e) {
+                       e.printStackTrace();
+                       fail();
+
+               }
+               
+       }
+}



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

Reply via email to