d15f0cb66d6a1aeb95edc68864a7835bb99cbd6a
[nemo.git] / nemo-tools / sandbox / src / test / java / org / opendaylight / nemo / tool / sandbox / northbound / SandboxNorthboundTest.java
1 /*
2  * Copyright (c) 2016 Huawei, Inc. and others. All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8 package org.opendaylight.nemo.tool.sandbox.northbound;
9
10 import junit.framework.TestCase;
11 import org.junit.Assert;
12 import org.junit.Before;
13 import org.junit.Test;
14
15 import static org.junit.Assert.*;
16 import org.codehaus.enunciate.jaxrs.ResponseCode;
17 import org.codehaus.enunciate.jaxrs.StatusCodes;
18 import org.codehaus.enunciate.jaxrs.TypeHint;
19 import org.junit.runner.RunWith;
20 import org.opendaylight.nemo.tool.sandbox.SandBoxManager;
21
22 import javax.ws.rs.*;
23 import javax.ws.rs.core.Context;
24 import javax.ws.rs.core.MediaType;
25 import javax.ws.rs.core.UriInfo;
26 import java.util.ArrayList;
27 import java.util.List;
28 import org.powermock.api.mockito.PowerMockito;
29 import org.powermock.api.support.membermodification.MemberMatcher;
30 import org.powermock.api.support.membermodification.MemberModifier;
31 import org.powermock.core.classloader.annotations.PrepareForTest;
32 import org.powermock.modules.junit4.PowerMockRunner;
33 import static org.mockito.Mockito.*;
34 /**
35  * Created by zhangmeng on 2016/1/14.
36  */
37
38 public class SandboxNorthboundTest extends TestCase {
39     private SandboxNorthbound sandboxNorthbound;
40     @Before
41     public void setUp() throws Exception {
42         sandboxNorthbound = new SandboxNorthbound();
43     }
44
45     @Test
46     public void testCreate() throws Exception {
47         ExecuteRequest executeRequest = new ExecuteRequest();
48         Assert.assertTrue(sandboxNorthbound.create(null,"test") != null);
49         Assert.assertTrue(sandboxNorthbound.create(null,executeRequest) != null);
50     }
51
52     @Test
53     public void testDestroy() throws Exception {
54         Assert.assertTrue(sandboxNorthbound.destroy(null) != null);
55     }
56
57     @Test
58     public void testGetXml() throws Exception {
59         Assert.assertTrue(sandboxNorthbound.getXml() != null);
60     }
61
62     @Test
63     public void testGetHosts() throws Exception {
64         Assert.assertTrue(sandboxNorthbound.getHosts() == null);
65     }
66
67     @Test
68     public void testGetSwitches() throws Exception {
69         Assert.assertTrue(sandboxNorthbound.getSwitches() != null);
70     }
71
72     @Test
73     public void testGetLinks() throws Exception {
74         Assert.assertTrue(sandboxNorthbound.getLinks() != null);
75     }
76
77     @Test
78     public void testGetExternals() throws Exception {
79         Assert.assertTrue(sandboxNorthbound.getExternals() == null);
80     }
81 }