Author: solomax
Date: Fri Oct 30 01:31:28 2015
New Revision: 1711398

URL: http://svn.apache.org/viewvc?rev=1711398&view=rev
Log:
[OPENMEETINGS-1118] first unit test is added

Added:
    
openmeetings/trunk/singlewebapp/openmeetings-web/src/test/java/org/apache/openmeetings/test/webservice/
    
openmeetings/trunk/singlewebapp/openmeetings-web/src/test/java/org/apache/openmeetings/test/webservice/UserServiceTest.java
Modified:
    openmeetings/trunk/singlewebapp/openmeetings-web/pom.xml

Modified: openmeetings/trunk/singlewebapp/openmeetings-web/pom.xml
URL: 
http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/openmeetings-web/pom.xml?rev=1711398&r1=1711397&r2=1711398&view=diff
==============================================================================
--- openmeetings/trunk/singlewebapp/openmeetings-web/pom.xml (original)
+++ openmeetings/trunk/singlewebapp/openmeetings-web/pom.xml Fri Oct 30 
01:31:28 2015
@@ -660,6 +660,12 @@
                        <scope>test</scope>
                </dependency>
                <dependency>
+                       <groupId>org.apache.cxf</groupId>
+                       <artifactId>cxf-rt-rs-client</artifactId>
+                       <version>${cxf.version}</version>
+                       <scope>test</scope>
+               </dependency>
+               <dependency>
                        <groupId>org.apache.tomcat.embed</groupId>
                        <artifactId>tomcat-embed-websocket</artifactId>
                        <version>8.0.26</version>

Added: 
openmeetings/trunk/singlewebapp/openmeetings-web/src/test/java/org/apache/openmeetings/test/webservice/UserServiceTest.java
URL: 
http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/openmeetings-web/src/test/java/org/apache/openmeetings/test/webservice/UserServiceTest.java?rev=1711398&view=auto
==============================================================================
--- 
openmeetings/trunk/singlewebapp/openmeetings-web/src/test/java/org/apache/openmeetings/test/webservice/UserServiceTest.java
 (added)
+++ 
openmeetings/trunk/singlewebapp/openmeetings-web/src/test/java/org/apache/openmeetings/test/webservice/UserServiceTest.java
 Fri Oct 30 01:31:28 2015
@@ -0,0 +1,41 @@
+/*
+ * 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.openmeetings.test.webservice;
+
+import static org.junit.Assert.assertNotNull;
+
+import org.apache.cxf.jaxrs.client.WebClient;
+import org.apache.openmeetings.db.dto.basic.ServiceResult;
+import org.apache.openmeetings.test.AbstractJUnitDefaults;
+import org.junit.Test;
+
+public class UserServiceTest extends AbstractJUnitDefaults {
+       public final static String BASE_SERVICES_URL = 
"http://localhost:5080/openmeetings/services";;
+       public final static String USER_SERVICE_URL = BASE_SERVICES_URL + 
"/user";
+       
+       protected static WebClient getClient(String url) {
+               return 
WebClient.create(url).accept("application/json").type("application/json");
+       }
+       
+       @Test
+       public void loginTest() {
+               ServiceResult r = 
getClient(USER_SERVICE_URL).path("/login").query("user", 
username).query("pass", userpass).get(ServiceResult.class);
+               assertNotNull(r);
+       }
+}


Reply via email to