2 * Copyright (c) 2016 Huawei, Inc. and others. All rights reserved.
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
8 package org.opendaylight.nemo.tool.sandbox.northbound;
10 import junit.framework.TestCase;
11 import org.junit.Assert;
12 import org.junit.Before;
13 import org.junit.Test;
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;
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.*;
35 * Created by zhangmeng on 2016/1/14.
38 public class SandboxNorthboundTest extends TestCase {
39 private SandboxNorthbound sandboxNorthbound;
41 public void setUp() throws Exception {
42 sandboxNorthbound = new SandboxNorthbound();
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);
53 public void testDestroy() throws Exception {
54 Assert.assertTrue(sandboxNorthbound.destroy(null) != null);
58 public void testGetXml() throws Exception {
59 Assert.assertTrue(sandboxNorthbound.getXml() != null);
63 public void testGetHosts() throws Exception {
64 Assert.assertTrue(sandboxNorthbound.getHosts() == null);
68 public void testGetSwitches() throws Exception {
69 Assert.assertTrue(sandboxNorthbound.getSwitches() != null);
73 public void testGetLinks() throws Exception {
74 Assert.assertTrue(sandboxNorthbound.getLinks() != null);
78 public void testGetExternals() throws Exception {
79 Assert.assertTrue(sandboxNorthbound.getExternals() == null);