View Javadoc
1   /**
2    * Copyright 2005-2014 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  package org.kuali.rice.vc.ken;
17  
18  import org.apache.commons.lang.StringUtils;
19  import org.apache.log4j.Logger;
20  import org.junit.Test;
21  import org.kuali.rice.vc.test.WsdlCompareTestCase;
22  
23  import java.io.File;
24  import java.util.ArrayList;
25  import java.util.List;
26  
27  import static org.junit.Assert.assertTrue;
28  
29  public class KenWsdlCompatibilityTest extends WsdlCompareTestCase {
30      private static final Logger LOG = Logger.getLogger(KenWsdlCompatibilityTest.class);
31      private static final String MODULE_NAME = "ken";
32  
33      public KenWsdlCompatibilityTest() {
34          super(MODULE_NAME);
35      }
36  
37      @Test
38      public void compareWsdls() {
39          File[] files = new File("../../" + getModuleName() + "/api/target/wsdl").listFiles();
40          assertTrue("There should be wsdls to compare", files != null  && files.length > 0);
41          if (StringUtils.equals("2.0.1", getPreviousVersion())
42                  && files != null) {
43              //hack to remove test for CacheAdminService, because 2.0.1's wdsl for that was generated incorrectly
44              List<File> fileList = new ArrayList<File>();
45              for (File file : files) {
46                  if (!file.getName().equals("SendNotificationService.wsdl")) {
47                      fileList.add(file);
48                  }
49              }
50              files = fileList.toArray(new File[]{});
51          }
52          if (files.length > 0) {
53              compareWsdlFiles(files);
54          }
55      }
56  
57  
58  }