JOGL v2.6.0-rc-20250712
JOGL, High-Performance Graphics Binding for Java™ (public API).
TestVersionSemanticsNOUI.java
Go to the documentation of this file.
1/**
2 * Copyright 2014 JogAmp Community. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without modification, are
5 * permitted provided that the following conditions are met:
6 *
7 * 1. Redistributions of source code must retain the above copyright notice, this list of
8 * conditions and the following disclaimer.
9 *
10 * 2. Redistributions in binary form must reproduce the above copyright notice, this list
11 * of conditions and the following disclaimer in the documentation and/or other materials
12 * provided with the distribution.
13 *
14 * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
15 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
16 * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
18 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
19 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
20 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
21 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
22 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23 *
24 * The views and conclusions contained in the software and documentation are those of the
25 * authors and should not be interpreted as representing official policies, either expressed
26 * or implied, of JogAmp Community.
27 */
28package com.jogamp.opengl.test.junit.jogl.acore;
29
30import java.io.File;
31import java.io.IOException;
32import java.net.URISyntaxException;
33import java.util.HashSet;
34import java.util.Set;
35
36import org.junit.FixMethodOrder;
37import org.junit.Test;
38import org.junit.runners.MethodSorters;
39
40import com.jogamp.common.util.JogampVersion;
41import com.jogamp.common.util.VersionNumberString;
42import com.jogamp.junit.util.SingletonJunitCase;
43import com.jogamp.junit.util.VersionSemanticsUtil;
44import com.jogamp.junit.util.VersionSemanticsUtil.CompatibilityType;
45import com.jogamp.opengl.JoglVersion;
46
47@FixMethodOrder(MethodSorters.NAME_ASCENDING)
48public class TestVersionSemanticsNOUI extends SingletonJunitCase {
49 static final String jarFile = "jogl-all.jar";
50
51 static final JogampVersion curVersion = JoglVersion.getInstance();
52 static final VersionNumberString curVersionNumber = new VersionNumberString(curVersion.getImplementationVersion());
53
54 static final String excludesDefault;
55 static final String excludesStereoPackageAndAppletUtils;
56 static {
57 excludesDefault = "jogamp";
58 excludesStereoPackageAndAppletUtils = excludesDefault+";com.jogamp.opengl.util.stereo;com.jogamp.newt.util.applet";
59 }
60
61
62 // @Test
63 public void testVersionV212V213() throws IllegalArgumentException, IOException, URISyntaxException {
64 testVersions(CompatibilityType.NON_BACKWARD_COMPATIBLE, "2.1.2", "2.1.3", excludesDefault);
65 }
66
67 // @Test
68 public void testVersionV213V214() throws IllegalArgumentException, IOException, URISyntaxException {
69 testVersions(CompatibilityType.NON_BACKWARD_COMPATIBLE, "2.1.3", "2.1.4", excludesDefault);
70 }
71
72 // @Test
73 public void testVersionV214V215() throws IllegalArgumentException, IOException, URISyntaxException {
74 testVersions(CompatibilityType.NON_BACKWARD_COMPATIBLE, "2.1.4", "2.1.5", excludesDefault);
75 }
76
77 // @Test
78 public void testVersionV215V220() throws IllegalArgumentException, IOException, URISyntaxException {
79 testVersions(CompatibilityType.NON_BACKWARD_COMPATIBLE, "2.1.5", "2.2.0", excludesDefault);
80 }
81
82 @Test
83 public void testVersionV220V221() throws IllegalArgumentException, IOException, URISyntaxException {
84 testVersions(CompatibilityType.BACKWARD_COMPATIBLE_SOURCE, "2.2.0", "2.2.1", excludesDefault);
85 }
86
87 @Test
88 public void testVersionV221V230() throws IllegalArgumentException, IOException, URISyntaxException {
89 testVersions(CompatibilityType.NON_BACKWARD_COMPATIBLE, "2.2.1", "2.3.0", excludesDefault);
90 }
91
92 void testVersions(final CompatibilityType expectedCompatibilityType,
93 final String v1, final String v2, final String excludes)
94 throws IllegalArgumentException, IOException, URISyntaxException {
95 final VersionNumberString preVersionNumber = new VersionNumberString(v1);
96 final File previousJar = new File("lib/v"+v1+"/"+jarFile);
97
98 final VersionNumberString curVersionNumber = new VersionNumberString(v2);
99 final File currentJar = new File("lib/v"+v2+"/"+jarFile);
100
101 VersionSemanticsUtil.testVersion2(expectedCompatibilityType,
102 previousJar, preVersionNumber,
103 currentJar, curVersionNumber, excludes, true);
104 }
105
106 @Test
107 public void testVersionV230V232() throws IllegalArgumentException, IOException, URISyntaxException {
108 final CompatibilityType expectedCompatibilityType = CompatibilityType.NON_BACKWARD_COMPATIBLE;
109 // final Delta.CompatibilityType expectedCompatibilityType = Delta.CompatibilityType.BACKWARD_COMPATIBLE_BINARY;
110 testVersions(expectedCompatibilityType, "2.3.0", "2.3.2", excludesStereoPackageAndAppletUtils);
111 }
112
113 @Test
114 public void testVersionV232V24x() throws IllegalArgumentException, IOException, URISyntaxException {
115 final CompatibilityType expectedCompatibilityType = CompatibilityType.NON_BACKWARD_COMPATIBLE;
116 // final Delta.CompatibilityType expectedCompatibilityType = Delta.CompatibilityType.BACKWARD_COMPATIBLE_USER;
117 // final Delta.CompatibilityType expectedCompatibilityType = Delta.CompatibilityType.BACKWARD_COMPATIBLE_BINARY;
118
119 final VersionNumberString preVersionNumber = new VersionNumberString("2.3.2");
120 final File previousJar = new File("lib/v"+preVersionNumber.getVersionString()+"/"+jarFile);
121
122 final ClassLoader currentCL = TestVersionSemanticsNOUI.class.getClassLoader();
123
124 VersionSemanticsUtil.testVersion2(expectedCompatibilityType,
125 previousJar, preVersionNumber,
126 curVersion.getClass(), currentCL, curVersionNumber,
127 excludesDefault, true);
128 }
129
130 public static void main(final String args[]) throws IOException {
131 final String tstname = TestVersionSemanticsNOUI.class.getName();
132 org.junit.runner.JUnitCore.main(tstname);
133 }
134
135}
static JoglVersion getInstance()