From 781b1a6df324419c846c84ea983c18fc8362bfd3 Mon Sep 17 00:00:00 2001 From: Patrick Brady Date: Wed, 13 Dec 2017 11:19:06 -0800 Subject: Third part of onap rename This part of the commit changes the folder structure on all other folders of appc. Change-Id: I8acfa11cdfcdcd36be0e137245d1dd7324f1abd3 Signed-off-by: Patrick Brady Issue-ID: APPC-13 --- .../org/onap/appc/tools/generator/api/CLITest.java | 57 ++++++++++++++++++++++ .../tools/generator/impl/CodeGenWriterTest.java | 22 +++++++++ .../appc/tools/generator/api/CLITest.java | 57 ---------------------- .../tools/generator/impl/CodeGenWriterTest.java | 22 --------- 4 files changed, 79 insertions(+), 79 deletions(-) create mode 100644 appc-client/code-generator/src/test/java/org/onap/appc/tools/generator/api/CLITest.java create mode 100644 appc-client/code-generator/src/test/java/org/onap/appc/tools/generator/impl/CodeGenWriterTest.java delete mode 100644 appc-client/code-generator/src/test/java/org/openecomp/appc/tools/generator/api/CLITest.java delete mode 100644 appc-client/code-generator/src/test/java/org/openecomp/appc/tools/generator/impl/CodeGenWriterTest.java (limited to 'appc-client/code-generator/src/test') diff --git a/appc-client/code-generator/src/test/java/org/onap/appc/tools/generator/api/CLITest.java b/appc-client/code-generator/src/test/java/org/onap/appc/tools/generator/api/CLITest.java new file mode 100644 index 000000000..4cd6bb5f5 --- /dev/null +++ b/appc-client/code-generator/src/test/java/org/onap/appc/tools/generator/api/CLITest.java @@ -0,0 +1,57 @@ +package org.onap.appc.tools.generator.api; + +import org.junit.Assert; +import org.junit.Test; + +public class CLITest { + @Test + public void missingSourceFileTest() { + CLI cli = new CLI(); + try { + String[] input = new String[1]; + cli.main(input); + } catch (Exception e) { + Assert.assertEquals("Source file is missing. Please add argument 'client '",e.getMessage()); + } + } + @Test + public void missingDestinationFileTest() { + CLI cli = new CLI(); + try { + String[] input = {"sourceFilePath",null}; + cli.main(input); + } catch (Exception e) { + Assert.assertEquals("Destination file name is missing. Please add argument 'client sourceFilePath '",e.getMessage()); + } + } + @Test + public void missingTemplateFileTest() { + CLI cli = new CLI(); + try { + String[] input = {"sourceFilePath","destinationPath",null}; + cli.main(input); + } catch (Exception e) { + Assert.assertEquals("template file name is missing. Please add argument 'client sourceFilePath destinationPath '",e.getMessage()); + } + } + @Test + public void missingBuilderNameTest() { + CLI cli = new CLI(); + try { + String[] input = {"sourceFilePath","destinationPath","templateFileName",null}; + cli.main(input); + } catch (Exception e) { + Assert.assertEquals("builder FQDN is missing. Please add argument 'client sourceFilePath destinationPath templateFileName '",e.getMessage()); + } + } + @Test + public void missingContextConfFileNameTest() { + CLI cli = new CLI(); + try { + String[] input = {"sourceFilePath","destinationPath","templateFileName","builderFQDN",null}; + cli.main(input); + } catch (Exception e) { + Assert.assertEquals(e.getMessage(),"context conf file is missing. Please add argument 'client sourceFilePath destinationPath templateFileName builderFQDN '"); + } + } +} diff --git a/appc-client/code-generator/src/test/java/org/onap/appc/tools/generator/impl/CodeGenWriterTest.java b/appc-client/code-generator/src/test/java/org/onap/appc/tools/generator/impl/CodeGenWriterTest.java new file mode 100644 index 000000000..e0669b836 --- /dev/null +++ b/appc-client/code-generator/src/test/java/org/onap/appc/tools/generator/impl/CodeGenWriterTest.java @@ -0,0 +1,22 @@ +package org.onap.appc.tools.generator.impl; + +import org.junit.Assert; +import org.junit.Test; + +import java.io.IOException; + + +public class CodeGenWriterTest { + @Test + public void writeTest() throws IOException { + CodeGenWriter codeGenWriter = new CodeGenWriter("destination"); + char[] cbuf = {'t','e','s','t'}; + int off = 1; + int len = 3; + codeGenWriter.write(cbuf,off,len); + codeGenWriter.flush(); + codeGenWriter.close(); + Assert.assertNotNull(codeGenWriter); + } + +} diff --git a/appc-client/code-generator/src/test/java/org/openecomp/appc/tools/generator/api/CLITest.java b/appc-client/code-generator/src/test/java/org/openecomp/appc/tools/generator/api/CLITest.java deleted file mode 100644 index 4cd6bb5f5..000000000 --- a/appc-client/code-generator/src/test/java/org/openecomp/appc/tools/generator/api/CLITest.java +++ /dev/null @@ -1,57 +0,0 @@ -package org.onap.appc.tools.generator.api; - -import org.junit.Assert; -import org.junit.Test; - -public class CLITest { - @Test - public void missingSourceFileTest() { - CLI cli = new CLI(); - try { - String[] input = new String[1]; - cli.main(input); - } catch (Exception e) { - Assert.assertEquals("Source file is missing. Please add argument 'client '",e.getMessage()); - } - } - @Test - public void missingDestinationFileTest() { - CLI cli = new CLI(); - try { - String[] input = {"sourceFilePath",null}; - cli.main(input); - } catch (Exception e) { - Assert.assertEquals("Destination file name is missing. Please add argument 'client sourceFilePath '",e.getMessage()); - } - } - @Test - public void missingTemplateFileTest() { - CLI cli = new CLI(); - try { - String[] input = {"sourceFilePath","destinationPath",null}; - cli.main(input); - } catch (Exception e) { - Assert.assertEquals("template file name is missing. Please add argument 'client sourceFilePath destinationPath '",e.getMessage()); - } - } - @Test - public void missingBuilderNameTest() { - CLI cli = new CLI(); - try { - String[] input = {"sourceFilePath","destinationPath","templateFileName",null}; - cli.main(input); - } catch (Exception e) { - Assert.assertEquals("builder FQDN is missing. Please add argument 'client sourceFilePath destinationPath templateFileName '",e.getMessage()); - } - } - @Test - public void missingContextConfFileNameTest() { - CLI cli = new CLI(); - try { - String[] input = {"sourceFilePath","destinationPath","templateFileName","builderFQDN",null}; - cli.main(input); - } catch (Exception e) { - Assert.assertEquals(e.getMessage(),"context conf file is missing. Please add argument 'client sourceFilePath destinationPath templateFileName builderFQDN '"); - } - } -} diff --git a/appc-client/code-generator/src/test/java/org/openecomp/appc/tools/generator/impl/CodeGenWriterTest.java b/appc-client/code-generator/src/test/java/org/openecomp/appc/tools/generator/impl/CodeGenWriterTest.java deleted file mode 100644 index e0669b836..000000000 --- a/appc-client/code-generator/src/test/java/org/openecomp/appc/tools/generator/impl/CodeGenWriterTest.java +++ /dev/null @@ -1,22 +0,0 @@ -package org.onap.appc.tools.generator.impl; - -import org.junit.Assert; -import org.junit.Test; - -import java.io.IOException; - - -public class CodeGenWriterTest { - @Test - public void writeTest() throws IOException { - CodeGenWriter codeGenWriter = new CodeGenWriter("destination"); - char[] cbuf = {'t','e','s','t'}; - int off = 1; - int len = 3; - codeGenWriter.write(cbuf,off,len); - codeGenWriter.flush(); - codeGenWriter.close(); - Assert.assertNotNull(codeGenWriter); - } - -} -- cgit 1.2.3-korg