blob: 68e7a041ccdfc36b21fa292774d06dda2511153a [file] [log] [blame]
Thomas Vachuska781d18b2014-10-27 10:31:25 -07001/*
2 * Licensed to the Apache Software Foundation (ASF) under one
3 * or more contributor license agreements. See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership. The ASF licenses this file
6 * to you under the Apache License, Version 2.0 (the
7 * "License"); you may not use this file except in compliance
8 * with the License. You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing,
13 * software distributed under the License is distributed on an
14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 * KIND, either express or implied. See the License for the
16 * specific language governing permissions and limitations
17 * under the License.
18 */
tom0eb04ca2014-08-25 14:34:51 -070019package org.onlab.onos.rest;
20
21import com.sun.jersey.api.client.WebResource;
22import com.sun.jersey.test.framework.JerseyTest;
23import org.junit.BeforeClass;
tom202175a2014-09-19 19:00:11 -070024import org.junit.Ignore;
tom0eb04ca2014-08-25 14:34:51 -070025import org.junit.Test;
tom0eb04ca2014-08-25 14:34:51 -070026
27import static org.junit.Assert.assertTrue;
28
29/**
30 * Simple example on how to write a JAX-RS unit test using Jersey test framework.
31 * A base class should/will be created to provide further assistance for testing.
32 */
33public class GreetResourceTest extends JerseyTest {
34
35 public GreetResourceTest() {
36 super("org.onlab.onos.rest");
37 }
38
39 @BeforeClass
40 public static void classSetUp() {
tom202175a2014-09-19 19:00:11 -070041// ServiceDirectory testDirectory =
42// new TestServiceDirectory().add(GreetService.class, new GreetManager());
43// GreetResource.setServiceDirectory(testDirectory);
tom0eb04ca2014-08-25 14:34:51 -070044 }
45
tom202175a2014-09-19 19:00:11 -070046 @Ignore
tom0eb04ca2014-08-25 14:34:51 -070047 @Test
48 public void basics() {
49 WebResource rs = resource();
50 String response = rs.path("greet").get(String.class);
51 assertTrue("incorrect response", response.contains("Whazup "));
52 }
53
54}