Skip to content

Commit

Permalink
Add testing for editor filter query
Browse files Browse the repository at this point in the history
  • Loading branch information
mgoellnitz committed Mar 30, 2016
1 parent 83730ad commit ebf088d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion mutable/test/org/tangram/mutable/test/BaseContentTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,6 @@ public void test3Code() throws Exception {
Assert.assertNotNull(beanFactory, "Need factory for beans.");
Map<Class<? extends Content>, List<Class<? extends Content>>> 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<Class<MutableCode>> codeClasses = beanFactory.getImplementingClasses(MutableCode.class);
Assert.assertEquals(codeClasses.size(), 1, "We have one code class.");
Expand Down Expand Up @@ -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<Class<MutableCode>> codeClasses = beanFactory.getImplementingClasses(MutableCode.class);
Assert.assertEquals(codeClasses.size(), 1, "We have one code class.");
Class<MutableCode> 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

0 comments on commit ebf088d

Please sign in to comment.