<groupId>junit</groupId>
<artifactId>junit</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-all</artifactId>
+ <scope>test</scope>
+ </dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
--- /dev/null
+/*
+ * Copyright (c) 2015 Huawei, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.nemo.intent;
+
+import junit.framework.TestCase;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+import org.opendaylight.nemo.intent.ConnectionMapper;
+import org.opendaylight.nemo.intent.NodeMapper;
+import org.opendaylight.controller.md.sal.binding.api.DataBroker;
+import static org.junit.Assert.*;
+import static org.mockito.Mockito.*;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.generic.virtual.network.rev151010.virtual.networks.VirtualNetwork;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.generic.virtual.network.rev151010.virtual.networks.virtual.network.virtual.links.VirtualLink;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.generic.virtual.network.rev151010.virtual.networks.virtual.network.virtual.links.VirtualLinkBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.generic.virtual.network.rev151010.virtual.networks.virtual.network.virtual.nodes.VirtualNode;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.generic.virtual.network.rev151010.virtual.node.instance.VirtualPort;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.generic.virtual.network.rev151010.virtual.node.instance.VirtualPortBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.intent.mapping.result.rev151010.intent.vn.mapping.results.UserIntentVnMapping;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.intent.mapping.result.rev151010.intent.vn.mapping.results.user.intent.vn.mapping.IntentVnMappingResult;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.intent.mapping.result.rev151010.intent.vn.mapping.results.user.intent.vn.mapping.IntentVnMappingResultBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.intent.mapping.result.rev151010.intent.vn.mapping.results.user.intent.vn.mapping.intent.vn.mapping.result.VirtualResource;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.intent.mapping.result.rev151010.intent.vn.mapping.results.user.intent.vn.mapping.intent.vn.mapping.result.VirtualResourceBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.common.rev151010.*;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.engine.common.rev151010.*;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.intent.rev151010.user.intent.objects.Connection;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.intent.rev151010.user.intent.objects.Node;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.intent.rev151010.users.User;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.object.rev151010.connection.instance.Property;
+/**
+ * Created by zhangmeng on 2015/11/9.
+ */
+public class ConnectionMapperTest extends ConnectionMapper{
+ public ConnectionMapperTest(){
+ super(mock(DataBroker.class),mock(NodeMapper.class));
+ }
+ public User user;
+ public Connection connection;
+ public VirtualNetwork virtualNetwork;
+ public UserIntentVnMapping userIntentVnMapping;
+ String flag;
+ @Before
+ public void setUp() throws Exception {
+ user = mock(User.class);
+ connection = mock(Connection.class);
+ virtualNetwork = mock(VirtualNetwork.class);
+ userIntentVnMapping = mock(UserIntentVnMapping.class);
+ flag = new String();
+ }
+
+ @Test
+ public void testResolveConnection() throws Exception {
+ ConnectionType connectionType = connection.getConnectionType();
+ Assert.assertNotEquals(mock(ConnectionType.class),connectionType);
+ //this.resolveConnection(user,connection,virtualNetwork,userIntentVnMapping);
+ Assert.assertNotNull(this);
+ }
+}
\ No newline at end of file
--- /dev/null
+/*
+ * Copyright (c) 2015 Huawei, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.nemo.intent;
+
+import org.junit.Before;
+import org.junit.Assert;
+import org.junit.Test;
+import org.opendaylight.nemo.intent.FlowManager;
+import static org.mockito.Mockito.*;
+import static org.junit.Assert.*;
+import org.opendaylight.controller.md.sal.binding.api.DataBroker;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.common.rev151010.UserId;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.intent.rev151010.user.intent.objects.Flow;
+/**
+ * Created by zhangmeng on 2015/11/9.
+ */
+public class FlowManagerTest extends FlowManager {
+ public FlowManagerTest(){
+ super(mock(DataBroker.class));
+ }
+ private UserId userId ;
+ private Flow flow;
+ @Before
+ public void setUp() throws Exception {
+ userId = mock(UserId.class);
+ flow = mock(Flow.class);
+ }
+
+ @Test
+ public void testResolveFlow() throws Exception {
+ this.resolveFlow(userId,flow);
+ Assert.assertNotNull(this);
+ }
+}
\ No newline at end of file
--- /dev/null
+/*
+ * Copyright (c) 2015 Huawei, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.nemo.intent;
+
+import junit.framework.TestCase;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+import org.opendaylight.nemo.intent.IntentResolutionException;
+
+import static org.junit.Assert.*;
+
+/**
+ * Created by zhangmeng on 2015/11/10.
+ */
+public class IntentResolutionExceptionTest{
+ private IntentResolutionException intentResolutionException1;
+ private IntentResolutionException intentResolutionException2;
+ private IntentResolutionException intentResolutionException3;
+ private IntentResolutionException intentResolutionException4;
+ private IntentResolutionException intentResolutionException5;
+
+ private String message;
+ private Throwable cause;
+ private boolean enableSuppression;
+ private boolean writableStackTrace;
+ @Before
+ public void setUp() throws Exception {
+ message = new String();
+ cause = new Throwable();
+ enableSuppression = true;
+ writableStackTrace = true;
+ }
+
+ @Test
+ public void Construction()throws Exception{
+ Assert.assertNull(intentResolutionException1);
+ Assert.assertNull(intentResolutionException2);
+ Assert.assertNull(intentResolutionException3);
+ Assert.assertNull(intentResolutionException4);
+ Assert.assertNull(intentResolutionException5);
+
+ intentResolutionException1 = new IntentResolutionException();
+ intentResolutionException2 = new IntentResolutionException(message);
+ intentResolutionException3 = new IntentResolutionException(cause);
+ intentResolutionException4 = new IntentResolutionException(message,cause);
+ intentResolutionException5 = new IntentResolutionException(message,cause,enableSuppression,writableStackTrace);
+
+ Assert.assertNotNull(intentResolutionException1);
+ Assert.assertNotNull(intentResolutionException2);
+ Assert.assertNotNull(intentResolutionException3);
+ Assert.assertNotNull(intentResolutionException4);
+ Assert.assertNotNull(intentResolutionException5);
+ }
+
+}
\ No newline at end of file
--- /dev/null
+/*
+ * Copyright (c) 2015 Huawei, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.nemo.intent;
+
+import junit.framework.TestCase;
+import org.junit.Before;
+import org.junit.Assert;
+import org.junit.Test;
+import org.opendaylight.nemo.intent.*;
+import org.opendaylight.nemo.intent.computation.PNComputationUnit;
+import org.opendaylight.nemo.intent.computation.VNComputationUnit;
+import org.opendaylight.nemo.intent.computation.VNMappingUnit;
+import org.opendaylight.controller.md.sal.binding.api.DataBroker;
+import java.util.Map;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.common.rev151010.UserId;
+
+import static org.junit.Assert.*;
+import static org.mockito.Mockito.*;
+
+/**
+ * Created by zhangmeng on 2015/11/10.
+ */
+public class IntentResolverTest extends TestCase {
+ private DataBroker dataBroker;
+ private NodeMapper nodeMapper;
+ private ConnectionMapper connectionMapper;
+ private FlowManager flowManager;
+ private OperationResolver operationResolver;
+ private PNComputationUnit pnComputationUnit;
+ private Map<UserId, VNComputationUnit> vnComputationUnits;
+ private VNMappingUnit vnMappingUnit;
+
+ private IntentResolver intentResolver;
+
+ @Before
+ public void setUp() throws Exception {
+ dataBroker = mock(DataBroker.class);
+ intentResolver = mock(IntentResolver.class);
+ }
+
+ @Test
+ public void testResolveIntent() throws Exception {
+ UserId userId = mock(UserId.class);
+ intentResolver.resolveIntent(userId);
+ verify(intentResolver).resolveIntent(any(UserId.class));
+ Assert.assertNotNull(intentResolver);
+ }
+
+ @Test
+ public void testClose() throws Exception {
+ intentResolver.close();
+ verify(intentResolver).close();
+ Assert.assertNotNull(intentResolver);
+ }
+}
\ No newline at end of file
--- /dev/null
+/*
+ * Copyright (c) 2015 Huawei, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.nemo.intent.algorithm;
+import edu.uci.ics.jung.algorithms.filters.EdgePredicateFilter;
+import edu.uci.ics.jung.algorithms.shortestpath.DijkstraShortestPath;
+import edu.uci.ics.jung.graph.DirectedSparseGraph;
+import edu.uci.ics.jung.graph.Graph;
+import edu.uci.ics.jung.graph.util.EdgeType;
+import org.apache.commons.collections15.Predicate;
+import org.apache.commons.collections15.Transformer;
+import org.opendaylight.nemo.intent.algorithm.*;
+
+
+import java.util.Collection;
+import java.util.List;
+import junit.framework.TestCase;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+import static org.mockito.Matchers.any;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.never;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+import static org.mockito.Mockito.*;
+import static org.junit.Assert.*;
+
+/**
+ * Created by zhangmeng on 2015/11/6.
+ */
+public class RoutingAlgorithmTest extends TestCase {
+ private Graph<Vertex,Edge> graph;
+ private DijkstraShortestPath<Vertex, Edge> dijkstraShortestPath;
+ private RoutingAlgorithm routingAlgorithm;
+
+ @Before
+ public void setUp() throws Exception {
+ graph = mock(DirectedSparseGraph.class);
+ dijkstraShortestPath = mock(DijkstraShortestPath.class);
+ routingAlgorithm = mock(RoutingAlgorithm.class);
+ }
+
+ @Test
+ public void testGetVertex() throws Exception {
+ Vertex vertex = routingAlgorithm.getVertex(null);
+ Assert.assertNull(vertex);
+ }
+
+ @Test
+ public void testGetEdge() throws Exception {
+ Edge edge = routingAlgorithm.getEdge(null);
+ Assert.assertNull(edge);
+ }
+
+ @Test
+ public void testGetVertices() throws Exception {
+ Collection<Vertex> collection = routingAlgorithm.getVertices();
+ Assert.assertNotNull(collection);
+ }
+
+ @Test
+ public void testAddVertex() throws Exception {
+ Vertex vertex = mock(Vertex.class);
+ Assert.assertNotNull(vertex);
+ routingAlgorithm.addVertex(vertex);
+ verify(routingAlgorithm).addVertex(vertex);
+ Assert.assertNotNull(routingAlgorithm);
+ }
+
+ @Test
+ public void testAddEdge() throws Exception {
+ Edge edge = mock(Edge.class);
+ Assert.assertNotNull(edge);
+ routingAlgorithm.addEdge(edge);
+ verify(routingAlgorithm).addEdge(edge);
+ Assert.assertNotNull(routingAlgorithm);
+ }
+
+
+ @Test
+ public void testRemoveVertex() throws Exception {
+ String flag = "test";
+ routingAlgorithm.removeVertex(flag);
+ Assert.assertNotNull(routingAlgorithm);
+ verify(routingAlgorithm).removeVertex(flag);
+ }
+
+ @Test
+ public void testRemoveEdge() throws Exception {
+ String flag = "test";
+ routingAlgorithm.removeEdge(flag);
+ Assert.assertNotNull(routingAlgorithm);
+ verify(routingAlgorithm).removeEdge(flag);
+ }
+
+ @Test
+ public void testComputePath() throws Exception {
+ List<Edge> list = mock(List.class);
+ list = routingAlgorithm.computePath(mock(Vertex.class),mock(Vertex.class));
+ Assert.assertNotNull(list);
+ }
+
+ @Test
+ public void testComputePath1() throws Exception {
+ List<Edge> list = mock(List.class);
+ list = routingAlgorithm.computePath(mock(Vertex.class),mock(Vertex.class));
+ Assert.assertNotNull(list);
+ }
+
+ @Test
+ public void testToString() throws Exception {
+ Assert.assertNotNull(routingAlgorithm.toString());
+ }
+}
\ No newline at end of file
--- /dev/null
+/*
+ * Copyright (c) 2015 Huawei, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.test.computation;
+import junit.framework.TestCase;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+import org.opendaylight.nemo.intent.algorithm.RoutingAlgorithm;
+import org.opendaylight.controller.md.sal.binding.api.*;
+import javax.xml.crypto.Data;
+import org.opendaylight.nemo.intent.computation.PNComputationUnit;
+
+import static org.junit.Assert.*;
+import static org.mockito.Mockito.*;
+/**
+ * Created by zhangmeng on 2015/11/9.
+ */
+public class PNComputationUnitTest extends TestCase {
+ private PNComputationUnit pnComputationUnit;
+ private DataBroker dataBroker;
+ @Before
+ public void setUp() throws Exception {
+
+ pnComputationUnit = mock(PNComputationUnit.class);
+ }
+
+ @Test
+ public void testClose() throws Exception {
+ pnComputationUnit.close();
+ Assert.assertNotNull(pnComputationUnit);
+ verify(pnComputationUnit).close();
+ }
+}
\ No newline at end of file
--- /dev/null
+/*
+ * Copyright (c) 2015 Huawei, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.test.computation;
+ import com.google.common.base.Optional;
+ import org.opendaylight.controller.md.sal.binding.api.DataBroker;
+ import org.opendaylight.controller.md.sal.binding.api.DataChangeListener;
+ import org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction;
+ import org.opendaylight.controller.md.sal.common.api.data.AsyncDataBroker.DataChangeScope;
+ import org.opendaylight.controller.md.sal.common.api.data.AsyncDataChangeEvent;
+ import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
+ import org.opendaylight.nemo.intent.algorithm.Edge;
+ import org.opendaylight.nemo.intent.algorithm.RoutingAlgorithm;
+ import org.opendaylight.nemo.intent.algorithm.Vertex;
+ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.generic.virtual.network.rev151010.VirtualNetworks;
+ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.generic.virtual.network.rev151010.virtual.networks.VirtualNetwork;
+ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.generic.virtual.network.rev151010.virtual.networks.VirtualNetworkKey;
+ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.generic.virtual.network.rev151010.virtual.networks.virtual.network.VirtualLinks;
+ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.generic.virtual.network.rev151010.virtual.networks.virtual.network.VirtualNodes;
+ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.generic.virtual.network.rev151010.virtual.networks.virtual.network.VirtualPaths;
+ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.generic.virtual.network.rev151010.virtual.networks.virtual.network.VirtualRoutes;
+ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.generic.virtual.network.rev151010.virtual.networks.virtual.network.virtual.links.VirtualLink;
+ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.generic.virtual.network.rev151010.virtual.networks.virtual.network.virtual.nodes.VirtualNode;
+ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.generic.virtual.network.rev151010.virtual.networks.virtual.network.virtual.paths.VirtualPath;
+ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.generic.virtual.network.rev151010.virtual.networks.virtual.network.virtual.paths.VirtualPathBuilder;
+ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.generic.virtual.network.rev151010.virtual.networks.virtual.network.virtual.paths.VirtualPathKey;
+ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.generic.virtual.network.rev151010.virtual.networks.virtual.network.virtual.routes.VirtualRoute;
+ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.generic.virtual.network.rev151010.virtual.networks.virtual.network.virtual.routes.VirtualRouteBuilder;
+ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.generic.virtual.network.rev151010.virtual.networks.virtual.network.virtual.routes.VirtualRouteKey;
+ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.generic.virtual.network.rev151010.virtual.path.instance.VirtualLinkBuilder;
+ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.common.rev151010.UserId;
+ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.engine.common.rev151010.VirtualLinkId;
+ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.engine.common.rev151010.VirtualNetworkId;
+ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.engine.common.rev151010.VirtualNodeId;
+ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.engine.common.rev151010.VirtualPathId;
+ import org.opendaylight.yangtools.concepts.ListenerRegistration;
+ import org.opendaylight.yangtools.yang.binding.DataObject;
+ import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+ import org.slf4j.Logger;
+ import org.slf4j.LoggerFactory;
+ import static org.mockito.Mockito.*;
+ import junit.framework.TestCase;
+ import org.junit.Assert;
+ import org.junit.Before;
+ import org.junit.Test;
+ import org.opendaylight.nemo.intent.computation.VNComputationUnit;
+ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.engine.common.rev151010.VirtualLinkId;
+ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.engine.common.rev151010.VirtualNetworkId;
+ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.engine.common.rev151010.VirtualNodeId;
+ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.engine.common.rev151010.VirtualPathId;
+ import static org.junit.Assert.*;
+ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.common.rev151010.UserId;
+/**
+ * Created by zhangmeng on 2015/11/9.
+ */
+public class VNComputationUnitTest extends TestCase {
+
+ private VNComputationUnit vnComputationUnit;
+ private DataBroker dataBroker;
+ private UserId userId;
+ private VirtualNodeId source,target;
+ private VirtualNodeId source1,target1;
+ private long bandwidth;
+ @Before
+ public void setUp() throws Exception {
+
+ source = mock(VirtualNodeId.class);
+ target = mock(VirtualNodeId.class);
+ source1 = mock(VirtualNodeId.class);
+ target1 = mock(VirtualNodeId.class);
+ vnComputationUnit = mock(VNComputationUnit.class);
+ }
+
+ @Test
+ public void testComputePath() throws Exception {
+ vnComputationUnit.computePath(source, target);
+ verify(vnComputationUnit).computePath(source, target);
+ Assert.assertNotEquals(mock(VirtualPath.class), vnComputationUnit.computePath(source, target));
+ Assert.assertNotNull(vnComputationUnit);
+ }
+
+ @Test
+ public void testComputePath1() throws Exception {
+ vnComputationUnit.computePath(source1, target1, bandwidth);
+ verify(vnComputationUnit).computePath(source1, target1, bandwidth);
+ Assert.assertNotEquals(mock(VirtualPath.class), vnComputationUnit.computePath(source1, target1, bandwidth));
+ Assert.assertNotNull(vnComputationUnit);
+ }
+
+ @Test
+ public void testClose() throws Exception {
+ vnComputationUnit.close();
+ Assert.assertNotNull(vnComputationUnit);
+ verify(vnComputationUnit).close();
+ }
+}
\ No newline at end of file
--- /dev/null
+/*\r
+ * Copyright (c) 2015 Huawei, Inc. and others. All rights reserved.\r
+ *\r
+ * This program and the accompanying materials are made available under the\r
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
+ * and is available at http://www.eclipse.org/legal/epl-v10.html\r
+ */\r
+package org.test.computation;\r
+\r
+import org.junit.Assert;\r
+import org.junit.Before;\r
+import org.junit.Test;\r
+import org.opendaylight.nemo.intent.computation.VNMappingException;\r
+import org.opendaylight.nemo.intent.computation.VNMappingUnit;\r
+\r
+import static org.junit.Assert.*;\r
+\r
+/**\r
+ * Created by zhangmeng on 2015/11/10.\r
+ */\r
+public class VNMappingExceptionTest {\r
+ private VNMappingException vnMappingException1;\r
+ private VNMappingException vnMappingException2;\r
+ private VNMappingException vnMappingException3;\r
+ private VNMappingException vnMappingException4;\r
+\r
+ private String message;\r
+ private Throwable cause;\r
+ @Before\r
+ public void setUp() throws Exception {\r
+ message = new String();\r
+ cause = new Throwable();\r
+ }\r
+\r
+ @Test\r
+ public void Construction()throws Exception{\r
+ Assert.assertNull(vnMappingException1);\r
+ Assert.assertNull(vnMappingException2);\r
+ Assert.assertNull(vnMappingException3);\r
+ Assert.assertNull(vnMappingException4);\r
+\r
+ vnMappingException1 = new VNMappingException();\r
+ vnMappingException2 = new VNMappingException(message);\r
+ vnMappingException3 = new VNMappingException(cause);\r
+ vnMappingException4 = new VNMappingException(message,cause);\r
+\r
+ Assert.assertNotNull(vnMappingException1);\r
+ Assert.assertNotNull(vnMappingException2);\r
+ Assert.assertNotNull(vnMappingException3);\r
+ Assert.assertNotNull(vnMappingException4);\r
+ }\r
+}
\ No newline at end of file
--- /dev/null
+/*
+ * Copyright (c) 2015 Huawei, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.test.computation;
+
+ import junit.framework.TestCase;
+ import org.junit.Assert;
+ import org.junit.Before;
+ import org.junit.Test;
+ import org.opendaylight.nemo.intent.computation.PNComputationUnit;
+ import org.opendaylight.nemo.intent.computation.VNComputationUnit;
+ import org.opendaylight.nemo.intent.computation.VNMappingUnit;
+ import com.google.common.base.Optional;
+ import org.opendaylight.controller.md.sal.binding.api.DataBroker;
+ import org.opendaylight.controller.md.sal.binding.api.DataChangeListener;
+ import org.opendaylight.controller.md.sal.binding.api.ReadOnlyTransaction;
+ import org.opendaylight.controller.md.sal.common.api.data.AsyncDataBroker.DataChangeScope;
+ import org.opendaylight.controller.md.sal.common.api.data.AsyncDataChangeEvent;
+ import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
+ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.generic.physical.network.rev151010.PhysicalNetwork;
+ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.generic.physical.network.rev151010.PhysicalNodeAttributeDefinitions;
+ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.generic.physical.network.rev151010.PhysicalPortAttributeDefinitions;
+ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.generic.physical.network.rev151010.attribute.definition.AttributeMatchPatterns;
+ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.generic.physical.network.rev151010.attribute.instance.attribute.value.RangeValue;
+ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.generic.physical.network.rev151010.physical.network.PhysicalLinks;
+ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.generic.physical.network.rev151010.physical.network.PhysicalNodes;
+ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.generic.physical.network.rev151010.physical.network.physical.links.PhysicalLink;
+ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.generic.physical.network.rev151010.physical.network.physical.nodes.PhysicalNode;
+ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.generic.physical.network.rev151010.physical.network.physical.paths.PhysicalPath;
+ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.generic.physical.network.rev151010.physical.network.physical.paths.PhysicalPathBuilder;
+ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.generic.physical.network.rev151010.physical.node.attribute.definitions.PhysicalNodeAttributeDefinition;
+ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.generic.physical.network.rev151010.physical.node.attribute.definitions.PhysicalNodeAttributeDefinitionKey;
+ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.generic.physical.network.rev151010.physical.node.instance.PhysicalPort;
+ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.generic.physical.network.rev151010.physical.port.attribute.definitions.PhysicalPortAttributeDefinition;
+ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.generic.physical.network.rev151010.physical.port.attribute.definitions.PhysicalPortAttributeDefinitionKey;
+ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.generic.physical.network.rev151010.physical.port.instance.Attribute;
+ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.generic.virtual.network.rev151010.virtual.networks.VirtualNetwork;
+ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.generic.virtual.network.rev151010.virtual.networks.virtual.network.virtual.links.VirtualLink;
+ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.generic.virtual.network.rev151010.virtual.networks.virtual.network.virtual.links.VirtualLinkBuilder;
+ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.generic.virtual.network.rev151010.virtual.networks.virtual.network.virtual.nodes.VirtualNode;
+ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.generic.virtual.network.rev151010.virtual.node.instance.VirtualPort;
+ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.generic.virtual.network.rev151010.virtual.port.instance.PhysicalResourceRequirement;
+ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.intent.mapping.result.rev151010.PhysicalResourceInstance;
+ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.intent.mapping.result.rev151010.VirtualResourceInstance;
+ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.intent.mapping.result.rev151010.vn.pn.mapping.results.UserVnPnMapping;
+ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.intent.mapping.result.rev151010.vn.pn.mapping.results.user.vn.pn.mapping.VnPnMappingResult;
+ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.intent.mapping.result.rev151010.vn.pn.mapping.results.user.vn.pn.mapping.VnPnMappingResultBuilder;
+ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.engine.common.rev151010.*;
+ import org.opendaylight.yangtools.concepts.ListenerRegistration;
+ import org.opendaylight.yangtools.yang.binding.DataObject;
+ import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+ import org.slf4j.Logger;
+ import org.slf4j.LoggerFactory;
+ import java.util.Map;
+ import static org.mockito.Mockito.*;
+ import static org.junit.Assert.*;
+ import java.util.*;
+/**
+ * Created by zhangmeng on 2015/11/9.
+ */
+public class VNMappingUnitTest extends TestCase {
+ private VNMappingUnit vnMappingUnit;
+ private DataBroker dataBroker;
+ private PNComputationUnit pnComputationUnit;
+ private Map<PhysicalNodeId, Map<PhysicalPortId, ListenerRegistration<DataChangeListener>>> physicalPortChangeListenerRegs;
+ private ListenerRegistration<DataChangeListener> physicalNodeChangeListenerReg;
+ private ListenerRegistration<DataChangeListener> physicalLinkChangeListenerReg;
+
+ @Before
+ public void setUp() throws Exception {
+ dataBroker = mock(DataBroker.class);
+ pnComputationUnit = mock(PNComputationUnit.class);
+ vnMappingUnit = mock(VNMappingUnit.class);
+
+ }
+
+ @Test
+ public void testVirtualNetworkMapping() throws Exception {
+ VirtualNetwork virtualNetwork = mock(VirtualNetwork.class);
+ UserVnPnMapping userVnPnMapping = mock(UserVnPnMapping.class);
+ List<PhysicalPath> physicalPaths = new ArrayList<PhysicalPath>();
+ vnMappingUnit.virtualNetworkMapping(virtualNetwork,userVnPnMapping,physicalPaths);
+ Assert.assertNotNull(vnMappingUnit);
+ verify(vnMappingUnit).virtualNetworkMapping(any(VirtualNetwork.class),any(UserVnPnMapping.class),any(List.class));
+ }
+
+ @Test
+ public void testClose() throws Exception {
+ Assert.assertNotNull(vnMappingUnit);
+ vnMappingUnit.close();
+ verify(vnMappingUnit).close();
+ }
+}
\ No newline at end of file
--- /dev/null
+/*
+ * Copyright (c) 2015 Huawei, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.test.computation;
+
+import junit.framework.TestCase;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+import org.opendaylight.nemo.intent.computation.VNMappingUnitUtils;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.intent.mapping.result.rev151010.vn.pn.mapping.results.user.vn.pn.mapping.VnPnMappingResult;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.engine.common.rev151010.VirtualResourceEntityId;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import static org.junit.Assert.*;
+import static org.mockito.Mockito.*;
+
+/**
+ * Created by zhangmeng on 2015/11/10.
+ */
+public class VNMappingUnitUtilsTest extends VNMappingUnitUtils {
+ private VNMappingUnitUtils vnMappingUnitUtils;
+ List<VnPnMappingResult> vnPnMappingResults;
+ VirtualResourceEntityId virtualResourceEntityId;
+ VnPnMappingResult test;
+ @Before
+ public void setUp() throws Exception {
+ vnPnMappingResults = new ArrayList<VnPnMappingResult>();
+ virtualResourceEntityId = mock(VirtualResourceEntityId.class);
+ test = mock(VnPnMappingResult.class);
+ //vnMappingUnitUtils = new VNMappingUnitUtils();
+ }
+
+ @Test
+ public void testGetVnPnMappingResult() throws Exception {
+ test = VNMappingUnitUtils.getVnPnMappingResult(vnPnMappingResults,virtualResourceEntityId);
+ //verify(this).getVnPnMappingResult(any(List.class), any(VirtualResourceEntityId.class));
+ Assert.assertNotEquals(test,mock(VnPnMappingResult.class));
+ }
+}
\ No newline at end of file
--- /dev/null
+/*\r
+ * Copyright (c) 2015 Huawei, Inc. and others. All rights reserved.\r
+ *\r
+ * This program and the accompanying materials are made available under the\r
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
+ * and is available at http://www.eclipse.org/legal/epl-v10.html\r
+ */\r
+package org.opendaylight.nemo.user;\r
+\r
+import junit.framework.TestCase;\r
+import org.junit.Assert;\r
+import org.junit.Before;\r
+import org.junit.Test;\r
+import static org.mockito.Mockito.*;\r
+import static org.junit.Assert.*;\r
+import com.google.common.util.concurrent.Futures;\r
+import org.opendaylight.controller.md.sal.binding.api.DataBroker;\r
+import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.RpcRegistration;\r
+import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry;\r
+import org.opendaylight.nemo.intent.IntentResolutionException;\r
+import org.opendaylight.nemo.intent.IntentResolver;\r
+import org.opendaylight.nemo.intent.computation.VNMappingException;\r
+import org.opendaylight.nemo.user.advancedquery.AdvancedQuery;\r
+import org.opendaylight.nemo.user.tenantmanager.AAA;\r
+import org.opendaylight.nemo.user.tenantmanager.RegisterUser;\r
+import org.opendaylight.nemo.user.tenantmanager.TenantManage;\r
+import org.opendaylight.nemo.user.transactionmanager.TransactionBegin;\r
+import org.opendaylight.nemo.user.transactionmanager.TransactionEnd;\r
+import org.opendaylight.nemo.user.vnspacemanager.languagestyle.LanguageIntent;\r
+import org.opendaylight.nemo.user.vnspacemanager.structurestyle.deleteintent.DeleteIntent;\r
+import org.opendaylight.nemo.user.vnspacemanager.structurestyle.updateintent.UpdateIntent;\r
+import org.opendaylight.nemo.user.vnspacemanager.VNSpaceManagement;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.intent.rev151010.*;\r
+import org.opendaylight.yangtools.yang.common.RpcResult;\r
+import org.opendaylight.yangtools.yang.common.RpcResultBuilder;\r
+\r
+import java.util.concurrent.Future;\r
+\r
+/**\r
+ * Created by Thomas Liu on 2015/11/12.\r
+ */\r
+public class UserManagerTest extends TestCase {\r
+ private UserManager userManagerTest;\r
+ private AdvancedNemoQueryInput advancedNemoQueryInput;\r
+ private BeginTransactionInput beginTransactionInput;\r
+ private EndTransactionInput endTransactionInput;\r
+ private LanguageStyleNemoRequestInput languageStyleNemoRequestInput;\r
+ private RegisterUserInput registerUserInput;\r
+ private StructureStyleNemoDeleteInput structureStyleNemoDeleteInput;\r
+ private StructureStyleNemoUpdateInput structureStyleNemoUpdateInput;\r
+\r
+\r
+ @org.junit.Before\r
+ public void setUp() throws Exception {\r
+ userManagerTest = mock(UserManager.class);\r
+ advancedNemoQueryInput = mock(AdvancedNemoQueryInput.class);\r
+ beginTransactionInput = mock(BeginTransactionInput.class);\r
+ endTransactionInput = mock(EndTransactionInput.class);\r
+ languageStyleNemoRequestInput = mock(LanguageStyleNemoRequestInput.class);\r
+ registerUserInput = mock(RegisterUserInput.class);\r
+ structureStyleNemoDeleteInput = mock(StructureStyleNemoDeleteInput.class);\r
+ structureStyleNemoUpdateInput = mock(StructureStyleNemoUpdateInput.class);\r
+ }\r
+\r
+ @org.junit.Test\r
+ public void testAdvancedNemoQuery() throws Exception {\r
+ userManagerTest.advancedNemoQuery(advancedNemoQueryInput);\r
+ Assert.assertNotNull(userManagerTest);\r
+ verify(userManagerTest).advancedNemoQuery(advancedNemoQueryInput);\r
+ }\r
+\r
+ @org.junit.Test\r
+ public void testBeginTransaction() throws Exception {\r
+ userManagerTest.beginTransaction(beginTransactionInput);\r
+ Assert.assertNotNull(userManagerTest);\r
+ verify(userManagerTest).beginTransaction(beginTransactionInput);\r
+\r
+ }\r
+\r
+ @org.junit.Test\r
+ public void testEndTransaction() throws Exception {\r
+ userManagerTest.endTransaction(endTransactionInput);\r
+ Assert.assertNotNull(userManagerTest);\r
+ verify(userManagerTest).endTransaction(endTransactionInput);\r
+ }\r
+\r
+ @org.junit.Test\r
+ public void testLanguageStyleNemoRequest() throws Exception {\r
+ userManagerTest.languageStyleNemoRequest(languageStyleNemoRequestInput);\r
+ Assert.assertNotNull(userManagerTest);\r
+ verify(userManagerTest).languageStyleNemoRequest(languageStyleNemoRequestInput);\r
+ }\r
+\r
+ @org.junit.Test\r
+ public void testRegisterUser() throws Exception {\r
+ userManagerTest.registerUser(registerUserInput);\r
+ Assert.assertNotNull(userManagerTest);\r
+ verify(userManagerTest).registerUser(registerUserInput);\r
+ }\r
+\r
+ @org.junit.Test\r
+ public void testStructureStyleNemoDelete() throws Exception {\r
+ userManagerTest.structureStyleNemoDelete(structureStyleNemoDeleteInput);\r
+ Assert.assertNotNull(userManagerTest);\r
+ verify(userManagerTest).structureStyleNemoDelete(structureStyleNemoDeleteInput);\r
+ }\r
+\r
+ @org.junit.Test\r
+ public void structureStyleNemoUpdate() throws Exception {\r
+ userManagerTest.structureStyleNemoUpdate(structureStyleNemoUpdateInput);\r
+ Assert.assertNotNull(userManagerTest);\r
+ verify(userManagerTest).structureStyleNemoUpdate(structureStyleNemoUpdateInput);\r
+ }\r
+\r
+ @org.junit.Test\r
+ public void testClose() throws Exception {\r
+ userManagerTest.close();\r
+ Assert.assertNotNull(userManagerTest);\r
+ verify(userManagerTest).close();\r
+ }\r
+}
\ No newline at end of file
--- /dev/null
+/*
+ * Copyright (c) 2015 Huawei, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.nemo.user.transactionmanager;
+
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+import static org.mockito.Mockito.mock;
+
+import org.opendaylight.nemo.user.tenantmanager.AAA;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.intent.rev151010.BeginTransactionInput;
+/**
+ * Created by wangjunfei on 2015/11/9.
+ */
+public class TransactionBeginTest {
+ private AAA aaa;
+ private BeginTransactionInput input;
+ private TransactionBegin begin;
+ @Before
+ public void setUp() throws Exception {
+ aaa = mock(AAA.class);
+ input = mock(BeginTransactionInput.class);
+ begin = mock(TransactionBegin.class);
+ }
+
+ @Test
+ public void testTransactionbegin() throws Exception {
+ Assert.assertNull(begin.transactionbegin(aaa,input));
+ }
+}
\ No newline at end of file
--- /dev/null
+/*
+ * Copyright (c) 2015 Huawei, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.nemo.user.transactionmanager;
+
+import org.opendaylight.nemo.user.transactionmanager.TransactionEnd;
+
+import static org.mockito.Mockito.mock;
+
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+import org.opendaylight.nemo.user.tenantmanager.AAA;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.intent.rev151010.EndTransactionInput;
+/**
+ * Created by wangjunfei on 2015/11/9.
+ */
+public class TransactionEndTest {
+ private AAA aaa;
+ private EndTransactionInput input;
+ private TransactionEnd end;
+
+ @org.junit.Before
+ public void setUp() throws Exception {
+ aaa = mock(AAA.class);
+ input = mock(EndTransactionInput.class);
+ end = mock(TransactionEnd.class);
+ }
+
+ @org.junit.Test
+ public void testTransactionend() throws Exception {
+ Assert.assertNull(end.transactionend(aaa, input));
+ }
+}
\ No newline at end of file
--- /dev/null
+/*
+ * Copyright (c) 2015 Huawei, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.test.user.vnspacemanager;
+
+import junit.framework.TestCase;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+import org.opendaylight.nemo.user.vnspacemanager.VNSpaceManagement;
+
+import static org.junit.Assert.*;
+import org.opendaylight.controller.md.sal.binding.api.DataBroker;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.common.rev151010.NodeId;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.common.rev151010.UserId;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.object.rev151010.NodeInstance;
+import static org.mockito.Mockito.*;
+/**
+ * Created by zhangmeng on 2015/11/12.
+ */
+public class VNSpaceManagementTest extends TestCase {
+ private VNSpaceManagement vnSpaceManagement;
+ private DataBroker dataBroker;
+ private UserId userId;
+ private NodeId nodeId;
+ private NodeInstance nodeInstance;
+ @Before
+ public void setUp() throws Exception {
+ dataBroker = mock(DataBroker.class);
+ userId = mock(UserId.class);
+ nodeId = mock(NodeId.class);
+ nodeInstance = mock(NodeInstance.class);
+ vnSpaceManagement = new VNSpaceManagement(dataBroker);
+ }
+
+ @Test
+ public void testGetNodeInstance() throws Exception {
+ nodeInstance = vnSpaceManagement.getNodeInstance(userId,nodeId);
+ Assert.assertNotSame(mock(NodeInstance.class),nodeInstance);
+ }
+}
\ No newline at end of file
--- /dev/null
+/*
+ * Copyright (c) 2015 Huawei, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.nemo.user.vnspacemanager.instancecheck;
+
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+import static org.mockito.Mockito.mock;
+
+import org.opendaylight.nemo.user.tenantmanager.TenantManage;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.common.rev151010.UserId;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.intent.rev151010.user.intent.objects.Connection;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.intent.rev151010.user.intent.objects.Node;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.intent.rev151010.users.User;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.object.rev151010.connection.instance.EndNode;
+
+import java.util.List;
+/**
+ * Created by wangjunfei on 2015/11/10.
+ */
+public class ConnectionInstanceCheckTest {
+ private TenantManage tenantManage;
+ private ConnectionInstanceCheck connectionInstanceCheck;
+ private UserId userId;
+ private Connection connection;
+
+ @org.junit.Before
+ public void setUp() throws Exception {
+ userId = mock(UserId.class);
+ connection = mock(Connection.class);
+ tenantManage = mock(TenantManage.class);
+ connectionInstanceCheck = mock(ConnectionInstanceCheck.class);
+ }
+
+ @org.junit.Test
+ public void testCheckConnInstance() throws Exception {
+ Assert.assertNull(connectionInstanceCheck.checkConnInstance(userId,connection));
+ }
+}
\ No newline at end of file
--- /dev/null
+/*
+ * Copyright (c) 2015 Huawei, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.nemo.user.vnspacemanager.instancecheck;
+
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+import static org.mockito.Mockito.mock;
+
+import org.opendaylight.nemo.user.tenantmanager.TenantManage;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.common.rev151010.UserId;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.intent.rev151010.user.intent.objects.Flow;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.intent.rev151010.users.User;
+
+import java.util.List;
+/**
+ * Created by wangjunfei on 2015/11/10.
+ */
+public class FlowInstanceCheckTest {
+ private TenantManage tenantManage;
+ private Flow flow;
+ private FlowInstanceCheck flowInstanceCheck;
+ private UserId userId;
+
+ @org.junit.Before
+ public void setUp() throws Exception {
+ userId = mock(UserId.class);
+ tenantManage = mock(TenantManage.class);
+ flow = mock(Flow.class);
+ flowInstanceCheck = mock(FlowInstanceCheck.class);
+ }
+
+ @org.junit.Test
+ public void testCheckFlowInstance() throws Exception {
+ Assert.assertNull(flowInstanceCheck.checkFlowInstance(userId,flow));
+ }
+}
\ No newline at end of file
--- /dev/null
+/*
+ * Copyright (c) 2015 Huawei, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.nemo.user.vnspacemanager.instancecheck;
+
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+import static org.mockito.Mockito.mock;
+
+import org.opendaylight.nemo.user.tenantmanager.TenantManage;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.common.rev151010.UserId;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.intent.rev151010.user.intent.Objects;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.intent.rev151010.user.intent.objects.Node;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.intent.rev151010.users.User;
+
+import java.util.List;
+
+/**
+ * Created by wangjunfei on 2015/11/10.
+ */
+public class NodeInstanceCheckTest {
+ private TenantManage tenantManage;
+ private UserId userId;
+ private Node node;
+ private NodeInstanceCheck nodeInstanceCheck;
+
+ @org.junit.Before
+ public void setUp() throws Exception {
+ tenantManage = mock(TenantManage.class);
+ userId = mock(UserId.class);
+ node = mock(Node.class);
+ nodeInstanceCheck = mock(NodeInstanceCheck.class);
+ }
+
+ @org.junit.Test
+ public void testCheckNodeInstance() throws Exception {
+ Assert.assertNull(nodeInstanceCheck.checkNodeInstance(userId,node));
+ }
+}
\ No newline at end of file
--- /dev/null
+/*
+ * Copyright (c) 2015 Huawei, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.nemo.user.vnspacemanager.instancecheck;
+
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+import static org.mockito.Mockito.mock;
+
+import org.opendaylight.nemo.user.tenantmanager.TenantManage;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.common.rev151010.UserId;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.intent.rev151010.user.intent.Objects;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.intent.rev151010.user.intent.objects.Connection;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.intent.rev151010.user.intent.objects.Flow;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.intent.rev151010.user.intent.objects.Node;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.intent.rev151010.user.intent.operations.Operation;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.intent.rev151010.users.User;
+
+import java.util.List;
+/**
+ * Created by wangjunfei on 2015/11/10.
+ */
+public class OperationInstanceCheckTest {
+ private OperationInstanceCheck operationInstanceCheck;
+ private TenantManage tenantManage;
+ private UserId userId;
+ private Operation operation;
+
+ @org.junit.Before
+ public void setUp() throws Exception {
+ tenantManage = mock(TenantManage.class);
+ userId = mock(UserId.class);
+ operation = mock(Operation.class);
+ operationInstanceCheck = mock(OperationInstanceCheck.class);
+ }
+
+ @org.junit.Test
+ public void testCheckOperationInstance() throws Exception {
+ Assert.assertNull(operationInstanceCheck.checkOperationInstance(userId,operation));
+ }
+}
\ No newline at end of file
--- /dev/null
+/*
+ * Copyright (c) 2015 Huawei, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.nemo.user.vnspacemanager.instancecheck;
+
+import org.opendaylight.nemo.user.tenantmanager.TenantManage;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.common.rev151010.UserId;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.intent.rev151010.user.intent.Results;
+
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+import static org.mockito.Mockito.mock;
+
+/**
+ * Created by wangjunfei on 2015/11/10.
+ */
+public class ResultInstanceCheckTest {
+ private TenantManage tenantManage;
+ private UserId userId;
+ private Results results;
+ private ResultInstanceCheck resultInstanceCheck;
+ @org.junit.Before
+ public void setUp() throws Exception {
+ tenantManage = mock(TenantManage.class);
+ userId = mock(UserId.class);
+ results = mock(Results.class);
+ resultInstanceCheck = mock(ResultInstanceCheck.class);
+ }
+
+ @org.junit.Test
+ public void testCheckResultInstance() throws Exception {
+ Assert.assertNull(resultInstanceCheck.checkResultInstance(userId,results));
+ }
+}
\ No newline at end of file
--- /dev/null
+/*
+ * Copyright (c) 2015 Huawei, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.test.user.vnspacemanager.languagestyle;
+import junit.framework.TestCase;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+import org.opendaylight.controller.md.sal.binding.api.DataBroker;
+import org.opendaylight.nemo.user.tenantmanager.AAA;
+import org.opendaylight.nemo.user.vnspacemanager.languagestyle.LanguageIntent;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.intent.rev151010.LanguageStyleNemoRequestInput;
+import static org.junit.Assert.*;
+import static org.mockito.Mockito.*;
+/**
+ * Created by zhangmeng on 2015/11/12.
+ */
+public class LanguageIntentTest extends TestCase {
+ private DataBroker dataBroker;
+ private LanguageIntent languageIntent;
+
+ @Before
+ public void setUp() throws Exception {
+ dataBroker = mock(DataBroker.class);
+ languageIntent = new LanguageIntent(dataBroker);
+
+ }
+
+ @Test
+ public void testLanIntentHandler() throws Exception {
+ AAA aaa = mock(AAA.class);
+ LanguageStyleNemoRequestInput languageStyleNemoRequestInput = mock(LanguageStyleNemoRequestInput.class);
+ Assert.assertEquals(null,languageIntent.LanIntentHandler(aaa,languageStyleNemoRequestInput));
+ }
+}
\ No newline at end of file
--- /dev/null
+/*
+ * Copyright (c) 2015 Huawei, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.nemo.user.vnspacemanager.structurestyle.deleteintent;
+import org.opendaylight.nemo.user.vnspacemanager.structurestyle.*;
+import static org.mockito.Mockito.mock;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+import org.opendaylight.controller.md.sal.binding.api.DataBroker;
+import org.opendaylight.nemo.user.tenantmanager.TenantManage;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.common.rev151010.ConnectionId;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.common.rev151010.UserId;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.intent.rev151010.Users;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.intent.rev151010.user.intent.Objects;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.intent.rev151010.user.intent.objects.Connection;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.intent.rev151010.user.intent.objects.ConnectionKey;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.intent.rev151010.users.User;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.intent.rev151010.users.UserKey;
+import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
+import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;
+import com.google.common.util.concurrent.CheckedFuture;
+import com.google.common.util.concurrent.FutureCallback;
+import com.google.common.util.concurrent.Futures;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.List;
+public class DeleteConnectionTest{
+ private DataBroker dataBroker;
+ private TenantManage tenantManage;
+ private DeleteConnection deleteconnection;
+ private UserId userId;
+ private ConnectionId connectionID;
+@org.junit.Before
+public void setUp() throws Exception {
+ dataBroker=mock(DataBroker.class);
+ tenantManage=mock(TenantManage.class);
+ deleteconnection=mock(DeleteConnection.class);
+ userId=mock(UserId.class);
+ connectionID=mock(ConnectionId.class);
+ }
+@org.junit.Test
+public void DeleteConnectionHandlingTest() throws Exception{
+ Assert.assertNull(deleteconnection.DeleteConnectionHandling(userId,connectionID));
+ }
+ }
\ No newline at end of file
--- /dev/null
+/*
+ * Copyright (c) 2015 Huawei, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.nemo.user.vnspacemanager.structurestyle.deleteintent;
+import org.opendaylight.nemo.user.vnspacemanager.structurestyle.*;
+import static org.mockito.Mockito.mock;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+import org.opendaylight.controller.md.sal.binding.api.DataBroker;
+import org.opendaylight.nemo.user.tenantmanager.TenantManage;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.common.rev151010.FlowId;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.common.rev151010.UserId;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.intent.rev151010.Users;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.intent.rev151010.user.intent.Objects;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.intent.rev151010.user.intent.objects.Flow;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.intent.rev151010.user.intent.objects.FlowKey;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.intent.rev151010.users.User;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.intent.rev151010.users.UserKey;
+import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
+import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;
+import com.google.common.util.concurrent.CheckedFuture;
+import com.google.common.util.concurrent.FutureCallback;
+import com.google.common.util.concurrent.Futures;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.List;
+
+import static org.junit.Assert.*;
+public class DeleteFlowTest{
+ private DataBroker dataBroker;
+ private TenantManage tenantManage;
+ private DeleteFlow deleteflow;
+ private UserId userId;
+ private FlowId flowId;
+ @org.junit.Before
+ public void setUp() throws Exception {
+ dataBroker=mock(DataBroker.class);
+ tenantManage=mock(TenantManage.class);
+ deleteflow=mock(DeleteFlow.class);
+ userId=mock(UserId.class);
+ flowId=mock(FlowId.class);
+ }
+ @org.junit.Test
+ public void DeleteFlowHandlingTest() throws Exception{
+ Assert.assertNull(deleteflow.DeleteFlowHandling(userId,flowId));
+ }
+}
--- /dev/null
+/*\r
+ * Copyright (c) 2015 Huawei, Inc. and others. All rights reserved.\r
+ *\r
+ * This program and the accompanying materials are made available under the\r
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
+ * and is available at http://www.eclipse.org/legal/epl-v10.html\r
+ */\r
+package org.opendaylight.nemo.user.vnspacemanager.structurestyle.deleteintent;\r
+import org.opendaylight.nemo.user.vnspacemanager.structurestyle.*;\r
+import static org.mockito.Mockito.mock;\r
+import org.junit.Assert;\r
+import org.junit.Before;\r
+import org.junit.Test;\r
+\r
+import org.opendaylight.controller.md.sal.binding.api.DataBroker;\r
+import org.opendaylight.nemo.user.tenantmanager.AAA;\r
+import org.opendaylight.nemo.user.tenantmanager.TenantManage;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.common.rev151010.ConnectionId;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.common.rev151010.FlowId;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.common.rev151010.NodeId;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.common.rev151010.OperationId;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.intent.rev151010.StructureStyleNemoDeleteInput;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.intent.rev151010.structure.style.nemo.delete.input.Results;\r
+\r
+import java.util.List;\r
+public class DeleteIntentTest{\r
+ private DataBroker dataBroker;\r
+ private TenantManage tenantManage;\r
+ private DeleteNode deleteNode;\r
+ private DeleteConnection deleteConnection;\r
+ private DeleteFlow deleteFlow;\r
+ private DeleteOperation deleteOperation;\r
+ private DeleteResult deleteResult;\r
+ private AAA aaa;\r
+ private StructureStyleNemoDeleteInput styleNemoDeleteInput;\r
+ private DeleteIntent deleteintent;\r
+@org.junit.Before\r
+public void setUp() throws Exception{\r
+ dataBroker=mock(DataBroker.class);\r
+ tenantManage=mock(TenantManage.class);\r
+ deleteNode=mock(DeleteNode.class);\r
+ deleteConnection=mock(DeleteConnection.class);\r
+ deleteFlow=mock(DeleteFlow.class);\r
+ deleteOperation=mock(DeleteOperation.class);\r
+ deleteResult=mock(DeleteResult.class);\r
+ aaa=mock(AAA.class);\r
+ styleNemoDeleteInput=mock(StructureStyleNemoDeleteInput.class);\r
+ deleteintent=mock(DeleteIntent.class);\r
+}\r
+@org.junit.Test\r
+public void styleNemoDeleteOutputTest(){\r
+ Assert.assertNull(deleteintent.styleNemoDeleteOutput(aaa,styleNemoDeleteInput));\r
+}\r
+}
\ No newline at end of file
--- /dev/null
+/*\r
+ * Copyright (c) 2015 Huawei, Inc. and others. All rights reserved.\r
+ *\r
+ * This program and the accompanying materials are made available under the\r
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
+ * and is available at http://www.eclipse.org/legal/epl-v10.html\r
+ */\r
+package org.opendaylight.nemo.user.vnspacemanager.structurestyle.deleteintent;\r
+import org.opendaylight.nemo.user.vnspacemanager.structurestyle.*;\r
+import static org.mockito.Mockito.mock;\r
+import org.junit.Assert;\r
+import org.junit.Before;\r
+import org.junit.Test;\r
+\r
+import org.opendaylight.controller.md.sal.binding.api.DataBroker;\r
+import org.opendaylight.nemo.user.tenantmanager.TenantManage;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.common.rev151010.NodeId;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.common.rev151010.UserId;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.intent.rev151010.Users;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.intent.rev151010.user.intent.Objects;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.intent.rev151010.user.intent.objects.Node;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.intent.rev151010.user.intent.objects.NodeKey;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.intent.rev151010.users.User;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.intent.rev151010.users.UserKey;\r
+import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;\r
+import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;\r
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;\r
+import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;\r
+import com.google.common.util.concurrent.CheckedFuture;\r
+import com.google.common.util.concurrent.FutureCallback;\r
+import com.google.common.util.concurrent.Futures;\r
+import org.slf4j.Logger;\r
+import org.slf4j.LoggerFactory;\r
+\r
+import java.util.List;\r
+public class DeleteNodeTest{\r
+ private DataBroker dataBroker;\r
+ private TenantManage tenantManage;\r
+ private UserId userid;\r
+ private NodeId nodeid;\r
+ private DeleteNode deletenode;\r
+ @org.junit.Before\r
+ public void setUp() throws Exception{\r
+ dataBroker=mock(DataBroker.class);\r
+ tenantManage=mock(TenantManage.class);\r
+ userid=mock(UserId.class); \r
+ nodeid=mock(NodeId.class);\r
+ deletenode=mock(DeleteNode.class);\r
+ }\r
+ @org.junit.Test\r
+ public void DeleNodeHandlingTest(){\r
+ Assert.assertNull(deletenode.DeleNodeHandling(userid,nodeid));\r
+ }\r
+}\r
--- /dev/null
+/*\r
+ * Copyright (c) 2015 Huawei, Inc. and others. All rights reserved.\r
+ *\r
+ * This program and the accompanying materials are made available under the\r
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
+ * and is available at http://www.eclipse.org/legal/epl-v10.html\r
+ */\r
+package org.opendaylight.nemo.user.vnspacemanager.structurestyle.deleteintent;\r
+import org.opendaylight.nemo.user.vnspacemanager.structurestyle.*;\r
+import static org.mockito.Mockito.mock;\r
+import org.junit.Assert;\r
+import org.junit.Before;\r
+import org.junit.Test;\r
+\r
+import org.opendaylight.controller.md.sal.binding.api.DataBroker;\r
+import org.opendaylight.nemo.user.tenantmanager.TenantManage;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.common.rev151010.OperationId;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.common.rev151010.UserId;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.intent.rev151010.Users;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.intent.rev151010.user.intent.Operations;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.intent.rev151010.user.intent.operations.Operation;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.intent.rev151010.user.intent.operations.OperationKey;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.intent.rev151010.users.User;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.intent.rev151010.users.UserKey;\r
+import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;\r
+import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;\r
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;\r
+import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;\r
+import com.google.common.util.concurrent.CheckedFuture;\r
+import com.google.common.util.concurrent.FutureCallback;\r
+import com.google.common.util.concurrent.Futures;\r
+import org.slf4j.Logger;\r
+import org.slf4j.LoggerFactory;\r
+\r
+import java.util.List;\r
+public class DeleteOperationTest{\r
+ private DataBroker dataBroker;\r
+ private TenantManage tenantManage;\r
+ private UserId userId;\r
+ private OperationId operationId;\r
+ private DeleteOperation deleteoperation;\r
+ @org.junit.Before\r
+ public void setUp() throws Exception{\r
+ dataBroker=mock(DataBroker.class);\r
+ tenantManage=mock(TenantManage.class);\r
+ userId=mock(UserId.class);\r
+ operationId=mock(OperationId.class);\r
+ deleteoperation=mock(DeleteOperation.class); \r
+ }\r
+ @org.junit.Test\r
+ public void DeleteOperationhandlingTest(){\r
+ Assert.assertNull(deleteoperation.DeleteOperationhandling(userId,operationId));\r
+ }\r
+}
\ No newline at end of file
--- /dev/null
+/*\r
+ * Copyright (c) 2015 Huawei, Inc. and others. All rights reserved.\r
+ *\r
+ * This program and the accompanying materials are made available under the\r
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
+ * and is available at http://www.eclipse.org/legal/epl-v10.html\r
+ */\r
+package org.opendaylight.nemo.user.vnspacemanager.structurestyle.deleteintent;\r
+import org.opendaylight.nemo.user.vnspacemanager.structurestyle.*;\r
+import static org.mockito.Mockito.mock;\r
+import org.junit.Assert;\r
+import org.junit.Before;\r
+import org.junit.Test;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.common.rev151010.UserId;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.intent.rev151010.structure.style.nemo.delete.input.Results;\r
+public class DeleteResultTest{\r
+ private UserId userId;\r
+ private Results results;\r
+ private DeleteResult deleteresult;\r
+ @org.junit.Before\r
+ public void setUp()throws Exception{\r
+ userId=mock(UserId.class);\r
+ results=mock(Results.class);\r
+ deleteresult=mock(DeleteResult.class);\r
+ }\r
+ public void DeleteResultHandlingTest() throws Exception{\r
+ Assert.assertNull(deleteresult.DeleteResultHandling(userId,results));\r
+ }\r
+}
\ No newline at end of file
--- /dev/null
+/*
+ * Copyright (c) 2015 Huawei, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.nemo.user.vnspacemanager.structurestyle.updateintent;
+
+import org.opendaylight.nemo.user.vnspacemanager.structurestyle.updateintent.UpdateConnection;
+import org.opendaylight.nemo.user.tenantmanager.TenantManage;
+import org.opendaylight.nemo.user.vnspacemanager.instancecheck.ConnectionInstanceCheck;
+import org.opendaylight.nemo.user.vnspacemanager.syntaxcheck.ConnectionDefinitionCheck;
+
+import static org.mockito.Mockito.mock;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+
+import org.opendaylight.controller.md.sal.binding.api.DataBroker;
+import org.opendaylight.nemo.user.tenantmanager.TenantManage;
+import org.opendaylight.nemo.user.vnspacemanager.instancecheck.ConnectionInstanceCheck;
+import org.opendaylight.nemo.user.vnspacemanager.syntaxcheck.ConnectionDefinitionCheck;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.common.rev151010.UserId;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.intent.rev151010.Users;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.intent.rev151010.user.intent.Objects;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.intent.rev151010.user.intent.objects.Connection;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.intent.rev151010.user.intent.objects.ConnectionBuilder;
+import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.intent.rev151010.user.intent.objects.ConnectionKey;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.intent.rev151010.users.User;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.intent.rev151010.users.UserKey;
+import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
+import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;
+import com.google.common.util.concurrent.Futures;
+import com.google.common.util.concurrent.CheckedFuture;
+import com.google.common.util.concurrent.FutureCallback;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+/**
+ * Created by ldzd11 on 2015/11/9.
+ */
+public class UpdateConnectionTest {
+
+
+ private UpdateConnection updateConnection;
+
+ private UserId userId;
+ private Connection connection;
+ private DataBroker dataBroker;
+ private TenantManage tenantManage;
+ private ConnectionDefinitionCheck connectionDefinitionCheck;
+ private ConnectionInstanceCheck connectionInstanceCheck;
+
+
+
+ @org.junit.Before
+ public void setUp() throws Exception {
+
+ dataBroker = mock(DataBroker.class);
+ tenantManage = mock(TenantManage.class);
+ connectionDefinitionCheck = mock(ConnectionDefinitionCheck.class);
+ connectionInstanceCheck = mock(ConnectionInstanceCheck.class);
+
+ userId = mock(UserId.class);
+ connection = mock(Connection.class);
+ updateConnection = mock(UpdateConnection.class);
+ }
+
+ @org.junit.Test
+ public void testConnectionHandling() throws Exception {
+
+ Assert.assertNull(updateConnection.ConnectionHandling(userId, connection));
+
+ }
+}
\ No newline at end of file
--- /dev/null
+/*\r
+ * Copyright (c) 2015 Huawei, Inc. and others. All rights reserved.\r
+ *\r
+ * This program and the accompanying materials are made available under the\r
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
+ * and is available at http://www.eclipse.org/legal/epl-v10.html\r
+ */\r
+package org.opendaylight.nemo.user.vnspacemanager.structurestyle.updateintent;\r
+import org.opendaylight.nemo.user.vnspacemanager.structurestyle.updateintent.UpdateFlow;\r
+\r
+import static org.mockito.Mockito.mock;\r
+import org.junit.Assert;\r
+import org.junit.Before;\r
+import org.junit.Test;\r
+\r
+import org.opendaylight.controller.md.sal.binding.api.DataBroker;\r
+import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;\r
+import org.opendaylight.nemo.user.tenantmanager.TenantManage;\r
+import org.opendaylight.nemo.user.vnspacemanager.instancecheck.FlowInstanceCheck;\r
+import org.opendaylight.nemo.user.vnspacemanager.syntaxcheck.FlowDefinitionCheck;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.common.rev151010.UserId;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.intent.rev151010.Users;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.intent.rev151010.user.intent.Objects;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.intent.rev151010.user.intent.objects.Flow;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.intent.rev151010.user.intent.objects.FlowBuilder;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.intent.rev151010.user.intent.objects.FlowKey;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.intent.rev151010.users.User;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.intent.rev151010.users.UserKey;\r
+import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;\r
+import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;\r
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;\r
+import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;\r
+import com.google.common.util.concurrent.CheckedFuture;\r
+import com.google.common.util.concurrent.FutureCallback;\r
+import com.google.common.util.concurrent.Futures;\r
+import org.slf4j.Logger;\r
+import org.slf4j.LoggerFactory;\r
+\r
+/**\r
+ * Created by ldzd11 on 2015/11/9.\r
+ */\r
+public class UpdateFlowTest {\r
+\r
+ private UpdateFlow updateFlow;\r
+\r
+ private DataBroker dataBroker;\r
+ private TenantManage tenantManage;\r
+ private FlowDefinitionCheck flowDefinitionCheck;\r
+ private FlowInstanceCheck flowInstanceCheck;\r
+ private UserId userId;\r
+ private Flow flow;\r
+ @org.junit.Before\r
+ public void setUp() throws Exception {\r
+ dataBroker = mock(DataBroker.class);\r
+ tenantManage = mock(TenantManage.class);\r
+ flowDefinitionCheck = mock(FlowDefinitionCheck.class);\r
+ flowInstanceCheck = mock(FlowInstanceCheck.class);\r
+ userId = mock(UserId.class);\r
+ flow = mock(Flow.class);\r
+\r
+\r
+ updateFlow = mock(UpdateFlow.class);\r
+\r
+ }\r
+\r
+ @org.junit.Test\r
+ public void testFlowHandling() throws Exception {\r
+\r
+ Assert.assertNull(updateFlow.FlowHandling(userId, flow));\r
+\r
+ }\r
+}
\ No newline at end of file
--- /dev/null
+/*
+ * Copyright (c) 2015 Huawei, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.nemo.user.vnspacemanager.structurestyle.updateintent;
+import org.opendaylight.nemo.user.vnspacemanager.structurestyle.updateintent.UpdateIntent;
+
+import org.opendaylight.nemo.user.tenantmanager.TenantManage;
+import org.opendaylight.nemo.user.vnspacemanager.structurestyle.updateintent.UpdateIntent;
+import org.opendaylight.controller.md.sal.binding.api.DataBroker;
+import org.opendaylight.nemo.user.tenantmanager.AAA;
+import org.opendaylight.nemo.user.tenantmanager.TenantManage;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.intent.rev151010.StructureStyleNemoUpdateInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.intent.rev151010.user.intent.Results;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.intent.rev151010.user.intent.objects.Connection;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.intent.rev151010.user.intent.objects.Flow;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.intent.rev151010.user.intent.objects.Node;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.intent.rev151010.user.intent.operations.Operation;
+import static org.mockito.Mockito.mock;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+/**
+ * Created by ldzd11 on 2015/11/9.
+ */
+public class UpdateIntentTest {
+
+
+ UpdateIntent updateIntent;
+ private DataBroker dataBroker;
+ private TenantManage tenantManage;
+ private UpdateNode updateNode;
+ private UpdateConnection updateConnection;
+ private UpdateFlow updateFlow;
+ private UpdateOperation updateOperation;
+ private UpdateResult updateResult;
+ private AAA aaa;
+ private StructureStyleNemoUpdateInput structureStyleNemoUpdateInput;
+
+
+ @org.junit.Before
+ public void setUp() throws Exception {
+
+ dataBroker = mock(DataBroker.class);
+ tenantManage = mock(TenantManage.class);
+ updateNode = mock(UpdateNode.class);
+ updateConnection = mock(UpdateConnection.class);
+ updateFlow = mock(UpdateFlow.class);
+ updateOperation = mock(UpdateOperation.class);
+ updateResult = mock(UpdateResult.class);
+ aaa = mock(AAA.class);
+ structureStyleNemoUpdateInput = mock(StructureStyleNemoUpdateInput.class);
+
+ updateIntent = mock(UpdateIntent.class);
+ }
+
+ @org.junit.Test
+ public void testUpdateIntent() throws Exception {
+ Assert.assertNull(updateIntent.updateIntent(aaa,structureStyleNemoUpdateInput));
+ }
+}
\ No newline at end of file
--- /dev/null
+/*\r
+ * Copyright (c) 2015 Huawei, Inc. and others. All rights reserved.\r
+ *\r
+ * This program and the accompanying materials are made available under the\r
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
+ * and is available at http://www.eclipse.org/legal/epl-v10.html\r
+ */\r
+package org.opendaylight.nemo.user.vnspacemanager.structurestyle.updateintent;\r
+import org.opendaylight.nemo.user.vnspacemanager.structurestyle.updateintent.UpdateNode;\r
+\r
+import static org.mockito.Mockito.mock;\r
+import org.junit.Assert;\r
+import org.junit.Before;\r
+import org.junit.Test;\r
+\r
+import org.opendaylight.controller.md.sal.binding.api.DataBroker;\r
+import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;\r
+import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;\r
+import org.opendaylight.nemo.user.tenantmanager.TenantManage;\r
+import org.opendaylight.nemo.user.vnspacemanager.instancecheck.NodeInstanceCheck;\r
+import org.opendaylight.nemo.user.vnspacemanager.syntaxcheck.NodeDefinitionCheck;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.common.rev151010.UserId;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.intent.rev151010.Users;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.intent.rev151010.user.intent.Objects;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.intent.rev151010.user.intent.objects.Node;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.intent.rev151010.user.intent.objects.NodeBuilder;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.intent.rev151010.user.intent.objects.NodeKey;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.intent.rev151010.users.User;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.intent.rev151010.users.UserKey;\r
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;\r
+import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;\r
+import com.google.common.util.concurrent.CheckedFuture;\r
+import com.google.common.util.concurrent.FutureCallback;\r
+import com.google.common.util.concurrent.Futures;\r
+import org.slf4j.Logger;\r
+import org.slf4j.LoggerFactory;\r
+/**\r
+ * Created by ldzd11 on 2015/11/9.\r
+ */\r
+public class UpdateNodeTest {\r
+\r
+\r
+ private UpdateNode updateNode;\r
+\r
+ private DataBroker dataBroker;\r
+ private NodeDefinitionCheck nodeCheck;\r
+ private NodeInstanceCheck nodeInstanceCheck;\r
+ private UserId userId;\r
+ private Node node;\r
+\r
+ private TenantManage tenantManage;\r
+ @org.junit.Before\r
+ public void setUp() throws Exception {\r
+ dataBroker = mock(DataBroker.class);\r
+ nodeCheck = mock(NodeDefinitionCheck.class);\r
+ nodeInstanceCheck = mock(NodeInstanceCheck.class);\r
+\r
+ tenantManage = mock(TenantManage.class);\r
+ userId = mock(UserId.class);\r
+ node = mock(Node.class);\r
+\r
+\r
+ updateNode = mock(UpdateNode.class);\r
+\r
+ }\r
+\r
+ @org.junit.Test\r
+ public void testNodeHandling() throws Exception {\r
+ Assert.assertNull(updateNode.NodeHandling(userId, node));\r
+\r
+ }\r
+}
\ No newline at end of file
--- /dev/null
+/*\r
+ * Copyright (c) 2015 Huawei, Inc. and others. All rights reserved.\r
+ *\r
+ * This program and the accompanying materials are made available under the\r
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
+ * and is available at http://www.eclipse.org/legal/epl-v10.html\r
+ */\r
+package org.opendaylight.nemo.user.vnspacemanager.structurestyle.updateintent;\r
+import org.opendaylight.nemo.user.vnspacemanager.structurestyle.updateintent.UpdateOperation;\r
+\r
+import static org.mockito.Mockito.mock;\r
+import org.junit.Assert;\r
+import org.junit.Before;\r
+import org.junit.Test;\r
+\r
+import org.opendaylight.controller.md.sal.binding.api.DataBroker;\r
+import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;\r
+import org.opendaylight.nemo.user.tenantmanager.TenantManage;\r
+import org.opendaylight.nemo.user.vnspacemanager.instancecheck.OperationInstanceCheck;\r
+import org.opendaylight.nemo.user.vnspacemanager.syntaxcheck.OperationDefinitionCheck;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.common.rev151010.UserId;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.intent.rev151010.Users;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.intent.rev151010.user.intent.Operations;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.intent.rev151010.user.intent.operations.Operation;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.intent.rev151010.user.intent.operations.OperationBuilder;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.intent.rev151010.user.intent.operations.OperationKey;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.intent.rev151010.users.User;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.intent.rev151010.users.UserKey;\r
+import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;\r
+import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;\r
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;\r
+import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;\r
+import com.google.common.util.concurrent.CheckedFuture;\r
+import com.google.common.util.concurrent.FutureCallback;\r
+import com.google.common.util.concurrent.Futures;\r
+import org.slf4j.Logger;\r
+import org.slf4j.LoggerFactory;\r
+/**\r
+ * Created by ldzd11 on 2015/11/9.\r
+ */\r
+public class UpdateOperationTest {\r
+\r
+ private UpdateOperation updateOperation;\r
+\r
+ private DataBroker dataBroker;\r
+ private TenantManage tenantManage;\r
+ private OperationDefinitionCheck operationDefinitionCheck;\r
+ private OperationInstanceCheck operationInstanceCheck;\r
+\r
+ private UserId userId;\r
+ private Operation operation;\r
+ @org.junit.Before\r
+ public void setUp() throws Exception {\r
+ dataBroker = mock(DataBroker.class);\r
+ tenantManage = mock(TenantManage.class);\r
+ operationDefinitionCheck = mock(OperationDefinitionCheck.class);\r
+ operationInstanceCheck = mock(OperationInstanceCheck.class);\r
+ userId = mock(UserId.class);\r
+ operation = mock(Operation.class);\r
+\r
+ updateOperation = mock(UpdateOperation.class);\r
+\r
+ }\r
+\r
+ @org.junit.Test\r
+ public void testOperationHandling() throws Exception {\r
+ Assert.assertNull(updateOperation.OperationHandling(userId, operation));\r
+\r
+ }\r
+}
\ No newline at end of file
--- /dev/null
+/*\r
+ * Copyright (c) 2015 Huawei, Inc. and others. All rights reserved.\r
+ *\r
+ * This program and the accompanying materials are made available under the\r
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
+ * and is available at http://www.eclipse.org/legal/epl-v10.html\r
+ */\r
+package org.opendaylight.nemo.user.vnspacemanager.structurestyle.updateintent;\r
+import org.opendaylight.nemo.user.vnspacemanager.structurestyle.updateintent.UpdateResult;\r
+\r
+import static org.mockito.Mockito.mock;\r
+import org.junit.Assert;\r
+import org.junit.Before;\r
+import org.junit.Test;\r
+\r
+import org.opendaylight.controller.md.sal.binding.api.DataBroker;\r
+import org.opendaylight.nemo.user.tenantmanager.TenantManage;\r
+import org.opendaylight.nemo.user.vnspacemanager.instancecheck.ResultInstanceCheck;\r
+import org.opendaylight.nemo.user.vnspacemanager.syntaxcheck.ResultDefinitionCheck;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.common.rev151010.UserId;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.intent.rev151010.user.intent.Results;\r
+/**\r
+ * Created by ldzd11 on 2015/11/9.\r
+ */\r
+public class UpdateResultTest {\r
+\r
+\r
+ private UpdateResult updateResult;\r
+\r
+ private DataBroker dataBroker;\r
+ private TenantManage tenantManage;\r
+ private ResultDefinitionCheck resultDefinitionCheck;\r
+ private ResultInstanceCheck resultInstanceCheck;\r
+ private UserId userId;\r
+ private Results results;\r
+\r
+ @org.junit.Before\r
+ public void setUp() throws Exception {\r
+ dataBroker = mock(DataBroker.class);\r
+ tenantManage = mock(TenantManage.class);\r
+ resultDefinitionCheck = mock(ResultDefinitionCheck.class);\r
+ resultInstanceCheck = mock(ResultInstanceCheck.class);\r
+ userId = mock(UserId.class);\r
+ results = mock(Results.class);\r
+\r
+ updateResult = mock(UpdateResult.class);\r
+\r
+\r
+ }\r
+\r
+ @org.junit.Test\r
+ public void testResultHandling() throws Exception {\r
+ Assert.assertNull(updateResult.ResultHandling(userId, results));\r
+\r
+ }\r
+}
\ No newline at end of file
--- /dev/null
+/*\r
+ * Copyright (c) 2015 Huawei, Inc. and others. All rights reserved.\r
+ *\r
+ * This program and the accompanying materials are made available under the\r
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
+ * and is available at http://www.eclipse.org/legal/epl-v10.html\r
+ */\r
+package org.opendaylight.nemo.user.vnspacemanager.syntaxcheck;\r
+\r
+import junit.framework.TestCase;\r
+import org.junit.Assert;\r
+import org.junit.Before;\r
+import org.junit.Test;\r
+import static org.mockito.Mockito.*;\r
+import org.opendaylight.controller.md.sal.binding.api.DataBroker;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.common.rev151010.PropertyName;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.intent.rev151010.user.intent.objects.Connection;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.object.rev151010.ConnectionDefinitions;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.object.rev151010.connection.definitions.ConnectionDefinition;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.object.rev151010.connection.instance.Property;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.object.rev151010.property.definitions.PropertyDefinition;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.object.rev151010.property.instance.PropertyValues;\r
+import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;\r
+import org.opendaylight.controller.md.sal.binding.api.ReadOnlyTransaction;\r
+import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;\r
+import org.opendaylight.yangtools.yang.common.RpcResult;\r
+import org.opendaylight.yangtools.yang.common.RpcResultBuilder;\r
+import org.opendaylight.yangtools.yang.common.RpcError.ErrorType;\r
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;\r
+import com.google.common.base.Optional;\r
+import com.google.common.base.Function;\r
+import com.google.common.util.concurrent.CheckedFuture;\r
+import com.google.common.util.concurrent.FutureCallback;\r
+import com.google.common.util.concurrent.Futures;\r
+import com.google.common.util.concurrent.ListenableFuture;\r
+\r
+import org.slf4j.Logger;\r
+import org.slf4j.LoggerFactory;\r
+import java.util.List;\r
+\r
+/**\r
+ * Created by Thomas Liu on 2015/11/11.\r
+ */\r
+public class ConnectionDefinitionCheckTest extends TestCase {\r
+\r
+ private ConnectionDefinitionCheck connectionDefinitionCheckTest;\r
+ private Connection connection;\r
+ @Before\r
+ public void setUp() {\r
+ connectionDefinitionCheckTest = mock(ConnectionDefinitionCheck.class);\r
+ connection = mock(Connection.class);\r
+\r
+ }\r
+ @Test\r
+ public void testCheckConnectionDefinition() {\r
+ connection.getProperty();\r
+ connectionDefinitionCheckTest.CheckConnectionDefinition(connection);\r
+ Assert.assertNotNull(connectionDefinitionCheckTest);\r
+ verify(connectionDefinitionCheckTest).CheckConnectionDefinition(connection);\r
+\r
+\r
+ }\r
+}
\ No newline at end of file
--- /dev/null
+/*\r
+ * Copyright (c) 2015 Huawei, Inc. and others. All rights reserved.\r
+ *\r
+ * This program and the accompanying materials are made available under the\r
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
+ * and is available at http://www.eclipse.org/legal/epl-v10.html\r
+ */\r
+package org.opendaylight.nemo.user.vnspacemanager.syntaxcheck;\r
+\r
+import junit.framework.TestCase;\r
+import org.junit.Assert;\r
+import org.junit.Before;\r
+import org.junit.Test;\r
+import static org.mockito.Mockito.*;\r
+import org.opendaylight.controller.md.sal.binding.api.DataBroker;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.intent.rev151010.user.intent.objects.Flow;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.object.rev151010.FlowPropertyDefinitions;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.object.rev151010.MatchItemDefinitions;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.object.rev151010.flow.instance.MatchItem;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.object.rev151010.match.item.definitions.MatchItemDefinition;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.object.rev151010.match.item.instance.MatchItemValue;\r
+import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;\r
+import org.opendaylight.controller.md.sal.binding.api.ReadOnlyTransaction;\r
+import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;\r
+import org.opendaylight.yangtools.yang.common.RpcResult;\r
+import org.opendaylight.yangtools.yang.common.RpcResultBuilder;\r
+import org.opendaylight.yangtools.yang.common.RpcError.ErrorType;\r
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;\r
+import com.google.common.base.Optional;\r
+import com.google.common.base.Function;\r
+import com.google.common.util.concurrent.CheckedFuture;\r
+import com.google.common.util.concurrent.FutureCallback;\r
+import com.google.common.util.concurrent.Futures;\r
+import com.google.common.util.concurrent.ListenableFuture;\r
+\r
+import org.slf4j.Logger;\r
+import org.slf4j.LoggerFactory;\r
+import java.util.List;\r
+\r
+/**\r
+ * Created by Thomas Liu on 2015/11/11.\r
+ */\r
+public class FlowDefinitionCheckTest extends TestCase {\r
+\r
+ private FlowDefinitionCheck flowDefinitionCheckTest;\r
+ private Flow flow;\r
+ @Before\r
+ public void setUp() throws Exception {\r
+ flowDefinitionCheckTest = mock(FlowDefinitionCheck.class);\r
+ flow = mock(Flow.class);\r
+ }\r
+\r
+ @Test\r
+ public void testCheckDefinition() throws Exception {\r
+ flowDefinitionCheckTest.CheckDefinition(flow);\r
+ Assert.assertNotNull(flowDefinitionCheckTest);\r
+ verify(flowDefinitionCheckTest).CheckDefinition(flow);\r
+\r
+ }\r
+}
\ No newline at end of file
--- /dev/null
+/*\r
+ * Copyright (c) 2015 Huawei, Inc. and others. All rights reserved.\r
+ *\r
+ * This program and the accompanying materials are made available under the\r
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
+ * and is available at http://www.eclipse.org/legal/epl-v10.html\r
+ */\r
+package org.opendaylight.nemo.user.vnspacemanager.syntaxcheck;\r
+\r
+import junit.framework.TestCase;\r
+import org.junit.Assert;\r
+import org.junit.Before;\r
+import org.junit.Test;\r
+import static org.mockito.Mockito.*;\r
+import static org.junit.Assert.*;\r
+import org.opendaylight.controller.md.sal.binding.api.DataBroker;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.common.rev151010.NodeType;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.common.rev151010.PropertyName;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.intent.rev151010.user.intent.objects.Node;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.object.rev151010.NodeDefinitions;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.object.rev151010.node.definitions.NodeDefinition;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.object.rev151010.node.instance.Property;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.object.rev151010.property.definitions.PropertyDefinition;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.object.rev151010.property.instance.PropertyValues;\r
+\r
+import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;\r
+import org.opendaylight.controller.md.sal.binding.api.ReadOnlyTransaction;\r
+import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;\r
+import org.opendaylight.yangtools.yang.common.RpcResult;\r
+import org.opendaylight.yangtools.yang.common.RpcResultBuilder;\r
+import org.opendaylight.yangtools.yang.common.RpcError.ErrorType;\r
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;\r
+import com.google.common.base.Optional;\r
+import com.google.common.base.Function;\r
+import com.google.common.util.concurrent.CheckedFuture;\r
+import com.google.common.util.concurrent.FutureCallback;\r
+import com.google.common.util.concurrent.Futures;\r
+import com.google.common.util.concurrent.ListenableFuture;\r
+\r
+import org.slf4j.Logger;\r
+import org.slf4j.LoggerFactory;\r
+\r
+import java.util.List;\r
+\r
+/**\r
+ * Created by Thomas Liu on 2015/11/11.\r
+ */\r
+public class NodeDefinitionCheckTest extends TestCase {\r
+\r
+ private Node node;\r
+ private NodeDefinitionCheck nodeDefinitionCheckTest;\r
+ @Before\r
+ public void setUp() throws Exception {\r
+ node = mock(Node.class);\r
+ nodeDefinitionCheckTest = mock(NodeDefinitionCheck.class);\r
+\r
+ }\r
+\r
+ @Test\r
+ public void testCheckNodeDefinition() throws Exception {\r
+ nodeDefinitionCheckTest.CheckNodeDefinition(node);\r
+ Assert.assertNotNull(nodeDefinitionCheckTest);\r
+ verify(nodeDefinitionCheckTest).CheckNodeDefinition(node);\r
+\r
+ }\r
+}
\ No newline at end of file
--- /dev/null
+/*\r
+ * Copyright (c) 2015 Huawei, Inc. and others. All rights reserved.\r
+ *\r
+ * This program and the accompanying materials are made available under the\r
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
+ * and is available at http://www.eclipse.org/legal/epl-v10.html\r
+ */\r
+package org.opendaylight.nemo.user.vnspacemanager.syntaxcheck;\r
+\r
+import junit.framework.TestCase;\r
+import org.junit.Assert;\r
+import org.junit.Before;\r
+import org.junit.Test;\r
+import static org.mockito.Mockito.*;\r
+import static org.junit.Assert.*;\r
+import com.google.common.base.Optional;\r
+import com.google.common.util.concurrent.FutureCallback;\r
+import com.google.common.util.concurrent.Futures;\r
+import com.google.common.util.concurrent.ListenableFuture;\r
+import org.opendaylight.controller.md.sal.binding.api.DataBroker;\r
+import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.common.rev151010.ParameterName;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.intent.rev151010.user.intent.operations.Operation;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.operation.rev151010.ActionDefinitions;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.operation.rev151010.ConditionParameterDefinitions;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.operation.rev151010.action.definitions.ActionDefinition;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.operation.rev151010.action.instance.ParameterValues;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.operation.rev151010.condition.instance.ConditionSegment;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.operation.rev151010.condition.instance.condition.segment.ConditionParameterTargetValue;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.operation.rev151010.condition.parameter.definitions.ConditionParameterDefinition;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.operation.rev151010.condition.parameter.definitions.condition.parameter.definition.ParameterMatchPatterns;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.operation.rev151010.operation.instance.Action;\r
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;\r
+import org.slf4j.Logger;\r
+import org.slf4j.LoggerFactory;\r
+\r
+import java.util.List;\r
+\r
+/**\r
+ * Created by Thomas Liu on 2015/11/11.\r
+ */\r
+public class OperationDefinitionCheckTest extends TestCase {\r
+\r
+ private Operation operation;\r
+ private OperationDefinitionCheck operationDefinitionCheckTest;\r
+\r
+ @Before\r
+ public void setUp() throws Exception {\r
+ operationDefinitionCheckTest = mock(OperationDefinitionCheck.class);\r
+ operation = mock(Operation.class);\r
+\r
+ }\r
+\r
+ @Test\r
+ public void testCheckDefinition() throws Exception {\r
+ operationDefinitionCheckTest.CheckDefinition(operation);\r
+ Assert.assertNotNull(operationDefinitionCheckTest);\r
+ verify(operationDefinitionCheckTest).CheckDefinition(operation);\r
+\r
+ }\r
+\r
+}
\ No newline at end of file
--- /dev/null
+/*\r
+ * Copyright (c) 2015 Huawei, Inc. and others. All rights reserved.\r
+ *\r
+ * This program and the accompanying materials are made available under the\r
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
+ * and is available at http://www.eclipse.org/legal/epl-v10.html\r
+ */\r
+package org.opendaylight.nemo.user.vnspacemanager.syntaxcheck;\r
+\r
+import junit.framework.TestCase;\r
+import org.junit.Assert;\r
+import org.junit.Before;\r
+import org.junit.Test;\r
+import static org.mockito.Mockito.*;\r
+import static org.junit.Assert.*;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.intent.rev151010.user.intent.Results;\r
+\r
+\r
+/**\r
+ * Created by Thomas Liu on 2015/11/11.\r
+ */\r
+public class ResultDefinitionCheckTest extends TestCase {\r
+\r
+ private Results results;\r
+ private ResultDefinitionCheck resultDefinitionCheckTest;\r
+ @Before\r
+ public void setUp() throws Exception {\r
+ resultDefinitionCheckTest = mock(ResultDefinitionCheck.class);\r
+ results = mock(Results.class);\r
+\r
+ }\r
+\r
+ @Test\r
+ public void testCheckDefinition() throws Exception {\r
+ resultDefinitionCheckTest.CheckDefinition(results);\r
+ Assert.assertNotNull(resultDefinitionCheckTest);\r
+ verify(resultDefinitionCheckTest).CheckDefinition(results);\r
+\r
+ }\r
+}
\ No newline at end of file