Repository: incubator-beam Updated Branches: refs/heads/master 48130f718 -> fd4b631f1
Add a test of ReleaseInfo Project: http://git-wip-us.apache.org/repos/asf/incubator-beam/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-beam/commit/1094fa6a Tree: http://git-wip-us.apache.org/repos/asf/incubator-beam/tree/1094fa6a Diff: http://git-wip-us.apache.org/repos/asf/incubator-beam/diff/1094fa6a Branch: refs/heads/master Commit: 1094fa6ac32046b4c092294b3cee046c91aea5a1 Parents: 48130f7 Author: Dan Halperin <dhalp...@google.com> Authored: Thu Dec 1 09:15:28 2016 -0800 Committer: Dan Halperin <dhalp...@google.com> Committed: Thu Dec 1 13:10:55 2016 -0800 ---------------------------------------------------------------------- .../apache/beam/sdk/util/ReleaseInfoTest.java | 45 ++++++++++++++++++++ 1 file changed, 45 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/1094fa6a/sdks/java/core/src/test/java/org/apache/beam/sdk/util/ReleaseInfoTest.java ---------------------------------------------------------------------- diff --git a/sdks/java/core/src/test/java/org/apache/beam/sdk/util/ReleaseInfoTest.java b/sdks/java/core/src/test/java/org/apache/beam/sdk/util/ReleaseInfoTest.java new file mode 100644 index 0000000..fabb7e2 --- /dev/null +++ b/sdks/java/core/src/test/java/org/apache/beam/sdk/util/ReleaseInfoTest.java @@ -0,0 +1,45 @@ +/* + * 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.beam.sdk.util; + +import static org.hamcrest.Matchers.containsString; +import static org.junit.Assert.assertThat; +import static org.junit.Assert.assertTrue; + +import org.junit.Test; + +/** + * Tests for {@link ReleaseInfo}. + */ +public class ReleaseInfoTest { + + @Test + public void getReleaseInfo() throws Exception { + ReleaseInfo info = ReleaseInfo.getReleaseInfo(); + + // Validate name + assertThat(info.getName(), containsString("Beam")); + + // Validate semantic version + String version = info.getVersion(); + String pattern = "\\d+\\.\\d+\\.\\d+.*"; + assertTrue( + String.format("%s does not match pattern %s", version, pattern), + version.matches(pattern)); + } +}