01: package org.drools.brms.client.common;
02:
03: /*
04: * Copyright 2005 JBoss Inc
05: *
06: * Licensed under the Apache License, Version 2.0 (the "License");
07: * you may not use this file except in compliance with the License.
08: * You may obtain a copy of the License at
09: *
10: * http://www.apache.org/licenses/LICENSE-2.0
11: *
12: * Unless required by applicable law or agreed to in writing, software
13: * distributed under the License is distributed on an "AS IS" BASIS,
14: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15: * See the License for the specific language governing permissions and
16: * limitations under the License.
17: */
18:
19: import junit.framework.TestCase;
20:
21: public class AssetFormatsTest extends TestCase {
22:
23: public void testGrouping() {
24: String[] formats = AssetFormats.BUSINESS_RULE_FORMATS;
25: for (int i = 0; i < formats.length; i++) {
26: String fmt = formats[i];
27: if (!(fmt.equals(AssetFormats.BUSINESS_RULE)
28: || fmt
29: .equals(AssetFormats.DECISION_SPREADSHEET_XLS) || fmt
30: .equals(AssetFormats.DSL_TEMPLATE_RULE))) {
31: fail("Incorrect grouping of business rules.");
32: }
33: }
34:
35: formats = AssetFormats.TECHNICAL_RULE_FORMATS;
36: for (int i = 0; i < formats.length; i++) {
37: String fmt = formats[i];
38: if (!(fmt.equals(AssetFormats.RULE_FLOW_RF)
39: || fmt.equals(AssetFormats.DRL) || fmt
40: .equals(AssetFormats.ENUMERATION))) {
41: fail("Incorrect grouping of technical rules.");
42: }
43: }
44:
45: }
46:
47: public void testPackageDependencies() {
48: assertFalse(AssetFormats
49: .isPackageDependency(AssetFormats.BUSINESS_RULE));
50: assertFalse(AssetFormats.isPackageDependency(AssetFormats.DRL));
51: assertTrue(AssetFormats.isPackageDependency(AssetFormats.DSL));
52: assertTrue(AssetFormats.isPackageDependency(AssetFormats.MODEL));
53: assertTrue(AssetFormats
54: .isPackageDependency(AssetFormats.FUNCTION));
55: assertTrue(AssetFormats
56: .isPackageDependency(AssetFormats.ENUMERATION));
57: }
58:
59: }
|