Shankara-Huawei
Committed by Gerrit Code Review

[ONOS-4831] Implement op param class for apps

Change-Id: I88aee8a3009de84649c959e21ce83e3bbbf63c18
Showing 16 changed files with 319 additions and 27 deletions
......@@ -150,6 +150,12 @@ public class YangUtilManager
@Parameter(readonly = true, defaultValue = "${project.remoteArtifactRepositories}")
private List<ArtifactRepository> remoteRepository;
/**
* Code generation is for nbi or sbi.
*/
@Parameter(property = "generateJavaFileForsbi", defaultValue = "nbi")
private String generateJavaFileForsbi;
@Override
public void execute()
throws MojoExecutionException, MojoFailureException {
......@@ -177,6 +183,7 @@ public class YangUtilManager
yangPlugin.setManagerCodeGenDir(managerCodeGenDir);
yangPlugin.setConflictResolver(conflictResolver);
yangPlugin.setCodeGenerateForsbi(generateJavaFileForsbi.toLowerCase());
/*
* Obtain the YANG files at a path mentioned in plugin and creates
* YANG file information set.
......
......@@ -44,8 +44,7 @@ public final class GeneratedJavaFileType {
/**
* Interface and class file.
*/
public static final int GENERATE_INTERFACE_WITH_BUILDER = INTERFACE_MASK
| BUILDER_INTERFACE_MASK | BUILDER_CLASS_MASK | IMPL_CLASS_MASK;
public static final int GENERATE_INTERFACE_WITH_BUILDER = 8207;
/**
* Java interface corresponding to rpc.
......@@ -94,6 +93,16 @@ public final class GeneratedJavaFileType {
public static final int GENERATE_IDENTITY_CLASS = 2048;
/**
* Operation class file.
*/
public static final int OPERATION_CLASS_MASK = 4096;
/**
* Operation class builder file.
*/
public static final int OPERATION_BUILDER_CLASS_MASK = 8192;
/**
* Creates an instance of generate java file type.
*/
private GeneratedJavaFileType() {
......
......@@ -32,6 +32,7 @@ import static org.onosproject.yangutils.utils.UtilConstants.HASH_MAP;
import static org.onosproject.yangutils.utils.UtilConstants.IMPORT;
import static org.onosproject.yangutils.utils.UtilConstants.JAVA_LANG;
import static org.onosproject.yangutils.utils.UtilConstants.JAVA_UTIL_OBJECTS_IMPORT_CLASS;
import static org.onosproject.yangutils.utils.UtilConstants.BITSET;
import static org.onosproject.yangutils.utils.UtilConstants.JAVA_UTIL_OBJECTS_IMPORT_PKG;
import static org.onosproject.yangutils.utils.UtilConstants.LIST;
import static org.onosproject.yangutils.utils.UtilConstants.LISTENER_REG;
......@@ -209,6 +210,15 @@ public class JavaImportData {
}
/**
* Returns import for to bitset method.
*
* @return import for to bitset method
*/
public String getImportForToBitSet() {
return IMPORT + JAVA_UTIL_OBJECTS_IMPORT_PKG + PERIOD + BITSET + SEMI_COLAN + NEW_LINE;
}
/**
* Returns import for list attribute.
*
* @return import for list attribute
......
......@@ -332,7 +332,7 @@ public class TempJavaTypeFragmentFiles
* Creates type def class file.
*/
if ((fileType & GENERATE_TYPEDEF_CLASS) != 0) {
addImportsToStringAndHasCodeMethods(imports);
addImportsToStringAndHasCodeMethods(imports, true);
setTypedefClassJavaFileHandle(getJavaFileHandle(getJavaClassName(TYPEDEF_CLASS_FILE_NAME_SUFFIX)));
generateTypeDefClassFile(getTypedefClassJavaFileHandle(), curNode, imports);
}
......@@ -340,7 +340,7 @@ public class TempJavaTypeFragmentFiles
* Creates type class file.
*/
if ((fileType & GENERATE_UNION_CLASS) != 0) {
addImportsToStringAndHasCodeMethods(imports);
addImportsToStringAndHasCodeMethods(imports, true);
setTypeClassJavaFileHandle(getJavaFileHandle(getJavaClassName(UNION_TYPE_CLASS_FILE_NAME_SUFFIX)));
generateUnionClassFile(getTypeClassJavaFileHandle(), curNode, imports);
}
......
......@@ -39,6 +39,7 @@ import static org.onosproject.yangutils.translator.tojava.YangJavaModelUtils.isM
import static org.onosproject.yangutils.translator.tojava.YangJavaModelUtils.isGenerationOfCodeReq;
import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getRootPackage;
import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.searchAndDeleteTempDir;
import static org.onosproject.yangutils.utils.UtilConstants.SBI;
/**
* Represents module information extended to support java code generation.
......@@ -159,10 +160,13 @@ public class YangJavaModule
try {
if (isManagerCodeGenRequired(this) && isGenerationOfCodeReq(getJavaFileInfo())) {
getTempJavaCodeFragmentFiles()
.generateJavaFile(GENERATE_INTERFACE_WITH_BUILDER, this);
getTempJavaCodeFragmentFiles()
.generateJavaFile(GENERATE_SERVICE_AND_MANAGER, this);
if ((getJavaFileInfo().getPluginConfig().getCodeGenerateForsbi() == null) ||
(!getJavaFileInfo().getPluginConfig().getCodeGenerateForsbi().equals(SBI))) {
getTempJavaCodeFragmentFiles()
.generateJavaFile(GENERATE_INTERFACE_WITH_BUILDER, this);
getTempJavaCodeFragmentFiles()
.generateJavaFile(GENERATE_SERVICE_AND_MANAGER, this);
}
}
searchAndDeleteTempDir(getJavaFileInfo().getBaseCodeGenPath() +
getJavaFileInfo().getPackageFilePath());
......
......@@ -40,6 +40,7 @@ import static org.onosproject.yangutils.translator.tojava.YangJavaModelUtils.gen
import static org.onosproject.yangutils.translator.tojava.YangJavaModelUtils.isManagerCodeGenRequired;
import static org.onosproject.yangutils.translator.tojava.YangJavaModelUtils.isGenerationOfCodeReq;
import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getRootPackage;
import static org.onosproject.yangutils.utils.UtilConstants.SBI;
import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.searchAndDeleteTempDir;
/**
......@@ -127,8 +128,7 @@ public class YangJavaSubModule
/**
* Returns the name space of the module to which the sub module belongs to.
*
* @param belongsToInfo Information of the module to which the sub module
* belongs
* @param belongsToInfo Information of the module to which the sub module belongs
* @return the name space string of the module.
*/
public String getNameSpaceFromModule(YangBelongsTo belongsToInfo) {
......@@ -136,8 +136,7 @@ public class YangJavaSubModule
}
/**
* Prepares the information for java code generation corresponding to YANG
* submodule info.
* Prepares the information for java code generation corresponding to YANG submodule info.
*
* @param yangPlugin YANG plugin config
* @throws TranslatorException when fails to translate
......@@ -171,9 +170,11 @@ public class YangJavaSubModule
*/
try {
if (isManagerCodeGenRequired(this) && isGenerationOfCodeReq(getJavaFileInfo())) {
getTempJavaCodeFragmentFiles().generateJavaFile(GENERATE_INTERFACE_WITH_BUILDER, this);
getTempJavaCodeFragmentFiles().generateJavaFile(GENERATE_SERVICE_AND_MANAGER, this);
if ((getJavaFileInfo().getPluginConfig().getCodeGenerateForsbi() == null) ||
(!getJavaFileInfo().getPluginConfig().getCodeGenerateForsbi().equals(SBI))) {
getTempJavaCodeFragmentFiles().generateJavaFile(GENERATE_INTERFACE_WITH_BUILDER, this);
getTempJavaCodeFragmentFiles().generateJavaFile(GENERATE_SERVICE_AND_MANAGER, this);
}
}
searchAndDeleteTempDir(getJavaFileInfo().getBaseCodeGenPath() +
getJavaFileInfo().getPackageFilePath());
......
......@@ -38,11 +38,14 @@ import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.
import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_UNION_CLASS;
import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.IMPL_CLASS_MASK;
import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.INTERFACE_MASK;
import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.OPERATION_BUILDER_CLASS_MASK;
import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.OPERATION_CLASS_MASK;
import static org.onosproject.yangutils.utils.UtilConstants.ABSTRACT;
import static org.onosproject.yangutils.utils.UtilConstants.BUILDER;
import static org.onosproject.yangutils.utils.UtilConstants.CLASS;
import static org.onosproject.yangutils.utils.UtilConstants.COMMA;
import static org.onosproject.yangutils.utils.UtilConstants.DEFAULT;
import static org.onosproject.yangutils.utils.UtilConstants.OPERATION;
import static org.onosproject.yangutils.utils.UtilConstants.DIAMOND_CLOSE_BRACKET;
import static org.onosproject.yangutils.utils.UtilConstants.DIAMOND_OPEN_BRACKET;
import static org.onosproject.yangutils.utils.UtilConstants.EIGHT_SPACE_INDENTATION;
......@@ -123,8 +126,12 @@ public final class ClassDefinitionGenerator {
return getInterfaceDefinition(yangName, curNode);
case BUILDER_CLASS_MASK:
return getBuilderClassDefinition(yangName, curNode);
case OPERATION_BUILDER_CLASS_MASK:
return getOpParamBuilderClassDefinition(yangName, curNode);
case IMPL_CLASS_MASK:
return getImplClassDefinition(yangName, curNode);
case OPERATION_CLASS_MASK:
return getOperClassDefinition(yangName, curNode);
case BUILDER_INTERFACE_MASK:
return getBuilderInterfaceDefinition(yangName, curNode);
case GENERATE_SERVICE_AND_MANAGER:
......@@ -205,6 +212,26 @@ public final class ClassDefinitionGenerator {
}
/**
* Returns operation param builder file class definition.
*
* @param yangName class name
* @param curNode YANG node
* @return definition returns operation param builder file class definition
*/
private static String getOpParamBuilderClassDefinition(String yangName, YangNode curNode) {
String clsDef = "";
if (curNode instanceof YangAugment) {
clsDef = getClassDefinitionForWhenExtended(curNode, yangName, OPERATION_BUILDER_CLASS_MASK);
if (clsDef != null) {
return clsDef;
}
}
return PUBLIC + SPACE + CLASS + SPACE + yangName + OPERATION + BUILDER + SPACE + EXTEND +
SPACE + getCapitalCase(DEFAULT) + yangName + PERIOD + yangName + BUILDER + SPACE +
OPEN_CURLY_BRACKET + NEW_LINE;
}
/**
* Returns impl file class definition.
*
* @param yangName file name
......@@ -223,6 +250,26 @@ public final class ClassDefinitionGenerator {
}
/**
* Returns operation param file class definition.
*
* @param yangName class name
* @param curNode YANG node
* @return definition returns operation param file class definition
*/
private static String getOperClassDefinition(String yangName, YangNode curNode) {
String clsDef = "";
if (curNode instanceof YangAugment) {
clsDef = getClassDefinitionForWhenExtended(curNode, yangName, OPERATION_CLASS_MASK);
if (clsDef != null) {
return clsDef;
}
}
return PUBLIC + SPACE + CLASS + SPACE + yangName + OPERATION + SPACE + EXTEND + SPACE
+ getCapitalCase(DEFAULT) + yangName + SPACE + OPEN_CURLY_BRACKET + NEW_LINE;
}
/**
* Returns impl file class definition.
*
* @param yangName file name
......@@ -413,6 +460,19 @@ public final class ClassDefinitionGenerator {
return def + SPACE + IMPLEMENTS + SPACE
+ yangName + SPACE + OPEN_CURLY_BRACKET + NEW_LINE;
case OPERATION_CLASS_MASK:
def = def + SPACE + CLASS + SPACE + yangName + OPERATION + SPACE;
for (JavaQualifiedTypeInfo info : holder.getExtendsList()) {
if (!info.getClassInfo().contains(BUILDER)
&& info.getClassInfo().contains(OPERATION)) {
def = getDefinitionString(def, info, holder);
}
}
def = trimAtLast(def, COMMA);
return def + SPACE + EXTEND + SPACE
+ getCapitalCase(DEFAULT) + yangName + SPACE + OPEN_CURLY_BRACKET + NEW_LINE;
default:
return null;
}
......
......@@ -105,16 +105,17 @@ public final class JavaCodeSnippetGen {
/**
* Returns the textual java code for attribute definition in class.
*
* @param javaAttributeTypePkg Package of the attribute type
* @param javaAttributeType java attribute type
* @param javaAttributeName name of the attribute
* @param isList is list attribute
* @return the textual java code for attribute definition in class
* @param javaAttributeTypePkg Package of the attribute type
* @param javaAttributeType java attribute type
* @param javaAttributeName name of the attribute
* @param isList is list attribute
* @param attributeAccessType attribute access type
* @return the textual java code for attribute definition in class
*/
public static String getJavaAttributeDefination(String javaAttributeTypePkg, String javaAttributeType,
String javaAttributeName, boolean isList) {
String javaAttributeName, boolean isList, String attributeAccessType) {
String attributeDefination = PRIVATE + SPACE;
String attributeDefination = attributeAccessType + SPACE;
if (!isList) {
if (javaAttributeTypePkg != null) {
......
......@@ -55,6 +55,8 @@ import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.
import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_UNION_CLASS;
import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.IMPL_CLASS_MASK;
import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.INTERFACE_MASK;
import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.OPERATION_BUILDER_CLASS_MASK;
import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.OPERATION_CLASS_MASK;
import static org.onosproject.yangutils.translator.tojava.GeneratedTempFileType.ATTRIBUTES_MASK;
import static org.onosproject.yangutils.translator.tojava.GeneratedTempFileType.AUGMENTE_CLASS_CONSTRUCTOR_MASK;
import static org.onosproject.yangutils.translator.tojava.GeneratedTempFileType.CONSTRUCTOR_FOR_TYPE_MASK;
......@@ -95,6 +97,7 @@ import static org.onosproject.yangutils.utils.io.impl.JavaDocGen.JavaDocType.ENU
import static org.onosproject.yangutils.utils.io.impl.JavaDocGen.JavaDocType.EVENT;
import static org.onosproject.yangutils.utils.io.impl.JavaDocGen.JavaDocType.EVENT_LISTENER;
import static org.onosproject.yangutils.utils.io.impl.JavaDocGen.JavaDocType.EVENT_SUBJECT_CLASS;
import static org.onosproject.yangutils.utils.io.impl.JavaDocGen.JavaDocType.OPERATION_CLASS;
import static org.onosproject.yangutils.utils.io.impl.JavaDocGen.JavaDocType.IMPL_CLASS;
import static org.onosproject.yangutils.utils.io.impl.JavaDocGen.JavaDocType.INTERFACE;
import static org.onosproject.yangutils.utils.io.impl.JavaDocGen.JavaDocType.RPC_INTERFACE;
......@@ -371,9 +374,16 @@ public final class JavaFileGeneratorUtils {
appendHeaderContents(file, pkgString, importsList);
write(file, genType, IMPL_CLASS, curNode, className);
break;
case OPERATION_CLASS_MASK:
appendHeaderContents(file, pkgString, importsList);
write(file, genType, OPERATION_CLASS, curNode, className);
break;
case BUILDER_CLASS_MASK:
write(file, genType, BUILDER_CLASS, curNode, className);
break;
case OPERATION_BUILDER_CLASS_MASK:
write(file, genType, BUILDER_CLASS, curNode, className);
break;
case BUILDER_INTERFACE_MASK:
write(file, genType, BUILDER_INTERFACE, curNode, className);
break;
......
......@@ -47,6 +47,11 @@ public final class UtilConstants {
public static final String EVENT_JAVA_DOC = " * Represents event implementation of ";
/**
* JavaDocs for op param class.
*/
public static final String OP_PARAM_JAVA_DOC = " * Represents operation parameter implementation of ";
/**
* JavaDocs for event listener.
*/
public static final String EVENT_LISTENER_JAVA_DOC = " * Abstraction for event listener of ";
......@@ -167,6 +172,21 @@ public final class UtilConstants {
public static final String DEFAULT = "default";
/**
* Static attribute for op param class.
*/
public static final String OPERATION = "OpParam";
/**
* Static attribute for operation type.
*/
public static final String OPERATION_ENUM = "OperationType";
/**
* Static attribute for java code generation for sbi.
*/
public static final String SBI = "sbi";
/**
* Static attribute for multiple new line.
*/
public static final String MULTIPLE_NEW_LINE = "\n\n";
......@@ -512,6 +532,11 @@ public final class UtilConstants {
public static final String OPEN_PARENTHESIS = "(";
/**
* Static attribute for received syntax.
*/
public static final String RECEIVED_OBJECT = "recv";
/**
* Static attribute for switch syntax.
*/
public static final String SWITCH = "switch";
......@@ -562,11 +587,76 @@ public final class UtilConstants {
public static final String SET_METHOD_PREFIX = "set";
/**
* Static attribute for get filter leaf flags.
*/
public static final String GET_FILTER_LEAF = "getFilterLeafFlags";
/**
* Static attribute for get filter leaf list flags.
*/
public static final String GET_FILTER_LEAF_LIST = "getFilterLeafListFlags";
/**
* Static attribute for filter leaf flags.
*/
public static final String FILTER_LEAF = "filterLeafFlags";
/**
* Static attribute for filter leaf list flags.
*/
public static final String FILTER_LEAF_LIST = "filterLeafListFlags";
/**
* Static attribute for get select leaf flags.
*/
public static final String GET_SELECT_LEAF = "getSelectLeafFlags";
/**
* Static attribute for get select leaf list flags.
*/
public static final String GET_SELECT_LEAF_LIST = "getSelectLeafListFlags";
/**
* Static attribute for get operation type.
*/
public static final String GET_OPERATION_TYPE = "getOpertionType";
/**
* Static attribute for set operation type.
*/
public static final String SET_OPERATION_TYPE = "setOpertionType";
/**
* Static attribute for select leaf flags.
*/
public static final String SELECT_LEAF = "selectLeafFlags";
/**
* Static attribute for select leaf list flags.
*/
public static final String SELECT_LEAF_LIST = "selectLeafListFlags";
/**
* Static attribute for op param type.
*/
public static final String OP_PARAM_TYPE = "opParamType";
/**
* Static attribute for is filter content match method prefix.
*/
public static final String FILTER_CONTENT_MATCH = "isFilterContentMatch";
/**
* Static attribute for four space indentation.
*/
public static final String FOUR_SPACE_INDENTATION = " ";
/**
* Static attribute for not syntax.
*/
public static final String NOT = "!";
/**
* Static attribute for try syntax.
*/
public static final String TRY = "try";
......@@ -582,6 +672,31 @@ public final class UtilConstants {
public static final String SUPER = "super";
/**
* Static attribute for merge syntax.
*/
public static final String MERGE = "MERGE,";
/**
* Static attribute for replace syntax.
*/
public static final String REPLACE = "REPLACE,";
/**
* Static attribute for create syntax.
*/
public static final String CREATE = "CREATE,";
/**
* Static attribute for delete syntax.
*/
public static final String DELETE = "DELETE,";
/**
* Static attribute for remove syntax.
*/
public static final String REMOVE = "REMOVE";
/**
* Static attribute for eight space indentation.
*/
public static final String EIGHT_SPACE_INDENTATION = FOUR_SPACE_INDENTATION + FOUR_SPACE_INDENTATION;
......@@ -637,6 +752,11 @@ public final class UtilConstants {
public static final String ABSTRACT = "abstract";
/**
* Static attribute for protected modifier.
*/
public static final String PROTECTED = "protected";
/**
* Void java type.
*/
public static final String VOID = "void";
......@@ -927,6 +1047,11 @@ public final class UtilConstants {
public static final String OBJECT = "Object";
/**
* Static attribute for app instance.
*/
public static final String APP_INSTANCE = "appInstance";
/**
* Static attribute for override annotation.
*/
public static final String OVERRIDE = "@Override";
......@@ -968,6 +1093,11 @@ public final class UtilConstants {
public static final String JAVA_UTIL_OBJECTS_IMPORT_PKG = "java.util";
/**
* Static attribute for bitset.
*/
public static final String BITSET = "BitSet";
/**
* Static attribute for java utilities objects import class.
*/
public static final String JAVA_UTIL_OBJECTS_IMPORT_CLASS = "Objects;\n";
......@@ -1111,6 +1241,11 @@ public final class UtilConstants {
public static final String EVENT_LISTENER = "EventListener";
/**
* Static attribute for or operator.
*/
public static final String OR_OPERATION = "||";
/**
* Static attribute for YANG file error.
*/
public static final String YANG_FILE_ERROR = "YANG file error : ";
......
......@@ -20,6 +20,7 @@ import static org.onosproject.yangutils.utils.UtilConstants.AUGMENTED;
import static org.onosproject.yangutils.utils.UtilConstants.YANG_AUGMENTED_INFO;
import static org.onosproject.yangutils.utils.UtilConstants.BUILDER;
import static org.onosproject.yangutils.utils.UtilConstants.BUILDER_CLASS_JAVA_DOC;
import static org.onosproject.yangutils.utils.UtilConstants.OP_PARAM_JAVA_DOC;
import static org.onosproject.yangutils.utils.UtilConstants.BUILDER_INTERFACE_JAVA_DOC;
import static org.onosproject.yangutils.utils.UtilConstants.BUILDER_OBJECT;
import static org.onosproject.yangutils.utils.UtilConstants.CLASS;
......@@ -97,6 +98,12 @@ public final class JavaDocGen {
case BUILDER_CLASS: {
return generateForBuilderClass(name);
}
case OPERATION_CLASS: {
return generateForOpParamClass(name);
}
case OPERATION_BUILDER_CLASS: {
return generateForOpParamClass(name);
}
case INTERFACE: {
return generateForInterface(name);
}
......@@ -401,6 +408,17 @@ public final class JavaDocGen {
}
/**
* Generates javaDocs for the op param class.
*
* @param className class name
* @return javaDocs
*/
private static String generateForOpParamClass(String className) {
return NEW_LINE + JAVA_DOC_FIRST_LINE + OP_PARAM_JAVA_DOC + className + PERIOD + NEW_LINE
+ JAVA_DOC_END_LINE;
}
/**
* Generates javaDoc for the interface.
*
* @param interfaceName interface name
......@@ -623,6 +641,16 @@ public final class JavaDocGen {
/**
* For event subject.
*/
EVENT_SUBJECT_CLASS
EVENT_SUBJECT_CLASS,
/**
* For operation.
*/
OPERATION_CLASS,
/**
* For operation builder.
*/
OPERATION_BUILDER_CLASS
}
}
......
......@@ -43,6 +43,29 @@ public final class YangPluginConfig {
}
/**
* Java code generation is for sbi.
*/
private String codeGenerateForsbi;
/**
* Returns the string for code generation.
*
* @return returns the string for code generation.
*/
public String getCodeGenerateForsbi() {
return codeGenerateForsbi;
}
/**
* Sets the string sbi or nbi for code generation.
*
* @par code generation is for sbi
*/
public void setCodeGenerateForsbi(String codeGenerateForsbi) {
this.codeGenerateForsbi = codeGenerateForsbi;
}
/**
* Sets the path of the java code where it has to be generated.
*
* @param codeGenDir path of the directory
......
......@@ -102,20 +102,24 @@ public class JavaCodeSnippetGenTest {
@Test
public void testForJavaAttributeInfo() {
String attributeWithoutTypePkg = getJavaAttributeDefination(null, STRING_DATA_TYPE, YANG_NAME, false);
String attributeWithoutTypePkg = getJavaAttributeDefination(null, STRING_DATA_TYPE, YANG_NAME,
false, PRIVATE);
assertThat(true, is(attributeWithoutTypePkg.equals(
PRIVATE + SPACE + STRING_DATA_TYPE + SPACE + YANG_NAME + SEMI_COLAN + NEW_LINE)));
String attributeWithTypePkg = getJavaAttributeDefination(JAVA_LANG, STRING_DATA_TYPE, YANG_NAME, false);
String attributeWithTypePkg = getJavaAttributeDefination(JAVA_LANG, STRING_DATA_TYPE, YANG_NAME,
false, PRIVATE);
assertThat(true, is(attributeWithTypePkg.equals(PRIVATE + SPACE + JAVA_LANG + PERIOD
+ STRING_DATA_TYPE + SPACE + YANG_NAME + SEMI_COLAN + NEW_LINE)));
String attributeWithListPkg = getJavaAttributeDefination(JAVA_LANG, STRING_DATA_TYPE, YANG_NAME, true);
String attributeWithListPkg = getJavaAttributeDefination(JAVA_LANG, STRING_DATA_TYPE, YANG_NAME,
true, PRIVATE);
assertThat(true, is(attributeWithListPkg.equals(
PRIVATE + SPACE + LIST + DIAMOND_OPEN_BRACKET + JAVA_LANG + PERIOD + STRING_DATA_TYPE
+ DIAMOND_CLOSE_BRACKET + SPACE + YANG_NAME + SEMI_COLAN + NEW_LINE)));
String attributeWithListWithoutPkg = getJavaAttributeDefination(null, STRING_DATA_TYPE, YANG_NAME, true);
String attributeWithListWithoutPkg = getJavaAttributeDefination(null, STRING_DATA_TYPE, YANG_NAME,
true, PRIVATE);
assertThat(true, is(attributeWithListWithoutPkg.equals(
PRIVATE + SPACE + LIST + DIAMOND_OPEN_BRACKET + STRING_DATA_TYPE + DIAMOND_CLOSE_BRACKET + SPACE
+ YANG_NAME + SEMI_COLAN + NEW_LINE)));
......