use of org.apache.stanbol.rules.base.api.UnavailableRuleObjectException in project stanbol by apache.
the class ClerezzaAdpterTest method wrongAdaptabeClassTest.
@SuppressWarnings("unchecked")
@Test
public void wrongAdaptabeClassTest() {
try {
List<Rule> rules = (List<Rule>) ruleAdapter.adaptTo(recipeGood, Rule.class);
for (Rule rule : rules) {
log.debug(rule.toString());
Assert.fail("The adapter for Clerezza should not accept " + Rule.class.getCanonicalName() + " objects.");
}
} catch (UnavailableRuleObjectException e) {
Assert.fail(e.getMessage());
} catch (UnsupportedTypeForExportException e) {
log.debug(e.getMessage());
} catch (RuleAtomCallExeption e) {
Assert.fail(e.getMessage());
}
}
use of org.apache.stanbol.rules.base.api.UnavailableRuleObjectException in project stanbol by apache.
the class ClerezzaAdpterTest method test.
@SuppressWarnings("unchecked")
@Test
public void test() {
try {
List<ConstructQuery> constructQueries = (List<ConstructQuery>) ruleAdapter.adaptTo(recipeGood, ConstructQuery.class);
for (ConstructQuery constructQuery : constructQueries) {
ConstructQuery cq = (ConstructQuery) QueryParser.getInstance().parse(constructQuery.toString());
System.out.println(cq.toString());
}
Assert.assertTrue(true);
} catch (UnavailableRuleObjectException e) {
Assert.fail(e.getMessage());
} catch (UnsupportedTypeForExportException e) {
Assert.fail(e.getMessage());
} catch (RuleAtomCallExeption e) {
Assert.fail(e.getMessage());
} catch (ParseException e) {
Assert.fail(e.getMessage());
}
}
Aggregations