2 * Copyright (c) 2016 Huawei, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 /* Generated By:JavaCC: Do not edit this line. NEMOparserTokenManager.java */
9 package org.opendaylight.nemo.user.vnspacemanager.languagestyle.NEMOParse;
10 import junit.framework.TestCase;
11 import org.junit.Assert;
12 import org.junit.Before;
13 import org.junit.BeforeClass;
14 import org.junit.Test;
15 import org.junit.runner.RunWith;
16 import org.opendaylight.nemo.user.vnspacemanager.languagestyle.NEMOParse.NEMOparser;
17 import org.opendaylight.nemo.user.vnspacemanager.languagestyle.NEMOParse.NEMOparserTokenManager;
18 import org.opendaylight.nemo.user.vnspacemanager.languagestyle.NEMOParse.SimpleCharStream;
19 import org.opendaylight.nemo.user.vnspacemanager.languagestyle.NEMOParse.Token;
21 import java.io.IOException;
22 import java.io.PrintStream;
23 import java.io.Reader;
24 import java.lang.reflect.Field;
25 import java.lang.reflect.Member;
26 import java.lang.reflect.Method;
28 import static org.junit.Assert.*;
29 import static org.mockito.Mockito.*;
30 import org.powermock.api.mockito.PowerMockito;
31 import org.powermock.api.support.membermodification.MemberMatcher;
32 import org.powermock.api.support.membermodification.MemberModifier;
33 import org.powermock.core.classloader.annotations.PrepareForTest;
34 import org.powermock.modules.junit4.PowerMockRunner;
36 * Created by zhangmeng on 2015/12/17.
38 @RunWith(PowerMockRunner.class)
39 @PrepareForTest(SimpleCharStream.class)
40 public class NEMOparserTokenManagerTest extends TestCase {
41 private SimpleCharStream simpleCharStream;
43 private NEMOparserTokenManager nemOparserTokenManager;
44 private Class<NEMOparserTokenManager> class1;
47 public void setUp() throws Exception {
48 class1 = NEMOparserTokenManager.class;
49 field = class1.getDeclaredField("input_stream");
50 field.setAccessible(true);
51 field.set(class1,null);
53 simpleCharStream = mock(SimpleCharStream.class);
58 public void Init_ReInit() throws Exception{
59 nemOparserTokenManager = new NEMOparserTokenManager(simpleCharStream);
60 NEMOparserTokenManager.ReInit(null);
61 nemOparserTokenManager = new NEMOparserTokenManager(simpleCharStream,lexState);//curLexstate = 0
62 NEMOparserTokenManager.ReInit(null, lexState);
64 Assert.assertTrue(field.get(class1) == null);
68 public void testSetDebugStream() throws Exception {
69 NEMOparserTokenManager.setDebugStream(null);
70 Field field1 = class1.getField("debugStream");
71 field1.setAccessible(true);
72 Assert.assertTrue(field1.get(class1) == null);
77 public void testJjFillToken() throws Exception {
78 nemOparserTokenManager = new NEMOparserTokenManager(simpleCharStream);
79 PowerMockito.mockStatic(SimpleCharStream.class);
80 PowerMockito.when(SimpleCharStream.GetImage()).thenReturn("test");
81 Assert.assertTrue(NEMOparserTokenManager.jjFillToken() != null);
85 public void testGetNextToken() throws Exception {
87 nemOparserTokenManager = new NEMOparserTokenManager(simpleCharStream);
88 Assert.assertTrue(field.get(nemOparserTokenManager) == simpleCharStream);
89 PowerMockito.mockStatic(SimpleCharStream.class);
90 PowerMockito.when(SimpleCharStream.BeginToken()).thenReturn(curChar);
91 // System.out.println("out :" + NEMOparserTokenManager.getNextToken());
92 Assert.assertTrue(NEMOparserTokenManager.getNextToken() != null);
96 public void testjjStartNfa_0() throws Exception{
97 Method method = class1.getDeclaredMethod("jjStartNfa_0",new Class[]{int.class,long.class});
98 method.setAccessible(true);
102 Assert.assertTrue((Integer) method.invoke(class1, pos, active0) == 3);
103 // System.out.println("method.invoke(class1,pos,active0):" + method.invoke(class1,pos,active0));
107 public void testjjStopStringLiteralDfa_0() throws Exception{
108 Method method = class1.getDeclaredMethod("jjStopStringLiteralDfa_0",new Class[]{
112 method.setAccessible(true);
113 // System.out.println("testjjStopStringLiteralDfa_0" + method.invoke(class1, 0, 0));
114 Assert.assertTrue((Integer) method.invoke(class1, 0, 0) == -1);
115 // System.out.println("testjjStopStringLiteralDfa_0" + method.invoke(class1, 0, 0x74800000000000L));
116 Assert.assertTrue((Integer) method.invoke(class1, 0, 0x74800000000000L) == 205);
117 // System.out.println("testjjStopStringLiteralDfa_0" + method.invoke(class1, 0, 0x3000000000000L));
118 Assert.assertTrue((Integer) method.invoke(class1, 0, 0x3000000000000L) == 81);
120 Assert.assertTrue((Integer) method.invoke(class1, 1, 0x77800000000000L) == 205);
121 Assert.assertTrue((Integer) method.invoke(class1, 1, 0) == -1);
123 Assert.assertTrue((Integer) method.invoke(class1, 2, 0x77800000000000L) == 205);
124 Assert.assertTrue((Integer) method.invoke(class1, 2, 0) == -1);
126 Assert.assertTrue((Integer) method.invoke(class1, 3, 0x77800000000000L) == 205);
127 Assert.assertTrue((Integer) method.invoke(class1, 3, 0) == -1);
129 Assert.assertTrue((Integer) method.invoke(class1, 4, 0x35000000000000L) == 205);
130 Assert.assertTrue((Integer) method.invoke(class1, 4, 0x42800000000000L) == 205);
131 Assert.assertTrue((Integer) method.invoke(class1, 4, 0) == -1);
133 Assert.assertTrue((Integer) method.invoke(class1, 5, 0x25000000000000L) == 205);
134 Assert.assertTrue((Integer) method.invoke(class1, 5, 0x10000000000000L) == 205);
135 Assert.assertTrue((Integer) method.invoke(class1, 5, 0) == -1);
137 Assert.assertTrue((Integer) method.invoke(class1, 6, 0x5000000000000L) == 205);
138 Assert.assertTrue((Integer) method.invoke(class1, 6, 0x20000000000000L) == 205);
139 Assert.assertTrue((Integer) method.invoke(class1, 6, 0) == -1);
141 Assert.assertTrue((Integer) method.invoke(class1, 7, 0x5000000000000L) == 205);
142 Assert.assertTrue((Integer) method.invoke(class1, 7, 0) == -1);
144 Assert.assertTrue((Integer) method.invoke(class1, 8, 0x5000000000000L) == 205);
145 Assert.assertTrue((Integer) method.invoke(class1, 8, 0) == -1);
147 Assert.assertTrue((Integer) method.invoke(class1, 9, 0x4000000000000L) == 205);
148 Assert.assertTrue((Integer) method.invoke(class1, 9, 0x1000000000000L) == 205);
149 Assert.assertTrue((Integer) method.invoke(class1, 9, 0) == -1);
151 Assert.assertTrue((Integer) method.invoke(class1, 10, 0) == -1);
156 public void testjjStopAtPos() throws Exception{
157 Method method = class1.getDeclaredMethod("jjStopAtPos",new Class[]{
161 method.setAccessible(true);
163 Assert.assertTrue((Integer) method.invoke(class1,1,1) == 2);
167 public void testjjMoveStringLiteralDfa0_0() throws Exception{
168 Method method = class1.getDeclaredMethod("jjMoveStringLiteralDfa0_0");
169 method.setAccessible(true);
170 Field field = class1.getDeclaredField("curChar");
171 field.setAccessible(true);
173 PowerMockito.mockStatic(SimpleCharStream.class);
174 PowerMockito.when(SimpleCharStream.readChar()).thenReturn((char) 0);
176 NEMOparserTokenManager.curChar = 33;
177 // System.out.println("jjMoveStringLiteralDfa0_0" + method.invoke(class1));
178 Assert.assertTrue((Integer) method.invoke(class1) != 0);
179 NEMOparserTokenManager.curChar = 38;
180 // System.out.println("jjMoveStringLiteralDfa0_0" + method.invoke(class1));
181 Assert.assertTrue((Integer) method.invoke(class1) != 0);
182 NEMOparserTokenManager.curChar = 40;
183 // System.out.println("jjMoveStringLiteralDfa0_0" + method.invoke(class1));
184 Assert.assertTrue((Integer) method.invoke(class1) != 0);
185 NEMOparserTokenManager.curChar = 41;
186 // System.out.println("jjMoveStringLiteralDfa0_0" + method.invoke(class1));
187 Assert.assertTrue((Integer) method.invoke(class1) != 0);
188 NEMOparserTokenManager.curChar = 42;
189 // System.out.println("jjMoveStringLiteralDfa0_0" + method.invoke(class1));
190 Assert.assertTrue((Integer) method.invoke(class1) != 0);
191 NEMOparserTokenManager.curChar = 43;
192 // System.out.println("jjMoveStringLiteralDfa0_0" + method.invoke(class1));
193 Assert.assertTrue((Integer) method.invoke(class1) != 0);
194 NEMOparserTokenManager.curChar = 44;
195 // System.out.println("jjMoveStringLiteralDfa0_0" + method.invoke(class1));
196 Assert.assertTrue((Integer) method.invoke(class1) != 0);
197 NEMOparserTokenManager.curChar = 58;
198 // System.out.println("jjMoveStringLiteralDfa0_0" + method.invoke(class1));
199 Assert.assertTrue((Integer) method.invoke(class1) != 0);
200 NEMOparserTokenManager.curChar = 59;
201 // System.out.println("jjMoveStringLiteralDfa0_0" + method.invoke(class1));
202 Assert.assertTrue((Integer) method.invoke(class1) != 0);
203 NEMOparserTokenManager.curChar = 60;
204 // System.out.println("jjMoveStringLiteralDfa0_0" + method.invoke(class1));
205 Assert.assertTrue((Integer) method.invoke(class1) != 0);
206 NEMOparserTokenManager.curChar = 61;
207 // System.out.println("jjMoveStringLiteralDfa0_0" + method.invoke(class1));
208 Assert.assertTrue((Integer) method.invoke(class1) != 0);
209 NEMOparserTokenManager.curChar = 65;
210 // System.out.println("jjMoveStringLiteralDfa0_0" + method.invoke(class1));
211 Assert.assertTrue((Integer) method.invoke(class1) != 0);
212 NEMOparserTokenManager.curChar = 66;
213 // System.out.println("jjMoveStringLiteralDfa0_0" + method.invoke(class1));
214 Assert.assertTrue((Integer) method.invoke(class1) != 0);
215 NEMOparserTokenManager.curChar = 67;
216 // System.out.println("jjMoveStringLiteralDfa0_0" + method.invoke(class1));
217 Assert.assertTrue((Integer) method.invoke(class1) != 0);
218 NEMOparserTokenManager.curChar = 68;
219 // System.out.println("jjMoveStringLiteralDfa0_0" + method.invoke(class1));
220 Assert.assertTrue((Integer) method.invoke(class1) != 0);
221 NEMOparserTokenManager.curChar = 69;
222 // System.out.println("jjMoveStringLiteralDfa0_0" + method.invoke(class1));
223 Assert.assertTrue((Integer) method.invoke(class1) != 0);
224 NEMOparserTokenManager.curChar = 70;
225 // System.out.println("jjMoveStringLiteralDfa0_0" + method.invoke(class1));
226 Assert.assertTrue((Integer) method.invoke(class1) != 0);
227 NEMOparserTokenManager.curChar = 73;
228 // System.out.println("jjMoveStringLiteralDfa0_0" + method.invoke(class1));
229 Assert.assertTrue((Integer) method.invoke(class1) != 0);
230 NEMOparserTokenManager.curChar = 77;
231 // System.out.println("jjMoveStringLiteralDfa0_0" + method.invoke(class1));
232 Assert.assertTrue((Integer) method.invoke(class1) != 0);
233 NEMOparserTokenManager.curChar = 78;
234 // System.out.println("jjMoveStringLiteralDfa0_0" + method.invoke(class1));
235 Assert.assertTrue((Integer) method.invoke(class1) != 0);
236 NEMOparserTokenManager.curChar = 79;
237 // System.out.println("jjMoveStringLiteralDfa0_0" + method.invoke(class1));
238 Assert.assertTrue((Integer) method.invoke(class1) != 0);
239 NEMOparserTokenManager.curChar = 80;
240 // System.out.println("jjMoveStringLiteralDfa0_0" + method.invoke(class1));
241 Assert.assertTrue((Integer) method.invoke(class1) != 0);
242 NEMOparserTokenManager.curChar = 81;
243 // System.out.println("jjMoveStringLiteralDfa0_0" + method.invoke(class1));
244 Assert.assertTrue((Integer) method.invoke(class1) != 0);
245 NEMOparserTokenManager.curChar = 84;
246 // System.out.println("jjMoveStringLiteralDfa0_0" + method.invoke(class1));
247 Assert.assertTrue((Integer) method.invoke(class1) != 0);
248 NEMOparserTokenManager.curChar = 85;
249 // System.out.println("jjMoveStringLiteralDfa0_0" + method.invoke(class1));
250 Assert.assertTrue((Integer) method.invoke(class1) != 0);
251 NEMOparserTokenManager.curChar = 91;
252 // System.out.println("jjMoveStringLiteralDfa0_0" + method.invoke(class1));
253 Assert.assertTrue((Integer) method.invoke(class1) != 0);
254 NEMOparserTokenManager.curChar = 93;
255 // System.out.println("jjMoveStringLiteralDfa0_0" + method.invoke(class1));
256 Assert.assertTrue((Integer) method.invoke(class1) != 0);
257 NEMOparserTokenManager.curChar = 99;
258 // System.out.println("jjMoveStringLiteralDfa0_0" + method.invoke(class1));
259 Assert.assertTrue((Integer) method.invoke(class1) != 0);
260 NEMOparserTokenManager.curChar = 102;
261 // System.out.println("jjMoveStringLiteralDfa0_0" + method.invoke(class1));
262 Assert.assertTrue((Integer) method.invoke(class1) != 0);
263 NEMOparserTokenManager.curChar = 105;
264 // System.out.println("jjMoveStringLiteralDfa0_0" + method.invoke(class1));
265 Assert.assertTrue((Integer) method.invoke(class1) != 0);
266 NEMOparserTokenManager.curChar = 110;
267 // System.out.println("jjMoveStringLiteralDfa0_0" + method.invoke(class1));
268 Assert.assertTrue((Integer) method.invoke(class1) != 0);
269 NEMOparserTokenManager.curChar = 111;
270 // System.out.println("jjMoveStringLiteralDfa0_0" + method.invoke(class1));
271 Assert.assertTrue((Integer) method.invoke(class1) != 0);
272 NEMOparserTokenManager.curChar = 114;
273 // System.out.println("jjMoveStringLiteralDfa0_0" + method.invoke(class1));
274 Assert.assertTrue((Integer) method.invoke(class1) != 0);
275 NEMOparserTokenManager.curChar = 115;
276 // System.out.println("jjMoveStringLiteralDfa0_0" + method.invoke(class1));
277 Assert.assertTrue((Integer) method.invoke(class1) != 0);
278 NEMOparserTokenManager.curChar = 124;
279 // System.out.println("jjMoveStringLiteralDfa0_0" + method.invoke(class1));
280 Assert.assertTrue((Integer) method.invoke(class1) != 0);
281 NEMOparserTokenManager.curChar = 1;
282 // System.out.println("jjMoveStringLiteralDfa0_0" + method.invoke(class1));
283 Assert.assertTrue((Integer) method.invoke(class1) != 0);
287 public void testjjMoveStringLiteralDfa1_0() throws Exception{
288 Method method = class1.getDeclaredMethod("jjMoveStringLiteralDfa1_0",new Class[]{long.class});
289 method.setAccessible(true);
291 PowerMockito.mockStatic(SimpleCharStream.class);
292 PowerMockito.when(SimpleCharStream.readChar())
293 .thenReturn((char) 0)
294 .thenReturn((char) 38)
295 .thenReturn((char) 61)
296 .thenReturn((char) 61)
297 .thenReturn((char) 61)
298 .thenReturn((char) 69)
299 .thenReturn((char) 77)
300 .thenReturn((char) 80)
301 .thenReturn((char) 82)
302 .thenReturn((char) 97)
303 .thenReturn((char) 99)
304 .thenReturn((char) 101)
305 .thenReturn((char) 108)
306 .thenReturn((char) 110)
307 .thenReturn((char) 111)
308 .thenReturn((char) 112)
309 .thenReturn((char) 114)
310 .thenReturn((char) 116)
311 .thenReturn((char) 117)
312 .thenReturn((char) 121)
313 .thenReturn((char) 124);
316 Assert.assertTrue((Integer) method.invoke(class1, 1L) == 2);
317 Assert.assertTrue(NEMOparserTokenManager.curChar == 0);
319 // System.out.println("0x8000L" + method.invoke(class1, 0x1000L));
320 Assert.assertTrue((Integer) method.invoke(class1, 0x1000L) == 2);
321 Assert.assertTrue(NEMOparserTokenManager.curChar == 38);
322 // System.out.println("0x8000L" + method.invoke(class1, 0x8000L));
323 Assert.assertTrue((Integer) method.invoke(class1, 0x8000L) == 2);
324 Assert.assertTrue(NEMOparserTokenManager.curChar == 61);
325 // System.out.println("0x8000L" + method.invoke(class1,0x40000L));
326 Assert.assertTrue((Integer) method.invoke(class1, 0x40000L) == 2);
327 Assert.assertTrue(NEMOparserTokenManager.curChar == 61);
328 // System.out.println("0x8000L" + method.invoke(class1,0x80000L));
329 Assert.assertTrue((Integer) method.invoke(class1, 0x80000L) == 2);
330 Assert.assertTrue(NEMOparserTokenManager.curChar == 61);
331 // System.out.println("0x8000L" + method.invoke(class1,0L));
332 Assert.assertTrue((Integer) method.invoke(class1, 0L) == 2);
333 Assert.assertTrue(NEMOparserTokenManager.curChar == 69);
334 Assert.assertTrue((Integer) method.invoke(class1, 0L) == 2);
335 Assert.assertTrue(NEMOparserTokenManager.curChar == 77);
336 Assert.assertTrue((Integer) method.invoke(class1, 0L) == 2);
337 Assert.assertTrue(NEMOparserTokenManager.curChar == 80);
338 Assert.assertTrue((Integer) method.invoke(class1, 0L) == 2);
339 Assert.assertTrue(NEMOparserTokenManager.curChar == 82);
340 Assert.assertTrue((Integer) method.invoke(class1, 0L) == 2);
341 Assert.assertTrue(NEMOparserTokenManager.curChar == 97);
342 Assert.assertTrue((Integer) method.invoke(class1, 0L) == 2);
343 Assert.assertTrue(NEMOparserTokenManager.curChar == 99);
344 Assert.assertTrue((Integer) method.invoke(class1, 0L) == 2);
345 Assert.assertTrue(NEMOparserTokenManager.curChar == 101);
346 Assert.assertTrue((Integer) method.invoke(class1, 0L) == 2);
347 Assert.assertTrue(NEMOparserTokenManager.curChar == 108);
348 Assert.assertTrue((Integer) method.invoke(class1, 0L) == 2);
349 Assert.assertTrue(NEMOparserTokenManager.curChar == 110);
350 Assert.assertTrue((Integer) method.invoke(class1, 0L) == 2);
351 Assert.assertTrue(NEMOparserTokenManager.curChar == 111);
352 Assert.assertTrue((Integer) method.invoke(class1, 0L) == 2);
353 Assert.assertTrue(NEMOparserTokenManager.curChar == 112);
354 Assert.assertTrue((Integer) method.invoke(class1, 0L) == 2);
355 Assert.assertTrue(NEMOparserTokenManager.curChar == 114);
356 Assert.assertTrue((Integer) method.invoke(class1, 0L) == 2);
357 Assert.assertTrue(NEMOparserTokenManager.curChar == 116);
358 Assert.assertTrue((Integer) method.invoke(class1, 0L) == 2);
359 Assert.assertTrue(NEMOparserTokenManager.curChar == 117);
360 Assert.assertTrue((Integer) method.invoke(class1, 0L) == 2);
361 Assert.assertTrue(NEMOparserTokenManager.curChar == 121);
362 Assert.assertTrue((Integer) method.invoke(class1, 0L) == 2);
363 Assert.assertTrue(NEMOparserTokenManager.curChar == 124);
367 public void testjjMoveStringLiteralDfa2_0() throws Exception{
368 Method method = class1.getDeclaredMethod("jjMoveStringLiteralDfa2_0",new Class[]{
372 method.setAccessible(true);
374 PowerMockito.mockStatic(SimpleCharStream.class);
375 PowerMockito.when(SimpleCharStream.readChar())
376 .thenReturn((char) 0)
377 .thenReturn((char) 68)
378 .thenReturn((char) 69)
379 .thenReturn((char) 76)
380 .thenReturn((char) 80)
381 .thenReturn((char) 97)
382 .thenReturn((char) 100)
383 .thenReturn((char) 101)
384 .thenReturn((char) 103)
385 .thenReturn((char) 105)
386 .thenReturn((char) 110)
387 .thenReturn((char) 111)
388 .thenReturn((char) 112)
389 .thenReturn((char) 114)
390 .thenReturn((char) 116);
393 // System.out.println("0x8000L" + method.invoke(class1, 1L, 1L));
394 Assert.assertTrue((Integer)method.invoke(class1,1L,1L) == 3);
395 Assert.assertTrue(NEMOparserTokenManager.curChar == 0);
397 Assert.assertTrue((Integer) method.invoke(class1, 1L, 1L) == 3);
398 Assert.assertTrue(NEMOparserTokenManager.curChar == 68);
399 Assert.assertTrue((Integer) method.invoke(class1, 1L, 1L) == 3);
400 Assert.assertTrue(NEMOparserTokenManager.curChar == 69);
401 Assert.assertTrue((Integer) method.invoke(class1, 1L, 1L) == 3);
402 Assert.assertTrue(NEMOparserTokenManager.curChar == 76);
403 Assert.assertTrue((Integer) method.invoke(class1, 1L, 1L) == 3);
404 Assert.assertTrue(NEMOparserTokenManager.curChar == 80);
405 Assert.assertTrue((Integer) method.invoke(class1, 1L, 1L) == 3);
406 Assert.assertTrue(NEMOparserTokenManager.curChar == 97);
407 Assert.assertTrue((Integer) method.invoke(class1, 1L, 1L) == 3);
408 Assert.assertTrue(NEMOparserTokenManager.curChar == 100);
409 Assert.assertTrue((Integer) method.invoke(class1, 1L, 1L) == 3);
410 Assert.assertTrue(NEMOparserTokenManager.curChar == 101);
411 Assert.assertTrue((Integer) method.invoke(class1, 1L, 1L) == 3);
412 Assert.assertTrue(NEMOparserTokenManager.curChar == 103);
413 Assert.assertTrue((Integer) method.invoke(class1, 1L, 1L) == 3);
414 Assert.assertTrue(NEMOparserTokenManager.curChar == 105);
415 Assert.assertTrue((Integer) method.invoke(class1, 1L, 1L) == 3);
416 Assert.assertTrue(NEMOparserTokenManager.curChar == 110);
417 Assert.assertTrue((Integer) method.invoke(class1, 1L, 1L) == 3);
418 Assert.assertTrue(NEMOparserTokenManager.curChar == 111);
419 Assert.assertTrue((Integer) method.invoke(class1, 1L, 1L) == 3);
420 Assert.assertTrue(NEMOparserTokenManager.curChar == 112);
421 Assert.assertTrue((Integer) method.invoke(class1, 1L, 1L) == 3);
422 Assert.assertTrue(NEMOparserTokenManager.curChar == 114);
423 Assert.assertTrue((Integer) method.invoke(class1, 1L, 1L) == 3);
424 Assert.assertTrue(NEMOparserTokenManager.curChar == 116);
429 public void testjjMoveStringLiteralDfa3_0() throws Exception{
430 Method method = class1.getDeclaredMethod("jjMoveStringLiteralDfa3_0",new Class[]{
434 method.setAccessible(true);
436 PowerMockito.mockStatic(SimpleCharStream.class);
437 PowerMockito.when(SimpleCharStream.readChar())
438 .thenReturn((char) 0)
439 .thenReturn((char) 65)
440 .thenReturn((char) 69)
441 .thenReturn((char) 79)
442 .thenReturn((char) 99)
443 .thenReturn((char) 100)
444 .thenReturn((char) 101)
445 .thenReturn((char) 103)
446 .thenReturn((char) 105)
447 .thenReturn((char) 109)
448 .thenReturn((char) 110)
449 .thenReturn((char) 111)
450 .thenReturn((char) 112)
451 .thenReturn((char) 114)
452 .thenReturn((char) 116)
453 .thenReturn((char) 119);
456 Assert.assertTrue((Integer) method.invoke(class1, 1L, 1L) == 4);
457 Assert.assertTrue(NEMOparserTokenManager.curChar == 0);
459 Assert.assertTrue((Integer) method.invoke(class1, 1L, 1L) == 4);
460 Assert.assertTrue(NEMOparserTokenManager.curChar == 65);
461 Assert.assertTrue((Integer) method.invoke(class1, 1L, 1L) == 4);
462 Assert.assertTrue(NEMOparserTokenManager.curChar == 69);
463 Assert.assertTrue((Integer) method.invoke(class1, 1L, 1L) == 4);
464 Assert.assertTrue(NEMOparserTokenManager.curChar == 79);
465 Assert.assertTrue((Integer) method.invoke(class1, 1L, 1L) == 4);
466 Assert.assertTrue(NEMOparserTokenManager.curChar == 99);
467 Assert.assertTrue((Integer) method.invoke(class1, 1L, 1L) == 4);
468 Assert.assertTrue(NEMOparserTokenManager.curChar == 100);
469 Assert.assertTrue((Integer) method.invoke(class1, 1L, 1L) == 4);
470 Assert.assertTrue(NEMOparserTokenManager.curChar == 101);
471 Assert.assertTrue((Integer) method.invoke(class1, 1L, 1L) == 4);
472 Assert.assertTrue(NEMOparserTokenManager.curChar == 103);
473 Assert.assertTrue((Integer) method.invoke(class1, 1L, 1L) == 4);
474 Assert.assertTrue(NEMOparserTokenManager.curChar == 105);
475 Assert.assertTrue((Integer) method.invoke(class1, 1L, 1L) == 4);
476 Assert.assertTrue(NEMOparserTokenManager.curChar == 109);
477 Assert.assertTrue((Integer) method.invoke(class1, 1L, 1L) == 4);
478 Assert.assertTrue(NEMOparserTokenManager.curChar == 110);
479 Assert.assertTrue((Integer) method.invoke(class1, 1L, 1L) == 4);
480 Assert.assertTrue(NEMOparserTokenManager.curChar == 111);
481 Assert.assertTrue((Integer) method.invoke(class1, 1L, 1L) == 4);
482 Assert.assertTrue(NEMOparserTokenManager.curChar == 112);
483 Assert.assertTrue((Integer) method.invoke(class1, 1L, 1L) == 4);
484 Assert.assertTrue(NEMOparserTokenManager.curChar == 114);
485 Assert.assertTrue((Integer) method.invoke(class1, 1L, 1L) == 4);
486 Assert.assertTrue(NEMOparserTokenManager.curChar == 116);
487 Assert.assertTrue((Integer) method.invoke(class1, 1L, 1L) == 4);
488 Assert.assertTrue(NEMOparserTokenManager.curChar == 119);
493 public void testjjMoveStringLiteralDfa4_0() throws Exception{
494 Method method = class1.getDeclaredMethod("jjMoveStringLiteralDfa4_0",new Class[]{
498 method.setAccessible(true);
500 PowerMockito.mockStatic(SimpleCharStream.class);
501 PowerMockito.when(SimpleCharStream.readChar())
502 .thenReturn((char) 0)
503 .thenReturn((char) 77)
504 .thenReturn((char) 82)
505 .thenReturn((char) 84)
506 .thenReturn((char) 97)
507 .thenReturn((char) 101)
508 // .thenReturn((char) 101)
509 .thenReturn((char) 103)
510 .thenReturn((char) 104)
511 // .thenReturn((char) 104)
512 .thenReturn((char) 105)
513 // .thenReturn((char) 110)
514 .thenReturn((char) 110)
515 .thenReturn((char) 111)
516 .thenReturn((char) 114)
517 // .thenReturn((char) 115)
518 // .thenReturn((char) 115)
519 .thenReturn((char) 115)
520 .thenReturn((char) 121);
523 Assert.assertTrue((Integer) method.invoke(class1, 1L, 1L) == 5);
524 Assert.assertTrue(NEMOparserTokenManager.curChar == 0);
526 Assert.assertTrue((Integer) method.invoke(class1, 1L, 1L) == 5);
527 Assert.assertTrue(NEMOparserTokenManager.curChar == 77);
528 Assert.assertTrue((Integer) method.invoke(class1, 1L, 1L) == 5);
529 Assert.assertTrue(NEMOparserTokenManager.curChar == 82);
530 Assert.assertTrue((Integer) method.invoke(class1, 1L, 1L) == 5);
531 Assert.assertTrue(NEMOparserTokenManager.curChar == 84);
532 Assert.assertTrue((Integer) method.invoke(class1, 1L, 1L) == 5);
533 Assert.assertTrue(NEMOparserTokenManager.curChar == 97);
534 // Assert.assertTrue((Integer) method.invoke(class1, 0x40000000000000L, 0x40000000000000L) == 5);
535 // System.out.println("0x40000000000000L" + method.invoke(class1, 0x40000000000000L, 0x40000000000000L));
536 // Assert.assertTrue(NEMOparserTokenManager.curChar == 101);
537 Assert.assertTrue((Integer) method.invoke(class1, 1L, 1L) == 5);
538 Assert.assertTrue(NEMOparserTokenManager.curChar == 101);
539 Assert.assertTrue((Integer) method.invoke(class1, 1L, 1L) == 5);
540 Assert.assertTrue(NEMOparserTokenManager.curChar == 103);
541 // System.out.println("0x40000000000000L" + method.invoke(class1, 0x1000000000L, 0x1000000000L));
542 // Assert.assertTrue(NEMOparserTokenManager.curChar == 104);
543 Assert.assertTrue((Integer) method.invoke(class1, 1L, 1L) == 5);
544 Assert.assertTrue(NEMOparserTokenManager.curChar == 104);
545 Assert.assertTrue((Integer) method.invoke(class1, 1L, 1L) == 5);
546 Assert.assertTrue(NEMOparserTokenManager.curChar == 105);
547 // System.out.println("0x40000000000000L" + method.invoke(class1, 0x200000000000L, 0x200000000000L));
548 // Assert.assertTrue(NEMOparserTokenManager.curChar == 110);
549 Assert.assertTrue((Integer) method.invoke(class1, 1L, 1L) == 5);
550 Assert.assertTrue(NEMOparserTokenManager.curChar == 110);
551 Assert.assertTrue((Integer) method.invoke(class1, 1L, 1L) == 5);
552 Assert.assertTrue(NEMOparserTokenManager.curChar == 111);
553 Assert.assertTrue((Integer) method.invoke(class1, 1L, 1L) == 5);
554 Assert.assertTrue(NEMOparserTokenManager.curChar == 114);
555 Assert.assertTrue((Integer) method.invoke(class1, 1L, 1L) == 5);
556 Assert.assertTrue(NEMOparserTokenManager.curChar == 115);
557 Assert.assertTrue((Integer) method.invoke(class1, 1L, 1L) == 5);
558 Assert.assertTrue(NEMOparserTokenManager.curChar == 121);
562 public void testjjMoveStringLiteralDfa5_0() throws Exception{
563 Method method = class1.getDeclaredMethod("jjMoveStringLiteralDfa5_0",new Class[]{
567 method.setAccessible(true);
569 PowerMockito.mockStatic(SimpleCharStream.class);
570 PowerMockito.when(SimpleCharStream.readChar())
571 .thenReturn((char) 0)
572 .thenReturn((char) 69)
573 .thenReturn((char) 69)
574 .thenReturn((char) 69)
575 .thenReturn((char) 84)
576 .thenReturn((char) 97)
577 .thenReturn((char) 99)
578 .thenReturn((char) 100)
579 .thenReturn((char) 101)
580 .thenReturn((char) 103)
581 .thenReturn((char) 105)
582 .thenReturn((char) 110)
583 .thenReturn((char) 111)
584 .thenReturn((char) 114)
585 .thenReturn((char) 116)
586 .thenReturn((char) 116);
590 Assert.assertTrue((Integer) method.invoke(class1, 1L, 1L) == 6);
591 Assert.assertTrue(NEMOparserTokenManager.curChar == 0);
593 Assert.assertTrue((Integer) method.invoke(class1, 0x2000000L, 0x2000000L) == 6);
594 Assert.assertTrue(NEMOparserTokenManager.curChar == 69);
595 Assert.assertTrue((Integer) method.invoke(class1, 0x10000000L, 0x10000000L) == 6);
596 Assert.assertTrue(NEMOparserTokenManager.curChar == 69);
597 Assert.assertTrue((Integer) method.invoke(class1, 0x8000000L, 0x8000000L) == 6);
598 Assert.assertTrue(NEMOparserTokenManager.curChar == 69);
599 Assert.assertTrue((Integer) method.invoke(class1, 0x4000000L, 0x4000000L) == 6);
600 Assert.assertTrue(NEMOparserTokenManager.curChar == 84);
601 Assert.assertTrue((Integer) method.invoke(class1, 1L, 1L) == 6);
602 Assert.assertTrue(NEMOparserTokenManager.curChar == 97);
603 Assert.assertTrue((Integer) method.invoke(class1, 1L, 1L) == 6);
604 Assert.assertTrue(NEMOparserTokenManager.curChar == 99);
605 Assert.assertTrue((Integer) method.invoke(class1, 1L, 1L) == 6);
606 Assert.assertTrue(NEMOparserTokenManager.curChar == 100);
607 Assert.assertTrue((Integer) method.invoke(class1, 1L, 1L) == 6);
608 Assert.assertTrue(NEMOparserTokenManager.curChar == 101);
609 Assert.assertTrue((Integer) method.invoke(class1, 1L, 1L) == 6);
610 Assert.assertTrue(NEMOparserTokenManager.curChar == 103);
611 Assert.assertTrue((Integer) method.invoke(class1, 1L, 1L) == 6);
612 Assert.assertTrue(NEMOparserTokenManager.curChar == 105);
613 Assert.assertTrue((Integer) method.invoke(class1, 0x10000000000L, 0x10000000000L) == 6);
614 Assert.assertTrue(NEMOparserTokenManager.curChar == 110);
615 Assert.assertTrue((Integer) method.invoke(class1, 1L, 1L) == 6);
616 Assert.assertTrue(NEMOparserTokenManager.curChar == 111);
617 Assert.assertTrue((Integer) method.invoke(class1, 1L, 1L) == 6);
618 Assert.assertTrue(NEMOparserTokenManager.curChar == 114);
619 Assert.assertTrue((Integer) method.invoke(class1, 0x4000000000L, 0x4000000000L) == 6);
620 Assert.assertTrue(NEMOparserTokenManager.curChar == 116);
621 Assert.assertTrue((Integer) method.invoke(class1, 1L, 1L) == 6);
622 Assert.assertTrue(NEMOparserTokenManager.curChar == 116);
626 public void testjjMoveStringLiteralDfa6_0() throws Exception{
627 Method method = class1.getDeclaredMethod("jjMoveStringLiteralDfa6_0",new Class[]{
631 method.setAccessible(true);
633 PowerMockito.mockStatic(SimpleCharStream.class);
634 PowerMockito.when(SimpleCharStream.readChar())
635 .thenReturn((char) 0)
636 .thenReturn((char) 99)
637 .thenReturn((char) 100)
638 .thenReturn((char) 101)
639 .thenReturn((char) 105)
640 .thenReturn((char) 110)
641 .thenReturn((char) 114)
642 .thenReturn((char) 116);
645 Assert.assertTrue((Integer) method.invoke(class1, 1L, 1L) == 7);
646 Assert.assertTrue(NEMOparserTokenManager.curChar == 0);
648 Assert.assertTrue((Integer) method.invoke(class1, 1L, 1L) == 7);
649 Assert.assertTrue(NEMOparserTokenManager.curChar == 99);
650 Assert.assertTrue((Integer) method.invoke(class1, 1L, 1L) == 7);
651 Assert.assertTrue(NEMOparserTokenManager.curChar == 100);
652 Assert.assertTrue((Integer) method.invoke(class1, 1L, 1L) == 7);
653 Assert.assertTrue(NEMOparserTokenManager.curChar == 101);
654 Assert.assertTrue((Integer) method.invoke(class1, 1L, 1L) == 7);
655 Assert.assertTrue(NEMOparserTokenManager.curChar == 105);
656 Assert.assertTrue((Integer) method.invoke(class1, 0x80000000L, 0x80000000L) == 7);
657 Assert.assertTrue(NEMOparserTokenManager.curChar == 110);
658 Assert.assertTrue((Integer) method.invoke(class1, 1L, 1L) == 7);
659 Assert.assertTrue(NEMOparserTokenManager.curChar == 114);
660 Assert.assertTrue((Integer) method.invoke(class1, 1L, 1L) == 7);
661 Assert.assertTrue(NEMOparserTokenManager.curChar == 116);
666 public void testjjMoveStringLiteralDfa7_0() throws Exception{
667 Method method = class1.getDeclaredMethod("jjMoveStringLiteralDfa7_0",new Class[]{
671 method.setAccessible(true);
673 PowerMockito.mockStatic(SimpleCharStream.class);
674 PowerMockito.when(SimpleCharStream.readChar())
675 .thenReturn((char) 0)
676 .thenReturn((char) 101)
677 .thenReturn((char) 105)
678 .thenReturn((char) 111)
679 .thenReturn((char) 115)
680 .thenReturn((char) 116)
681 .thenReturn((char) 121)
682 .thenReturn((char) 121);
685 Assert.assertTrue((Integer) method.invoke(class1, 1L, 1L) == 8);
686 Assert.assertTrue(NEMOparserTokenManager.curChar == 0);
689 Assert.assertTrue((Integer) method.invoke(class1, 1L, 1L) == 8);
690 Assert.assertTrue(NEMOparserTokenManager.curChar == 101);
691 Assert.assertTrue((Integer) method.invoke(class1, 1L, 1L) == 8);
692 Assert.assertTrue(NEMOparserTokenManager.curChar == 105);
693 Assert.assertTrue((Integer) method.invoke(class1, 1L, 1L) == 8);
694 Assert.assertTrue(NEMOparserTokenManager.curChar == 111);
695 Assert.assertTrue((Integer) method.invoke(class1, 0x400000000L, 0x400000000L) == 8);
696 Assert.assertTrue(NEMOparserTokenManager.curChar == 115);
697 Assert.assertTrue((Integer) method.invoke(class1, 1L, 1L) == 8);
698 Assert.assertTrue(NEMOparserTokenManager.curChar == 116);
699 Assert.assertTrue((Integer) method.invoke(class1, 0x100000000L, 0x100000000L) == 8);
700 Assert.assertTrue(NEMOparserTokenManager.curChar == 121);
701 Assert.assertTrue((Integer) method.invoke(class1, 0x80000000000L, 0x80000000000L) == 8);
702 Assert.assertTrue(NEMOparserTokenManager.curChar == 121);
706 public void testjjMoveStringLiteralDfa8_0() throws Exception{
707 Method method = class1.getDeclaredMethod("jjMoveStringLiteralDfa8_0",new Class[]{
711 method.setAccessible(true);
713 PowerMockito.mockStatic(SimpleCharStream.class);
714 PowerMockito.when(SimpleCharStream.readChar())
715 .thenReturn((char) 0)
716 .thenReturn((char) 105)
717 .thenReturn((char) 108)
718 .thenReturn((char) 110)
719 .thenReturn((char) 110)
720 .thenReturn((char) 110)
721 .thenReturn((char) 111);
724 Assert.assertTrue((Integer) method.invoke(class1, 1L, 1L) == 9);
725 Assert.assertTrue(NEMOparserTokenManager.curChar == 0);
728 Assert.assertTrue((Integer) method.invoke(class1, 1L, 1L) == 9);
729 Assert.assertTrue(NEMOparserTokenManager.curChar == 105);
730 Assert.assertTrue((Integer) method.invoke(class1, 0x8000000000000L, 0x8000000000000L) == 9);
731 Assert.assertTrue(NEMOparserTokenManager.curChar == 108);
732 Assert.assertTrue((Integer) method.invoke(class1, 0x2000000000L, 0x2000000000L) == 9);
733 Assert.assertTrue(NEMOparserTokenManager.curChar == 110);
734 Assert.assertTrue((Integer) method.invoke(class1, 0x8000000000L, 0x8000000000L) == 9);
735 Assert.assertTrue(NEMOparserTokenManager.curChar == 110);
736 Assert.assertTrue((Integer) method.invoke(class1, 1L, 1L) == 9);
737 Assert.assertTrue(NEMOparserTokenManager.curChar == 110);
738 Assert.assertTrue((Integer) method.invoke(class1, 1L, 1L) == 9);
739 Assert.assertTrue(NEMOparserTokenManager.curChar == 111);
743 public void testjjMoveStringLiteralDfa9_0() throws Exception{
744 Method method = class1.getDeclaredMethod("jjMoveStringLiteralDfa9_0",new Class[]{
748 method.setAccessible(true);
750 PowerMockito.mockStatic(SimpleCharStream.class);
751 PowerMockito.when(SimpleCharStream.readChar())
752 .thenReturn((char) 0)
753 .thenReturn((char) 110)
754 .thenReturn((char) 110)
755 .thenReturn((char) 111)
756 .thenReturn((char) 115);
759 Assert.assertTrue((Integer) method.invoke(class1, 1L, 1L) == 10);
760 Assert.assertTrue(NEMOparserTokenManager.curChar == 0);
763 Assert.assertTrue((Integer) method.invoke(class1, 0x200000000L, 0x200000000L) == 10);
764 Assert.assertTrue(NEMOparserTokenManager.curChar == 110);
765 Assert.assertTrue((Integer) method.invoke(class1, 1L, 1L) == 10);
766 Assert.assertTrue(NEMOparserTokenManager.curChar == 110);
767 Assert.assertTrue((Integer) method.invoke(class1, 1L, 1L) == 10);
768 Assert.assertTrue(NEMOparserTokenManager.curChar == 111);
769 Assert.assertTrue((Integer) method.invoke(class1, 1L, 1L) == 10);
770 Assert.assertTrue(NEMOparserTokenManager.curChar == 115);
774 public void testjjMoveStringLiteralDfa10_0() throws Exception {
775 Method method = class1.getDeclaredMethod("jjMoveStringLiteralDfa10_0", new Class[]{
779 method.setAccessible(true);
781 PowerMockito.mockStatic(SimpleCharStream.class);
782 PowerMockito.when(SimpleCharStream.readChar())
783 .thenReturn((char) 0)
784 .thenReturn((char) 110)
785 .thenReturn((char) 115);
788 Assert.assertTrue((Integer) method.invoke(class1, 1L, 1L) == 11);
789 Assert.assertTrue(NEMOparserTokenManager.curChar == 0);
792 Assert.assertTrue((Integer) method.invoke(class1, 0x100000000000L, 0x100000000000L) == 11);
793 Assert.assertTrue(NEMOparserTokenManager.curChar == 110);
794 Assert.assertTrue((Integer) method.invoke(class1, 1L, 1L) == 11);
795 Assert.assertTrue(NEMOparserTokenManager.curChar == 115);
799 public void testjjStartNfaWithStates_0() throws Exception {
803 public void testjjMoveNfa_0() throws Exception {
807 public void testjjCheckNAdd() throws Exception {
808 Field field = class1.getDeclaredField("jjrounds");
809 field.setAccessible(true);
810 Field field1 = class1.getDeclaredField("jjround");
811 field1.setAccessible(true);
814 int jjrounds[] = new int[205];