-
Notifications
You must be signed in to change notification settings - Fork 817
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WW-5382 Rework existing Dispatcher tests and base test classes
- Loading branch information
Showing
14 changed files
with
287 additions
and
384 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 0 additions & 59 deletions
59
core/src/main/java/org/apache/struts2/dispatcher/MockDispatcher.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
core/src/test/java/org/apache/struts2/StrutsJUnit4InternalTestCase.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package org.apache.struts2; | ||
|
||
import com.opensymphony.xwork2.ActionProxyFactory; | ||
import com.opensymphony.xwork2.XWorkJUnit4TestCase; | ||
import org.apache.struts2.dispatcher.Dispatcher; | ||
import org.apache.struts2.util.StrutsTestCaseHelper; | ||
import org.apache.struts2.views.jsp.StrutsMockServletContext; | ||
import org.junit.After; | ||
import org.junit.Before; | ||
|
||
import java.util.Map; | ||
|
||
public class StrutsJUnit4InternalTestCase extends XWorkJUnit4TestCase { | ||
|
||
protected StrutsMockServletContext servletContext; | ||
protected Dispatcher dispatcher; | ||
|
||
@Override | ||
@Before | ||
public void setUp() throws Exception { | ||
initDispatcher(); | ||
} | ||
|
||
@Override | ||
@After | ||
public void tearDown() throws Exception { | ||
StrutsTestCaseHelper.tearDown(dispatcher); | ||
} | ||
|
||
protected void initDispatcher() { | ||
initDispatcher(null); | ||
} | ||
|
||
protected void initDispatcher(Map<String, String> params) { | ||
StrutsTestCaseHelper.tearDown(); | ||
servletContext = new StrutsMockServletContext(); | ||
dispatcher = StrutsTestCaseHelper.initDispatcher(servletContext, params); | ||
configurationManager = dispatcher.getConfigurationManager(); | ||
configuration = configurationManager.getConfiguration(); | ||
container = configuration.getContainer(); | ||
actionProxyFactory = container.getInstance(ActionProxyFactory.class); | ||
} | ||
} |
Oops, something went wrong.