File: JiBXConstrainedParseExceptionTest.java

package info (click to toggle)
libjibx1.2-java 1.2.6-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 26,260 kB
  • sloc: java: 75,013; xml: 14,068; makefile: 17
file content (27 lines) | stat: -rw-r--r-- 948 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package org.jibx.runtime;

import junit.framework.TestCase;

/**
 * Verify the permutations of the constrained parse exception (specifically,
 * string creation).
 */
public class JiBXConstrainedParseExceptionTest extends TestCase {
	public void testOneValue() {
		JiBXConstrainedParseException e = new JiBXConstrainedParseException(
				"msg", "value", new String[] {"abc"});
		assertTrue(e.getMessage().endsWith(".  Acceptable values are 'abc'."));
	}
	
	public void testTwoValues() {
		JiBXConstrainedParseException e = new JiBXConstrainedParseException(
				"msg", "value", new String[] {"abc", "def"});
		assertTrue(e.getMessage().endsWith(".  Acceptable values are 'abc', 'def'."));
	}
	
	public void testThreeValues() {
		JiBXConstrainedParseException e = new JiBXConstrainedParseException(
				"msg", "value", new String[] {"abc", "def", "ghi"});
		assertTrue(e.getMessage().endsWith(".  Acceptable values are 'abc', 'def', 'ghi'."));
	}
}