From ebf088dd27fe9596571cd13c9363eda6bd64cea1 Mon Sep 17 00:00:00 2001 From: Martin Goellnitz Date: Wed, 30 Mar 2016 23:14:12 +0200 Subject: [PATCH] Add testing for editor filter query --- .../test/org/tangram/mutable/test/BaseContentTest.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/mutable/test/org/tangram/mutable/test/BaseContentTest.java b/mutable/test/org/tangram/mutable/test/BaseContentTest.java index c68403ec..70352ea3 100644 --- a/mutable/test/org/tangram/mutable/test/BaseContentTest.java +++ b/mutable/test/org/tangram/mutable/test/BaseContentTest.java @@ -264,7 +264,6 @@ public void test3Code() throws Exception { Assert.assertNotNull(beanFactory, "Need factory for beans."); Map, List>> classesMap = beanFactory.getImplementingClassesMap(); Assert.assertNotNull(classesMap, "We have a classes map."); - // Assert.assertEquals(classesMap.keySet(), Collections.emptySet(), "There should be no implementing classes."); Assert.assertNotNull(classesMap.get(MutableCode.class), "We have a code class."); List> codeClasses = beanFactory.getImplementingClasses(MutableCode.class); Assert.assertEquals(codeClasses.size(), 1, "We have one code class."); @@ -334,6 +333,13 @@ public void test5Factory() throws Exception { String managerClassName = manager.getClass().getName(); LOG.info("test5Factory() managerClassName={}", managerClassName); Assert.assertTrue(managerClassName.startsWith(getManagerPrefix()), "The factory should have a correctly typed manager instance."); + List> codeClasses = beanFactory.getImplementingClasses(MutableCode.class); + Assert.assertEquals(codeClasses.size(), 1, "We have one code class."); + Class codeClass = codeClasses.get(0); + String filterQuery = beanFactory.getFilterQuery(codeClass, "annotation", "tangram"); + Assert.assertNotNull(filterQuery, "There should be some filter query"); + Assert.assertTrue(filterQuery.indexOf("annotation")>0, "Unexpected contents of filter query"); + Assert.assertTrue(filterQuery.indexOf("tangram")>0, "Unexpected contents of filter query"); } // test5Factory() } // BaseContentTest