~ubuntu-branches/ubuntu/lucid/libstruts1.2-java/lucid

« back to all changes in this revision

Viewing changes to web/test/test/org/apache/struts/taglib/html/TestErrorsTag1.jsp

  • Committer: Bazaar Package Importer
  • Author(s): Arnaud Vandyck
  • Date: 2006-04-24 12:14:23 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20060424121423-naev53qigqgks0sa
Tags: 1.2.9-1
New upstream  release Fixes  three security  problems: CVE-2006-1546,
CVE-2006-1547,  CVE-2006-1548  (closes:  #360551),  thanks  to  Moritz
Muehlenhoff.

Show diffs side-by-side

added added

removed removed

Lines of Context:
247
247
 
248
248
 
249
249
 
250
 
<!-- Name -->
251
 
 
252
 
<logic:equal name="runTest" value="testErrorsDefaultBundle0ErrorsName">
253
 
        <bean:define id="EXPECTED_RESULTS" toScope="page">
254
 
                My Errors go here:<html:errors name="MY_ERRORS_KEY"/>
255
 
        </bean:define>
256
 
        <bean:define id="TEST_RESULTS" toScope="page">
257
 
                My Errors go here:
258
 
        </bean:define>
259
 
</logic:equal>
260
 
 
261
 
<logic:equal name="runTest" value="testErrorsDefaultBundle2ErrorsName">
262
 
<%
263
 
//This should be done in your action.  I do it here to keep the tests simple.
264
 
        ActionErrors errors = new ActionErrors();
265
 
    errors.add(ActionErrors.GLOBAL_ERROR,
266
 
         new ActionError("default.testing.errors.tag"));
267
 
    errors.add(ActionErrors.GLOBAL_ERROR,
268
 
         new ActionError("default.testing.errors.tag2"));
269
 
    request.setAttribute("MY_ERRORS_KEY", errors);
270
 
%>
271
 
        <bean:define id="EXPECTED_RESULTS" toScope="page">
272
 
                My Errors go here:<html:errors name="MY_ERRORS_KEY"/>
273
 
        </bean:define>
274
 
        <bean:define id="TEST_RESULTS" toScope="page">
275
 
                My Errors go here:<default_errors_header><default_errors_prefix>My Errors Text<default_errors_suffix><default_errors_prefix>My Errors Text 2<default_errors_suffix><default_errors_footer>
276
 
        </bean:define>
277
 
</logic:equal>
278
 
 
279
 
<logic:equal name="runTest" value="testErrorsAlternateBundle0ErrorsName">
280
 
        <bean:define id="EXPECTED_RESULTS" toScope="page">
281
 
                My Errors go here:<html:errors name="MY_ERRORS_KEY"/>
282
 
        </bean:define>
283
 
        <bean:define id="TEST_RESULTS" toScope="page">
284
 
                My Errors go here:
285
 
        </bean:define>
286
 
</logic:equal>
287
 
 
288
 
<logic:equal name="runTest" value="testErrorsAlternateBundle2ErrorsName">
289
 
<%
290
 
//This should be done in your action.  I do it here to keep the tests simple.
291
 
        ActionErrors errors = new ActionErrors();
292
 
    errors.add(ActionErrors.GLOBAL_ERROR,
293
 
         new ActionError("alternate.testing.errors.tag"));
294
 
    errors.add(ActionErrors.GLOBAL_ERROR,
295
 
         new ActionError("alternate.testing.errors.tag2"));
296
 
    request.setAttribute("MY_ERRORS_KEY", errors);
297
 
%>
298
 
        <bean:define id="EXPECTED_RESULTS" toScope="page">
299
 
                My Errors go here:<html:errors bundle="alternate" name="MY_ERRORS_KEY"/>
300
 
        </bean:define>
301
 
        <bean:define id="TEST_RESULTS" toScope="page">
302
 
                My Errors go here:<alternate_errors_header><alternate_errors_prefix>My Alternate Errors Text<alternate_errors_suffix><alternate_errors_prefix>My Alternate Errors Text 2<alternate_errors_suffix><alternate_errors_footer>
303
 
        </bean:define>
304
 
</logic:equal>
305
 
 
306
 
<logic:equal name="runTest" value="testErrorsDefaultBundle0ErrorsName_fr">
307
 
        <bean:define id="EXPECTED_RESULTS" toScope="page">
308
 
                My Errors go here:<html:errors name="MY_ERRORS_KEY"/>
309
 
        </bean:define>
310
 
        <bean:define id="TEST_RESULTS" toScope="page">
311
 
                My Errors go here:
312
 
        </bean:define>
313
 
</logic:equal>
314
 
 
315
 
<logic:equal name="runTest" value="testErrorsDefaultBundle2ErrorsName_fr">
316
 
<%
317
 
//This should be done in your action.  I do it here to keep the tests simple.
318
 
        ActionErrors errors = new ActionErrors();
319
 
    errors.add(ActionErrors.GLOBAL_ERROR,
320
 
         new ActionError("default.testing.errors.tag"));
321
 
    errors.add(ActionErrors.GLOBAL_ERROR,
322
 
         new ActionError("default.testing.errors.tag2"));
323
 
    request.setAttribute("MY_ERRORS_KEY", errors);
324
 
%>
325
 
        <bean:define id="EXPECTED_RESULTS" toScope="page">
326
 
                My Errors go here:<html:errors name="MY_ERRORS_KEY"/>
327
 
        </bean:define>
328
 
        <bean:define id="TEST_RESULTS" toScope="page">
329
 
                My Errors go here:<default_errors_header_fr><default_errors_prefix_fr>My Errors Text (fr)<default_errors_suffix_fr><default_errors_prefix_fr>My Errors Text 2 (fr)<default_errors_suffix_fr><default_errors_footer_fr>
330
 
        </bean:define>
331
 
</logic:equal>
332
 
 
333
 
 
334
 
<logic:equal name="runTest" value="testErrorsAlternateBundle0ErrorsName_fr">
335
 
        <bean:define id="EXPECTED_RESULTS" toScope="page">
336
 
                My Errors go here:<html:errors name="MY_ERRORS_KEY"/>
337
 
        </bean:define>
338
 
        <bean:define id="TEST_RESULTS" toScope="page">
339
 
                My Errors go here:
340
 
        </bean:define>
341
 
</logic:equal>
342
 
 
343
 
<logic:equal name="runTest" value="testErrorsAlternateBundle2ErrorsName_fr">
344
 
<%
345
 
//This should be done in your action.  I do it here to keep the tests simple.
346
 
        ActionErrors errors = new ActionErrors();
347
 
    errors.add(ActionErrors.GLOBAL_ERROR,
348
 
         new ActionError("alternate.testing.errors.tag"));
349
 
    errors.add(ActionErrors.GLOBAL_ERROR,
350
 
         new ActionError("alternate.testing.errors.tag2"));
351
 
    request.setAttribute("MY_ERRORS_KEY", errors);
352
 
%>
353
 
        <bean:define id="EXPECTED_RESULTS" toScope="page">
354
 
                My Errors go here:<html:errors bundle="alternate" name="MY_ERRORS_KEY"/>
355
 
        </bean:define>
356
 
        <bean:define id="TEST_RESULTS" toScope="page">
357
 
                My Errors go here:<alternate_errors_header_fr><alternate_errors_prefix_fr>My Alternate Errors Text (fr)<alternate_errors_suffix_fr><alternate_errors_prefix_fr>My Alternate Errors Text 2 (fr)<alternate_errors_suffix_fr><alternate_errors_footer_fr>
358
 
        </bean:define>
359
 
</logic:equal>
360
 
 
361
 
 
362
 
 
363
 
 
364
 
 
365
 
 
366
 
 
367
 
 
368
 
 
369
 
 
370
 
 
371
 
<logic:equal name="runTest" value="testErrorsDefaultBundle0ErrorsLocaleName">
372
 
        <bean:define id="EXPECTED_RESULTS" toScope="page">
373
 
                My Errors go here:<html:errors locale="MY_LOCALE_KEY" name="MY_ERRORS_KEY"/>
374
 
        </bean:define>
375
 
        <bean:define id="TEST_RESULTS" toScope="page">
376
 
                My Errors go here:
377
 
        </bean:define>
378
 
</logic:equal>
379
 
 
380
 
<logic:equal name="runTest" value="testErrorsDefaultBundle2ErrorsLocaleName">
381
 
<%
382
 
//This should be done in your action.  I do it here to keep the tests simple.
383
 
        ActionErrors errors = new ActionErrors();
384
 
    errors.add(ActionErrors.GLOBAL_ERROR,
385
 
         new ActionError("default.testing.errors.tag"));
386
 
    errors.add(ActionErrors.GLOBAL_ERROR,
387
 
         new ActionError("default.testing.errors.tag2"));
388
 
    request.setAttribute("MY_ERRORS_KEY", errors);
389
 
%>
390
 
        <bean:define id="EXPECTED_RESULTS" toScope="page">
391
 
                My Errors go here:<html:errors locale="MY_LOCALE_KEY" name="MY_ERRORS_KEY"/>
392
 
        </bean:define>
393
 
        <bean:define id="TEST_RESULTS" toScope="page">
394
 
                My Errors go here:<default_errors_header_fr><default_errors_prefix_fr>My Errors Text (fr)<default_errors_suffix_fr><default_errors_prefix_fr>My Errors Text 2 (fr)<default_errors_suffix_fr><default_errors_footer_fr>
395
 
        </bean:define>
396
 
</logic:equal>
397
 
 
398
 
<logic:equal name="runTest" value="testErrorsAlternateBundle0ErrorsLocaleName">
399
 
        <bean:define id="EXPECTED_RESULTS" toScope="page">
400
 
                My Errors go here:<html:errors locale="MY_LOCALE_KEY" name="MY_ERRORS_KEY"/>
401
 
        </bean:define>
402
 
        <bean:define id="TEST_RESULTS" toScope="page">
403
 
                My Errors go here:
404
 
        </bean:define>
405
 
</logic:equal>
406
 
 
407
 
<logic:equal name="runTest" value="testErrorsAlternateBundle2ErrorsLocaleName">
408
 
<%
409
 
//This should be done in your action.  I do it here to keep the tests simple.
410
 
        ActionErrors errors = new ActionErrors();
411
 
    errors.add(ActionErrors.GLOBAL_ERROR,
412
 
         new ActionError("alternate.testing.errors.tag"));
413
 
    errors.add(ActionErrors.GLOBAL_ERROR,
414
 
         new ActionError("alternate.testing.errors.tag2"));
415
 
    request.setAttribute("MY_ERRORS_KEY", errors);
416
 
%>
417
 
        <bean:define id="EXPECTED_RESULTS" toScope="page">
418
 
                My Errors go here:<html:errors locale="MY_LOCALE_KEY" bundle="alternate" name="MY_ERRORS_KEY"/>
419
 
        </bean:define>
420
 
        <bean:define id="TEST_RESULTS" toScope="page">
421
 
                My Errors go here:<alternate_errors_header_fr><alternate_errors_prefix_fr>My Alternate Errors Text (fr)<alternate_errors_suffix_fr><alternate_errors_prefix_fr>My Alternate Errors Text 2 (fr)<alternate_errors_suffix_fr><alternate_errors_footer_fr>
422
 
        </bean:define>
423
 
</logic:equal>
424
 
 
425
 
<logic:equal name="runTest" value="testErrorsDefaultBundle0ErrorsLocaleName_fr">
426
 
        <bean:define id="EXPECTED_RESULTS" toScope="page">
427
 
                My Errors go here:<html:errors locale="MY_LOCALE_KEY" name="MY_ERRORS_KEY"/>
428
 
        </bean:define>
429
 
        <bean:define id="TEST_RESULTS" toScope="page">
430
 
                My Errors go here:
431
 
        </bean:define>
432
 
</logic:equal>
433
 
 
434
 
<logic:equal name="runTest" value="testErrorsDefaultBundle2ErrorsLocaleName_fr">
435
 
<%
436
 
//This should be done in your action.  I do it here to keep the tests simple.
437
 
        ActionErrors errors = new ActionErrors();
438
 
    errors.add(ActionErrors.GLOBAL_ERROR,
439
 
         new ActionError("default.testing.errors.tag"));
440
 
    errors.add(ActionErrors.GLOBAL_ERROR,
441
 
         new ActionError("default.testing.errors.tag2"));
442
 
    request.setAttribute("MY_ERRORS_KEY", errors);
443
 
%>
444
 
        <bean:define id="EXPECTED_RESULTS" toScope="page">
445
 
                My Errors go here:<html:errors locale="MY_LOCALE_KEY" name="MY_ERRORS_KEY"/>
446
 
        </bean:define>
447
 
        <bean:define id="TEST_RESULTS" toScope="page">
448
 
                My Errors go here:<default_errors_header_fr><default_errors_prefix_fr>My Errors Text (fr)<default_errors_suffix_fr><default_errors_prefix_fr>My Errors Text 2 (fr)<default_errors_suffix_fr><default_errors_footer_fr>
449
 
        </bean:define>
450
 
</logic:equal>
451
 
 
452
 
 
453
 
<logic:equal name="runTest" value="testErrorsAlternateBundle0ErrorsLocaleName_fr">
454
 
        <bean:define id="EXPECTED_RESULTS" toScope="page">
455
 
                My Errors go here:<html:errors locale="MY_LOCALE_KEY" name="MY_ERRORS_KEY"/>
456
 
        </bean:define>
457
 
        <bean:define id="TEST_RESULTS" toScope="page">
458
 
                My Errors go here:
459
 
        </bean:define>
460
 
</logic:equal>
461
 
 
462
 
<logic:equal name="runTest" value="testErrorsAlternateBundle2ErrorsLocaleName_fr">
463
 
<%
464
 
//This should be done in your action.  I do it here to keep the tests simple.
465
 
        ActionErrors errors = new ActionErrors();
466
 
    errors.add(ActionErrors.GLOBAL_ERROR,
467
 
         new ActionError("alternate.testing.errors.tag"));
468
 
    errors.add(ActionErrors.GLOBAL_ERROR,
469
 
         new ActionError("alternate.testing.errors.tag2"));
470
 
    request.setAttribute("MY_ERRORS_KEY", errors);
471
 
%>
472
 
        <bean:define id="EXPECTED_RESULTS" toScope="page">
473
 
                My Errors go here:<html:errors locale="MY_LOCALE_KEY" bundle="alternate" name="MY_ERRORS_KEY"/>
474
 
        </bean:define>
475
 
        <bean:define id="TEST_RESULTS" toScope="page">
476
 
                My Errors go here:<alternate_errors_header_fr><alternate_errors_prefix_fr>My Alternate Errors Text (fr)<alternate_errors_suffix_fr><alternate_errors_prefix_fr>My Alternate Errors Text 2 (fr)<alternate_errors_suffix_fr><alternate_errors_footer_fr>
477
 
        </bean:define>
478
 
</logic:equal>
479
 
 
480
 
 
481
 
 
482
250
<% 
483
251
String expected = "";
484
252
String compareTo = "";