2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Copyright (C) 2017 Amdocs
8 * =============================================================================
9 * Licensed under the Apache License, Version 2.0 (the "License");
10 * you may not use this file except in compliance with the License.
11 * You may obtain a copy of the License at
13 * http://www.apache.org/licenses/LICENSE-2.0
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS,
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
21 * ECOMP is a trademark and service mark of AT&T Intellectual Property.
22 * ============LICENSE_END=========================================================
25 package org.onap.appc.tools.generator.api;
27 import org.junit.Assert;
28 import org.junit.Test;
30 public class CLITest {
32 public void missingSourceFileTest() {
35 String[] input = new String[1];
37 } catch (Exception e) {
38 Assert.assertEquals("Source file is missing. Please add argument 'client <source file> <destination file> <model template>'",e.getMessage());
42 public void missingDestinationFileTest() {
45 String[] input = {"sourceFilePath",null};
47 } catch (Exception e) {
48 Assert.assertEquals("Destination file name is missing. Please add argument 'client sourceFilePath <destination> <model template> <builder> <conf file>'",e.getMessage());
52 public void missingTemplateFileTest() {
55 String[] input = {"sourceFilePath","destinationPath",null};
57 } catch (Exception e) {
58 Assert.assertEquals("template file name is missing. Please add argument 'client sourceFilePath destinationPath <model template> <builder> <conf file>'",e.getMessage());
62 public void missingBuilderNameTest() {
65 String[] input = {"sourceFilePath","destinationPath","templateFileName",null};
67 } catch (Exception e) {
68 Assert.assertEquals("builder FQDN is missing. Please add argument 'client sourceFilePath destinationPath templateFileName <builder> <conf file>'",e.getMessage());
72 public void missingContextConfFileNameTest() {
75 String[] input = {"sourceFilePath","destinationPath","templateFileName","builderFQDN",null};
77 } catch (Exception e) {
78 Assert.assertEquals(e.getMessage(),"context conf file is missing. Please add argument 'client sourceFilePath destinationPath templateFileName builderFQDN <conf file>'");