[Devel] Query engine transparent to the underlying implementation

Currently querying in memory works, now we need the visitor pattern to
abstract away the details of the in memory querying mechanism and allow
other querying mechanisms
This commit is contained in:
Robert von Burg 2013-11-30 13:13:30 +01:00
parent 925a25657a
commit 9bea101c9d
33 changed files with 712 additions and 65 deletions

View File

@ -0,0 +1,47 @@
/*
* Copyright (c) 2012, Robert von Burg
*
* All rights reserved.
*
* This file is part of the XXX.
*
* XXX is free software: you can redistribute
* it and/or modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 3 of the License,
* or (at your option) any later version.
*
* XXX is distributed in the hope that it will
* be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with XXX. If not, see
* <http://www.gnu.org/licenses/>.
*/
package li.strolch.runtime.query;
import java.util.List;
/**
* @author Robert von Burg <eitch@eitchnet.ch>
*
*/
public class AndSelection extends BooleanSelection {
/**
* @param selections
*/
public AndSelection(List<Selection<QueryVisitor>> selections) {
super(selections);
}
public AndSelection(Selection<QueryVisitor> leftHandSide, Selection<QueryVisitor> rightHandSide) {
super(leftHandSide, rightHandSide);
}
@Override
public void accept(QueryVisitor visitor) {
visitor.visitAnd(this);
}
}

View File

@ -0,0 +1,48 @@
/*
* Copyright (c) 2012, Robert von Burg
*
* All rights reserved.
*
* This file is part of the XXX.
*
* XXX is free software: you can redistribute
* it and/or modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 3 of the License,
* or (at your option) any later version.
*
* XXX is distributed in the hope that it will
* be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with XXX. If not, see
* <http://www.gnu.org/licenses/>.
*/
package li.strolch.runtime.query;
import java.util.ArrayList;
import java.util.List;
/**
* @author Robert von Burg <eitch@eitchnet.ch>
*
*/
public abstract class BooleanSelection implements Selection<QueryVisitor> {
protected List<Selection<QueryVisitor>> selections;
public BooleanSelection(Selection<QueryVisitor> leftHandSide, Selection<QueryVisitor> rightHandSide) {
this.selections = new ArrayList<>();
this.selections.add(leftHandSide);
this.selections.add(rightHandSide);
}
public BooleanSelection(List<Selection<QueryVisitor>> selections) {
this.selections = selections;
}
public List<Selection<QueryVisitor>> getSelections() {
return this.selections;
}
}

View File

@ -19,37 +19,33 @@
* along with XXX. If not, see
* <http://www.gnu.org/licenses/>.
*/
package li.strolch.runtime.query.inmemory;
package li.strolch.runtime.query;
import java.util.ArrayList;
import java.util.List;
import li.strolch.model.Resource;
import li.strolch.runtime.component.ComponentContainer;
import li.strolch.runtime.query.ResourceQuery;
import li.strolch.runtime.query.ResourceQueryVisitor;
import li.strolch.runtime.query.visitor.StrolchElementVisitor;
/**
* @author Robert von Burg <eitch@eitchnet.ch>
*
*/
public class InMemoryResourceQueryVisitor implements ResourceQueryVisitor {
public class ElementQuery implements Query<StrolchElementVisitor> {
private ArrayList<Resource> result;
public List<Resource> performQuery(ComponentContainer container, ResourceQuery query) {
this.result = new ArrayList<>();
private Navigation<QueryVisitor> navigation;
private List<Selection<QueryVisitor>> selections;
query.accept(this);
return this.result;
public ElementQuery(Navigation<QueryVisitor> navigation) {
this.selections = new ArrayList<>();
}
@Override
public void visit(ResourceQuery resourceQuery) {
// TODO Auto-generated method stub
public void visit(StrolchElementVisitor queryVisitor) {
this.navigation.accept(queryVisitor);
for (Selection<QueryVisitor> selection : this.selections) {
selection.accept(queryVisitor);
}
}
}

View File

@ -0,0 +1,52 @@
/*
* Copyright (c) 2012, Robert von Burg
*
* All rights reserved.
*
* This file is part of the XXX.
*
* XXX is free software: you can redistribute
* it and/or modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 3 of the License,
* or (at your option) any later version.
*
* XXX is distributed in the hope that it will
* be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with XXX. If not, see
* <http://www.gnu.org/licenses/>.
*/
package li.strolch.runtime.query;
import li.strolch.runtime.query.visitor.StrolchElementVisitor;
/**
* @author Robert von Burg <eitch@eitchnet.ch>
*
*/
public class IdSelection implements Selection<StrolchElementVisitor> {
private String id;
/**
* @param id
*/
public IdSelection(String id) {
this.id = id;
}
/**
* @return the id
*/
public String getId() {
return this.id;
}
@Override
public void accept(StrolchElementVisitor visitor) {
visitor.visit(this);
}
}

View File

@ -0,0 +1,52 @@
/*
* Copyright (c) 2012, Robert von Burg
*
* All rights reserved.
*
* This file is part of the XXX.
*
* XXX is free software: you can redistribute
* it and/or modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 3 of the License,
* or (at your option) any later version.
*
* XXX is distributed in the hope that it will
* be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with XXX. If not, see
* <http://www.gnu.org/licenses/>.
*/
package li.strolch.runtime.query;
import li.strolch.runtime.query.visitor.StrolchElementVisitor;
/**
* @author Robert von Burg <eitch@eitchnet.ch>
*
*/
public class NameSelection implements Selection<StrolchElementVisitor> {
private String name;
/**
* @param name
*/
public NameSelection(String name) {
this.name = name;
}
/**
* @return the name
*/
public String getName() {
return this.name;
}
@Override
public void accept(StrolchElementVisitor visitor) {
visitor.visit(this);
}
}

View File

@ -23,11 +23,9 @@ package li.strolch.runtime.query;
/**
* @author Robert von Burg <eitch@eitchnet.ch>
*
*
*/
public class ByElementSelection {
public interface Navigation<T extends QueryVisitor> {
private String id;
private String name;
private String type;
public void accept(T visitor);
}

View File

@ -0,0 +1,44 @@
/*
* Copyright (c) 2012, Robert von Burg
*
* All rights reserved.
*
* This file is part of the XXX.
*
* XXX is free software: you can redistribute
* it and/or modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 3 of the License,
* or (at your option) any later version.
*
* XXX is distributed in the hope that it will
* be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with XXX. If not, see
* <http://www.gnu.org/licenses/>.
*/
package li.strolch.runtime.query;
import java.util.List;
/**
* @author Robert von Burg <eitch@eitchnet.ch>
*
*/
public class OrSelection extends BooleanSelection {
public OrSelection(List<Selection<QueryVisitor>> selections) {
super(selections);
}
public OrSelection(Selection<QueryVisitor> leftHandSide, Selection<QueryVisitor> rightHandSide) {
super(leftHandSide, rightHandSide);
}
@Override
public void accept(QueryVisitor visitor) {
visitor.visitOr(this);
}
}

View File

@ -0,0 +1,43 @@
/*
* Copyright (c) 2012, Robert von Burg
*
* All rights reserved.
*
* This file is part of the XXX.
*
* XXX is free software: you can redistribute
* it and/or modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 3 of the License,
* or (at your option) any later version.
*
* XXX is distributed in the hope that it will
* be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with XXX. If not, see
* <http://www.gnu.org/licenses/>.
*/
package li.strolch.runtime.query;
import li.strolch.runtime.query.visitor.StrolchElementVisitor;
/**
* @author Robert von Burg <eitch@eitchnet.ch>
*
*/
public class OrderTypeNavigation extends StrolchTypeNavigation<StrolchElementVisitor> {
/**
* @param type
*/
OrderTypeNavigation(String type) {
super(type);
}
@Override
public void accept(StrolchElementVisitor visitor) {
visitor.visit(this);
}
}

View File

@ -0,0 +1,31 @@
/*
* Copyright (c) 2012, Robert von Burg
*
* All rights reserved.
*
* This file is part of the XXX.
*
* XXX is free software: you can redistribute
* it and/or modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 3 of the License,
* or (at your option) any later version.
*
* XXX is distributed in the hope that it will
* be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with XXX. If not, see
* <http://www.gnu.org/licenses/>.
*/
package li.strolch.runtime.query;
/**
* @author Robert von Burg <eitch@eitchnet.ch>
*
*/
public interface Query<T extends QueryVisitor> {
public void visit(T queryVisitor);
}

View File

@ -21,22 +21,14 @@
*/
package li.strolch.runtime.query;
import java.util.List;
import li.strolch.model.Resource;
/**
* @author Robert von Burg <eitch@eitchnet.ch>
*
*
*/
public class ResourceQuery {
private String byType;
public interface QueryVisitor {
public void accept(ResourceQueryVisitor visitor) {
visitor.visit(this);
}
public void visitAnd(AndSelection andSelection);
public void visitOr(OrSelection orSelection);
}

View File

@ -0,0 +1,43 @@
/*
* Copyright (c) 2012, Robert von Burg
*
* All rights reserved.
*
* This file is part of the XXX.
*
* XXX is free software: you can redistribute
* it and/or modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 3 of the License,
* or (at your option) any later version.
*
* XXX is distributed in the hope that it will
* be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with XXX. If not, see
* <http://www.gnu.org/licenses/>.
*/
package li.strolch.runtime.query;
import li.strolch.runtime.query.visitor.StrolchElementVisitor;
/**
* @author Robert von Burg <eitch@eitchnet.ch>
*
*/
public class ResourceTypeNavigation extends StrolchTypeNavigation<StrolchElementVisitor>{
/**
* @param type
*/
ResourceTypeNavigation(String type) {
super(type);
}
@Override
public void accept(StrolchElementVisitor visitor) {
visitor.visit(this);
}
}

View File

@ -25,7 +25,7 @@ package li.strolch.runtime.query;
* @author Robert von Burg <eitch@eitchnet.ch>
*
*/
public interface ResourceQueryVisitor {
public interface Selection<T extends QueryVisitor> {
public void visit(ResourceQuery query);
public void accept(T visitor);
}

View File

@ -0,0 +1,44 @@
/*
* Copyright (c) 2012, Robert von Burg
*
* All rights reserved.
*
* This file is part of the XXX.
*
* XXX is free software: you can redistribute
* it and/or modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 3 of the License,
* or (at your option) any later version.
*
* XXX is distributed in the hope that it will
* be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with XXX. If not, see
* <http://www.gnu.org/licenses/>.
*/
package li.strolch.runtime.query;
import java.util.ArrayList;
import java.util.List;
import li.strolch.runtime.query.visitor.StrolchElementVisitor;
/**
* @author Robert von Burg <eitch@eitchnet.ch>
*
*/
public class StrolchElementSelection {
private List<Selection<StrolchElementVisitor>> selections;
public StrolchElementSelection() {
this.selections = new ArrayList<>();
}
public void addSelection(Selection<StrolchElementVisitor> selection) {
this.selections.add(selection);
}
}

View File

@ -21,18 +21,17 @@
*/
package li.strolch.runtime.query;
import li.strolch.runtime.query.visitor.StrolchElementVisitor;
/**
* @author Robert von Burg <eitch@eitchnet.ch>
*
*/
public class TypeSelection {
public abstract class StrolchTypeNavigation<T extends StrolchElementVisitor> implements Navigation<T> {
private String type;
/**
* @param type
*/
public TypeSelection(String type) {
StrolchTypeNavigation(String type) {
this.type = type;
}

View File

@ -0,0 +1,65 @@
/*
* Copyright (c) 2012, Robert von Burg
*
* All rights reserved.
*
* This file is part of the XXX.
*
* XXX is free software: you can redistribute
* it and/or modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 3 of the License,
* or (at your option) any later version.
*
* XXX is distributed in the hope that it will
* be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with XXX. If not, see
* <http://www.gnu.org/licenses/>.
*/
package li.strolch.runtime.query.inmemory;
import java.util.List;
import li.strolch.model.StrolchElement;
import li.strolch.runtime.query.AndSelection;
import li.strolch.runtime.query.BooleanSelection;
import li.strolch.runtime.query.OrSelection;
import li.strolch.runtime.query.QueryVisitor;
/**
* @author Robert von Burg <eitch@eitchnet.ch>
*
*/
public class BooleanVisitor<T extends StrolchElement> implements QueryVisitor {
private List<Selector<T>> selectors;
/**
* @param selectors
*/
public BooleanVisitor(List<Selector<T>> selectors) {
this.selectors = selectors;
}
/**
* @param selection
*/
public void visit(BooleanSelection selection) {
selection.accept(this);
}
@Override
public void visitAnd(AndSelection selection) {
// TODO Auto-generated method stub
}
@Override
public void visitOr(OrSelection selection) {
// TODO Auto-generated method stub
}
}

View File

@ -0,0 +1,118 @@
/*
* Copyright (c) 2012, Robert von Burg
*
* All rights reserved.
*
* This file is part of the XXX.
*
* XXX is free software: you can redistribute
* it and/or modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 3 of the License,
* or (at your option) any later version.
*
* XXX is distributed in the hope that it will
* be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with XXX. If not, see
* <http://www.gnu.org/licenses/>.
*/
package li.strolch.runtime.query.inmemory;
import java.util.ArrayList;
import java.util.List;
import li.strolch.model.StrolchElement;
import li.strolch.runtime.component.ComponentContainer;
import li.strolch.runtime.query.AndSelection;
import li.strolch.runtime.query.ElementQuery;
import li.strolch.runtime.query.IdSelection;
import li.strolch.runtime.query.NameSelection;
import li.strolch.runtime.query.OrSelection;
import li.strolch.runtime.query.OrderTypeNavigation;
import li.strolch.runtime.query.QueryVisitor;
import li.strolch.runtime.query.ResourceTypeNavigation;
import li.strolch.runtime.query.Selection;
import li.strolch.runtime.query.visitor.StrolchElementVisitor;
/**
* @author Robert von Burg <eitch@eitchnet.ch>
*/
public class InMemoryQueryVisitor<T extends StrolchElement> implements StrolchElementVisitor {
private Navigator<T> navigator;
private List<Selector<T>> selectors;
private ComponentContainer container;
public InMemoryQueryVisitor(ComponentContainer container) {
this.container = container;
this.selectors = new ArrayList<>();
}
/**
* @return the navigator
*/
public Navigator<T> getNavigator() {
return this.navigator;
}
/**
* @return the selectors
*/
public List<Selector<T>> getSelectors() {
return this.selectors;
}
public void visit(ElementQuery query) {
query.visit(this);
}
@Override
public void visitAnd(AndSelection andSelection) {
InMemoryQueryVisitor<T> visitor = new InMemoryQueryVisitor<>(this.container);
List<Selection<QueryVisitor>> selections = andSelection.getSelections();
for (Selection<QueryVisitor> selection : selections) {
selection.accept(visitor);
}
AndSelector<T> andSelector = new AndSelector<>(visitor.getSelectors());
this.selectors.add(andSelector);
}
@Override
public void visitOr(OrSelection orSelection) {
InMemoryQueryVisitor<T> visitor = new InMemoryQueryVisitor<>(this.container);
List<Selection<QueryVisitor>> selections = orSelection.getSelections();
for (Selection<QueryVisitor> selection : selections) {
selection.accept(visitor);
}
OrSelector<T> andSelector = new OrSelector<>(visitor.getSelectors());
this.selectors.add(andSelector);
}
@Override
public void visit(IdSelection selection) {
this.selectors.add(new IdSelector<T>(selection.getId()));
}
@Override
public void visit(NameSelection selection) {
this.selectors.add(new NameSelector<T>(selection.getName()));
}
@SuppressWarnings("unchecked")
@Override
public void visit(OrderTypeNavigation navigation) {
this.navigator = (Navigator<T>) new OrderTypeNavigator(navigation.getType(), this.container);
}
@SuppressWarnings("unchecked")
@Override
public void visit(ResourceTypeNavigation navigation) {
// XXX not good... class should be parameterized, but then there is no sense in ResourceType... but then one would need the ElementMap passed in...
this.navigator = (Navigator<T>) new ResourceTypeNavigator(navigation.getType(), this.container);
}
}

View File

@ -28,7 +28,6 @@ import li.strolch.runtime.component.ComponentContainer;
/**
* @author Robert von Burg <eitch@eitchnet.ch>
*
*/
public class OrderTypeNavigator extends StrolchTypeNavigator<Order> {

View File

@ -0,0 +1,30 @@
/*
* Copyright (c) 2012, Robert von Burg
*
* All rights reserved.
*
* This file is part of the XXX.
*
* XXX is free software: you can redistribute
* it and/or modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 3 of the License,
* or (at your option) any later version.
*
* XXX is distributed in the hope that it will
* be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with XXX. If not, see
* <http://www.gnu.org/licenses/>.
*/
package li.strolch.runtime.query.inmemory;
/**
* @author Robert von Burg <eitch@eitchnet.ch>
*
*/
public class StrolchTypeNavigationVisitor {
}

View File

@ -0,0 +1,43 @@
/*
* Copyright (c) 2012, Robert von Burg
*
* All rights reserved.
*
* This file is part of the XXX.
*
* XXX is free software: you can redistribute
* it and/or modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 3 of the License,
* or (at your option) any later version.
*
* XXX is distributed in the hope that it will
* be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with XXX. If not, see
* <http://www.gnu.org/licenses/>.
*/
package li.strolch.runtime.query.visitor;
import li.strolch.runtime.query.IdSelection;
import li.strolch.runtime.query.NameSelection;
import li.strolch.runtime.query.OrderTypeNavigation;
import li.strolch.runtime.query.QueryVisitor;
import li.strolch.runtime.query.ResourceTypeNavigation;
/**
* @author Robert von Burg <eitch@eitchnet.ch>
*
*/
public interface StrolchElementVisitor extends QueryVisitor {
public void visit(IdSelection selection);
public void visit(NameSelection selection);
public void visit(OrderTypeNavigation navigation);
public void visit(ResourceTypeNavigation navigation);
}

View File

@ -1,4 +1,4 @@
package li.strolch.runtime;
package li.strolch.runtime.test.component;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
@ -8,9 +8,6 @@ import java.io.File;
import li.strolch.model.Resource;
import li.strolch.runtime.agent.StrolchAgent;
import li.strolch.runtime.component.ComponentContainer;
import li.strolch.runtime.test.PersistenceHandlerTest;
import li.strolch.runtime.test.ServiceHandlerTest;
import li.strolch.runtime.test.ServiceResultTest;
import org.junit.Test;
import org.slf4j.Logger;

View File

@ -1,4 +1,4 @@
package li.strolch.runtime;
package li.strolch.runtime.test.component;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;

View File

@ -1,4 +1,4 @@
package li.strolch.runtime;
package li.strolch.runtime.test.component;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;

View File

@ -1,4 +1,4 @@
package li.strolch.runtime.test;
package li.strolch.runtime.test.component;
import li.strolch.model.Resource;

View File

@ -1,4 +1,4 @@
package li.strolch.runtime.test;
package li.strolch.runtime.test.component;
import li.strolch.model.Resource;
import li.strolch.runtime.component.ComponentContainer;

View File

@ -1,4 +1,4 @@
package li.strolch.runtime.test;
package li.strolch.runtime.test.component;
public interface PostInitializerTest {

View File

@ -1,4 +1,4 @@
package li.strolch.runtime.test;
package li.strolch.runtime.test.component;
import li.strolch.runtime.component.ComponentContainer;
import li.strolch.runtime.component.StrolchComponent;

View File

@ -1,4 +1,4 @@
package li.strolch.runtime.test;
package li.strolch.runtime.test.component;
public interface ServiceHandlerTest {

View File

@ -1,4 +1,4 @@
package li.strolch.runtime.test;
package li.strolch.runtime.test.component;
import li.strolch.runtime.component.ComponentContainer;
import li.strolch.runtime.component.StrolchComponent;

View File

@ -1,4 +1,4 @@
package li.strolch.runtime.test;
package li.strolch.runtime.test.component;
public class ServiceResultTest {

View File

@ -19,7 +19,7 @@
* along with li.strolch.model. If not, see
* <http://www.gnu.org/licenses/>.
*/
package li.strolch.runtime;
package li.strolch.runtime.test.query;
import java.util.ArrayList;
import java.util.Date;

View File

@ -19,7 +19,7 @@
* along with XXX. If not, see
* <http://www.gnu.org/licenses/>.
*/
package li.strolch.runtime;
package li.strolch.runtime.test.query;
import org.junit.Ignore;
import org.junit.Test;
@ -35,11 +35,7 @@ public class QueryTest {
@Ignore
public void shouldQueryResourceWithParamValue() {
// ResourceQuery resQuery = new ResourceQuery();
// resQuery.with(new TypeMatcher("MyType"));
// resQuery.with(new ParameterBagMatcher("Bla").with(ParameterMatcher.stringValue("color", "red")));
//
// List<Resource> result = resQuery.doQuery();
//
}
}

View File

@ -19,7 +19,7 @@
* along with XXX. If not, see
* <http://www.gnu.org/licenses/>.
*/
package li.strolch.runtime.query.inmemory;
package li.strolch.runtime.test.query.inmemory;
import static org.junit.Assert.assertEquals;
@ -35,7 +35,17 @@ import li.strolch.model.State;
import li.strolch.model.parameter.BooleanParameter;
import li.strolch.model.parameter.FloatParameter;
import li.strolch.model.parameter.StringParameter;
import li.strolch.runtime.ModelBuilder;
import li.strolch.runtime.query.inmemory.AndSelector;
import li.strolch.runtime.query.inmemory.BooleanSelector;
import li.strolch.runtime.query.inmemory.IdSelector;
import li.strolch.runtime.query.inmemory.InMemoryQuery;
import li.strolch.runtime.query.inmemory.ListNavigator;
import li.strolch.runtime.query.inmemory.NameSelector;
import li.strolch.runtime.query.inmemory.OrSelector;
import li.strolch.runtime.query.inmemory.ParameterSelector;
import li.strolch.runtime.query.inmemory.ParameterizedElementSelector;
import li.strolch.runtime.query.inmemory.Selector;
import li.strolch.runtime.test.query.ModelBuilder;
import org.junit.Test;