ST defect fixes and review comments fixes
Change-Id: Ib8c56a88c19cd9aa23918d0f9e37c89e74cb0d13
diff --git a/src/test/java/org/onosproject/yangutils/translator/tojava/utils/ClassDefinitionGeneratorTest.java b/src/test/java/org/onosproject/yangutils/translator/tojava/utils/ClassDefinitionGeneratorTest.java
index 6d0056e..d2cb823 100644
--- a/src/test/java/org/onosproject/yangutils/translator/tojava/utils/ClassDefinitionGeneratorTest.java
+++ b/src/test/java/org/onosproject/yangutils/translator/tojava/utils/ClassDefinitionGeneratorTest.java
@@ -16,17 +16,16 @@
package org.onosproject.yangutils.translator.tojava.utils;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.InvocationTargetException;
-
import org.junit.Test;
import org.onosproject.yangutils.translator.GeneratedFileType;
import org.onosproject.yangutils.translator.tojava.GeneratedMethodTypes;
import org.onosproject.yangutils.translator.tojava.TraversalType;
import org.onosproject.yangutils.utils.UtilConstants;
-import static org.hamcrest.core.Is.is;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
import static org.junit.Assert.assertNotNull;
+import static org.hamcrest.core.Is.is;
import static org.junit.Assert.assertThat;
/**
@@ -40,18 +39,14 @@
* @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
+ * @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, InstantiationException, IllegalAccessException, InvocationTargetException {
- Class<?>[] classesToConstruct = {
- ClassDefinitionGenerator.class };
+ public void callPrivateConstructors() throws SecurityException, NoSuchMethodException, IllegalArgumentException,
+ InstantiationException, IllegalAccessException, InvocationTargetException {
+ Class<?>[] classesToConstruct = {ClassDefinitionGenerator.class };
for (Class<?> clazz : classesToConstruct) {
Constructor<?> constructor = clazz.getDeclaredConstructor();
constructor.setAccessible(true);
@@ -105,14 +100,14 @@
}
/**
- * Unit test for invalid generated type.
+ * Unit test for typedef generated type.
*/
@Test
- public void generateInvalidDefinitionTest() {
+ public void generateTypeDefTest() {
- // String invalidDefinition = ClassDefinitionGenerator
- // .generateClassDefinition(GeneratedFileType.GENERATE_INTERFACE_WITH_BUILDER, "invalid");
- // assertThat(true, is(invalidDefinition == null));
+ String typeDef = ClassDefinitionGenerator.generateClassDefinition(GeneratedFileType.GENERATE_TYPEDEF_CLASS,
+ "invalid");
+ assertThat(true, is(typeDef.contains(UtilConstants.CLASS)));
}
/**
@@ -123,5 +118,6 @@
TraversalType.valueOf(TraversalType.CHILD.toString());
GeneratedMethodTypes.valueOf(GeneratedMethodTypes.CONSTRUCTOR.toString());
+ TempDataStoreTypes.valueOf(TempDataStoreTypes.CONSTRUCTOR.toString());
}
}