X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fconfig%2Fyang-store-impl%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fconfig%2Fyang%2Fstore%2Fimpl%2FHardcodedYangStoreService.java;fp=opendaylight%2Fconfig%2Fyang-store-impl%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fconfig%2Fyang%2Fstore%2Fimpl%2FHardcodedYangStoreService.java;h=0000000000000000000000000000000000000000;hp=6221682147e86eea464e3f25abb066d0bfa4d3aa;hb=c99a5bb839b67beefc5a339e60438894ab4037c2;hpb=a8ceea323c972b086d3c9e6817dce53659ce8343 diff --git a/opendaylight/config/yang-store-impl/src/test/java/org/opendaylight/controller/config/yang/store/impl/HardcodedYangStoreService.java b/opendaylight/config/yang-store-impl/src/test/java/org/opendaylight/controller/config/yang/store/impl/HardcodedYangStoreService.java deleted file mode 100644 index 6221682147..0000000000 --- a/opendaylight/config/yang-store-impl/src/test/java/org/opendaylight/controller/config/yang/store/impl/HardcodedYangStoreService.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0 which accompanies this distribution, - * and is available at http://www.eclipse.org/legal/epl-v10.html - */ -package org.opendaylight.controller.config.yang.store.impl; - -import org.apache.commons.io.IOUtils; -import org.opendaylight.controller.config.yang.store.api.YangStoreException; -import org.opendaylight.controller.config.yang.store.api.YangStoreService; -import org.opendaylight.controller.config.yang.store.api.YangStoreSnapshot; - -import java.io.ByteArrayInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.util.ArrayList; -import java.util.Collection; - -import static org.junit.Assert.assertNotNull; - -public class HardcodedYangStoreService implements YangStoreService { - - private final Collection byteArrayInputStreams; - - public HardcodedYangStoreService( - Collection inputStreams) - throws YangStoreException, IOException { - byteArrayInputStreams = new ArrayList<>(); - for (InputStream inputStream : inputStreams) { - assertNotNull(inputStream); - byte[] content = IOUtils.toByteArray(inputStream); - ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream( - content); - byteArrayInputStreams.add(byteArrayInputStream); - } - } - - @Override - public YangStoreSnapshot getYangStoreSnapshot() throws YangStoreException { - for (InputStream inputStream : byteArrayInputStreams) { - try { - inputStream.reset(); - } catch (IOException e) { - throw new RuntimeException(e); - } - } - return new MbeParser().parseYangFiles(byteArrayInputStreams); - } -}