29import java.io.IOException;
31import org.jau.util.VersionNumber;
32import org.junit.Assert;
33import org.junit.FixMethodOrder;
35import org.junit.runners.MethodSorters;
37import jau.test.junit.util.JunitTracer;
39@FixMethodOrder(MethodSorters.NAME_ASCENDING)
44 final String vs00 =
"1.0.16";
45 final String vs01 =
"OpenGL ES GLSL ES 1.0.16";
46 final String vs02 =
"1.0.16 OpenGL ES GLSL ES";
47 final VersionNumber vn0 =
new VersionNumber(1, 0, 16);
48 Assert.assertTrue(vn0.hasMajor());
49 Assert.assertTrue(vn0.hasMinor());
50 Assert.assertTrue(vn0.hasSub());
54 vn =
new VersionNumber(vs00);
55 Assert.assertTrue(vn.hasMajor());
56 Assert.assertTrue(vn.hasMinor());
57 Assert.assertTrue(vn.hasSub());
58 Assert.assertEquals(vn0, vn);
60 vn =
new VersionNumber(vs01);
61 Assert.assertTrue(vn.hasMajor());
62 Assert.assertTrue(vn.hasMinor());
63 Assert.assertTrue(vn.hasSub());
64 Assert.assertEquals(vn0, vn);
66 vn =
new VersionNumber(vs02);
67 Assert.assertTrue(vn.hasMajor());
68 Assert.assertTrue(vn.hasMinor());
69 Assert.assertTrue(vn.hasSub());
70 Assert.assertEquals(vn0, vn);
74 final String delim =
",";
76 final String vs00 =
"1,0,16";
77 final String vs01 =
"OpenGL ES GLSL ES 1,0,16";
78 final String vs02 =
"1,0,16 OpenGL ES GLSL ES";
79 final VersionNumber vn0 =
new VersionNumber(1, 0, 16);
80 Assert.assertTrue(vn0.hasMajor());
81 Assert.assertTrue(vn0.hasMinor());
82 Assert.assertTrue(vn0.hasSub());
86 vn =
new VersionNumber(vs00, delim);
87 Assert.assertTrue(vn.hasMajor());
88 Assert.assertTrue(vn.hasMinor());
89 Assert.assertTrue(vn.hasSub());
90 Assert.assertEquals(vn0, vn);
92 vn =
new VersionNumber(vs01, delim);
93 Assert.assertTrue(vn.hasMajor());
94 Assert.assertTrue(vn.hasMinor());
95 Assert.assertTrue(vn.hasSub());
96 Assert.assertEquals(vn0, vn);
98 vn =
new VersionNumber(vs02, delim);
99 Assert.assertTrue(vn.hasMajor());
100 Assert.assertTrue(vn.hasMinor());
101 Assert.assertTrue(vn.hasSub());
102 Assert.assertEquals(vn0, vn);
107 final String vs00 =
"4.20";
108 final String vs01 =
"COMPANY via Stupid tool 4.20";
109 final String vs02 =
"4.20 COMPANY via Stupid tool";
110 final VersionNumber vn0 =
new VersionNumber(4, 20, 0);
111 Assert.assertTrue(vn0.hasMajor());
112 Assert.assertTrue(vn0.hasMinor());
113 Assert.assertTrue(vn0.hasSub());
117 vn =
new VersionNumber(vs00);
118 Assert.assertTrue(vn.hasMajor());
119 Assert.assertTrue(vn.hasMinor());
120 Assert.assertTrue(!vn.hasSub());
121 Assert.assertEquals(vn0, vn);
123 vn =
new VersionNumber(vs01);
124 Assert.assertTrue(vn.hasMajor());
125 Assert.assertTrue(vn.hasMinor());
126 Assert.assertTrue(!vn.hasSub());
127 Assert.assertEquals(vn0, vn);
129 vn =
new VersionNumber(vs02);
130 Assert.assertTrue(vn.hasMajor());
131 Assert.assertTrue(vn.hasMinor());
132 Assert.assertTrue(!vn.hasSub());
133 Assert.assertEquals(vn0, vn);
138 final String delim =
",";
140 final String vs00 =
"4,20";
141 final String vs01 =
"COMPANY via Stupid tool 4,20";
142 final String vs02 =
"4,20 COMPANY via Stupid tool";
143 final VersionNumber vn0 =
new VersionNumber(4, 20, 0);
144 Assert.assertTrue(vn0.hasMajor());
145 Assert.assertTrue(vn0.hasMinor());
146 Assert.assertTrue(vn0.hasSub());
150 vn =
new VersionNumber(vs00, delim);
151 Assert.assertTrue(vn.hasMajor());
152 Assert.assertTrue(vn.hasMinor());
153 Assert.assertTrue(!vn.hasSub());
154 Assert.assertEquals(vn0, vn);
156 vn =
new VersionNumber(vs01, delim);
157 Assert.assertTrue(vn.hasMajor());
158 Assert.assertTrue(vn.hasMinor());
159 Assert.assertTrue(!vn.hasSub());
160 Assert.assertEquals(vn0, vn);
162 vn =
new VersionNumber(vs02, delim);
163 Assert.assertTrue(vn.hasMajor());
164 Assert.assertTrue(vn.hasMinor());
165 Assert.assertTrue(!vn.hasSub());
166 Assert.assertEquals(vn0, vn);
171 final String vs00 =
"A10.11.12b";
172 final String vs01 =
"Prelim Text 10.Funny11.Weird12 Something is odd";
173 final String vs02 =
"Prelim Text 10.Funny11l1.Weird12 2 Something is odd";
174 final VersionNumber vn0 =
new VersionNumber(10, 11, 12);
175 Assert.assertTrue(vn0.hasMajor());
176 Assert.assertTrue(vn0.hasMinor());
177 Assert.assertTrue(vn0.hasSub());
181 vn =
new VersionNumber(vs00);
182 Assert.assertTrue(vn.hasMajor());
183 Assert.assertTrue(vn.hasMinor());
184 Assert.assertTrue(vn.hasSub());
185 Assert.assertEquals(vn0, vn);
187 vn =
new VersionNumber(vs01);
188 Assert.assertTrue(vn.hasMajor());
189 Assert.assertTrue(vn.hasMinor());
190 Assert.assertTrue(vn.hasSub());
191 Assert.assertEquals(vn0, vn);
193 vn =
new VersionNumber(vs02);
194 Assert.assertTrue(vn.hasMajor());
195 Assert.assertTrue(vn.hasMinor());
196 Assert.assertTrue(vn.hasSub());
197 Assert.assertEquals(vn0, vn);
202 final String delim =
",";
204 final String vs00 =
"A10,11,12b";
205 final String vs01 =
"Prelim Text 10,Funny11,Weird12 Something is odd";
206 final String vs02 =
"Prelim Text 10,Funny11l1,Weird12 2 Something is odd";
207 final VersionNumber vn0 =
new VersionNumber(10, 11, 12);
208 Assert.assertTrue(vn0.hasMajor());
209 Assert.assertTrue(vn0.hasMinor());
210 Assert.assertTrue(vn0.hasSub());
214 vn =
new VersionNumber(vs00, delim);
215 Assert.assertTrue(vn.hasMajor());
216 Assert.assertTrue(vn.hasMinor());
217 Assert.assertTrue(vn.hasSub());
218 Assert.assertEquals(vn0, vn);
220 vn =
new VersionNumber(vs01, delim);
221 Assert.assertTrue(vn.hasMajor());
222 Assert.assertTrue(vn.hasMinor());
223 Assert.assertTrue(vn.hasSub());
224 Assert.assertEquals(vn0, vn);
226 vn =
new VersionNumber(vs02, delim);
227 Assert.assertTrue(vn.hasMajor());
228 Assert.assertTrue(vn.hasMinor());
229 Assert.assertTrue(vn.hasSub());
230 Assert.assertEquals(vn0, vn);
235 final String vs00 =
"A10.11.12b (git-d6c318e)";
236 final String vs01 =
"Prelim Text 10.Funny11.Weird12 Something is odd (git-d6c318e)";
237 final String vs02 =
"Prelim Text 10.Funny11l1.Weird12 2 Something is odd (git-d6c318e)";
238 final VersionNumber vn0 =
new VersionNumber(10, 11, 12);
239 Assert.assertTrue(vn0.hasMajor());
240 Assert.assertTrue(vn0.hasMinor());
241 Assert.assertTrue(vn0.hasSub());
245 vn =
new VersionNumber(vs00);
246 Assert.assertTrue(vn.hasMajor());
247 Assert.assertTrue(vn.hasMinor());
248 Assert.assertTrue(vn.hasSub());
249 Assert.assertEquals(vn0, vn);
251 vn =
new VersionNumber(vs01);
252 Assert.assertTrue(vn.hasMajor());
253 Assert.assertTrue(vn.hasMinor());
254 Assert.assertTrue(vn.hasSub());
255 Assert.assertEquals(vn0, vn);
257 vn =
new VersionNumber(vs02);
258 Assert.assertTrue(vn.hasMajor());
259 Assert.assertTrue(vn.hasMinor());
260 Assert.assertTrue(vn.hasSub());
261 Assert.assertEquals(vn0, vn);
265 final String delim =
",";
267 final String vs00 =
"A10,11,12b (git-d6c318e)";
268 final String vs01 =
"Prelim Text 10,Funny11,Weird12 Something is odd (git-d6c318e)";
269 final String vs02 =
"Prelim Text 10,Funny11l1,Weird12 2 Something is odd (git-d6c318e)";
270 final VersionNumber vn0 =
new VersionNumber(10, 11, 12);
271 Assert.assertTrue(vn0.hasMajor());
272 Assert.assertTrue(vn0.hasMinor());
273 Assert.assertTrue(vn0.hasSub());
277 vn =
new VersionNumber(vs00, delim);
278 Assert.assertTrue(vn.hasMajor());
279 Assert.assertTrue(vn.hasMinor());
280 Assert.assertTrue(vn.hasSub());
281 Assert.assertEquals(vn0, vn);
283 vn =
new VersionNumber(vs01, delim);
284 Assert.assertTrue(vn.hasMajor());
285 Assert.assertTrue(vn.hasMinor());
286 Assert.assertTrue(vn.hasSub());
287 Assert.assertEquals(vn0, vn);
289 vn =
new VersionNumber(vs02, delim);
290 Assert.assertTrue(vn.hasMajor());
291 Assert.assertTrue(vn.hasMinor());
292 Assert.assertTrue(vn.hasSub());
293 Assert.assertEquals(vn0, vn);
296 public static void main(
final String args[])
throws IOException {
298 org.junit.runner.JUnitCore.
main(tstname);
static void main(final String args[])