@Test public void testDesignerFindDataTypesQuery() { FindDataTypesQuery query = new FindDataTypesQuery(); Set<ValueIndexTerm> queryTerms = new HashSet<>(); try { query.validateTerms(queryTerms); fail( "The required java term is missing, but no exception was thrown."); } catch( IllegalArgumentException iae ) { assertTrue( "Incorrect error message: " + iae.getMessage(), iae.getMessage().contains("At least 1 term") ); } queryTerms = new HashSet<>(); queryTerms.add(new ValueSharedPartIndexTerm("not-rule-flow", PartType.ACTIVATION_GROUP)); try { query.validateTerms(queryTerms); fail( "The required java term is missing, but no exception was thrown."); } catch( IllegalArgumentException iae ) { assertTrue( "Incorrect error message: " + iae.getMessage(), iae.getMessage().contains(ERROR_MSG) ); } queryTerms = new HashSet<>(); queryTerms.add(new ValueSharedPartIndexTerm("not-rule-flow", PartType.ACTIVATION_GROUP)); queryTerms.add(new ValueResourceIndexTerm("java.class", ResourceType.JAVA)); try { query.validateTerms(queryTerms); fail( "The activation term is not acceptable here, but no exception was thrown."); } catch( IllegalArgumentException iae ) { assertTrue( "Incorrect error message: " + iae.getMessage(), iae.getMessage().contains(ERROR_MSG) ); } queryTerms = new HashSet<>(); queryTerms.add(new ValueResourceIndexTerm("java.class", ResourceType.JAVA)); query.validateTerms(queryTerms); }
@Override public void validateTerms(Set<ValueIndexTerm> queryTerms) throws IllegalArgumentException { checkNotNullAndNotEmpty(queryTerms); checkInvalidAndRequiredTerms(queryTerms, NAME, new String [] { ResourceType.JAVA.toString() }, (t) -> (t.getTerm().equals(ResourceType.JAVA.toString())) ); }
FindDataTypesQuery extends AbstractFindQuery implements NamedQuery { @Override public void validateTerms(Set<ValueIndexTerm> queryTerms) throws IllegalArgumentException { checkNotNullAndNotEmpty(queryTerms); checkInvalidAndRequiredTerms(queryTerms, NAME, new String [] { ResourceType.JAVA.toString() }, (t) -> (t.getTerm().equals(ResourceType.JAVA.toString())) ); } }
FindDataTypesQuery extends AbstractFindQuery implements NamedQuery { @Override public void validateTerms(Set<ValueIndexTerm> queryTerms) throws IllegalArgumentException { checkNotNullAndNotEmpty(queryTerms); checkInvalidAndRequiredTerms(queryTerms, NAME, new String [] { ResourceType.JAVA.toString() }, (t) -> (t.getTerm().equals(ResourceType.JAVA.toString())) ); }  }
FindDataTypesQuery extends AbstractFindQuery implements NamedQuery { @Override public void validateTerms(Set<ValueIndexTerm> queryTerms) throws IllegalArgumentException { checkNotNullAndNotEmpty(queryTerms); checkInvalidAndRequiredTerms(queryTerms, NAME, new String [] { ResourceType.JAVA.toString() }, (t) -> (t.getTerm().equals(ResourceType.JAVA.toString())) ); }  @Override String getName(); @Override Query toQuery( final Set<ValueIndexTerm> terms ); @Override ResponseBuilder getResponseBuilder(); @Override void validateTerms(Set<ValueIndexTerm> queryTerms); }
FindDataTypesQuery extends AbstractFindQuery implements NamedQuery { @Override public void validateTerms(Set<ValueIndexTerm> queryTerms) throws IllegalArgumentException { checkNotNullAndNotEmpty(queryTerms); checkInvalidAndRequiredTerms(queryTerms, NAME, new String [] { ResourceType.JAVA.toString() }, (t) -> (t.getTerm().equals(ResourceType.JAVA.toString())) ); }  @Override String getName(); @Override Query toQuery( final Set<ValueIndexTerm> terms ); @Override ResponseBuilder getResponseBuilder(); @Override void validateTerms(Set<ValueIndexTerm> queryTerms); static final String NAME; }