NicoK commented on a change in pull request #31:
URL: https://github.com/apache/flink-training/pull/31#discussion_r699187127



##########
File path: 
hourly-tips/src/main/java/org/apache/flink/training/exercises/hourlytips/HourlyTipsExercise.java
##########
@@ -56,8 +55,8 @@ public HourlyTipsExercise(
      */
     public static void main(String[] args) throws Exception {
 
-        HourlyTipsSolution job =
-                new HourlyTipsSolution(new TaxiFareGenerator(), new 
PrintSinkFunction<>());
+        HourlyTipsExercise job =
+                new HourlyTipsExercise(new TaxiFareGenerator(), new 
PrintSinkFunction<>());

Review comment:
       Good catch!

##########
File path: 
rides-and-fares/src/test/java/org/apache/flink/training/exercises/ridesandfares/RidesAndFaresIntegrationTest.java
##########
@@ -0,0 +1,91 @@
+/*
+ * 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 org.apache.flink.training.exercises.ridesandfares;
+
+import org.apache.flink.api.common.JobExecutionResult;
+import org.apache.flink.runtime.testutils.MiniClusterResourceConfiguration;
+import org.apache.flink.test.util.MiniClusterWithClientResource;
+import org.apache.flink.training.exercises.common.datatypes.RideAndFare;
+import org.apache.flink.training.exercises.common.datatypes.TaxiFare;
+import org.apache.flink.training.exercises.common.datatypes.TaxiRide;
+import org.apache.flink.training.exercises.testing.ComposedTwoInputPipeline;
+import org.apache.flink.training.exercises.testing.ExecutableTwoInputPipeline;
+import org.apache.flink.training.exercises.testing.ParallelTestSource;
+import org.apache.flink.training.exercises.testing.TestSink;
+import org.apache.flink.training.solutions.ridesandfares.RidesAndFaresSolution;
+
+import org.junit.ClassRule;
+import org.junit.Test;
+
+import static org.assertj.core.api.AssertionsForInterfaceTypes.assertThat;
+
+public class RidesAndFaresIntegrationTest extends RidesAndFaresTestBase {
+
+    private static final int PARALLELISM = 2;
+
+    /** This isn't necessary, but speeds up the tests. */
+    @ClassRule
+    public static MiniClusterWithClientResource flinkCluster =
+            new MiniClusterWithClientResource(
+                    new MiniClusterResourceConfiguration.Builder()
+                            .setNumberSlotsPerTaskManager(PARALLELISM)
+                            .setNumberTaskManagers(1)
+                            .build());
+
+    private static final TaxiRide ride1 = testRide(1);
+    private static final TaxiRide ride2 = testRide(2);
+    private static final TaxiFare fare1 = testFare(1);
+    private static final TaxiFare fare2 = testFare(2);
+
+    @Test
+    public void testInOrder() throws Exception {
+
+        ParallelTestSource<TaxiRide> rides = new ParallelTestSource<>(ride1, 
ride2);
+        ParallelTestSource<TaxiFare> fares = new ParallelTestSource<>(fare1, 
fare2);
+        TestSink<RideAndFare> sink = new TestSink<>();
+
+        JobExecutionResult jobResult = ridesAndFaresPipeline().execute(rides, 
fares, sink);
+        assertThat(sink.getResults(jobResult))
+                .containsExactlyInAnyOrder(
+                        new RideAndFare(ride1, fare1), new RideAndFare(ride2, 
fare2));

Review comment:
       @alpinegizmo please have a look at this as well - doesn't seem outdated

##########
File path: 
rides-and-fares/src/test/java/org/apache/flink/training/exercises/ridesandfares/RidesAndFaresIntegrationTest.java
##########
@@ -0,0 +1,91 @@
+/*
+ * 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 org.apache.flink.training.exercises.ridesandfares;
+
+import org.apache.flink.api.common.JobExecutionResult;
+import org.apache.flink.runtime.testutils.MiniClusterResourceConfiguration;
+import org.apache.flink.test.util.MiniClusterWithClientResource;
+import org.apache.flink.training.exercises.common.datatypes.RideAndFare;
+import org.apache.flink.training.exercises.common.datatypes.TaxiFare;
+import org.apache.flink.training.exercises.common.datatypes.TaxiRide;
+import org.apache.flink.training.exercises.testing.ComposedTwoInputPipeline;
+import org.apache.flink.training.exercises.testing.ExecutableTwoInputPipeline;
+import org.apache.flink.training.exercises.testing.ParallelTestSource;
+import org.apache.flink.training.exercises.testing.TestSink;
+import org.apache.flink.training.solutions.ridesandfares.RidesAndFaresSolution;
+
+import org.junit.ClassRule;
+import org.junit.Test;
+
+import static org.assertj.core.api.AssertionsForInterfaceTypes.assertThat;
+
+public class RidesAndFaresIntegrationTest extends RidesAndFaresTestBase {
+
+    private static final int PARALLELISM = 2;
+
+    /** This isn't necessary, but speeds up the tests. */
+    @ClassRule
+    public static MiniClusterWithClientResource flinkCluster =
+            new MiniClusterWithClientResource(
+                    new MiniClusterResourceConfiguration.Builder()
+                            .setNumberSlotsPerTaskManager(PARALLELISM)
+                            .setNumberTaskManagers(1)
+                            .build());
+
+    private static final TaxiRide ride1 = testRide(1);
+    private static final TaxiRide ride2 = testRide(2);
+    private static final TaxiFare fare1 = testFare(1);
+    private static final TaxiFare fare2 = testFare(2);
+
+    @Test
+    public void testInOrder() throws Exception {
+
+        ParallelTestSource<TaxiRide> rides = new ParallelTestSource<>(ride1, 
ride2);
+        ParallelTestSource<TaxiFare> fares = new ParallelTestSource<>(fare1, 
fare2);
+        TestSink<RideAndFare> sink = new TestSink<>();
+
+        JobExecutionResult jobResult = ridesAndFaresPipeline().execute(rides, 
fares, sink);
+        assertThat(sink.getResults(jobResult))
+                .containsExactlyInAnyOrder(
+                        new RideAndFare(ride1, fare1), new RideAndFare(ride2, 
fare2));
+    }
+
+    @Test
+    public void testFaresOutOfOrder() throws Exception {

Review comment:
       @alpinegizmo please have a look at this as well - doesn't seem outdated




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@flink.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to