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.core;
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 CoreWsdlCompatibilityTest extends WsdlCompareTestCase {
31      private static final Logger LOG = Logger.getLogger(CoreWsdlCompatibilityTest.class);
32      private static final String MODULE_NAME = "core";
33  
34      public CoreWsdlCompatibilityTest() {
35          super(MODULE_NAME);
36      }
37  
38      @Test
39      public void compareCoreServiceWsdls() {
40          File[] files = new File("../../" + getModuleName() + "-service/api/target/wsdl").listFiles();
41          compareWsdlFiles(files);
42      }
43  
44      @Test
45      public void compareCoreWsdls() {
46          File[] files = new File("../../" + getModuleName() + "/api/target/wsdl").listFiles();
47          assertTrue("There should be wsdls to compare", files != null  && files.length > 0);
48          if (StringUtils.equals("2.0.1", getPreviousVersion())
49                  && files != null) {
50              //hack to remove test for CacheAdminService, because 2.0.1's wdsl for that was generated incorrectly
51              List<File> fileList = new ArrayList<File>();
52              for (File file : files) {
53                  if (!file.getName().equals("CacheAdminService.wsdl")) {
54                      fileList.add(file);
55                  }
56              }
57              files = fileList.toArray(new File[]{});
58          }
59          if (files.length > 0) {
60              compareWsdlFiles(files);
61          }
62      }
63  
64  
65  }