Repository: apex-malhar Updated Branches: refs/heads/master 2e47b4cd7 -> 8f00cefa2
http://git-wip-us.apache.org/repos/asf/apex-malhar/blob/8f00cefa/library/src/test/java/com/datatorrent/lib/streamquery/advanced/CompoundConditionTest.java ---------------------------------------------------------------------- diff --git a/library/src/test/java/com/datatorrent/lib/streamquery/advanced/CompoundConditionTest.java b/library/src/test/java/com/datatorrent/lib/streamquery/advanced/CompoundConditionTest.java deleted file mode 100644 index 2f92c9b..0000000 --- a/library/src/test/java/com/datatorrent/lib/streamquery/advanced/CompoundConditionTest.java +++ /dev/null @@ -1,92 +0,0 @@ -/** - * 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. - */ -package com.datatorrent.lib.streamquery.advanced; - -import java.util.HashMap; - -import org.junit.Test; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import com.datatorrent.lib.streamquery.SelectOperator; -import com.datatorrent.lib.streamquery.condition.CompoundCondition; -import com.datatorrent.lib.streamquery.condition.EqualValueCondition; -import com.datatorrent.lib.streamquery.index.ColumnIndex; -import com.datatorrent.lib.testbench.CollectorTestSink; - -/** - * Functional test for {@link com.datatorrent.lib.streamquery.advanced.CompoundConditionTest}. - */ -public class CompoundConditionTest -{ - @SuppressWarnings({ "rawtypes", "unchecked" }) - @Test - public void testSqlSelect() - { - // create operator - SelectOperator oper = new SelectOperator(); - oper.addIndex(new ColumnIndex("b", null)); - oper.addIndex(new ColumnIndex("c", null)); - - EqualValueCondition left = new EqualValueCondition(); - left.addEqualValue("a", 1); - EqualValueCondition right = new EqualValueCondition(); - right.addEqualValue("b", 1); - - oper.setCondition(new CompoundCondition(left, right)); - - - CollectorTestSink sink = new CollectorTestSink(); - oper.outport.setSink(sink); - - oper.setup(null); - oper.beginWindow(1); - - HashMap<String, Object> tuple = new HashMap<String, Object>(); - tuple.put("a", 0); - tuple.put("b", 1); - tuple.put("c", 2); - oper.inport.process(tuple); - - tuple = new HashMap<String, Object>(); - tuple.put("a", 1); - tuple.put("b", 3); - tuple.put("c", 4); - oper.inport.process(tuple); - - tuple = new HashMap<String, Object>(); - tuple.put("a", 1); - tuple.put("b", 5); - tuple.put("c", 6); - oper.inport.process(tuple); - - tuple = new HashMap<String, Object>(); - tuple.put("a", 3); - tuple.put("b", 7); - tuple.put("c", 8); - oper.inport.process(tuple); - - oper.endWindow(); - oper.teardown(); - - LOG.debug("{}", sink.collectedTuples); - } - - private static final Logger LOG = LoggerFactory.getLogger(CompoundConditionTest.class); -} http://git-wip-us.apache.org/repos/asf/apex-malhar/blob/8f00cefa/library/src/test/java/com/datatorrent/lib/streamquery/advanced/InConditionTest.java ---------------------------------------------------------------------- diff --git a/library/src/test/java/com/datatorrent/lib/streamquery/advanced/InConditionTest.java b/library/src/test/java/com/datatorrent/lib/streamquery/advanced/InConditionTest.java deleted file mode 100644 index d235a9c..0000000 --- a/library/src/test/java/com/datatorrent/lib/streamquery/advanced/InConditionTest.java +++ /dev/null @@ -1,90 +0,0 @@ -/** - * 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. - */ -package com.datatorrent.lib.streamquery.advanced; - -import java.util.HashMap; - -import org.junit.Test; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import com.datatorrent.lib.streamquery.SelectOperator; -import com.datatorrent.lib.streamquery.condition.InCondition; -import com.datatorrent.lib.streamquery.index.ColumnIndex; -import com.datatorrent.lib.testbench.CollectorTestSink; - -/** - * Functional test for {@link com.datatorrent.lib.streamquery.advanced.InConditionTest}. - */ -public class InConditionTest -{ - @SuppressWarnings({ "rawtypes", "unchecked" }) - @Test - public void testSqlSelect() - { - // create operator - SelectOperator oper = new SelectOperator(); - oper.addIndex(new ColumnIndex("b", null)); - oper.addIndex(new ColumnIndex("c", null)); - - InCondition cond = new InCondition("a"); - cond.addInValue(0); - cond.addInValue(1); - oper.setCondition(cond); - - - CollectorTestSink sink = new CollectorTestSink(); - oper.outport.setSink(sink); - - oper.setup(null); - oper.beginWindow(1); - - HashMap<String, Object> tuple = new HashMap<String, Object>(); - tuple.put("a", 0); - tuple.put("b", 1); - tuple.put("c", 2); - oper.inport.process(tuple); - - tuple = new HashMap<String, Object>(); - tuple.put("a", 1); - tuple.put("b", 3); - tuple.put("c", 4); - oper.inport.process(tuple); - - tuple = new HashMap<String, Object>(); - tuple.put("a", 2); - tuple.put("b", 5); - tuple.put("c", 6); - oper.inport.process(tuple); - - tuple = new HashMap<String, Object>(); - tuple.put("a", 3); - tuple.put("b", 7); - tuple.put("c", 8); - oper.inport.process(tuple); - - oper.endWindow(); - oper.teardown(); - - LOG.debug("{}", sink.collectedTuples); - } - - private static final Logger LOG = LoggerFactory.getLogger(InConditionTest.class); - -} http://git-wip-us.apache.org/repos/asf/apex-malhar/blob/8f00cefa/library/src/test/java/com/datatorrent/lib/streamquery/advanced/LikeConditionTest.java ---------------------------------------------------------------------- diff --git a/library/src/test/java/com/datatorrent/lib/streamquery/advanced/LikeConditionTest.java b/library/src/test/java/com/datatorrent/lib/streamquery/advanced/LikeConditionTest.java deleted file mode 100644 index b4d8539..0000000 --- a/library/src/test/java/com/datatorrent/lib/streamquery/advanced/LikeConditionTest.java +++ /dev/null @@ -1,81 +0,0 @@ -/** - * 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. - */ -package com.datatorrent.lib.streamquery.advanced; - -import java.util.HashMap; - -import org.junit.Test; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import com.datatorrent.lib.streamquery.SelectOperator; -import com.datatorrent.lib.streamquery.condition.LikeCondition; -import com.datatorrent.lib.streamquery.index.ColumnIndex; -import com.datatorrent.lib.testbench.CollectorTestSink; - -/** - * Functional test for {@link com.datatorrent.lib.streamquery.advanced.LikeConditionTest}. - */ -public class LikeConditionTest -{ - @SuppressWarnings({ "rawtypes", "unchecked" }) - @Test - public void testSqlSelect() - { - // create operator - SelectOperator oper = new SelectOperator(); - oper.addIndex(new ColumnIndex("b", null)); - oper.addIndex(new ColumnIndex("c", null)); - - LikeCondition condition = new LikeCondition("a", "test*"); - oper.setCondition(condition); - - CollectorTestSink sink = new CollectorTestSink(); - oper.outport.setSink(sink); - - oper.setup(null); - oper.beginWindow(1); - - HashMap<String, Object> tuple = new HashMap<String, Object>(); - tuple.put("a", "testing"); - tuple.put("b", 1); - tuple.put("c", 2); - oper.inport.process(tuple); - - tuple = new HashMap<String, Object>(); - tuple.put("a", "null"); - tuple.put("b", 3); - tuple.put("c", 4); - oper.inport.process(tuple); - - tuple = new HashMap<String, Object>(); - tuple.put("a", "testall"); - tuple.put("b", 5); - tuple.put("c", 6); - oper.inport.process(tuple); - - oper.endWindow(); - oper.teardown(); - - LOG.debug("{}", sink.collectedTuples); - } - - private static final Logger LOG = LoggerFactory.getLogger(LikeConditionTest.class); - -} http://git-wip-us.apache.org/repos/asf/apex-malhar/blob/8f00cefa/library/src/test/java/com/datatorrent/lib/streamquery/advanced/NegateIndexTest.java ---------------------------------------------------------------------- diff --git a/library/src/test/java/com/datatorrent/lib/streamquery/advanced/NegateIndexTest.java b/library/src/test/java/com/datatorrent/lib/streamquery/advanced/NegateIndexTest.java deleted file mode 100644 index 3ccb03e..0000000 --- a/library/src/test/java/com/datatorrent/lib/streamquery/advanced/NegateIndexTest.java +++ /dev/null @@ -1,75 +0,0 @@ -/** - * 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. - */ -package com.datatorrent.lib.streamquery.advanced; - -import java.util.HashMap; - -import org.junit.Test; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import com.datatorrent.lib.streamquery.SelectOperator; -import com.datatorrent.lib.streamquery.index.NegateExpression; -import com.datatorrent.lib.testbench.CollectorTestSink; - -/** - * Functional test for {@link com.datatorrent.lib.streamquery.SelectOperatorTest}. - */ -public class NegateIndexTest -{ - @SuppressWarnings({ "rawtypes", "unchecked" }) - @Test - public void testSqlSelect() - { - // create operator - SelectOperator oper = new SelectOperator(); - oper.addIndex(new NegateExpression("b", null)); - - CollectorTestSink sink = new CollectorTestSink(); - oper.outport.setSink(sink); - - oper.setup(null); - oper.beginWindow(1); - - HashMap<String, Object> tuple = new HashMap<String, Object>(); - tuple.put("a", 0); - tuple.put("b", 1); - tuple.put("c", 2); - oper.inport.process(tuple); - - tuple = new HashMap<String, Object>(); - tuple.put("a", 1); - tuple.put("b", 3); - tuple.put("c", 4); - oper.inport.process(tuple); - - tuple = new HashMap<String, Object>(); - tuple.put("a", 1); - tuple.put("b", 5); - tuple.put("c", 6); - oper.inport.process(tuple); - - oper.endWindow(); - oper.teardown(); - - LOG.debug("{}", sink.collectedTuples); - } - - private static final Logger LOG = LoggerFactory.getLogger(NegateIndexTest.class); -} http://git-wip-us.apache.org/repos/asf/apex-malhar/blob/8f00cefa/library/src/test/java/com/datatorrent/lib/streamquery/advanced/SelectAverageTest.java ---------------------------------------------------------------------- diff --git a/library/src/test/java/com/datatorrent/lib/streamquery/advanced/SelectAverageTest.java b/library/src/test/java/com/datatorrent/lib/streamquery/advanced/SelectAverageTest.java deleted file mode 100644 index 5279dac..0000000 --- a/library/src/test/java/com/datatorrent/lib/streamquery/advanced/SelectAverageTest.java +++ /dev/null @@ -1,75 +0,0 @@ -/** - * 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. - */ -package com.datatorrent.lib.streamquery.advanced; - -import java.util.HashMap; - -import org.junit.Test; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import com.datatorrent.lib.streamquery.SelectFunctionOperator; -import com.datatorrent.lib.streamquery.function.AverageFunction; -import com.datatorrent.lib.testbench.CollectorTestSink; - -/** - * Functional test for {@link com.datatorrent.lib.streamquery.SelectOperatorTest}. - */ -public class SelectAverageTest -{ - @SuppressWarnings({ "rawtypes", "unchecked" }) - @Test - public void testSqlSelect() - { - // create operator - SelectFunctionOperator oper = new SelectFunctionOperator(); - oper.addSqlFunction(new AverageFunction("b", null)); - - CollectorTestSink sink = new CollectorTestSink(); - oper.outport.setSink(sink); - - oper.setup(null); - oper.beginWindow(1); - - HashMap<String, Object> tuple = new HashMap<String, Object>(); - tuple.put("a", 0); - tuple.put("b", 1); - tuple.put("c", 2); - oper.inport.process(tuple); - - tuple = new HashMap<String, Object>(); - tuple.put("a", 1); - tuple.put("b", 3); - tuple.put("c", 4); - oper.inport.process(tuple); - - tuple = new HashMap<String, Object>(); - tuple.put("a", 1); - tuple.put("b", 5); - tuple.put("c", 6); - oper.inport.process(tuple); - - oper.endWindow(); - oper.teardown(); - - LOG.debug("{}", sink.collectedTuples); - } - - private static final Logger LOG = LoggerFactory.getLogger(SelectAverageTest.class); -} http://git-wip-us.apache.org/repos/asf/apex-malhar/blob/8f00cefa/library/src/test/java/com/datatorrent/lib/streamquery/advanced/SelectCountTest.java ---------------------------------------------------------------------- diff --git a/library/src/test/java/com/datatorrent/lib/streamquery/advanced/SelectCountTest.java b/library/src/test/java/com/datatorrent/lib/streamquery/advanced/SelectCountTest.java deleted file mode 100644 index 9c235e1..0000000 --- a/library/src/test/java/com/datatorrent/lib/streamquery/advanced/SelectCountTest.java +++ /dev/null @@ -1,76 +0,0 @@ -/** - * 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. - */ -package com.datatorrent.lib.streamquery.advanced; - -import java.util.HashMap; - -import org.junit.Test; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import com.datatorrent.lib.streamquery.SelectFunctionOperator; -import com.datatorrent.lib.streamquery.function.CountFunction; -import com.datatorrent.lib.testbench.CollectorTestSink; - -/** - * Functional test for {@link com.datatorrent.lib.streamquery.SelectOperatorTest}. - */ -public class SelectCountTest -{ - @SuppressWarnings({ "rawtypes", "unchecked" }) - @Test - public void testSqlSelect() - { - // create operator - SelectFunctionOperator oper = new SelectFunctionOperator(); - oper.addSqlFunction(new CountFunction("b", null)); - - CollectorTestSink sink = new CollectorTestSink(); - oper.outport.setSink(sink); - - oper.setup(null); - oper.beginWindow(1); - - HashMap<String, Object> tuple = new HashMap<String, Object>(); - tuple.put("a", 0); - tuple.put("b", null); - tuple.put("c", 2); - oper.inport.process(tuple); - - tuple = new HashMap<String, Object>(); - tuple.put("a", 1); - tuple.put("b", null); - tuple.put("c", 4); - oper.inport.process(tuple); - - tuple = new HashMap<String, Object>(); - tuple.put("a", 1); - tuple.put("b", 5); - tuple.put("c", 6); - oper.inport.process(tuple); - - oper.endWindow(); - oper.teardown(); - - LOG.debug("{}", sink.collectedTuples); - } - - private static final Logger LOG = LoggerFactory.getLogger(SelectCountTest.class); - -} http://git-wip-us.apache.org/repos/asf/apex-malhar/blob/8f00cefa/library/src/test/java/com/datatorrent/lib/streamquery/advanced/SelectFirstLastTest.java ---------------------------------------------------------------------- diff --git a/library/src/test/java/com/datatorrent/lib/streamquery/advanced/SelectFirstLastTest.java b/library/src/test/java/com/datatorrent/lib/streamquery/advanced/SelectFirstLastTest.java deleted file mode 100644 index c7b56fe..0000000 --- a/library/src/test/java/com/datatorrent/lib/streamquery/advanced/SelectFirstLastTest.java +++ /dev/null @@ -1,76 +0,0 @@ -/** - * 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. - */ -package com.datatorrent.lib.streamquery.advanced; - -import java.util.HashMap; - -import org.junit.Test; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import com.datatorrent.lib.streamquery.SelectFunctionOperator; -import com.datatorrent.lib.streamquery.function.FirstLastFunction; -import com.datatorrent.lib.testbench.CollectorTestSink; - -/** - * Functional test for {@link com.datatorrent.lib.streamquery.SelectOperatorTest}. - */ -public class SelectFirstLastTest -{ - @SuppressWarnings({ "rawtypes", "unchecked" }) - @Test - public void testSqlSelect() - { - // create operator - SelectFunctionOperator oper = new SelectFunctionOperator(); - oper.addSqlFunction(new FirstLastFunction("b", null, false)); - - CollectorTestSink sink = new CollectorTestSink(); - oper.outport.setSink(sink); - - oper.setup(null); - oper.beginWindow(1); - - HashMap<String, Object> tuple = new HashMap<String, Object>(); - tuple.put("a", 0); - tuple.put("b", null); - tuple.put("c", 2); - oper.inport.process(tuple); - - tuple = new HashMap<String, Object>(); - tuple.put("a", 1); - tuple.put("b", null); - tuple.put("c", 4); - oper.inport.process(tuple); - - tuple = new HashMap<String, Object>(); - tuple.put("a", 1); - tuple.put("b", 5); - tuple.put("c", 6); - oper.inport.process(tuple); - - oper.endWindow(); - oper.teardown(); - - LOG.debug("{}", sink.collectedTuples); - } - - private static final Logger LOG = LoggerFactory.getLogger(SelectFirstLastTest.class); - -} http://git-wip-us.apache.org/repos/asf/apex-malhar/blob/8f00cefa/library/src/test/java/com/datatorrent/lib/streamquery/advanced/SelectMaxMinTest.java ---------------------------------------------------------------------- diff --git a/library/src/test/java/com/datatorrent/lib/streamquery/advanced/SelectMaxMinTest.java b/library/src/test/java/com/datatorrent/lib/streamquery/advanced/SelectMaxMinTest.java deleted file mode 100644 index e57554a..0000000 --- a/library/src/test/java/com/datatorrent/lib/streamquery/advanced/SelectMaxMinTest.java +++ /dev/null @@ -1,76 +0,0 @@ -/** - * 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. - */ -package com.datatorrent.lib.streamquery.advanced; - -import java.util.HashMap; - -import org.junit.Test; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import com.datatorrent.lib.streamquery.SelectFunctionOperator; -import com.datatorrent.lib.streamquery.function.MaxMinFunction; -import com.datatorrent.lib.testbench.CollectorTestSink; - -/** - * Functional test for {@link com.datatorrent.lib.streamquery.SelectOperatorTest}. - */ -public class SelectMaxMinTest -{ - @SuppressWarnings({ "rawtypes", "unchecked" }) - @Test - public void testSqlSelect() - { - // create operator - SelectFunctionOperator oper = new SelectFunctionOperator(); - oper.addSqlFunction(new MaxMinFunction("b", null, false)); - - CollectorTestSink sink = new CollectorTestSink(); - oper.outport.setSink(sink); - - oper.setup(null); - oper.beginWindow(1); - - HashMap<String, Object> tuple = new HashMap<String, Object>(); - tuple.put("a", 0); - tuple.put("b", 1); - tuple.put("c", 2); - oper.inport.process(tuple); - - tuple = new HashMap<String, Object>(); - tuple.put("a", 1); - tuple.put("b", 3); - tuple.put("c", 4); - oper.inport.process(tuple); - - tuple = new HashMap<String, Object>(); - tuple.put("a", 1); - tuple.put("b", 5); - tuple.put("c", 6); - oper.inport.process(tuple); - - oper.endWindow(); - oper.teardown(); - - LOG.debug("{}", sink.collectedTuples); - } - - private static final Logger LOG = LoggerFactory.getLogger(SelectMaxMinTest.class); - -} http://git-wip-us.apache.org/repos/asf/apex-malhar/blob/8f00cefa/library/src/test/java/com/datatorrent/lib/streamquery/advanced/SumIndexTest.java ---------------------------------------------------------------------- diff --git a/library/src/test/java/com/datatorrent/lib/streamquery/advanced/SumIndexTest.java b/library/src/test/java/com/datatorrent/lib/streamquery/advanced/SumIndexTest.java deleted file mode 100644 index f9f1e10..0000000 --- a/library/src/test/java/com/datatorrent/lib/streamquery/advanced/SumIndexTest.java +++ /dev/null @@ -1,76 +0,0 @@ -/** - * 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. - */ -package com.datatorrent.lib.streamquery.advanced; - -import java.util.HashMap; - -import org.junit.Test; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import com.datatorrent.lib.streamquery.SelectOperator; -import com.datatorrent.lib.streamquery.index.SumExpression; -import com.datatorrent.lib.testbench.CollectorTestSink; - -/** - * Functional test for {@link com.datatorrent.lib.streamquery.SelectOperatorTest}. - */ -public class SumIndexTest -{ - @SuppressWarnings({ "rawtypes", "unchecked" }) - @Test - public void testSqlSelect() - { - // create operator - SelectOperator oper = new SelectOperator(); - oper.addIndex(new SumExpression("b", "c", null)); - - CollectorTestSink sink = new CollectorTestSink(); - oper.outport.setSink(sink); - - oper.setup(null); - oper.beginWindow(1); - - HashMap<String, Object> tuple = new HashMap<String, Object>(); - tuple.put("a", 0); - tuple.put("b", 1); - tuple.put("c", 2); - oper.inport.process(tuple); - - tuple = new HashMap<String, Object>(); - tuple.put("a", 1); - tuple.put("b", 3); - tuple.put("c", 4); - oper.inport.process(tuple); - - tuple = new HashMap<String, Object>(); - tuple.put("a", 1); - tuple.put("b", 5); - tuple.put("c", 6); - oper.inport.process(tuple); - - oper.endWindow(); - oper.teardown(); - - LOG.debug("{}", sink.collectedTuples); - } - - private static final Logger LOG = LoggerFactory.getLogger(SumIndexTest.class); - -} http://git-wip-us.apache.org/repos/asf/apex-malhar/blob/8f00cefa/samples/pom.xml ---------------------------------------------------------------------- diff --git a/samples/pom.xml b/samples/pom.xml index d84f86b..9eb3c36 100644 --- a/samples/pom.xml +++ b/samples/pom.xml @@ -40,8 +40,8 @@ <dependencies> <dependency> - <groupId>${project.groupId}</groupId> - <artifactId>malhar-library</artifactId> + <groupId>org.apache.apex</groupId> + <artifactId>malhar-contrib</artifactId> <version>${project.version}</version> </dependency> <dependency> http://git-wip-us.apache.org/repos/asf/apex-malhar/blob/8f00cefa/samples/src/main/java/com/datatorrent/samples/lib/algo/AllAfterMatchMapSample.java ---------------------------------------------------------------------- diff --git a/samples/src/main/java/com/datatorrent/samples/lib/algo/AllAfterMatchMapSample.java b/samples/src/main/java/com/datatorrent/samples/lib/algo/AllAfterMatchMapSample.java index 59764a7..78f479c 100644 --- a/samples/src/main/java/com/datatorrent/samples/lib/algo/AllAfterMatchMapSample.java +++ b/samples/src/main/java/com/datatorrent/samples/lib/algo/AllAfterMatchMapSample.java @@ -18,14 +18,12 @@ */ package com.datatorrent.samples.lib.algo; - +import org.apache.apex.malhar.contrib.misc.algo.AllAfterMatchMap; import org.apache.hadoop.conf.Configuration; import com.datatorrent.api.Context.OperatorContext; import com.datatorrent.api.DAG; import com.datatorrent.api.StreamingApplication; - -import com.datatorrent.lib.algo.AllAfterMatchMap; import com.datatorrent.lib.io.ConsoleOutputOperator; import com.datatorrent.samples.lib.math.RandomKeyValMap; http://git-wip-us.apache.org/repos/asf/apex-malhar/blob/8f00cefa/samples/src/main/java/com/datatorrent/samples/lib/math/ChangeSample.java ---------------------------------------------------------------------- diff --git a/samples/src/main/java/com/datatorrent/samples/lib/math/ChangeSample.java b/samples/src/main/java/com/datatorrent/samples/lib/math/ChangeSample.java index fa8694d..e9b8dec 100644 --- a/samples/src/main/java/com/datatorrent/samples/lib/math/ChangeSample.java +++ b/samples/src/main/java/com/datatorrent/samples/lib/math/ChangeSample.java @@ -18,12 +18,12 @@ */ package com.datatorrent.samples.lib.math; +import org.apache.apex.malhar.contrib.misc.math.Change; import org.apache.hadoop.conf.Configuration; -import com.datatorrent.api.StreamingApplication; import com.datatorrent.api.DAG; +import com.datatorrent.api.StreamingApplication; import com.datatorrent.lib.io.ConsoleOutputOperator; -import com.datatorrent.lib.math.Change; import com.datatorrent.lib.testbench.RandomEventGenerator; /** http://git-wip-us.apache.org/repos/asf/apex-malhar/blob/8f00cefa/samples/src/main/java/com/datatorrent/samples/lib/math/CompreMapSample.java ---------------------------------------------------------------------- diff --git a/samples/src/main/java/com/datatorrent/samples/lib/math/CompreMapSample.java b/samples/src/main/java/com/datatorrent/samples/lib/math/CompreMapSample.java index 62e1574..abf4d4b 100644 --- a/samples/src/main/java/com/datatorrent/samples/lib/math/CompreMapSample.java +++ b/samples/src/main/java/com/datatorrent/samples/lib/math/CompreMapSample.java @@ -18,12 +18,12 @@ */ package com.datatorrent.samples.lib.math; +import org.apache.apex.malhar.contrib.misc.math.CompareMap; import org.apache.hadoop.conf.Configuration; -import com.datatorrent.api.StreamingApplication; import com.datatorrent.api.DAG; +import com.datatorrent.api.StreamingApplication; import com.datatorrent.lib.io.ConsoleOutputOperator; -import com.datatorrent.lib.math.CompareMap; /** http://git-wip-us.apache.org/repos/asf/apex-malhar/blob/8f00cefa/samples/src/main/java/com/datatorrent/samples/lib/math/CountKeyValSample.java ---------------------------------------------------------------------- diff --git a/samples/src/main/java/com/datatorrent/samples/lib/math/CountKeyValSample.java b/samples/src/main/java/com/datatorrent/samples/lib/math/CountKeyValSample.java index 66b1247..e7460ea 100644 --- a/samples/src/main/java/com/datatorrent/samples/lib/math/CountKeyValSample.java +++ b/samples/src/main/java/com/datatorrent/samples/lib/math/CountKeyValSample.java @@ -18,15 +18,13 @@ */ package com.datatorrent.samples.lib.math; - +import org.apache.apex.malhar.contrib.misc.math.CountKeyVal; import org.apache.hadoop.conf.Configuration; import com.datatorrent.api.Context.OperatorContext; import com.datatorrent.api.DAG; import com.datatorrent.api.StreamingApplication; - import com.datatorrent.lib.io.ConsoleOutputOperator; -import com.datatorrent.lib.math.CountKeyVal; /** * This sample application code for showing sample usage of malhar operator(s). <br>
