http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/f61227bc/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Strategy/Optimization/AdjacentToIncidentStrategy.cs ---------------------------------------------------------------------- diff --git a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Strategy/Optimization/AdjacentToIncidentStrategy.cs b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Strategy/Optimization/AdjacentToIncidentStrategy.cs new file mode 100644 index 0000000..bae85d7 --- /dev/null +++ b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Strategy/Optimization/AdjacentToIncidentStrategy.cs @@ -0,0 +1,32 @@ +#region License + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#endregion + +namespace Gremlin.Net.Process.Traversal.Strategy.Optimization +{ + /// <summary> + /// Optimizes vertex- and value-emitting steps. + /// </summary> + public class AdjacentToIncidentStrategy : AbstractTraversalStrategy + { + } +} \ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/f61227bc/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Strategy/Optimization/FilterRankingStrategy.cs ---------------------------------------------------------------------- diff --git a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Strategy/Optimization/FilterRankingStrategy.cs b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Strategy/Optimization/FilterRankingStrategy.cs new file mode 100644 index 0000000..3443e71 --- /dev/null +++ b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Strategy/Optimization/FilterRankingStrategy.cs @@ -0,0 +1,32 @@ +#region License + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#endregion + +namespace Gremlin.Net.Process.Traversal.Strategy.Optimization +{ + /// <summary> + /// Reorders filter- and order-steps according to their rank. + /// </summary> + public class FilterRankingStrategy : AbstractTraversalStrategy + { + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/f61227bc/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Strategy/Optimization/GraphFilterStrategy.cs ---------------------------------------------------------------------- diff --git a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Strategy/Optimization/GraphFilterStrategy.cs b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Strategy/Optimization/GraphFilterStrategy.cs new file mode 100644 index 0000000..aaaee2c --- /dev/null +++ b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Strategy/Optimization/GraphFilterStrategy.cs @@ -0,0 +1,29 @@ +#region License + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#endregion + +namespace Gremlin.Net.Process.Traversal.Strategy.Optimization +{ + public class GraphFilterStrategy : AbstractTraversalStrategy + { + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/f61227bc/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Strategy/Optimization/IdentityRemovalStrategy.cs ---------------------------------------------------------------------- diff --git a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Strategy/Optimization/IdentityRemovalStrategy.cs b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Strategy/Optimization/IdentityRemovalStrategy.cs new file mode 100644 index 0000000..08a4c46 --- /dev/null +++ b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Strategy/Optimization/IdentityRemovalStrategy.cs @@ -0,0 +1,32 @@ +#region License + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#endregion + +namespace Gremlin.Net.Process.Traversal.Strategy.Optimization +{ + /// <summary> + /// Looks for <c>Identity()</c>-steps and removes them. + /// </summary> + public class IdentityRemovalStrategy : AbstractTraversalStrategy + { + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/f61227bc/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Strategy/Optimization/IncidentToAdjacentStrategy.cs ---------------------------------------------------------------------- diff --git a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Strategy/Optimization/IncidentToAdjacentStrategy.cs b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Strategy/Optimization/IncidentToAdjacentStrategy.cs new file mode 100644 index 0000000..75b98c2 --- /dev/null +++ b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Strategy/Optimization/IncidentToAdjacentStrategy.cs @@ -0,0 +1,33 @@ +#region License + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#endregion + +namespace Gremlin.Net.Process.Traversal.Strategy.Optimization +{ + /// <summary> + /// Replaces <c>.OutE().InV()</c> with <c>.Out()</c>, <c>.InE().OutV()</c> with <c>In()</c> and <c>.BothE().BothV()</c> + /// with <c>Both()</c>. + /// </summary> + public class IncidentToAdjacentStrategy : AbstractTraversalStrategy + { + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/f61227bc/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Strategy/Optimization/InlineFilterStrategy.cs ---------------------------------------------------------------------- diff --git a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Strategy/Optimization/InlineFilterStrategy.cs b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Strategy/Optimization/InlineFilterStrategy.cs new file mode 100644 index 0000000..8eade84 --- /dev/null +++ b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Strategy/Optimization/InlineFilterStrategy.cs @@ -0,0 +1,32 @@ +#region License + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#endregion + +namespace Gremlin.Net.Process.Traversal.Strategy.Optimization +{ + /// <summary> + /// Analyzes filter-steps with child traversals that themselves are pure filters. + /// </summary> + public class InlineFilterStrategy : AbstractTraversalStrategy + { + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/f61227bc/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Strategy/Optimization/LazyBarrierStrategy.cs ---------------------------------------------------------------------- diff --git a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Strategy/Optimization/LazyBarrierStrategy.cs b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Strategy/Optimization/LazyBarrierStrategy.cs new file mode 100644 index 0000000..b5cac4a --- /dev/null +++ b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Strategy/Optimization/LazyBarrierStrategy.cs @@ -0,0 +1,33 @@ +#region License + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#endregion + +namespace Gremlin.Net.Process.Traversal.Strategy.Optimization +{ + /// <summary> + /// Inserts <c>Barrier()</c>-steps into a <see cref="ITraversal" /> where appropriate in order to gain the "bulking + /// optimization". + /// </summary> + public class LazyBarrierStrategy : AbstractTraversalStrategy + { + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/f61227bc/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Strategy/Optimization/MatchPredicateStrategy.cs ---------------------------------------------------------------------- diff --git a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Strategy/Optimization/MatchPredicateStrategy.cs b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Strategy/Optimization/MatchPredicateStrategy.cs new file mode 100644 index 0000000..d535963 --- /dev/null +++ b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Strategy/Optimization/MatchPredicateStrategy.cs @@ -0,0 +1,32 @@ +#region License + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#endregion + +namespace Gremlin.Net.Process.Traversal.Strategy.Optimization +{ + /// <summary> + /// Folds any post<c>Where()</c> step that maintains a traversal constraint into <c>Match()</c>. + /// </summary> + public class MatchPredicateStrategy : AbstractTraversalStrategy + { + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/f61227bc/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Strategy/Optimization/OrderLimitStrategy.cs ---------------------------------------------------------------------- diff --git a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Strategy/Optimization/OrderLimitStrategy.cs b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Strategy/Optimization/OrderLimitStrategy.cs new file mode 100644 index 0000000..82a8df9 --- /dev/null +++ b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Strategy/Optimization/OrderLimitStrategy.cs @@ -0,0 +1,29 @@ +#region License + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#endregion + +namespace Gremlin.Net.Process.Traversal.Strategy.Optimization +{ + public class OrderLimitStrategy : AbstractTraversalStrategy + { + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/f61227bc/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Strategy/Optimization/PathProcessorStrategy.cs ---------------------------------------------------------------------- diff --git a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Strategy/Optimization/PathProcessorStrategy.cs b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Strategy/Optimization/PathProcessorStrategy.cs new file mode 100644 index 0000000..2c8e106 --- /dev/null +++ b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Strategy/Optimization/PathProcessorStrategy.cs @@ -0,0 +1,32 @@ +#region License + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#endregion + +namespace Gremlin.Net.Process.Traversal.Strategy.Optimization +{ + /// <summary> + /// Helps to ensure that more traversals meet the local child constraint imposed on OLAP traversals. + /// </summary> + public class PathProcessorStrategy : AbstractTraversalStrategy + { + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/f61227bc/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Strategy/Optimization/PathRetractionStrategy.cs ---------------------------------------------------------------------- diff --git a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Strategy/Optimization/PathRetractionStrategy.cs b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Strategy/Optimization/PathRetractionStrategy.cs new file mode 100644 index 0000000..e54fbb5 --- /dev/null +++ b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Strategy/Optimization/PathRetractionStrategy.cs @@ -0,0 +1,29 @@ +#region License + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#endregion + +namespace Gremlin.Net.Process.Traversal.Strategy.Optimization +{ + public class PathRetractionStrategy : AbstractTraversalStrategy + { + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/f61227bc/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Strategy/Optimization/RangeByIsCountStrategy.cs ---------------------------------------------------------------------- diff --git a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Strategy/Optimization/RangeByIsCountStrategy.cs b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Strategy/Optimization/RangeByIsCountStrategy.cs new file mode 100644 index 0000000..e3024bc --- /dev/null +++ b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Strategy/Optimization/RangeByIsCountStrategy.cs @@ -0,0 +1,32 @@ +#region License + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#endregion + +namespace Gremlin.Net.Process.Traversal.Strategy.Optimization +{ + /// <summary> + /// Optimizes any occurrence of <c>Count()</c>-step followed by an <c>Is()</c>-step. + /// </summary> + public class RangeByIsCountStrategy : AbstractTraversalStrategy + { + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/f61227bc/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Strategy/Optimization/RepeatUnrollStrategy.cs ---------------------------------------------------------------------- diff --git a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Strategy/Optimization/RepeatUnrollStrategy.cs b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Strategy/Optimization/RepeatUnrollStrategy.cs new file mode 100644 index 0000000..6cac454 --- /dev/null +++ b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Strategy/Optimization/RepeatUnrollStrategy.cs @@ -0,0 +1,29 @@ +#region License + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#endregion + +namespace Gremlin.Net.Process.Traversal.Strategy.Optimization +{ + public class RepeatUnrollStrategy : AbstractTraversalStrategy + { + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/f61227bc/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Strategy/Verification/LambdaRestrictionStrategy.cs ---------------------------------------------------------------------- diff --git a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Strategy/Verification/LambdaRestrictionStrategy.cs b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Strategy/Verification/LambdaRestrictionStrategy.cs new file mode 100644 index 0000000..0f488ab --- /dev/null +++ b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Strategy/Verification/LambdaRestrictionStrategy.cs @@ -0,0 +1,32 @@ +#region License + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#endregion + +namespace Gremlin.Net.Process.Traversal.Strategy.Verification +{ + /// <summary> + /// Does not allow lambdas to be used in a <see cref="ITraversal" />. + /// </summary> + public class LambdaRestrictionStrategy : AbstractTraversalStrategy + { + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/f61227bc/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Strategy/Verification/ReadOnlyStrategy.cs ---------------------------------------------------------------------- diff --git a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Strategy/Verification/ReadOnlyStrategy.cs b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Strategy/Verification/ReadOnlyStrategy.cs new file mode 100644 index 0000000..a703e18 --- /dev/null +++ b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Strategy/Verification/ReadOnlyStrategy.cs @@ -0,0 +1,32 @@ +#region License + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#endregion + +namespace Gremlin.Net.Process.Traversal.Strategy.Verification +{ + /// <summary> + /// Detects mutating steps and throws an exception if one is found. + /// </summary> + public class ReadOnlyStrategy : AbstractTraversalStrategy + { + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/f61227bc/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/T.cs ---------------------------------------------------------------------- diff --git a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/T.cs b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/T.cs new file mode 100644 index 0000000..50c15d9 --- /dev/null +++ b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/T.cs @@ -0,0 +1,33 @@ +#region License + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#endregion + +namespace Gremlin.Net.Process.Traversal +{ + public enum T + { + id, + key, + label, + value + } +} http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/f61227bc/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/TraversalPredicate.cs ---------------------------------------------------------------------- diff --git a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/TraversalPredicate.cs b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/TraversalPredicate.cs new file mode 100644 index 0000000..b854213 --- /dev/null +++ b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/TraversalPredicate.cs @@ -0,0 +1,85 @@ +#region License + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#endregion + +namespace Gremlin.Net.Process.Traversal +{ + /// <summary> + /// Represents a predicate (boolean-valued function) used in a <see cref="ITraversal" />. + /// </summary> + public class TraversalPredicate + { + /// <summary> + /// Initializes a new instance of the <see cref="TraversalPredicate" /> class. + /// </summary> + /// <param name="operatorName">The name of the predicate.</param> + /// <param name="value">The value of the predicate.</param> + /// <param name="other">An optional other predicate that is used as an argument for this predicate.</param> + public TraversalPredicate(string operatorName, dynamic value, TraversalPredicate other = null) + { + OperatorName = operatorName; + Value = value; + Other = other; + } + + /// <summary> + /// Gets the name of the predicate. + /// </summary> + public string OperatorName { get; } + + /// <summary> + /// Gets the value of the predicate. + /// </summary> + public dynamic Value { get; } + + /// <summary> + /// Gets an optional other predicate that is used as an argument for this predicate. + /// </summary> + public TraversalPredicate Other { get; } + + /// <summary> + /// Returns a composed predicate that represents a logical AND of this predicate and another. + /// </summary> + /// <param name="otherPredicate">A predicate that will be logically-ANDed with this predicate.</param> + /// <returns>The composed predicate.</returns> + public TraversalPredicate And(TraversalPredicate otherPredicate) + { + return new TraversalPredicate("and", this, otherPredicate); + } + + /// <summary> + /// Returns a composed predicate that represents a logical OR of this predicate and another. + /// </summary> + /// <param name="otherPredicate">A predicate that will be logically-ORed with this predicate.</param> + /// <returns>The composed predicate.</returns> + public TraversalPredicate Or(TraversalPredicate otherPredicate) + { + return new TraversalPredicate("or", this, otherPredicate); + } + + /// <inheritdoc /> + public override string ToString() + { + return Other == null ? $"{OperatorName}({Value})" : $"{OperatorName}({Value},{Other})"; + } + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/f61227bc/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Traverser.cs ---------------------------------------------------------------------- diff --git a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Traverser.cs b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Traverser.cs new file mode 100644 index 0000000..573e57f --- /dev/null +++ b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Traverser.cs @@ -0,0 +1,75 @@ +#region License + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#endregion + +namespace Gremlin.Net.Process.Traversal +{ + /// <summary> + /// A traverser represents the current state of an object flowing through a <see cref="ITraversal" />. + /// </summary> + public class Traverser + { + /// <summary> + /// Initializes a new instance of the <see cref="Traverser" /> class. + /// </summary> + /// <param name="obj">The object of the traverser.</param> + /// <param name="bulk">The number of traversers represented in this traverser.</param> + public Traverser(dynamic obj, long bulk = 1) + { + Object = obj; + Bulk = bulk; + } + + /// <summary> + /// Gets the object of this traverser. + /// </summary> + public dynamic Object { get; } + + /// <summary> + /// Gets the number of traversers represented in this traverser. + /// </summary> + public long Bulk { get; internal set; } + + /// <inheritdoc /> + public bool Equals(Traverser other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + return Equals(Object, other.Object); + } + + /// <inheritdoc /> + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + if (obj.GetType() != GetType()) return false; + return Equals((Traverser) obj); + } + + /// <inheritdoc /> + public override int GetHashCode() + { + return Object != null ? Object.GetHashCode() : 0; + } + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/f61227bc/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/__.cs ---------------------------------------------------------------------- diff --git a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/__.cs b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/__.cs new file mode 100644 index 0000000..e120372 --- /dev/null +++ b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/__.cs @@ -0,0 +1,488 @@ +#region License + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#endregion + +namespace Gremlin.Net.Process.Traversal +{ + public static class __ + { + public static GraphTraversal Start() + { + return new GraphTraversal(); + } + + public static GraphTraversal V(params object[] args) + { + return new GraphTraversal().V(args); + } + + public static GraphTraversal AddE(params object[] args) + { + return new GraphTraversal().AddE(args); + } + + public static GraphTraversal AddInE(params object[] args) + { + return new GraphTraversal().AddInE(args); + } + + public static GraphTraversal AddOutE(params object[] args) + { + return new GraphTraversal().AddOutE(args); + } + + public static GraphTraversal AddV(params object[] args) + { + return new GraphTraversal().AddV(args); + } + + public static GraphTraversal Aggregate(params object[] args) + { + return new GraphTraversal().Aggregate(args); + } + + public static GraphTraversal And(params object[] args) + { + return new GraphTraversal().And(args); + } + + public static GraphTraversal As(params object[] args) + { + return new GraphTraversal().As(args); + } + + public static GraphTraversal Barrier(params object[] args) + { + return new GraphTraversal().Barrier(args); + } + + public static GraphTraversal Both(params object[] args) + { + return new GraphTraversal().Both(args); + } + + public static GraphTraversal BothE(params object[] args) + { + return new GraphTraversal().BothE(args); + } + + public static GraphTraversal BothV(params object[] args) + { + return new GraphTraversal().BothV(args); + } + + public static GraphTraversal Branch(params object[] args) + { + return new GraphTraversal().Branch(args); + } + + public static GraphTraversal Cap(params object[] args) + { + return new GraphTraversal().Cap(args); + } + + public static GraphTraversal Choose(params object[] args) + { + return new GraphTraversal().Choose(args); + } + + public static GraphTraversal Coalesce(params object[] args) + { + return new GraphTraversal().Coalesce(args); + } + + public static GraphTraversal Coin(params object[] args) + { + return new GraphTraversal().Coin(args); + } + + public static GraphTraversal Constant(params object[] args) + { + return new GraphTraversal().Constant(args); + } + + public static GraphTraversal Count(params object[] args) + { + return new GraphTraversal().Count(args); + } + + public static GraphTraversal CyclicPath(params object[] args) + { + return new GraphTraversal().CyclicPath(args); + } + + public static GraphTraversal Dedup(params object[] args) + { + return new GraphTraversal().Dedup(args); + } + + public static GraphTraversal Drop(params object[] args) + { + return new GraphTraversal().Drop(args); + } + + public static GraphTraversal Emit(params object[] args) + { + return new GraphTraversal().Emit(args); + } + + public static GraphTraversal Filter(params object[] args) + { + return new GraphTraversal().Filter(args); + } + + public static GraphTraversal FlatMap(params object[] args) + { + return new GraphTraversal().FlatMap(args); + } + + public static GraphTraversal Fold(params object[] args) + { + return new GraphTraversal().Fold(args); + } + + public static GraphTraversal Group(params object[] args) + { + return new GraphTraversal().Group(args); + } + + public static GraphTraversal GroupCount(params object[] args) + { + return new GraphTraversal().GroupCount(args); + } + + public static GraphTraversal GroupV3d0(params object[] args) + { + return new GraphTraversal().GroupV3d0(args); + } + + public static GraphTraversal Has(params object[] args) + { + return new GraphTraversal().Has(args); + } + + public static GraphTraversal HasId(params object[] args) + { + return new GraphTraversal().HasId(args); + } + + public static GraphTraversal HasKey(params object[] args) + { + return new GraphTraversal().HasKey(args); + } + + public static GraphTraversal HasLabel(params object[] args) + { + return new GraphTraversal().HasLabel(args); + } + + public static GraphTraversal HasNot(params object[] args) + { + return new GraphTraversal().HasNot(args); + } + + public static GraphTraversal HasValue(params object[] args) + { + return new GraphTraversal().HasValue(args); + } + + public static GraphTraversal Id(params object[] args) + { + return new GraphTraversal().Id(args); + } + + public static GraphTraversal Identity(params object[] args) + { + return new GraphTraversal().Identity(args); + } + + public static GraphTraversal In(params object[] args) + { + return new GraphTraversal().In(args); + } + + public static GraphTraversal InE(params object[] args) + { + return new GraphTraversal().InE(args); + } + + public static GraphTraversal InV(params object[] args) + { + return new GraphTraversal().InV(args); + } + + public static GraphTraversal Inject(params object[] args) + { + return new GraphTraversal().Inject(args); + } + + public static GraphTraversal Is(params object[] args) + { + return new GraphTraversal().Is(args); + } + + public static GraphTraversal Key(params object[] args) + { + return new GraphTraversal().Key(args); + } + + public static GraphTraversal Label(params object[] args) + { + return new GraphTraversal().Label(args); + } + + public static GraphTraversal Limit(params object[] args) + { + return new GraphTraversal().Limit(args); + } + + public static GraphTraversal Local(params object[] args) + { + return new GraphTraversal().Local(args); + } + + public static GraphTraversal Loops(params object[] args) + { + return new GraphTraversal().Loops(args); + } + + public static GraphTraversal Map(params object[] args) + { + return new GraphTraversal().Map(args); + } + + public static GraphTraversal MapKeys(params object[] args) + { + return new GraphTraversal().MapKeys(args); + } + + public static GraphTraversal MapValues(params object[] args) + { + return new GraphTraversal().MapValues(args); + } + + public static GraphTraversal Match(params object[] args) + { + return new GraphTraversal().Match(args); + } + + public static GraphTraversal Max(params object[] args) + { + return new GraphTraversal().Max(args); + } + + public static GraphTraversal Mean(params object[] args) + { + return new GraphTraversal().Mean(args); + } + + public static GraphTraversal Min(params object[] args) + { + return new GraphTraversal().Min(args); + } + + public static GraphTraversal Not(params object[] args) + { + return new GraphTraversal().Not(args); + } + + public static GraphTraversal Optional(params object[] args) + { + return new GraphTraversal().Optional(args); + } + + public static GraphTraversal Or(params object[] args) + { + return new GraphTraversal().Or(args); + } + + public static GraphTraversal Order(params object[] args) + { + return new GraphTraversal().Order(args); + } + + public static GraphTraversal OtherV(params object[] args) + { + return new GraphTraversal().OtherV(args); + } + + public static GraphTraversal Out(params object[] args) + { + return new GraphTraversal().Out(args); + } + + public static GraphTraversal OutE(params object[] args) + { + return new GraphTraversal().OutE(args); + } + + public static GraphTraversal OutV(params object[] args) + { + return new GraphTraversal().OutV(args); + } + + public static GraphTraversal Path(params object[] args) + { + return new GraphTraversal().Path(args); + } + + public static GraphTraversal Project(params object[] args) + { + return new GraphTraversal().Project(args); + } + + public static GraphTraversal Properties(params object[] args) + { + return new GraphTraversal().Properties(args); + } + + public static GraphTraversal Property(params object[] args) + { + return new GraphTraversal().Property(args); + } + + public static GraphTraversal PropertyMap(params object[] args) + { + return new GraphTraversal().PropertyMap(args); + } + + public static GraphTraversal Range(params object[] args) + { + return new GraphTraversal().Range(args); + } + + public static GraphTraversal Repeat(params object[] args) + { + return new GraphTraversal().Repeat(args); + } + + public static GraphTraversal Sack(params object[] args) + { + return new GraphTraversal().Sack(args); + } + + public static GraphTraversal Sample(params object[] args) + { + return new GraphTraversal().Sample(args); + } + + public static GraphTraversal Select(params object[] args) + { + return new GraphTraversal().Select(args); + } + + public static GraphTraversal SideEffect(params object[] args) + { + return new GraphTraversal().SideEffect(args); + } + + public static GraphTraversal SimplePath(params object[] args) + { + return new GraphTraversal().SimplePath(args); + } + + public static GraphTraversal Store(params object[] args) + { + return new GraphTraversal().Store(args); + } + + public static GraphTraversal Subgraph(params object[] args) + { + return new GraphTraversal().Subgraph(args); + } + + public static GraphTraversal Sum(params object[] args) + { + return new GraphTraversal().Sum(args); + } + + public static GraphTraversal Tail(params object[] args) + { + return new GraphTraversal().Tail(args); + } + + public static GraphTraversal TimeLimit(params object[] args) + { + return new GraphTraversal().TimeLimit(args); + } + + public static GraphTraversal Times(params object[] args) + { + return new GraphTraversal().Times(args); + } + + public static GraphTraversal To(params object[] args) + { + return new GraphTraversal().To(args); + } + + public static GraphTraversal ToE(params object[] args) + { + return new GraphTraversal().ToE(args); + } + + public static GraphTraversal ToV(params object[] args) + { + return new GraphTraversal().ToV(args); + } + + public static GraphTraversal Tree(params object[] args) + { + return new GraphTraversal().Tree(args); + } + + public static GraphTraversal Unfold(params object[] args) + { + return new GraphTraversal().Unfold(args); + } + + public static GraphTraversal Union(params object[] args) + { + return new GraphTraversal().Union(args); + } + + public static GraphTraversal Until(params object[] args) + { + return new GraphTraversal().Until(args); + } + + public static GraphTraversal Value(params object[] args) + { + return new GraphTraversal().Value(args); + } + + public static GraphTraversal ValueMap(params object[] args) + { + return new GraphTraversal().ValueMap(args); + } + + public static GraphTraversal Values(params object[] args) + { + return new GraphTraversal().Values(args); + } + + public static GraphTraversal Where(params object[] args) + { + return new GraphTraversal().Where(args); + } + } +} http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/f61227bc/gremlin-dotnet/src/Gremlin.Net/Structure/Graph.cs ---------------------------------------------------------------------- diff --git a/gremlin-dotnet/src/Gremlin.Net/Structure/Graph.cs b/gremlin-dotnet/src/Gremlin.Net/Structure/Graph.cs new file mode 100644 index 0000000..0a07763 --- /dev/null +++ b/gremlin-dotnet/src/Gremlin.Net/Structure/Graph.cs @@ -0,0 +1,35 @@ +#region License + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#endregion + +using Gremlin.Net.Process.Traversal; + +namespace Gremlin.Net.Structure +{ + public class Graph + { + public GraphTraversalSource Traversal() + { + return new GraphTraversalSource(); + } + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/f61227bc/gremlin-dotnet/test/Gremlin.CSharp.IntegrationTest/BytecodeGeneration/BytecodeGenerationTests.cs ---------------------------------------------------------------------- diff --git a/gremlin-dotnet/test/Gremlin.CSharp.IntegrationTest/BytecodeGeneration/BytecodeGenerationTests.cs b/gremlin-dotnet/test/Gremlin.CSharp.IntegrationTest/BytecodeGeneration/BytecodeGenerationTests.cs deleted file mode 100644 index 672ff35..0000000 --- a/gremlin-dotnet/test/Gremlin.CSharp.IntegrationTest/BytecodeGeneration/BytecodeGenerationTests.cs +++ /dev/null @@ -1,76 +0,0 @@ -#region License - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -#endregion - -using Gremlin.CSharp.Process; -using Gremlin.CSharp.Structure; -using Xunit; - -namespace Gremlin.CSharp.IntegrationTest.BytecodeGeneration -{ - public class BytecodeGenerationTests - { - [Fact] - public void g_V_OutXcreatedX() - { - var g = new Graph().Traversal(); - - var bytecode = g.V().Out("created").Bytecode; - - Assert.Equal(0, bytecode.SourceInstructions.Count); - Assert.Equal(2, bytecode.StepInstructions.Count); - Assert.Equal("V", bytecode.StepInstructions[0].OperatorName); - Assert.Equal("out", bytecode.StepInstructions[1].OperatorName); - Assert.Equal("created", bytecode.StepInstructions[1].Arguments[0]); - Assert.Equal(1, bytecode.StepInstructions[1].Arguments.Length); - } - - [Fact] - public void g_WithSackX1X_E_GroupCount_ByXweightX() - { - var g = new Graph().Traversal(); - - var bytecode = g.WithSack(1).E().GroupCount().By("weight").Bytecode; - - Assert.Equal(1, bytecode.SourceInstructions.Count); - Assert.Equal("withSack", bytecode.SourceInstructions[0].OperatorName); - Assert.Equal(1, bytecode.SourceInstructions[0].Arguments[0]); - Assert.Equal(3, bytecode.StepInstructions.Count); - Assert.Equal("E", bytecode.StepInstructions[0].OperatorName); - Assert.Equal("groupCount", bytecode.StepInstructions[1].OperatorName); - Assert.Equal("by", bytecode.StepInstructions[2].OperatorName); - Assert.Equal("weight", bytecode.StepInstructions[2].Arguments[0]); - Assert.Equal(0, bytecode.StepInstructions[0].Arguments.Length); - Assert.Equal(0, bytecode.StepInstructions[1].Arguments.Length); - Assert.Equal(1, bytecode.StepInstructions[2].Arguments.Length); - } - - [Fact] - public void AnonymousTraversal_Start_EmptyBytecode() - { - var bytecode = __.Start().Bytecode; - - Assert.Equal(0, bytecode.SourceInstructions.Count); - Assert.Equal(0, bytecode.StepInstructions.Count); - } - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/f61227bc/gremlin-dotnet/test/Gremlin.CSharp.IntegrationTest/BytecodeGeneration/StrategiesTests.cs ---------------------------------------------------------------------- diff --git a/gremlin-dotnet/test/Gremlin.CSharp.IntegrationTest/BytecodeGeneration/StrategiesTests.cs b/gremlin-dotnet/test/Gremlin.CSharp.IntegrationTest/BytecodeGeneration/StrategiesTests.cs deleted file mode 100644 index 6afda71..0000000 --- a/gremlin-dotnet/test/Gremlin.CSharp.IntegrationTest/BytecodeGeneration/StrategiesTests.cs +++ /dev/null @@ -1,170 +0,0 @@ -#region License - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -#endregion - -using System.Collections.Generic; -using Gremlin.CSharp.Process; -using Gremlin.CSharp.Structure; -using Gremlin.Net.Process.Traversal.Strategy.Decoration; -using Gremlin.Net.Process.Traversal.Strategy.Finalization; -using Gremlin.Net.Process.Traversal.Strategy.Optimization; -using Gremlin.Net.Process.Traversal.Strategy.Verification; -using Xunit; - -namespace Gremlin.CSharp.IntegrationTest.BytecodeGeneration -{ - public class StrategiesTests - { - [Fact] - public void TraversalWithoutStrategies_AfterWithStrategiesWasCalled_WithStrategiesNotAffected() - { - var graph = new Graph(); - var g = graph.Traversal().WithStrategies(new ReadOnlyStrategy(), new IncidentToAdjacentStrategy()); - - var bytecode = g.WithoutStrategies(new ReadOnlyStrategy()).Bytecode; - - Assert.Equal(2, bytecode.SourceInstructions.Count); - Assert.Equal("withStrategies", bytecode.SourceInstructions[0].OperatorName); - Assert.Equal(2, bytecode.SourceInstructions[0].Arguments.Length); - Assert.Equal(new ReadOnlyStrategy(), bytecode.SourceInstructions[0].Arguments[0]); - Assert.Equal(new IncidentToAdjacentStrategy(), bytecode.SourceInstructions[0].Arguments[1]); - - Assert.Equal("withoutStrategies", bytecode.SourceInstructions[1].OperatorName); - Assert.Equal(1, bytecode.SourceInstructions[1].Arguments.Length); - Assert.Equal(new ReadOnlyStrategy(), bytecode.SourceInstructions[1].Arguments[0]); - } - - [Fact] - public void ShouldIncludeMultipleStrategiesInBytecodeWhenGivenToWithoutStrategies() - { - var graph = new Graph(); - var g = graph.Traversal(); - - var bytecode = g.WithoutStrategies(new ReadOnlyStrategy(), new LazyBarrierStrategy()).Bytecode; - - Assert.Equal(1, bytecode.SourceInstructions.Count); - Assert.Equal(2, bytecode.SourceInstructions[0].Arguments.Length); - Assert.Equal("withoutStrategies", bytecode.SourceInstructions[0].OperatorName); - Assert.Equal(new ReadOnlyStrategy(), bytecode.SourceInstructions[0].Arguments[0]); - Assert.Equal(new LazyBarrierStrategy(), bytecode.SourceInstructions[0].Arguments[1]); - } - - [Fact] - public void ShouldIncludeOneStrategyInBytecodeWhenGivenToWithoutStrategies() - { - var graph = new Graph(); - var g = graph.Traversal(); - - var bytecode = g.WithoutStrategies(new ReadOnlyStrategy()).Bytecode; - - Assert.Equal(1, bytecode.SourceInstructions.Count); - Assert.Equal(1, bytecode.SourceInstructions[0].Arguments.Length); - Assert.Equal("withoutStrategies", bytecode.SourceInstructions[0].OperatorName); - Assert.Equal(new ReadOnlyStrategy(), bytecode.SourceInstructions[0].Arguments[0]); - } - - [Fact] - public void ShouldIncludeConfigurationInBytecodeWhenGivenToWithStrategies() - { - var graph = new Graph(); - var g = graph.Traversal(); - - var bytecode = g.WithStrategies(new MatchAlgorithmStrategy("greedy")).Bytecode; - - Assert.Equal(1, bytecode.SourceInstructions.Count); - Assert.Equal(1, bytecode.SourceInstructions[0].Arguments.Length); - Assert.Equal("withStrategies", bytecode.SourceInstructions[0].OperatorName); - Assert.Equal(new MatchAlgorithmStrategy(), bytecode.SourceInstructions[0].Arguments[0]); - Assert.Contains("greedy", - ((MatchAlgorithmStrategy) bytecode.SourceInstructions[0].Arguments[0]).Configuration.Values); - } - - [Fact] - public void ShouldIncludeMultipleStrategiesInBytecodeWhenGivenToWithStrategies() - { - var graph = new Graph(); - var g = graph.Traversal(); - - var bytecode = g.WithStrategies(new ReadOnlyStrategy(), new IncidentToAdjacentStrategy()).Bytecode; - - Assert.Equal(1, bytecode.SourceInstructions.Count); - Assert.Equal(2, bytecode.SourceInstructions[0].Arguments.Length); - Assert.Equal("withStrategies", bytecode.SourceInstructions[0].OperatorName); - Assert.Equal(new ReadOnlyStrategy(), bytecode.SourceInstructions[0].Arguments[0]); - Assert.Equal(new IncidentToAdjacentStrategy(), bytecode.SourceInstructions[0].Arguments[1]); - } - - [Fact] - public void ShouldIncludeOneStrategyInBytecodeWhenGivenToWithStrategies() - { - var graph = new Graph(); - var g = graph.Traversal(); - - var bytecode = g.WithStrategies(new ReadOnlyStrategy()).Bytecode; - - Assert.Equal(1, bytecode.SourceInstructions.Count); - Assert.Equal(1, bytecode.SourceInstructions[0].Arguments.Length); - Assert.Equal("withStrategies", bytecode.SourceInstructions[0].OperatorName); - Assert.Equal(new ReadOnlyStrategy(), bytecode.SourceInstructions[0].Arguments[0]); - Assert.Equal("ReadOnlyStrategy", bytecode.SourceInstructions[0].Arguments[0].ToString()); - Assert.Equal(new ReadOnlyStrategy().GetHashCode(), bytecode.SourceInstructions[0].Arguments[0].GetHashCode()); - Assert.Equal(0, g.TraversalStrategies.Count); - } - - [Fact] - public void TraversalWithStrategies_Strategies_ApplyToReusedGraphTraversalSource() - { - var graph = new Graph(); - var g = graph.Traversal().WithStrategies(new ReadOnlyStrategy(), new IncidentToAdjacentStrategy()); - - var bytecode = g.V().Bytecode; - - Assert.Equal(1, bytecode.SourceInstructions.Count); - Assert.Equal(2, bytecode.SourceInstructions[0].Arguments.Length); - Assert.Equal("withStrategies", bytecode.SourceInstructions[0].OperatorName); - Assert.Equal(new ReadOnlyStrategy(), bytecode.SourceInstructions[0].Arguments[0]); - Assert.Equal(new IncidentToAdjacentStrategy(), bytecode.SourceInstructions[0].Arguments[1]); - Assert.Equal(1, bytecode.StepInstructions.Count); - Assert.Equal("V", bytecode.StepInstructions[0].OperatorName); - } - - [Fact] - public void TraversalWithStrategies_StrategyWithTraversalInConfig_IncludeTraversalInInConfigInBytecode() - { - var graph = new Graph(); - var g = graph.Traversal(); - - var bytecode = g.WithStrategies(new SubgraphStrategy(__.Has("name", "marko"))).Bytecode; - - Assert.Equal(1, bytecode.SourceInstructions.Count); - Assert.Equal(1, bytecode.SourceInstructions[0].Arguments.Length); - Assert.Equal("withStrategies", bytecode.SourceInstructions[0].OperatorName); - Assert.Equal(new SubgraphStrategy(), bytecode.SourceInstructions[0].Arguments[0]); - SubgraphStrategy strategy = bytecode.SourceInstructions[0].Arguments[0]; - Assert.Equal(1, strategy.Configuration.Count); - Assert.Equal(typeof(GraphTraversal), strategy.Configuration["vertices"].GetType()); - GraphTraversal traversal = strategy.Configuration["vertices"]; - Assert.Equal("has", traversal.Bytecode.StepInstructions[0].OperatorName); - Assert.Equal(new List<string> {"name", "marko"}, traversal.Bytecode.StepInstructions[0].Arguments); - } - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/f61227bc/gremlin-dotnet/test/Gremlin.CSharp.IntegrationTest/ConfigProvider.cs ---------------------------------------------------------------------- diff --git a/gremlin-dotnet/test/Gremlin.CSharp.IntegrationTest/ConfigProvider.cs b/gremlin-dotnet/test/Gremlin.CSharp.IntegrationTest/ConfigProvider.cs deleted file mode 100644 index 27e7009..0000000 --- a/gremlin-dotnet/test/Gremlin.CSharp.IntegrationTest/ConfigProvider.cs +++ /dev/null @@ -1,47 +0,0 @@ -#region License - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -#endregion - -using System.IO; -using Microsoft.Extensions.Configuration; - -namespace Gremlin.CSharp.IntegrationTest -{ - public static class ConfigProvider - { - static ConfigProvider() - { - Configuration = GetConfig(); - } - - public static IConfiguration Configuration { get; } - - private static IConfiguration GetConfig() - { - var configFile = Path.Combine(Directory.GetCurrentDirectory(), "appsettings.json"); - var builder = new ConfigurationBuilder() - .AddJsonFile(configFile, false, false); - - return builder.Build(); - } - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/f61227bc/gremlin-dotnet/test/Gremlin.CSharp.IntegrationTest/DriverRemoteConnection/EnumTests.cs ---------------------------------------------------------------------- diff --git a/gremlin-dotnet/test/Gremlin.CSharp.IntegrationTest/DriverRemoteConnection/EnumTests.cs b/gremlin-dotnet/test/Gremlin.CSharp.IntegrationTest/DriverRemoteConnection/EnumTests.cs deleted file mode 100644 index a49a09d..0000000 --- a/gremlin-dotnet/test/Gremlin.CSharp.IntegrationTest/DriverRemoteConnection/EnumTests.cs +++ /dev/null @@ -1,59 +0,0 @@ -#region License - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -#endregion - -using System.Collections.Generic; -using Gremlin.CSharp.Process; -using Gremlin.CSharp.Structure; -using Xunit; - -namespace Gremlin.CSharp.IntegrationTest.DriverRemoteConnection -{ - public class EnumTests - { - private readonly RemoteConnectionFactory _connectionFactory = new RemoteConnectionFactory(); - - [Fact] - public void ShouldUseOrderDecrInByStep() - { - var graph = new Graph(); - var connection = _connectionFactory.CreateRemoteConnection(); - var g = graph.Traversal().WithRemote(connection); - - var orderedAges = g.V().Values("age").Order().By(Order.decr).ToList(); - - Assert.Equal(new List<object> {35, 32, 29, 27}, orderedAges); - } - - [Fact] - public void ShouldUseTLabelInHasStep() - { - var graph = new Graph(); - var connection = _connectionFactory.CreateRemoteConnection(); - var g = graph.Traversal().WithRemote(connection); - - var personsCount = g.V().Has(T.label, "person").Count().Next(); - - Assert.Equal((long) 4, personsCount); - } - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/f61227bc/gremlin-dotnet/test/Gremlin.CSharp.IntegrationTest/DriverRemoteConnection/GraphTraversalSourceTests.cs ---------------------------------------------------------------------- diff --git a/gremlin-dotnet/test/Gremlin.CSharp.IntegrationTest/DriverRemoteConnection/GraphTraversalSourceTests.cs b/gremlin-dotnet/test/Gremlin.CSharp.IntegrationTest/DriverRemoteConnection/GraphTraversalSourceTests.cs deleted file mode 100644 index f8c12e2..0000000 --- a/gremlin-dotnet/test/Gremlin.CSharp.IntegrationTest/DriverRemoteConnection/GraphTraversalSourceTests.cs +++ /dev/null @@ -1,55 +0,0 @@ -#region License - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -#endregion - -using System.Collections.Generic; -using Gremlin.CSharp.Process; -using Gremlin.CSharp.Structure; -using Xunit; - -namespace Gremlin.CSharp.IntegrationTest.DriverRemoteConnection -{ - public class GraphTraversalSourceTests - { - private readonly RemoteConnectionFactory _connectionFactory = new RemoteConnectionFactory(); - - [Fact] - public void ShouldUseSideEffectSpecifiedInWithSideEffect() - { - var graph = new Graph(); - var connection = _connectionFactory.CreateRemoteConnection(); - var g = graph.Traversal().WithRemote(connection); - - var results = g.WithSideEffect("a", new List<string> {"josh", "peter"}) - .V(1) - .Out("created") - .In("created") - .Values("name") - .Where(P.Within("a")) - .ToList(); - - Assert.Equal(2, results.Count); - Assert.Contains("josh", results); - Assert.Contains("peter", results); - } - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/f61227bc/gremlin-dotnet/test/Gremlin.CSharp.IntegrationTest/DriverRemoteConnection/GraphTraversalTests.cs ---------------------------------------------------------------------- diff --git a/gremlin-dotnet/test/Gremlin.CSharp.IntegrationTest/DriverRemoteConnection/GraphTraversalTests.cs b/gremlin-dotnet/test/Gremlin.CSharp.IntegrationTest/DriverRemoteConnection/GraphTraversalTests.cs deleted file mode 100644 index 91a41ba..0000000 --- a/gremlin-dotnet/test/Gremlin.CSharp.IntegrationTest/DriverRemoteConnection/GraphTraversalTests.cs +++ /dev/null @@ -1,171 +0,0 @@ -#region License - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -#endregion - -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Gremlin.CSharp.Process; -using Gremlin.CSharp.Structure; -using Gremlin.Net.Process.Traversal; -using Gremlin.Net.Structure; -using Xunit; - -namespace Gremlin.CSharp.IntegrationTest.DriverRemoteConnection -{ - public class GraphTraversalTests - { - private readonly RemoteConnectionFactory _connectionFactory = new RemoteConnectionFactory(); - - [Fact] - public void g_V_Count() - { - var graph = new Graph(); - var connection = _connectionFactory.CreateRemoteConnection(); - var g = graph.Traversal().WithRemote(connection); - - var count = g.V().Count().Next(); - - Assert.Equal((long) 6, count); - } - - [Fact] - public void g_VX1X_Next() - { - var graph = new Graph(); - var connection = _connectionFactory.CreateRemoteConnection(); - var g = graph.Traversal().WithRemote(connection); - - var vertex = (Vertex) g.V(1).Next(); - - Assert.Equal(new Vertex((long) 1), vertex); - Assert.Equal((long) 1, vertex.Id); - } - - [Fact] - public void g_VX1X_NextTraverser() - { - var graph = new Graph(); - var connection = _connectionFactory.CreateRemoteConnection(); - var g = graph.Traversal().WithRemote(connection); - - var traverser = g.V(1).NextTraverser(); - - Assert.Equal(new Traverser(new Vertex((long)1)), traverser); - } - - [Fact] - public void g_VX1X_ToList() - { - var graph = new Graph(); - var connection = _connectionFactory.CreateRemoteConnection(); - var g = graph.Traversal().WithRemote(connection); - - var list = g.V(1).ToList(); - - Assert.Equal(1, list.Count); - } - - [Fact] - public void g_V_RepeatXBothX_TimesX5X_NextX10X() - { - var graph = new Graph(); - var connection = _connectionFactory.CreateRemoteConnection(); - var g = graph.Traversal().WithRemote(connection); - - var result = g.V().Repeat(__.Both()).Times(5).Next(10); - - Assert.Equal(10, result.Count()); - } - - [Fact] - public void g_V_HasXname_markoX_ValueMap_Next() - { - var graph = new Graph(); - var connection = _connectionFactory.CreateRemoteConnection(); - var g = graph.Traversal().WithRemote(connection); - - var receivedValueMap = g.V().Has("name", "marko").ValueMap().Next(); - - var expectedValueMap = new Dictionary<string, dynamic> - { - {"age", new List<object> {29}}, - {"name", new List<object> {"marko"}} - }; - Assert.Equal(expectedValueMap, receivedValueMap); - } - - [Fact] - public void g_V_RepeatXOutX_TimesX2X_ValuesXNameX() - { - var graph = new Graph(); - var connection = _connectionFactory.CreateRemoteConnection(); - var g = graph.Traversal().WithRemote(connection); - - var t = g.V().Repeat(__.Out()).Times(2).Values("name"); - var names = t.ToList(); - - Assert.Equal((long) 2, names.Count); - Assert.Contains("lop", names); - Assert.Contains("ripple", names); - } - - [Fact] - public void ShortestPathTest() - { - var graph = new Graph(); - var connection = _connectionFactory.CreateRemoteConnection(); - var g = graph.Traversal().WithRemote(connection); - - var shortestPath = - (Path) g.V(5).Repeat(__.Both().SimplePath()).Until(__.HasId(6)).Limit(1).Path().Next(); - - Assert.Equal((long) 4, shortestPath.Count); - Assert.Equal(new Vertex((long) 6), shortestPath[3]); - } - - [Fact] - public void ShouldUseBindingsInTraversal() - { - var graph = new Graph(); - var connection = _connectionFactory.CreateRemoteConnection(); - var g = graph.Traversal().WithRemote(connection); - - var b = new Bindings(); - var count = g.V().Has(b.Of("propertyKey", "name"), b.Of("propertyValue", "marko")).OutE().Count().Next(); - - Assert.Equal((long) 3, count); - } - - [Fact] - public async Task ShouldExecuteAsynchronouslyWhenPromiseIsCalled() - { - var graph = new Graph(); - var connection = _connectionFactory.CreateRemoteConnection(); - var g = graph.Traversal().WithRemote(connection); - - var count = await g.V().Count().Promise(t => t.Next()); - - Assert.Equal((long) 6, count); - } - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/f61227bc/gremlin-dotnet/test/Gremlin.CSharp.IntegrationTest/DriverRemoteConnection/PredicateTests.cs ---------------------------------------------------------------------- diff --git a/gremlin-dotnet/test/Gremlin.CSharp.IntegrationTest/DriverRemoteConnection/PredicateTests.cs b/gremlin-dotnet/test/Gremlin.CSharp.IntegrationTest/DriverRemoteConnection/PredicateTests.cs deleted file mode 100644 index 8dffa43..0000000 --- a/gremlin-dotnet/test/Gremlin.CSharp.IntegrationTest/DriverRemoteConnection/PredicateTests.cs +++ /dev/null @@ -1,58 +0,0 @@ -#region License - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -#endregion - -using Gremlin.CSharp.Process; -using Gremlin.CSharp.Structure; -using Xunit; - -namespace Gremlin.CSharp.IntegrationTest.DriverRemoteConnection -{ - public class PredicateTests - { - private readonly RemoteConnectionFactory _connectionFactory = new RemoteConnectionFactory(); - - [Fact] - public void ShouldUsePredicatesCombinedWithPAndInHasStep() - { - var graph = new Graph(); - var connection = _connectionFactory.CreateRemoteConnection(); - var g = graph.Traversal().WithRemote(connection); - - var count = g.V().Has("age", P.Gt(30).And(P.Lt(35))).Count().Next(); - - Assert.Equal((long) 1, count); - } - - [Fact] - public void ShouldUsePWithinInHasStep() - { - var graph = new Graph(); - var connection = _connectionFactory.CreateRemoteConnection(); - var g = graph.Traversal().WithRemote(connection); - - var count = g.V().Has("name", P.Within("josh", "vadas")).Count().Next(); - - Assert.Equal((long) 2, count); - } - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/f61227bc/gremlin-dotnet/test/Gremlin.CSharp.IntegrationTest/DriverRemoteConnection/RemoteConnectionFactory.cs ---------------------------------------------------------------------- diff --git a/gremlin-dotnet/test/Gremlin.CSharp.IntegrationTest/DriverRemoteConnection/RemoteConnectionFactory.cs b/gremlin-dotnet/test/Gremlin.CSharp.IntegrationTest/DriverRemoteConnection/RemoteConnectionFactory.cs deleted file mode 100644 index 53b6e50..0000000 --- a/gremlin-dotnet/test/Gremlin.CSharp.IntegrationTest/DriverRemoteConnection/RemoteConnectionFactory.cs +++ /dev/null @@ -1,41 +0,0 @@ -#region License - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -#endregion - -using System; -using Gremlin.Net.Driver; -using Gremlin.Net.Process.Remote; - -namespace Gremlin.CSharp.IntegrationTest.DriverRemoteConnection -{ - internal class RemoteConnectionFactory - { - private static readonly string TestHost = ConfigProvider.Configuration["TestServerIpAddress"]; - private static readonly int TestPort = Convert.ToInt32(ConfigProvider.Configuration["TestServerPort"]); - - public IRemoteConnection CreateRemoteConnection() - { - return new Net.Driver.Remote.DriverRemoteConnection( - new GremlinClient(new GremlinServer(TestHost, TestPort))); - } - } -} \ No newline at end of file