query = QueryStringParser.parse("(bla datatype:a)"); assertEquals(1, query.getDataTypes().length);
query = QueryStringParser.parse("(bla (-datatype:a) datatype:a)"); assertEquals(2, query.getDataTypes().length); assertEquals(1, query.getNegativeDataTypes().length); assertEquals(1, query.getPositiveDataTypes().length);
    public void testDataTypes() throws Exception {        IngridQuery query = new IngridQuery(true, true, IngridQuery.TERM, "ba");        assertTrue(query.isProhibited());        query = new IngridQuery();        FieldQuery fieldQuery = new FieldQuery(true, true, "datatype", "UDK");        assertTrue(fieldQuery.isProhibited());        query.addField(fieldQuery);        assertEquals(1, query.getDataTypes().length);        assertTrue(query.getDataTypes()[0].isProhibited());        query = QueryStringParser.parse("bla datatype:a");        assertEquals(1, query.getDataTypes().length);        assertFalse(query.getDataTypes()[0].isProhibited());        query = QueryStringParser.parse("bla -datatype:a");        assertEquals(1, query.getDataTypes().length);        assertTrue(query.getDataTypes()[0].isProhibited());        query = QueryStringParser.parse("(bla datatype:a)");        assertEquals(1, query.getDataTypes().length);    }