Package com.opensymphony.xwork2.util.fs

Examples of com.opensymphony.xwork2.util.fs.DefaultFileManager


        if (excludePackages != null) {
            builder.setExcludePackages(excludePackages);
        }
        DefaultFileManagerFactory fileManagerFactory = new DefaultFileManagerFactory();
        fileManagerFactory.setContainer(ActionContext.getContext().getContainer());
        fileManagerFactory.setFileManager(new DefaultFileManager());
        builder.setFileManagerFactory(fileManagerFactory);
        builder.setPackageLocatorsBase("org.apache.struts2.convention.actions");
        builder.buildActionConfigs();
        verify(resultMapBuilder);
View Full Code Here


    public void testInterceptorStackParamOveriding() throws Exception {
      DefaultConfiguration conf = new DefaultConfiguration();
      final XmlConfigurationProvider p = new XmlConfigurationProvider("com/opensymphony/xwork2/config/providers/xwork-test-interceptor-stack-param-overriding.xml");
        DefaultFileManagerFactory factory = new DefaultFileManagerFactory();
        factory.setContainer(container);
        factory.setFileManager(new DefaultFileManager());
        p.setFileManagerFactory(factory);
      configurationManager.addContainerProvider(p);
        conf.reload(new ArrayList<ConfigurationProvider>(){
            {
                add(new XWorkConfigurationProvider());
View Full Code Here

    public void testInterceptorParamOveriding() throws Exception {
        DefaultConfiguration conf = new DefaultConfiguration();
        final XmlConfigurationProvider p = new XmlConfigurationProvider("com/opensymphony/xwork2/config/providers/xwork-test-interceptor-param-overriding.xml");
        DefaultFileManagerFactory factory = new DefaultFileManagerFactory();
        factory.setContainer(container);
        factory.setFileManager(new DefaultFileManager());
        p.setFileManagerFactory(factory);
        conf.reload(new ArrayList<ConfigurationProvider>() {
            {
                add(new XWorkConfigurationProvider());
                add(p);
View Full Code Here

        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);
    }
View Full Code Here

public class FreemarkerManagerTest extends StrutsTestCase {

    public void testIfStrutsEncodingIsSetProperty() throws Exception {
        FreemarkerManager mgr = new FreemarkerManager();
        mgr.setEncoding("UTF-8");
        mgr.setFileManager(new DefaultFileManager());
        StrutsMockServletContext servletContext = new StrutsMockServletContext();
        servletContext.setAttribute(FreemarkerManager.CONFIG_SERVLET_CONTEXT_KEY, null);
        freemarker.template.Configuration conf = mgr.getConfiguration(servletContext);
        assertEquals(conf.getDefaultEncoding(), "UTF-8");
    }
View Full Code Here

public class XmlConfigurationProviderInterceptorStackParamOverridingTest extends XWorkTestCase {
   
    public void testInterceptorStackParamOveriding() throws Exception {
      DefaultConfiguration conf = new DefaultConfiguration();
      final XmlConfigurationProvider p = new XmlConfigurationProvider("com/opensymphony/xwork2/config/providers/xwork-test-interceptor-stack-param-overriding.xml");
        p.setFileManager(new DefaultFileManager());
      configurationManager.addContainerProvider(p);
        conf.reload(new ArrayList<ConfigurationProvider>(){
            {
                add(new XWorkConfigurationProvider());
                add(p);
View Full Code Here

public class XmlConfigurationProviderInterceptorParamOverridingTest extends XWorkTestCase {

    public void testInterceptorParamOveriding() throws Exception {
        DefaultConfiguration conf = new DefaultConfiguration();
        final XmlConfigurationProvider p = new XmlConfigurationProvider("com/opensymphony/xwork2/config/providers/xwork-test-interceptor-param-overriding.xml");
        p.setFileManager(new DefaultFileManager());
        conf.reload(new ArrayList<ConfigurationProvider>() {
            {
                add(new XWorkConfigurationProvider());
                add(p);
            }
View Full Code Here

        Mock mockContainer = new Mock(Container.class);
        mockConfiguration.expectAndReturn("getContainer", mockContainer.proxy());
        mockContainer.expectAndReturn("getInstance", C.args(C.eq(ObjectFactory.class)), destroyedObjectFactory);
        mockConfiguration.expectAndReturn("getContainer", mockContainer.proxy());
        mockConfiguration.expectAndReturn("getContainer", mockContainer.proxy());
        FileManager fileManager = new DefaultFileManager();
        mockContainer.expectAndReturn("getInstance", C.args(C.eq(FileManager.class)), fileManager);
        mockContainer.expectAndReturn("getInstance", C.args(C.eq(FileManager.class)), fileManager);
        mockConfiguration.expect("destroy");
        mockConfiguration.matchAndReturn("getPackageConfigs", new HashMap<String, PackageConfig>());
       
View Full Code Here

        Map<String, PackageConfig> packageConfigs = new HashMap<String, PackageConfig>();
        packageConfigs.put("test", packageConfig);
       
        Mock mockContainer = new Mock(Container.class);
        mockContainer.matchAndReturn("getInstance", C.args(C.eq(ObjectFactory.class)), new ObjectFactory());
        mockContainer.matchAndReturn("getInstance", C.args(C.eq(FileManager.class)), new DefaultFileManager());

        Mock mockConfiguration = new Mock(Configuration.class);
        mockConfiguration.matchAndReturn("getPackageConfigs", packageConfigs);
        mockConfiguration.matchAndReturn("getContainer", mockContainer.proxy());
        mockConfiguration.expect("destroy");
View Full Code Here

        actionValidatorManager.setValidatorFileParser((ValidatorFileParser)mockValidatorFileParser.proxy());

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

        actionValidatorManager.setFileManager(new DefaultFileManager());

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

TOP

Related Classes of com.opensymphony.xwork2.util.fs.DefaultFileManager

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.