01: /*******************************************************************************
02: * Portions created by Sebastian Thomschke are copyright (c) 2005-2007 Sebastian
03: * Thomschke.
04: *
05: * All Rights Reserved. This program and the accompanying materials
06: * are made available under the terms of the Eclipse Public License v1.0
07: * which accompanies this distribution, and is available at
08: * http://www.eclipse.org/legal/epl-v10.html
09: *
10: * Contributors:
11: * Sebastian Thomschke - initial implementation.
12: *******************************************************************************/package net.sf.oval.test.constraints;
13:
14: import junit.framework.TestCase;
15: import net.sf.oval.Check;
16: import net.sf.oval.Validator;
17:
18: /**
19: * @author Sebastian Thomschke
20: */
21: public abstract class AbstractContraintsTest extends TestCase {
22: protected Validator validator = new Validator();
23:
24: protected void testCheck(final Check check) {
25: check.setMessage("XYZ");
26: assertEquals("XYZ", check.getMessage());
27:
28: check.setProfiles("p1");
29: assertNotNull(check.getProfiles());
30: assertEquals(1, check.getProfiles().length);
31: assertEquals("p1", check.getProfiles()[0]);
32:
33: check.setProfiles((String[]) null);
34: assertTrue(check.getProfiles() == null
35: || check.getProfiles().length == 0);
36: }
37: }
|