2 * Copyright © 2020 Orange Labs, 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.transportpce.pce.service;
10 import org.junit.After;
11 import org.junit.Assert;
12 import org.junit.Before;
13 import org.junit.Test;
14 import org.opendaylight.transportpce.common.network.NetworkTransactionImpl;
15 import org.opendaylight.transportpce.common.network.RequestProcessor;
16 import org.opendaylight.transportpce.pce.gnpy.GnpyResult;
17 import org.opendaylight.transportpce.pce.gnpy.GnpyTopoImpl;
18 import org.opendaylight.transportpce.pce.utils.PceTestData;
19 import org.opendaylight.transportpce.test.AbstractTest;
21 public class PathComputationServiceImplTest extends AbstractTest {
23 private PathComputationServiceImpl pathComputationServiceImpl;
27 pathComputationServiceImpl = new PathComputationServiceImpl(
28 new NetworkTransactionImpl(new RequestProcessor(this.getDataBroker())),
29 this.getNotificationPublishService());
30 pathComputationServiceImpl.init();
34 public void pathComputationRequestTest() {
36 pathComputationServiceImpl.pathComputationRequest(PceTestData.getEmptyPCERequest()));
40 @Test(expected = Exception.class)
41 public void generateGnpyResponse() throws Exception {
43 GnpyResult gnpyResult =
44 new GnpyResult("A-to-Z",
45 new GnpyTopoImpl(new NetworkTransactionImpl(
46 new RequestProcessor(this.getNewDataBroker()))));
47 pathComputationServiceImpl.generateGnpyResponse(gnpyResult.getResponse(), "A-to-Z");
52 public void destroy() {
53 pathComputationServiceImpl.close();