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