[ONOS-4303, ONOS-4508, ONOS-4509, ONOS-4510, ONOS-4351]notification,rpc,union,sub-module,augment
Change-Id: Ibeed9ff965c13fd66743c1080cb1350d93a3a435
diff --git a/src/test/java/org/onosproject/yangutils/utils/io/impl/FileSystemUtilTest.java b/src/test/java/org/onosproject/yangutils/utils/io/impl/FileSystemUtilTest.java
index 9a637f9..0d97cf0 100644
--- a/src/test/java/org/onosproject/yangutils/utils/io/impl/FileSystemUtilTest.java
+++ b/src/test/java/org/onosproject/yangutils/utils/io/impl/FileSystemUtilTest.java
@@ -22,6 +22,8 @@
import java.lang.reflect.InvocationTargetException;
import org.junit.Test;
+import org.onosproject.yangutils.translator.tojava.JavaFileInfo;
+import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaModule;
import static org.hamcrest.core.Is.is;
import static org.hamcrest.core.IsNot.not;
@@ -48,18 +50,19 @@
/**
* A private constructor is tested.
*
- * @throws SecurityException if any security violation is observed
- * @throws NoSuchMethodException if when the method is not found
- * @throws IllegalArgumentException if there is illegal argument found
- * @throws InstantiationException if instantiation is provoked for the private constructor
- * @throws IllegalAccessException if instance is provoked or a method is provoked
+ * @throws SecurityException if any security violation is observed
+ * @throws NoSuchMethodException if when the method is not found
+ * @throws IllegalArgumentException if there is illegal argument found
+ * @throws InstantiationException if instantiation is provoked for the private constructor
+ * @throws IllegalAccessException if instance is provoked or a method is provoked
* @throws InvocationTargetException when an exception occurs by the method or constructor
*/
@Test
- public void callPrivateConstructors() throws SecurityException, NoSuchMethodException, IllegalArgumentException,
+ public void callPrivateConstructors()
+ throws SecurityException, NoSuchMethodException, IllegalArgumentException,
InstantiationException, IllegalAccessException, InvocationTargetException {
- Class<?>[] classesToConstruct = {FileSystemUtil.class };
+ Class<?>[] classesToConstruct = {FileSystemUtil.class};
for (Class<?> clazz : classesToConstruct) {
Constructor<?> constructor = clazz.getDeclaredConstructor();
constructor.setAccessible(true);
@@ -73,7 +76,8 @@
* @throws IOException when fails to create a test file
*/
@Test
- public void updateFileHandleTest() throws IOException {
+ public void updateFileHandleTest()
+ throws IOException {
File dir = new File(BASE_PKG + SLASH + "File1");
dir.mkdirs();
@@ -94,7 +98,8 @@
* @throws IOException when failed to create a test file
*/
@Test
- public void packageExistTest() throws IOException {
+ public void packageExistTest()
+ throws IOException {
String dirPath = "exist1.exist2.exist3";
String strPath = BASE_DIR_PKG + dirPath;
@@ -103,7 +108,12 @@
File createFile = new File(createDir + SLASH + "package-info.java");
createFile.createNewFile();
assertThat(true, is(doesPackageExist(strPath)));
- createPackage(strPath, PKG_INFO_CONTENT);
+ JavaFileInfo javaFileInfo = new JavaFileInfo();
+ javaFileInfo.setBaseCodeGenPath(BASE_DIR_PKG);
+ javaFileInfo.setPackageFilePath(dirPath);
+ YangJavaModule moduleNode = new YangJavaModule();
+ moduleNode.setJavaFileInfo(javaFileInfo);
+ createPackage(moduleNode);
createDir.delete();
}
diff --git a/src/test/java/org/onosproject/yangutils/utils/io/impl/YangIoUtilsTest.java b/src/test/java/org/onosproject/yangutils/utils/io/impl/YangIoUtilsTest.java
index 4dd7608..b939516 100644
--- a/src/test/java/org/onosproject/yangutils/utils/io/impl/YangIoUtilsTest.java
+++ b/src/test/java/org/onosproject/yangutils/utils/io/impl/YangIoUtilsTest.java
@@ -34,7 +34,7 @@
import static org.junit.Assert.assertThat;
import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.addPackageInfo;
import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.addToSource;
-import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.clean;
+import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.deleteDirectory;
import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.createDirectories;
import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.trimAtLast;
@@ -135,7 +135,7 @@
createNewDir.mkdirs();
File createFile = new File(createNewDir + File.separator + "check1.java");
createFile.createNewFile();
- clean(baseDirPath.getAbsolutePath());
+ deleteDirectory(baseDirPath.getAbsolutePath());
}
/**
@@ -147,7 +147,7 @@
public void cleanWithInvalidDirTest() throws IOException {
File baseDirPath = new File(BASE_DIR + "invalid");
- clean(baseDirPath.getAbsolutePath());
+ deleteDirectory(baseDirPath.getAbsolutePath());
}
/**