2 * Copyright (c) 2015 Huawei, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.nemo.intent;
10 import junit.framework.TestCase;
11 import org.junit.Before;
12 import org.junit.Assert;
13 import org.junit.Test;
14 import org.opendaylight.nemo.intent.*;
15 import org.opendaylight.nemo.intent.computation.PNComputationUnit;
16 import org.opendaylight.nemo.intent.computation.VNComputationUnit;
17 import org.opendaylight.nemo.intent.computation.VNMappingUnit;
18 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
20 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.common.rev151010.UserId;
22 import static org.junit.Assert.*;
23 import static org.mockito.Mockito.*;
26 * Created by zhangmeng on 2015/11/10.
28 public class IntentResolverTest extends TestCase {
29 private DataBroker dataBroker;
30 private NodeMapper nodeMapper;
31 private ConnectionMapper connectionMapper;
32 private FlowManager flowManager;
33 private OperationResolver operationResolver;
34 private PNComputationUnit pnComputationUnit;
35 private Map<UserId, VNComputationUnit> vnComputationUnits;
36 private VNMappingUnit vnMappingUnit;
38 private IntentResolver intentResolver;
41 public void setUp() throws Exception {
42 dataBroker = mock(DataBroker.class);
43 intentResolver = mock(IntentResolver.class);
47 public void testResolveIntent() throws Exception {
48 UserId userId = mock(UserId.class);
49 intentResolver.resolveIntent(userId);
50 verify(intentResolver).resolveIntent(any(UserId.class));
51 Assert.assertNotNull(intentResolver);
55 public void testClose() throws Exception {
56 intentResolver.close();
57 verify(intentResolver).close();
58 Assert.assertNotNull(intentResolver);