/** * Test interface implementation for ALP nodes. */ @SuppressWarnings("serial") public void testSimpleALPNode() { final ArbitraryLengthPathNode alpNode = (ArbitraryLengthPathNode) new Helper() {{ tmp = arbitartyLengthPropertyPath( varNode(x), constantNode(b), HelperFlag.ZERO_OR_MORE, joinGroupNode( statementPatternNode( leftVar(), constantNode(c), rightVar(), 26))); }}.getTmp(); final Set<IVariable<?>> requiredBoundAlpNode = new HashSet<IVariable<?>>(); final Set<IVariable<?>> desiredBoundAlpNode = new HashSet<IVariable<?>>() {{ add(Var.var("x")); }}; // dummy sa object final StaticAnalysis sa = new StaticAnalysis(new QueryRoot(QueryType.SELECT), null); assertEquals(requiredBoundAlpNode, alpNode.getRequiredBound(sa)); assertEquals(desiredBoundAlpNode, alpNode.getDesiredBound(sa)); }
/** * Test interface implementation for ALP nodes. */ @SuppressWarnings("serial") public void testSimpleALPNode() { final ArbitraryLengthPathNode alpNode = (ArbitraryLengthPathNode) new Helper() {{ tmp = arbitartyLengthPropertyPath( varNode(x), constantNode(b), HelperFlag.ZERO_OR_MORE, joinGroupNode( statementPatternNode( leftVar(), constantNode(c), rightVar(), 26))); }}.getTmp(); final Set<IVariable<?>> requiredBoundAlpNode = new HashSet<IVariable<?>>(); final Set<IVariable<?>> desiredBoundAlpNode = new HashSet<IVariable<?>>() {{ add(Var.var("x")); }}; // dummy sa object final StaticAnalysis sa = new StaticAnalysis(new QueryRoot(QueryType.SELECT), null); assertEquals(requiredBoundAlpNode, alpNode.getRequiredBound(sa)); assertEquals(desiredBoundAlpNode, alpNode.getDesiredBound(sa)); }
@SuppressWarnings("serial") public void testComplexALPNode() { final ArbitraryLengthPathNode alpNode = (ArbitraryLengthPathNode) new Helper() {{ tmp = arbitartyLengthPropertyPath( varNode(x), constantNode(b), HelperFlag.ZERO_OR_MORE, joinGroupNode( statementPatternNode(leftVar(), constantNode(c), varNode(y)), statementPatternNode(varNode(y), constantNode(d), rightVar()) )); }}.getTmp(); final Set<IVariable<?>> requiredBoundAlpNode = new HashSet<IVariable<?>>(); final Set<IVariable<?>> desiredBoundAlpNode = new HashSet<IVariable<?>>() {{ add(Var.var("x")); add(Var.var("y")); }}; // dummy sa object final StaticAnalysis sa = new StaticAnalysis(new QueryRoot(QueryType.SELECT), null); assertEquals(requiredBoundAlpNode, alpNode.getRequiredBound(sa)); assertEquals(desiredBoundAlpNode, alpNode.getDesiredBound(sa)); }
@SuppressWarnings("serial") public void testComplexALPNode() { final ArbitraryLengthPathNode alpNode = (ArbitraryLengthPathNode) new Helper() {{ tmp = arbitartyLengthPropertyPath( varNode(x), constantNode(b), HelperFlag.ZERO_OR_MORE, joinGroupNode( statementPatternNode(leftVar(), constantNode(c), varNode(y)), statementPatternNode(varNode(y), constantNode(d), rightVar()) )); }}.getTmp(); final Set<IVariable<?>> requiredBoundAlpNode = new HashSet<IVariable<?>>(); final Set<IVariable<?>> desiredBoundAlpNode = new HashSet<IVariable<?>>() {{ add(Var.var("x")); add(Var.var("y")); }}; // dummy sa object final StaticAnalysis sa = new StaticAnalysis(new QueryRoot(QueryType.SELECT), null); assertEquals(requiredBoundAlpNode, alpNode.getRequiredBound(sa)); assertEquals(desiredBoundAlpNode, alpNode.getDesiredBound(sa)); }
/** * Test interface implementation for ALP nodes. */ @SuppressWarnings("serial") public void testSimpleALPNode() { final ArbitraryLengthPathNode alpNode = (ArbitraryLengthPathNode) new Helper() {{ tmp = arbitartyLengthPropertyPath( varNode(x), constantNode(b), HelperFlag.ZERO_OR_MORE, joinGroupNode( statementPatternNode( leftVar(), constantNode(c), rightVar(), 26))); }}.getTmp(); final Set<IVariable<?>> requiredBoundAlpNode = new HashSet<IVariable<?>>(); final Set<IVariable<?>> desiredBoundAlpNode = new HashSet<IVariable<?>>() {{ add(Var.var("x")); }}; // dummy sa object final StaticAnalysis sa = new StaticAnalysis(new QueryRoot(QueryType.SELECT), null); assertEquals(requiredBoundAlpNode, alpNode.getRequiredBound(sa)); assertEquals(desiredBoundAlpNode, alpNode.getDesiredBound(sa)); }
@SuppressWarnings("serial") public void testComplexALPNode() { final ArbitraryLengthPathNode alpNode = (ArbitraryLengthPathNode) new Helper() {{ tmp = arbitartyLengthPropertyPath( varNode(x), constantNode(b), HelperFlag.ZERO_OR_MORE, joinGroupNode( statementPatternNode(leftVar(), constantNode(c), varNode(y)), statementPatternNode(varNode(y), constantNode(d), rightVar()) )); }}.getTmp(); final Set<IVariable<?>> requiredBoundAlpNode = new HashSet<IVariable<?>>(); final Set<IVariable<?>> desiredBoundAlpNode = new HashSet<IVariable<?>>() {{ add(Var.var("x")); add(Var.var("y")); }}; // dummy sa object final StaticAnalysis sa = new StaticAnalysis(new QueryRoot(QueryType.SELECT), null); assertEquals(requiredBoundAlpNode, alpNode.getRequiredBound(sa)); assertEquals(desiredBoundAlpNode, alpNode.getDesiredBound(sa)); }