1 /*******************************************************************************
2 * ============LICENSE_START========================================================================
3 * ONAP : ccsdk feature sdnr wt
4 * =================================================================================================
5 * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved.
6 * =================================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
8 * in compliance with the License. You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software distributed under the License
13 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
14 * or implied. See the License for the specific language governing permissions and limitations under
16 * ============LICENSE_END==========================================================================
17 ******************************************************************************/
18 package org.onap.ccsdk.features.sdnr.wt.dataprovider.test;
20 import static org.junit.Assert.fail;
24 import org.junit.Test;
25 import org.onap.ccsdk.features.sdnr.wt.dataprovider.http.AboutHttpServlet;
26 import org.onap.ccsdk.features.sdnr.wt.dataprovider.http.MsServlet;
27 import org.onap.ccsdk.features.sdnr.wt.dataprovider.impl.DataProviderImpl;
28 import org.onap.ccsdk.features.sdnr.wt.dataprovider.model.StatusChangedHandler.StatusKey;
29 import org.opendaylight.mdsal.binding.api.RpcProviderService;
30 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.DataProviderService;
31 import org.opendaylight.yangtools.concepts.ObjectRegistration;
32 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
33 import org.opendaylight.yangtools.yang.binding.RpcService;
35 import net.bytebuddy.implementation.bytecode.StackSize;
38 * @author Michael Dürre
41 public class TestImplementation {
45 DataProviderImpl impl = new DataProviderImpl();
46 impl.setRpcProviderService(new RpcProviderService() {
49 public <S extends RpcService, T extends S> ObjectRegistration<T> registerRpcImplementation(Class<S> type,
50 T implementation, Set<InstanceIdentifier<?>> paths) {
51 // TODO Auto-generated method stub
56 public <S extends RpcService, T extends S> ObjectRegistration<T> registerRpcImplementation(Class<S> type,
58 // TODO Auto-generated method stub
62 impl.setMediatorServerServlet(new MsServlet());
63 impl.setAboutServlet(new AboutHttpServlet());
66 } catch (Exception e) {
68 fail("failed to init impl: "+e.getMessage());
71 impl.setStatus(StatusKey.CLUSTER_SIZE, "3");
72 impl.setReadyStatus(true);
75 } catch (Exception e) {
77 fail("failed to close impl: "+e.getMessage());