コード例 #1
0
 @Override
 protected void setUp() throws Exception {
   super.setUp();
   XmlConfigurationProvider provider = new XmlConfigurationProvider("xwork-test-beans.xml");
   container.inject(provider);
   loadConfigurationProviders(provider, new MockConfigurationProvider());
 }
コード例 #2
0
 @Override
 protected void tearDown() throws Exception {
   actionValidatorManager = null;
   super.tearDown();
   mockValidatorFactory = null;
   mockValidatorFileParser = null;
 }
コード例 #3
0
  @Override
  protected void setUp() throws Exception {
    super.setUp();
    converter = container.getInstance(XWorkConverter.class);

    ac = ActionContext.getContext();
    ac.setLocale(Locale.US);
    context = ac.getContextMap();
  }
コード例 #4
0
  @Override
  protected void setUp() throws Exception {
    super.setUp();

    XmlConfigurationProvider provider1 = new XmlConfigurationProvider("xwork-default.xml");
    container.inject(provider1);
    XmlConfigurationProvider provider2 = new XmlConfigurationProvider("xwork-test-validation.xml");
    container.inject(provider2);
    loadConfigurationProviders(provider1, provider2);
  }
コード例 #5
0
  @Override
  protected void setUp() throws Exception {
    actionValidatorManager = new DefaultActionValidatorManager();
    super.setUp();
    mockValidatorFileParser = new Mock(ValidatorFileParser.class);
    actionValidatorManager.setValidatorFileParser(
        (ValidatorFileParser) mockValidatorFileParser.proxy());

    mockValidatorFactory = new Mock(ValidatorFactory.class);
    actionValidatorManager.setValidatorFactory((ValidatorFactory) mockValidatorFactory.proxy());

    stubValueStack = new StubValueStack();
    ActionContext.setContext(new ActionContext(new HashMap<String, Object>()));
    ActionContext.getContext().setValueStack(stubValueStack);

    DefaultFileManagerFactory factory = new DefaultFileManagerFactory();
    factory.setContainer(container);
    factory.setFileManager(new DefaultFileManager());
    actionValidatorManager.setFileManagerFactory(factory);
  }
  @Override
  protected void setUp() throws Exception {
    super.setUp();
    annotationActionValidatorManager =
        (AnnotationActionValidatorManager) container.getInstance(ActionValidatorManager.class);

    ActionConfig config = new ActionConfig.Builder("packageName", "name", "").build();
    ActionInvocation invocation = EasyMock.createNiceMock(ActionInvocation.class);
    ActionProxy proxy = EasyMock.createNiceMock(ActionProxy.class);

    EasyMock.expect(invocation.getProxy()).andReturn(proxy).anyTimes();
    EasyMock.expect(invocation.getAction()).andReturn(null).anyTimes();
    EasyMock.expect(invocation.invoke()).andReturn(Action.SUCCESS).anyTimes();
    EasyMock.expect(proxy.getMethod()).andReturn("execute").anyTimes();
    EasyMock.expect(proxy.getConfig()).andReturn(config).anyTimes();

    EasyMock.replay(invocation);
    EasyMock.replay(proxy);

    ActionContext.getContext().setActionInvocation(invocation);
  }
 @Override
 protected void tearDown() throws Exception {
   annotationActionValidatorManager = null;
   super.tearDown();
 }
コード例 #8
0
ファイル: LoginActionTest.java プロジェクト: redback/redback
 protected void setUp() throws Exception {
   super.setUp();
   action = new LoginAction();
   action.session = new HashMap<String, Object>();
 }
コード例 #9
0
 /** Set up instance variables required by this test case. */
 @Override
 public void setUp() throws Exception {
   super.setUp();
   inter = new ScopedModelDrivenInterceptor();
   inter.setObjectFactory(new ProxyObjectFactory());
 }
コード例 #10
0
ファイル: OgnlUtilTest.java プロジェクト: krosenvold/struts2
 @Override
 public void setUp() throws Exception {
   super.setUp();
   ognlUtil = container.getInstance(OgnlUtil.class);
 }