01: package org.andromda.translation.ocl.syntax;
02:
03: import junit.framework.TestCase;
04:
05: /**
06: * Tests {@link OCLPatterns}
07: *
08: * @author Chad Brandon
09: */
10: public class OCLPatternsTest extends TestCase {
11: public void testIsCollectionOperationResultNavigationalPath() {
12: final String validPatternOne = "attributes->first().type.fullyQualifiedName";
13: assertTrue(OCLPatterns
14: .isCollectionOperationResultNavigationalPath(validPatternOne));
15: final String validPatternTwo = " attributes -> first ( ) . type . fullyQualifiedName";
16: assertTrue(OCLPatterns
17: .isCollectionOperationResultNavigationalPath(validPatternTwo));
18: final String invalidPatternOne = "attributes -> forAll ( type . fullyQualifiedName = literalTypeName )";
19: assertFalse(OCLPatterns
20: .isCollectionOperationResultNavigationalPath(invalidPatternOne));
21: }
22: }
|