@Test public void getRootPackageWithSpecialCharactersTest() { conflictResolver.setPrefixForIdentifier(VALID_PREFIX); String rootPackage = getRootPackage((byte) 1, INVALID_NAME_SPACE1, DATE1, conflictResolver); assertThat(rootPackage.equals(DEFAULT_BASE_PKG + PERIOD + VERSION_NUMBER + PERIOD + VALID_NAME_SPACE1 + PERIOD + DATE_WITH_REV1), is(true)); conflictResolver.setPrefixForIdentifier(null); String rootPackage1 = getRootPackage((byte) 1, INVALID_NAME_SPACE2, DATE1, conflictResolver); assertThat(rootPackage1.equals(DEFAULT_BASE_PKG + PERIOD + VERSION_NUMBER + PERIOD + VALID_NAME_SPACE2 + PERIOD + DATE_WITH_REV1), is(true)); String rootPackage2 = getRootPackage((byte) 1, INVALID_NAME_SPACE3, DATE1, conflictResolver); assertThat(rootPackage2.equals(DEFAULT_BASE_PKG + PERIOD + VERSION_NUMBER + PERIOD + VALID_NAME_SPACE4 + PERIOD + DATE_WITH_REV1), is(true)); conflictResolver.setPrefixForIdentifier(INVALID_PREFIX1); String rootPackage3 = getRootPackage((byte) 1, INVALID_NAME_SPACE2, DATE1, conflictResolver); assertThat(rootPackage3.equals(DEFAULT_BASE_PKG + PERIOD + VERSION_NUMBER + PERIOD + VALID_NAME_SPACE3 + PERIOD + DATE_WITH_REV1), is(true)); }
public static String getRootPackage(byte version, String nameSpace, String revision, YangToJavaNamingConflictUtil conflictResolver) { String pkg; pkg = DEFAULT_BASE_PKG; pkg = pkg + PERIOD; pkg = pkg + getYangVersion(version); pkg = pkg + PERIOD; pkg = pkg + getPkgFromNameSpace(nameSpace, conflictResolver); pkg = pkg + PERIOD; pkg = pkg + getYangRevisionStr(revision); return pkg.toLowerCase(); }
JavaIdentifierSyntax { public static String getRootPackage(byte version, String nameSpace, String revision, YangToJavaNamingConflictUtil conflictResolver) { String pkg; pkg = DEFAULT_BASE_PKG; pkg = pkg + PERIOD; pkg = pkg + getYangVersion(version); pkg = pkg + PERIOD; pkg = pkg + getPkgFromNameSpace(nameSpace, conflictResolver); pkg = pkg + PERIOD; pkg = pkg + getYangRevisionStr(revision); return pkg.toLowerCase(); } }
JavaIdentifierSyntax { public static String getRootPackage(byte version, String nameSpace, String revision, YangToJavaNamingConflictUtil conflictResolver) { String pkg; pkg = DEFAULT_BASE_PKG; pkg = pkg + PERIOD; pkg = pkg + getYangVersion(version); pkg = pkg + PERIOD; pkg = pkg + getPkgFromNameSpace(nameSpace, conflictResolver); pkg = pkg + PERIOD; pkg = pkg + getYangRevisionStr(revision); return pkg.toLowerCase(); } private  JavaIdentifierSyntax(); }
JavaIdentifierSyntax { public static String getRootPackage(byte version, String nameSpace, String revision, YangToJavaNamingConflictUtil conflictResolver) { String pkg; pkg = DEFAULT_BASE_PKG; pkg = pkg + PERIOD; pkg = pkg + getYangVersion(version); pkg = pkg + PERIOD; pkg = pkg + getPkgFromNameSpace(nameSpace, conflictResolver); pkg = pkg + PERIOD; pkg = pkg + getYangRevisionStr(revision); return pkg.toLowerCase(); } private  JavaIdentifierSyntax(); static String getRootPackage(byte version, String nameSpace, String revision,
                                        YangToJavaNamingConflictUtil conflictResolver); static String getEnumJavaAttribute(String name); static void createPackage(YangNode yangNode); static boolean doesPackageExist(String pkg); }
JavaIdentifierSyntax { public static String getRootPackage(byte version, String nameSpace, String revision, YangToJavaNamingConflictUtil conflictResolver) { String pkg; pkg = DEFAULT_BASE_PKG; pkg = pkg + PERIOD; pkg = pkg + getYangVersion(version); pkg = pkg + PERIOD; pkg = pkg + getPkgFromNameSpace(nameSpace, conflictResolver); pkg = pkg + PERIOD; pkg = pkg + getYangRevisionStr(revision); return pkg.toLowerCase(); } private  JavaIdentifierSyntax(); static String getRootPackage(byte version, String nameSpace, String revision,
                                        YangToJavaNamingConflictUtil conflictResolver); static String getEnumJavaAttribute(String name); static void createPackage(YangNode yangNode); static boolean doesPackageExist(String pkg);  }