public void testErrors() throws Exception {
RulesRepository repo = new RulesRepository(TestEnvironmentSessionHelper.getSession());
PackageItem item = repo.createPackage( "testErrorsInPackage", "to test error handling" );
BRMSSuggestionCompletionLoader loader = new BRMSSuggestionCompletionLoader();
assertNotNull(loader.getSuggestionEngine( item ));
assertFalse(loader.hasErrors());
ServiceImplementation.updateDroolsHeader("gooble de gook", item );
loader = new BRMSSuggestionCompletionLoader();
loader.getSuggestionEngine( item );
assertTrue(loader.hasErrors());
ServiceImplementation.updateDroolsHeader("import foo.bar; \nglobal goo.Bar baz;", item );
loader = new BRMSSuggestionCompletionLoader();
loader.getSuggestionEngine( item );
assertTrue(loader.hasErrors());
}