pavel-avilov commented on a change in pull request #16172:
URL: https://github.com/apache/beam/pull/16172#discussion_r766498786
##########
File path: playground/backend/internal/validators/java_validators_test.go
##########
@@ -21,10 +21,14 @@ import (
"testing"
)
-const unitTestFilePath = "unitTestCode.java"
-const filePath = "code.java"
-const unitTestCode = "@RunWith(JUnit4.class)\npublic class DeduplicateTest
{\n\n @Rule public TestPipeline p = TestPipeline.create();\n\n @Test\n
@Category({NeedsRunner.class, UsesTestStream.class})\n public void
testInDifferentWindows() {}}"
-const code = "package org.apache.beam.sdk.transforms; \n public class Class
{\n public static void main(String[] args) {\n
System.out.println(\"Hello World!\");\n }\n}"
+const (
+ unitTestFilePath = "unitTestCode.java"
+ kataFilePath = "kataCode.java"
+ filePath = "code.java"
+ unitTestCode = "@RunWith(JUnit4.class)\npublic class
DeduplicateTest {\n\n @Rule public TestPipeline p = TestPipeline.create();\n\n
@Test\n @Category({NeedsRunner.class, UsesTestStream.class})\n public void
testInDifferentWindows() {}}"
+ kataCode = "/*\n * Licensed to the Apache Software Foundation
(ASF) under one\n * or more contributor license agreements. See the NOTICE
file\n * distributed with this work for additional information\n * regarding
copyright ownership. The ASF licenses this file\n * to you under the Apache
License, Version 2.0 (the\n * \"License\"); you may not use this file except in
compliance\n * with the License. You may obtain a copy of the License at\n *\n
* http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by
applicable law or agreed to in writing, software\n * distributed under the
License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the
specific language governing permissions and\n * limitations under the
License.\n */\n\npackage
org.apache.beam.learning.katas.commontransforms.aggregation.max;\n\nimport
org.apache.beam.learning.katas.util.Log;\nimport org.apache.beam
.sdk.Pipeline;\nimport org.apache.beam.sdk.options.PipelineOptions;\nimport
org.apache.beam.sdk.options.PipelineOptionsFactory;\nimport
org.apache.beam.sdk.transforms.Create;\nimport
org.apache.beam.sdk.transforms.Max;\nimport
org.apache.beam.sdk.values.PCollection;\n\npublic class Task {\n\n public
static void main(String[] args) {\n PipelineOptions options =
PipelineOptionsFactory.fromArgs(args).create();\n Pipeline pipeline =
Pipeline.create(options);\n\n PCollection<Integer> numbers =
pipeline.apply(Create.of(1, 2, 3, 4, 5, 6, 7, 8, 9, 10));\n\n
PCollection<Integer> output = applyTransform(numbers);\n\n
output.apply(Log.ofElements());\n\n pipeline.run();\n }\n\n static
PCollection<Integer> applyTransform(PCollection<Integer> input) {\n return
input.apply(Max.integersGlobally());\n }\n\n}"
Review comment:
Done
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]