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 static org.mockito.Matchers.any;
11 import static org.mockito.Mockito.mock;
12 import static org.mockito.Mockito.verify;
16 import junit.framework.TestCase;
18 import org.junit.Assert;
19 import org.junit.Before;
20 import org.junit.Test;
21 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
22 import org.opendaylight.nemo.intent.computation.PNComputationUnit;
23 import org.opendaylight.nemo.intent.computation.VNComputationUnit;
24 import org.opendaylight.nemo.intent.computation.VNMappingUnit;
25 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.common.rev151010.UserId;
28 * Created by zhangmeng on 2015/11/10.
30 public class IntentResolverTest extends TestCase {
31 private DataBroker dataBroker;
32 private NodeMapper nodeMapper;
33 private ConnectionMapper connectionMapper;
34 private FlowManager flowManager;
35 private OperationResolver operationResolver;
36 private PNComputationUnit pnComputationUnit;
37 private Map<UserId, VNComputationUnit> vnComputationUnits;
38 private VNMappingUnit vnMappingUnit;
40 private IntentResolver intentResolver;
43 public void setUp() throws Exception {
44 dataBroker = mock(DataBroker.class);
45 intentResolver = mock(IntentResolver.class);
49 public void testResolveIntent() throws Exception {
50 UserId userId = mock(UserId.class);
51 intentResolver.resolveIntent(userId);
52 verify(intentResolver).resolveIntent(any(UserId.class));
53 Assert.assertNotNull(intentResolver);
57 public void testClose() throws Exception {
58 intentResolver.close();
59 verify(intentResolver).close();
60 Assert.assertNotNull(intentResolver);