Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Aug 23rd, 2012  |  syntax: None  |  size: 0.80 KB  |  hits: 9  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. @RunWith(SpringJUnit4ClassRunner.class)
  2. @ContextConfiguration(locations = {"/org/apache/struts/spring/app-context.xml"})
  3. public class SampleActionIntegrationTest extends StrutsSpringJUnit4TestCase<SampleAction> {
  4.     @Test
  5.     public void executeTest() throws Exception {
  6.         String result = executeAction("/sample");
  7.         SampleAction action = getAction();
  8.         assertFalse(containsErrors());
  9.     }
  10.  
  11.     /**
  12.      * Override this method to return a comma separated list of paths to a configuration
  13.      * file.
  14.      * <p>The default implementation simply returns <code>null</code>.
  15.      *
  16.      * @return a comma separated list of config locations
  17.      */
  18.     @Override
  19.     protected String getConfigPath() {
  20.         return "path-to-my-struts-config-file-01.xml,path-to-my-struts-config-file-02.xml,";
  21.     }
  22. }