private Collection<KnowledgePackage> buildKnowledgePackage(Resource resource,
ResourceType resourceType) {
KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
kbuilder.add( resource,
resourceType );
KnowledgeBuilderErrors errors = kbuilder.getErrors();
if ( errors != null && errors.size() > 0 ) {
for ( KnowledgeBuilderError error : errors ) {
System.err.println( "Error: " + error.getMessage() );
}
Assert.fail( "KnowledgeBase did not build" );
}