View Javadoc
1   /*
2    * Copyright 2006-2012 The Kuali Foundation
3    *
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    * http://www.opensource.org/licenses/ecl2.php
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  
17  package org.kuali.rice.vc.ken;
18  
19  import org.apache.commons.lang.StringUtils;
20  import org.apache.log4j.Logger;
21  import org.junit.Test;
22  import org.kuali.rice.vc.test.WsdlCompareTestCase;
23  
24  import java.io.File;
25  import java.util.ArrayList;
26  import java.util.List;
27  
28  import static org.junit.Assert.assertTrue;
29  
30  public class KenWsdlCompatibilityTest extends WsdlCompareTestCase {
31      private static final Logger LOG = Logger.getLogger(KenWsdlCompatibilityTest.class);
32      private static final String MODULE_NAME = "ken";
33  
34      public KenWsdlCompatibilityTest() {
35          super(MODULE_NAME);
36      }
37  
38      @Test
39      public void compareWsdls() {
40          File[] files = new File("../../" + getModuleName() + "/api/target/wsdl").listFiles();
41          assertTrue("There should be wsdls to compare", files != null  && files.length > 0);
42          if (StringUtils.equals("2.0.1", getPreviousVersion())
43                  && files != null) {
44              //hack to remove test for CacheAdminService, because 2.0.1's wdsl for that was generated incorrectly
45              List<File> fileList = new ArrayList<File>();
46              for (File file : files) {
47                  if (!file.getName().equals("SendNotificationService.wsdl")) {
48                      fileList.add(file);
49                  }
50              }
51              files = fileList.toArray(new File[]{});
52          }
53          if (files.length > 0) {
54              compareWsdlFiles(files);
55          }
56      }
57  
58  
59  }