1 /*
2 * Copyright 2009, 2012 Ange Optimization ApS
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16 package eu.simuline.octave;
17
18 import java.util.Arrays;
19 import java.util.HashSet;
20 import java.util.Set;
21
22 import static org.junit.Assert.assertTrue;
23
24 import org.junit.Ignore;
25 import org.junit.Test;
26
27 /**
28 * Test getVersion
29 */
30 public class TestVersion {
31
32 /**
33 * Test getVersion
34 */
35 @Test public void testVersion() {
36 final OctaveEngine octave = new OctaveEngineFactory().getScriptEngine();
37 octave.getVersion();
38 }
39
40 /**
41 * Test that the version is a version we know.
42 * If this test fails the fix will usually be
43 * to add the new version to the Set of known versions.
44 */
45 @Test public void testKnownVersion() {
46 final OctaveEngine octave = new OctaveEngineFactory().getScriptEngine();
47 final String version = octave.getVersion();
48 final Set<String> knownVersions = new HashSet<String>
49 (Arrays.asList("3.0.5", "3.2.3", "3.2.4", "3.6.2", "3.8.2",
50 // added by E.R.
51 "4.3.0+",
52 "4.4.0", "5.0.0"));
53 assertTrue("Version '" + version + "' is not known",
54 knownVersions.contains(version));
55 }
56
57 }