summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSeshu Kumar M <seshu.kumar.m@huawei.com>2018-03-22 15:53:15 +0000
committerGerrit Code Review <gerrit@onap.org>2018-03-22 15:53:15 +0000
commitcad1e50d716e1c20a9679c312a4befd3c74ff708 (patch)
tree6c60445d8c2ea80e9c81d8fa4becde95b0bccb94
parent32ed3f3dc441bf90e7fc91d9033e6afd449a5ea9 (diff)
parentcc248780f5e303bf536ea75414af8fbef7805947 (diff)
Merge "updated grm beans test to remove flakey junit"
-rw-r--r--common/src/test/java/org/openecomp/mso/client/grm/GRMBeansTest.java21
1 files changed, 12 insertions, 9 deletions
diff --git a/common/src/test/java/org/openecomp/mso/client/grm/GRMBeansTest.java b/common/src/test/java/org/openecomp/mso/client/grm/GRMBeansTest.java
index ef2d984af4..e22dc7b754 100644
--- a/common/src/test/java/org/openecomp/mso/client/grm/GRMBeansTest.java
+++ b/common/src/test/java/org/openecomp/mso/client/grm/GRMBeansTest.java
@@ -25,6 +25,8 @@ import java.util.List;
import org.junit.Test;
import com.openpojo.reflection.PojoClass;
+import com.openpojo.reflection.PojoClassFilter;
+import com.openpojo.reflection.filters.FilterEnum;
import com.openpojo.reflection.filters.FilterPackageInfo;
import com.openpojo.reflection.impl.PojoClassFactory;
import com.openpojo.validation.Validator;
@@ -36,15 +38,9 @@ import com.openpojo.validation.test.impl.GetterTester;
import com.openpojo.validation.test.impl.SetterTester;
public class GRMBeansTest {
- private static final int EXPECTED_CLASS_COUNT = 10;
private static final String POJO_PACKAGE = "org.openecomp.mso.client.grm.beans";
-
- @Test
- public void ensureExpectedPojoCount() {
- List<PojoClass> pojoClasses = PojoClassFactory.getPojoClasses( POJO_PACKAGE, new FilterPackageInfo());
- Affirm.affirmEquals("Classes added / removed?", EXPECTED_CLASS_COUNT, pojoClasses.size());
- }
-
+ private PojoClassFilter filterTestClasses = new FilterTestClasses();
+
@Test
public void testPojoStructureAndBehavior() {
Validator validator = ValidatorBuilder.create()
@@ -54,6 +50,13 @@ public class GRMBeansTest {
.with(new GetterTester())
.build();
- validator.validate(POJO_PACKAGE, new FilterPackageInfo());
+ validator.validate(POJO_PACKAGE, new FilterPackageInfo(), new FilterEnum(), filterTestClasses);
+ }
+
+ private static class FilterTestClasses implements PojoClassFilter {
+ public boolean include(PojoClass pojoClass) {
+ return !pojoClass.getSourcePath().contains("/test-classes/");
+ }
}
+
}