use of de.ids_mannheim.korap.user.KorAPUser in project Kustvakt by KorAP.
the class FoundryRewriteTest method testFoundryInjectGroupedQueryNoErrors.
@Test
public void testFoundryInjectGroupedQueryNoErrors() throws KustvaktException {
QuerySerializer s = new QuerySerializer();
s.setQuery("[(base=laufen | tt/pos=VVFIN)]", "poliqarp");
String result = handler.processQuery(s.toJSON(), new KorAPUser("test"));
JsonNode node = JsonUtils.readTree(result);
assertNotNull(node);
assertEquals("koral:termGroup", node.at("/query/wrap/@type").asText());
assertFalse(node.at("/query/wrap/operands/0/foundry").isMissingNode());
assertFalse(node.at("/query/wrap/operands/0/rewrites").isMissingNode());
assertFalse(node.at("/query/wrap/operands/1/foundry").isMissingNode());
assertTrue(node.at("/query/wrap/operands/1/rewrites").isMissingNode());
}
use of de.ids_mannheim.korap.user.KorAPUser in project Kustvakt by KorAP.
the class FoundryRewriteTest method testDefaultFoundryInjectPOSNoErrors.
@Test
public void testDefaultFoundryInjectPOSNoErrors() throws KustvaktException {
QuerySerializer s = new QuerySerializer();
s.setQuery("[pos=ADJA]", "poliqarp");
String result = handler.processQuery(s.toJSON(), new KorAPUser("test"));
JsonNode node = JsonUtils.readTree(result);
assertNotNull(node);
assertFalse(node.at("/query/wrap/foundry").isMissingNode());
assertEquals(config.getDefault_pos(), node.at("/query/wrap/foundry").asText());
assertEquals("pos", node.at("/query/wrap/layer").asText());
assertFalse(node.at("/query/wrap/rewrites").isMissingNode());
assertEquals("koral:rewrite", node.at("/query/wrap/rewrites/0/@type").asText());
}
use of de.ids_mannheim.korap.user.KorAPUser in project Kustvakt by KorAP.
the class FoundryRewriteTest method testFoundryInjectJoinedQueryNoErrors.
@Test
public void testFoundryInjectJoinedQueryNoErrors() throws KustvaktException {
QuerySerializer s = new QuerySerializer();
s.setQuery("[orth=laufe/i & base!=Lauf]", "poliqarp");
String result = handler.processQuery(s.toJSON(), new KorAPUser("test"));
JsonNode node = JsonUtils.readTree(result);
assertNotNull(node);
assertEquals("koral:termGroup", node.at("/query/wrap/@type").asText());
assertFalse(node.at("/query/wrap/operands/0/foundry").isMissingNode());
assertFalse(node.at("/query/wrap/operands/0/rewrites").isMissingNode());
assertFalse(node.at("/query/wrap/operands/1/foundry").isMissingNode());
assertFalse(node.at("/query/wrap/operands/1/rewrites").isMissingNode());
}
use of de.ids_mannheim.korap.user.KorAPUser in project Kustvakt by KorAP.
the class KustvaktAuthenticationManagerTest method testUserSettingsGetNonExistent.
@Test(expected = KustvaktException.class)
public void testUserSettingsGetNonExistent() throws KustvaktException {
User user = new KorAPUser(10, "random");
authenticationManager.getUserData(user, UserSettingProcessor.class);
}
use of de.ids_mannheim.korap.user.KorAPUser in project Kustvakt by KorAP.
the class DummyAuthenticationManager method getUser.
@Override
public User getUser(String username) throws KustvaktException {
KorAPUser user = new KorAPUser();
user.setUsername(username);
return user;
}
Aggregations