X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fconfig%2Fyang-jmx-generator-plugin%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fconfig%2Fyangjmxgenerator%2Fplugin%2Fftl%2FFtlFilePersisterTest.java;fp=opendaylight%2Fconfig%2Fyang-jmx-generator-plugin%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fconfig%2Fyangjmxgenerator%2Fplugin%2Fftl%2FFtlFilePersisterTest.java;h=0000000000000000000000000000000000000000;hb=cd0a18d48f5e8b6ff208b6633e05ee003979218e;hp=2582a602b38c5321cf05728c68ed2f9556802e77;hpb=ef6bd770f1366f84fdbc7ab19fa649953b36197b;p=controller.git diff --git a/opendaylight/config/yang-jmx-generator-plugin/src/test/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/FtlFilePersisterTest.java b/opendaylight/config/yang-jmx-generator-plugin/src/test/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/FtlFilePersisterTest.java deleted file mode 100644 index 2582a602b3..0000000000 --- a/opendaylight/config/yang-jmx-generator-plugin/src/test/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/FtlFilePersisterTest.java +++ /dev/null @@ -1,72 +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.yangjmxgenerator.plugin.ftl; - -import static org.junit.Assert.assertEquals; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; -import java.util.Map; - -import org.junit.Before; -import org.junit.Test; -import org.mockito.MockitoAnnotations; -import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.Field; -import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.MethodDeclaration; -import org.opendaylight.controller.config.yangjmxgenerator.plugin.util.FormattingUtil; - -import com.google.common.collect.Lists; - -public class FtlFilePersisterTest { - private final FtlFilePersister tested = new FtlFilePersister(); - - @Before - public void setUp() { - MockitoAnnotations.initMocks(this); - } - - @Test - public void testGeneralInterface() { - String packageName = "pa.cka.ge"; - String name = "GeneralClassImpl"; - List extendedInterfaces = Arrays.asList("List", "Set"); - List methods = new ArrayList<>(); - methods.add(new MethodDeclaration("String", "executeOperation", - Collections. emptyList())); - - List mods = Lists.newArrayList(); - List mods2 = Lists.newArrayList("final"); - methods.add(new MethodDeclaration("String", "executeOperation", Arrays - .asList(new Field(mods, "int", "param1"), new Field(mods2, "long", "param2")))); - - GeneralInterfaceTemplate generalInterface = new GeneralInterfaceTemplate( - null, packageName, name, extendedInterfaces, methods); - - Map abstractFtlFileStringMap = tested - .serializeFtls(Arrays.asList(generalInterface)); - String content = FormattingUtil - .cleanUpEmptyLinesAndIndent(abstractFtlFileStringMap.get(generalInterface)); - - // skip header - content = content.substring(content.indexOf("package")); - - String expected = "package pa.cka.ge;\n" - + "/**\n" - + "*\n" - + "*/\n" - + "public interface GeneralClassImpl extends List, Set\n{\n" - + "public String executeOperation();\n" - + "public String executeOperation(int param1, final long param2);\n" - + "}\n"; - - assertEquals(expected, content); - } - -}