/** * Test interface implementation for assignment nodes. */ @SuppressWarnings("serial") public void testBindingsClause() { final LinkedHashSet<IVariable<?>> declaredVars = new LinkedHashSet<IVariable<?>>() {{ add(Var.var("x")); add(Var.var("y")); }}; final List<IBindingSet> bindingSets = new ArrayList<IBindingSet>() {{ add(new ListBindingSet() {{ set(Var.var("x"), new Constant<>(TermId.mockIV(VTE.URI))); set(Var.var("y"), new Constant<>(TermId.mockIV(VTE.URI))); }}); }}; final BindingsClause bc = new BindingsClause(declaredVars, bindingSets); // dummy sa object final StaticAnalysis sa = new StaticAnalysis(new QueryRoot(QueryType.SELECT), null); // bindings clauses requires no variables to be bound before, as they // introduce constant values only; nothing is forbidden and nothing // desired here... assertEquals(new HashSet<IVariable<?>>(), bc.getRequiredBound(sa)); assertEquals(new HashSet<IVariable<?>>(), bc.getDesiredBound(sa)); }
/** * Test interface implementation for assignment nodes. */ @SuppressWarnings("serial") public void testBindingsClause() { final LinkedHashSet<IVariable<?>> declaredVars = new LinkedHashSet<IVariable<?>>() {{ add(Var.var("x")); add(Var.var("y")); }}; final List<IBindingSet> bindingSets = new ArrayList<IBindingSet>() {{ add(new ListBindingSet() {{ set(Var.var("x"), new Constant<>(TermId.mockIV(VTE.URI))); set(Var.var("y"), new Constant<>(TermId.mockIV(VTE.URI))); }}); }}; final BindingsClause bc = new BindingsClause(declaredVars, bindingSets); // dummy sa object final StaticAnalysis sa = new StaticAnalysis(new QueryRoot(QueryType.SELECT), null); // bindings clauses requires no variables to be bound before, as they // introduce constant values only; nothing is forbidden and nothing // desired here... assertEquals(new HashSet<IVariable<?>>(), bc.getRequiredBound(sa)); assertEquals(new HashSet<IVariable<?>>(), bc.getDesiredBound(sa)); }
/** * Test interface implementation for assignment nodes. */ @SuppressWarnings("serial") public void testBindingsClause() { final LinkedHashSet<IVariable<?>> declaredVars = new LinkedHashSet<IVariable<?>>() {{ add(Var.var("x")); add(Var.var("y")); }}; final List<IBindingSet> bindingSets = new ArrayList<IBindingSet>() {{ add(new ListBindingSet() {{ set(Var.var("x"), new Constant<>(TermId.mockIV(VTE.URI))); set(Var.var("y"), new Constant<>(TermId.mockIV(VTE.URI))); }}); }}; final BindingsClause bc = new BindingsClause(declaredVars, bindingSets); // dummy sa object final StaticAnalysis sa = new StaticAnalysis(new QueryRoot(QueryType.SELECT), null); // bindings clauses requires no variables to be bound before, as they // introduce constant values only; nothing is forbidden and nothing // desired here... assertEquals(new HashSet<IVariable<?>>(), bc.getRequiredBound(sa)); assertEquals(new HashSet<IVariable<?>>(), bc.getDesiredBound(sa)); }