Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright 2010 The Kuali Foundation Licensed under the Educational Community License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
 package org.kuali.student.common.test.spring;
This class will start a Jetty server and deploy an exploded war file defined in @IntegrationServer annotation.

@IntegrationServer annotation takes the following parameters:

  • port - Server port to deploy web application on e.g. 9090
  • webAppPath - Webapp path of exploded war file e.g. brms-ws-1.0.0.war
  • contextPath - Servlet context path e.g. brms-ws-1.0.0

The @SystemProperties and @Property annotation is used to set System properties before starting the Jetty server. For instance, if you want to set the catalina.base path or the URL or port of a service that is different from what is specified in the file CXF configuration in the war file.

@SystemProperties takes the following parameter:

  • properties - List of Property to set

@Property takes the following parameter:

  • key - Property key
  • value - Property value

Example 1: Setup an integration test on port 8080 which is the same port as specified in the file in the war file.

Example 2: Setup an integration test on port 9090 which is different from what is specified in the file in the war file.
Example 3: Integration test.
 package org.kuali.student.rules.integration;
 // The following system properties are only needed if you want to specify a
 // server port (port 9000) other than 8080 as defined in
 // brms-ws/src/main/resources/, 
 // and
 @IntegrationServer(port=9000, webappPath="../../../brms-ws/target/brms-ws-0.1.0-SNAPSHOT", contextPath="/brms-ws-0.1.0-SNAPSHOT")
     @Property(key="ks.servicelocation.RuleManagementService", value="http://localhost:9000/brms-ws-0.1.0-SNAPSHOT/services/RuleManagementService"),
 public class IntegrationTest extends AbstractIntegrationServiceTest {
     private final static String HOST = "http://localhost:9000/brms-ws-0.1.0-SNAPSHOT";
     private static String ruleManagementServiceURL = HOST+"/services/RuleManagementService";
     private static String ruleManagementNamespace = "";
     private static String ruleManagementServiceName = "RuleManagementService";
     private static String ruleManagementServiceInterface = RuleManagementService.class.getName();
     private static RuleManagementService ruleManagementService;
     public static void setUpOnce() throws Exception {
         ruleManagementService = (RuleManagementService) ServiceFactory.getPort(
             ruleManagementServiceURL + "?wsdl", 

     public static void tearDownOnce() throws Exception { }

     public void setUp() throws Exception { }
     public void tearDown() throws Exception { }
     public void testFindBusinessRuleTypesFromTestBeans() throws Exception {
         List<String> businessRuleIdList1 = ruleManagementService.findBusinessRuleIdsByBusinessRuleType("KUALI_PRE_REQ");
         List<String> businessRuleIdList2 = ruleManagementService.findBusinessRuleIdsByBusinessRuleType("KUALI_CO_REQ");
public abstract class AbstractIntegrationServiceTest {
New to GrepCode? Check out our FAQ X