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

    ac = ActionContext.getContext();
    ac.setLocale(Locale.US);
    context = ac.getContextMap();
  }
  @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);
  }
  @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();
 }
Exemple #8
0
 protected void setUp() throws Exception {
   super.setUp();
   action = new LoginAction();
   action.session = new HashMap<String, Object>();
 }
 /** Set up instance variables required by this test case. */
 @Override
 public void setUp() throws Exception {
   super.setUp();
   inter = new ScopedModelDrivenInterceptor();
   inter.setObjectFactory(new ProxyObjectFactory());
 }
Exemple #10
0
 @Override
 public void setUp() throws Exception {
   super.setUp();
   ognlUtil = container.getInstance(OgnlUtil.class);
 }