struts-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lukaszlen...@apache.org
Subject svn commit: r1406145 - in /struts/struts2/trunk: core/src/main/java/org/apache/struts2/util/fs/ core/src/test/java/org/apache/struts2/dispatcher/ plugins/oval/src/main/java/org/apache/struts2/oval/interceptor/ xwork-core/src/main/java/com/opensymphony/...
Date Tue, 06 Nov 2012 14:23:51 GMT
Author: lukaszlenart
Date: Tue Nov  6 14:23:51 2012
New Revision: 1406145

URL: http://svn.apache.org/viewvc?rev=1406145&view=rev
Log:
WW-3918 removes FileManager#isReloadConfigs() method and use @Inject("struts.configuration.xml.reload")

Modified:
    struts/struts2/trunk/core/src/main/java/org/apache/struts2/util/fs/JBossFileManager.java
    struts/struts2/trunk/core/src/test/java/org/apache/struts2/dispatcher/DispatcherTest.java
    struts/struts2/trunk/plugins/oval/src/main/java/org/apache/struts2/oval/interceptor/DefaultOValValidationManager.java
    struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/FileManager.java
    struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/config/ConfigurationManager.java
    struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/conversion/impl/XWorkConverter.java
    struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/util/fs/DefaultFileManager.java
    struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/validator/AnnotationActionValidatorManager.java
    struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/validator/DefaultActionValidatorManager.java
    struts/struts2/trunk/xwork-core/src/test/java/com/opensymphony/xwork2/util/DefaultFileManagerTest.java
    struts/struts2/trunk/xwork-core/src/test/java/com/opensymphony/xwork2/util/fs/DefaultFileManagerFactoryTest.java

Modified: struts/struts2/trunk/core/src/main/java/org/apache/struts2/util/fs/JBossFileManager.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/java/org/apache/struts2/util/fs/JBossFileManager.java?rev=1406145&r1=1406144&r2=1406145&view=diff
==============================================================================
--- struts/struts2/trunk/core/src/main/java/org/apache/struts2/util/fs/JBossFileManager.java
(original)
+++ struts/struts2/trunk/core/src/main/java/org/apache/struts2/util/fs/JBossFileManager.java
Tue Nov  6 14:23:51 2012
@@ -154,8 +154,9 @@ public class JBossFileManager extends De
     }
 
     private void readFile(List<URL> urls, File physicalFile) throws MalformedURLException
{
-        if (physicalFile.isDirectory()) {
-            for (File file : physicalFile.listFiles()) {
+        File[] files = physicalFile.listFiles();
+        if (physicalFile.isDirectory() && files != null) {
+            for (File file : files) {
                 if (file.isFile()) {
                     addIfAbsent(urls, file.toURI().toURL());
                 } else if (file.isDirectory()) {

Modified: struts/struts2/trunk/core/src/test/java/org/apache/struts2/dispatcher/DispatcherTest.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/test/java/org/apache/struts2/dispatcher/DispatcherTest.java?rev=1406145&r1=1406144&r2=1406145&view=diff
==============================================================================
--- struts/struts2/trunk/core/src/test/java/org/apache/struts2/dispatcher/DispatcherTest.java
(original)
+++ struts/struts2/trunk/core/src/test/java/org/apache/struts2/dispatcher/DispatcherTest.java
Tue Nov  6 14:23:51 2012
@@ -23,8 +23,8 @@ package org.apache.struts2.dispatcher;
 
 import com.mockobjects.dynamic.C;
 import com.mockobjects.dynamic.Mock;
-import com.opensymphony.xwork2.FileManagerFactory;
 import com.opensymphony.xwork2.ObjectFactory;
+import com.opensymphony.xwork2.XWorkConstants;
 import com.opensymphony.xwork2.config.Configuration;
 import com.opensymphony.xwork2.config.ConfigurationManager;
 import com.opensymphony.xwork2.config.entities.InterceptorMapping;
@@ -33,7 +33,6 @@ import com.opensymphony.xwork2.config.en
 import com.opensymphony.xwork2.inject.Container;
 import com.opensymphony.xwork2.interceptor.Interceptor;
 import com.opensymphony.xwork2.util.LocalizedTextUtil;
-import com.opensymphony.xwork2.util.fs.DefaultFileManagerFactory;
 import org.apache.struts2.StrutsConstants;
 import org.apache.struts2.StrutsTestCase;
 import org.apache.struts2.dispatcher.FilterDispatcherTest.InnerDestroyableObjectFactory;
@@ -194,17 +193,19 @@ public class DispatcherTest extends Stru
         cm.setConfiguration((Configuration)mockConfiguration.proxy());
         
         Mock mockContainer = new Mock(Container.class);
-        mockConfiguration.expectAndReturn("getContainer", mockContainer.proxy());
+        String reloadConfigs = container.getInstance(String.class, XWorkConstants.RELOAD_XML_CONFIGURATION);
+        mockContainer.expectAndReturn("getInstance", C.args(C.eq(String.class), C.eq(XWorkConstants.RELOAD_XML_CONFIGURATION)),
+                reloadConfigs);
         mockContainer.expectAndReturn("getInstance", C.args(C.eq(ObjectFactory.class)), destroyedObjectFactory);
+        mockContainer.expectAndReturn("getInstance", C.args(C.eq(String.class), C.eq(XWorkConstants.RELOAD_XML_CONFIGURATION)),
+                reloadConfigs);
+
+        mockConfiguration.expectAndReturn("getContainer", mockContainer.proxy());
         mockConfiguration.expectAndReturn("getContainer", mockContainer.proxy());
         mockConfiguration.expectAndReturn("getContainer", mockContainer.proxy());
-        FileManagerFactory fileManagerFactory = new DefaultFileManagerFactory();
-        container.inject(fileManagerFactory);
-        mockContainer.expectAndReturn("getInstance", C.args(C.eq(FileManagerFactory.class)),
fileManagerFactory);
-        mockContainer.expectAndReturn("getInstance", C.args(C.eq(FileManagerFactory.class)),
fileManagerFactory);
         mockConfiguration.expect("destroy");
         mockConfiguration.matchAndReturn("getPackageConfigs", new HashMap<String, PackageConfig>());
-        
+
         du.setConfigurationManager(cm);
         assertFalse(destroyedObjectFactory.destroyed);
         du.cleanup();
@@ -229,9 +230,11 @@ public class DispatcherTest extends Stru
         
         Mock mockContainer = new Mock(Container.class);
         mockContainer.matchAndReturn("getInstance", C.args(C.eq(ObjectFactory.class)), new
ObjectFactory());
-        DefaultFileManagerFactory factory = new DefaultFileManagerFactory();
-        container.inject(factory);
-        mockContainer.matchAndReturn("getInstance", C.args(C.eq(FileManagerFactory.class)),
factory);
+        String reloadConfigs = container.getInstance(String.class, XWorkConstants.RELOAD_XML_CONFIGURATION);
+        mockContainer.expectAndReturn("getInstance", C.args(C.eq(String.class), C.eq(XWorkConstants.RELOAD_XML_CONFIGURATION)),
+                reloadConfigs);
+        mockContainer.expectAndReturn("getInstance", C.args(C.eq(String.class), C.eq(XWorkConstants.RELOAD_XML_CONFIGURATION)),
+                reloadConfigs);
 
         Mock mockConfiguration = new Mock(Configuration.class);
         mockConfiguration.matchAndReturn("getPackageConfigs", packageConfigs);

Modified: struts/struts2/trunk/plugins/oval/src/main/java/org/apache/struts2/oval/interceptor/DefaultOValValidationManager.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/plugins/oval/src/main/java/org/apache/struts2/oval/interceptor/DefaultOValValidationManager.java?rev=1406145&r1=1406144&r2=1406145&view=diff
==============================================================================
--- struts/struts2/trunk/plugins/oval/src/main/java/org/apache/struts2/oval/interceptor/DefaultOValValidationManager.java
(original)
+++ struts/struts2/trunk/plugins/oval/src/main/java/org/apache/struts2/oval/interceptor/DefaultOValValidationManager.java
Tue Nov  6 14:23:51 2012
@@ -10,6 +10,7 @@ import net.sf.oval.configuration.Configu
 import net.sf.oval.configuration.annotation.AnnotationsConfigurer;
 import net.sf.oval.configuration.annotation.JPAAnnotationsConfigurer;
 import net.sf.oval.configuration.xml.XMLConfigurer;
+import org.apache.struts2.StrutsConstants;
 
 import java.net.URL;
 import java.util.ArrayList;
@@ -29,8 +30,14 @@ public class DefaultOValValidationManage
 
     protected boolean validateJPAAnnotations;
 
+    private boolean reloadConfigs;
     private FileManager fileManager;
 
+    @Inject(value = StrutsConstants.STRUTS_CONFIGURATION_XML_RELOAD, required = false)
+    public void setReloadingConfigs(String reloadingConfigs) {
+        this.reloadConfigs = Boolean.parseBoolean(reloadingConfigs);
+    }
+
     @Inject
     public void setFileManagerFactory(FileManagerFactory fileManagerFactory) {
         this.fileManager = fileManagerFactory.getFileManager();
@@ -41,7 +48,7 @@ public class DefaultOValValidationManage
         final String validatorKey = buildValidatorKey(clazz, context);
 
         if (validatorCache.containsKey(validatorKey)) {
-            if (fileManager.isReloadingConfigs()) {
+            if (reloadConfigs) {
                 List<Configurer> configurers = buildXMLConfigurers(clazz, context,
true, null);
 
                 //add an annotation configurer

Modified: struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/FileManager.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/FileManager.java?rev=1406145&r1=1406144&r2=1406145&view=diff
==============================================================================
--- struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/FileManager.java
(original)
+++ struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/FileManager.java
Tue Nov  6 14:23:51 2012
@@ -17,10 +17,8 @@ public interface FileManager {
      */
     void setReloadingConfigs(boolean reloadingConfigs);
 
-    boolean isReloadingConfigs();
-
     /**
-     * Checks if given file changed and must be reloaded if {@link #isReloadingConfigs()}
is true
+     * Checks if given file changed and must be reloaded if {@link #setReloadingConfigs(boolean)}
is true
      *
      * @param fileName to check
      * @return true if file changed
@@ -45,7 +43,7 @@ public interface FileManager {
     InputStream loadFile(URL fileUrl);
 
     /**
-     * Adds file to list of monitored files if {@link #isReloadingConfigs()} is true
+     * Adds file to list of monitored files if {@link #setReloadingConfigs(boolean)} is true
      *
      * @param fileUrl {@link URL} to file to be monitored
      */

Modified: struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/config/ConfigurationManager.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/config/ConfigurationManager.java?rev=1406145&r1=1406144&r2=1406145&view=diff
==============================================================================
--- struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/config/ConfigurationManager.java
(original)
+++ struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/config/ConfigurationManager.java
Tue Nov  6 14:23:51 2012
@@ -15,8 +15,7 @@
  */
 package com.opensymphony.xwork2.config;
 
-import com.opensymphony.xwork2.FileManager;
-import com.opensymphony.xwork2.FileManagerFactory;
+import com.opensymphony.xwork2.XWorkConstants;
 import com.opensymphony.xwork2.config.impl.DefaultConfiguration;
 import com.opensymphony.xwork2.config.providers.XWorkConfigurationProvider;
 import com.opensymphony.xwork2.config.providers.XmlConfigurationProvider;
@@ -173,8 +172,8 @@ public class ConfigurationManager {
      * @param container current container used to obtain instance of {@link com.opensymphony.xwork2.util.fs.DefaultFileManager}
      */
     public synchronized void conditionalReload(Container container) {
-        FileManager fileManager = container.getInstance(FileManagerFactory.class).getFileManager();
-        if (fileManager.isReloadingConfigs() || providersChanged) {
+        boolean reloadConfigs = Boolean.parseBoolean(container.getInstance(String.class,
XWorkConstants.RELOAD_XML_CONFIGURATION));
+        if (reloadConfigs || providersChanged) {
             if (LOG.isDebugEnabled()) {
                 LOG.debug("Checking ConfigurationProviders for reload.");
             }

Modified: struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/conversion/impl/XWorkConverter.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/conversion/impl/XWorkConverter.java?rev=1406145&r1=1406144&r2=1406145&view=diff
==============================================================================
--- struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/conversion/impl/XWorkConverter.java
(original)
+++ struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/conversion/impl/XWorkConverter.java
Tue Nov  6 14:23:51 2012
@@ -19,6 +19,7 @@ import com.opensymphony.xwork2.ActionCon
 import com.opensymphony.xwork2.FileManager;
 import com.opensymphony.xwork2.FileManagerFactory;
 import com.opensymphony.xwork2.ObjectFactory;
+import com.opensymphony.xwork2.XWorkConstants;
 import com.opensymphony.xwork2.XWorkMessages;
 import com.opensymphony.xwork2.XWorkException;
 import com.opensymphony.xwork2.conversion.TypeConverter;
@@ -184,6 +185,7 @@ public class XWorkConverter extends Defa
     private TypeConverter defaultTypeConverter;
     private ObjectFactory objectFactory;
     private FileManager fileManager;
+    private boolean reloadingConfigs;
 
     protected XWorkConverter() {
     }
@@ -207,6 +209,11 @@ public class XWorkConverter extends Defa
         this.fileManager = fileManagerFactory.getFileManager();
     }
 
+    @Inject(value = XWorkConstants.RELOAD_XML_CONFIGURATION, required = false)
+    public void setReloadingConfigs(String reloadingConfigs) {
+        this.reloadingConfigs = Boolean.parseBoolean(reloadingConfigs);
+    }
+
     public static String getConversionErrorMessage(String propertyName, ValueStack stack)
{
         String defaultMessage = LocalizedTextUtil.findDefaultText(XWorkMessages.DEFAULT_INVALID_FIELDVALUE,
                 ActionContext.getContext().getLocale(),
@@ -744,7 +751,7 @@ public class XWorkConverter extends Defa
     private Map<String, Object> conditionalReload(Class clazz, Map<String, Object>
oldValues) throws Exception {
         Map<String, Object> mapping = oldValues;
 
-        if (fileManager.isReloadingConfigs()) {
+        if (reloadingConfigs) {
             URL fileUrl = ClassLoaderUtil.getResource(buildConverterFilename(clazz), clazz);
             if (fileManager.fileNeedsReloading(fileUrl.toString())) {
                 mapping = buildConverterMapping(clazz);

Modified: struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/util/fs/DefaultFileManager.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/util/fs/DefaultFileManager.java?rev=1406145&r1=1406144&r2=1406145&view=diff
==============================================================================
--- struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/util/fs/DefaultFileManager.java
(original)
+++ struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/util/fs/DefaultFileManager.java
Tue Nov  6 14:23:51 2012
@@ -52,10 +52,6 @@ public class DefaultFileManager implemen
         this.reloadingConfigs = reloadingConfigs;
     }
 
-    public boolean isReloadingConfigs() {
-        return reloadingConfigs;
-    }
-
     public boolean fileNeedsReloading(URL fileUrl) {
         return fileUrl != null && fileNeedsReloading(fileUrl.toString());
     }

Modified: struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/validator/AnnotationActionValidatorManager.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/validator/AnnotationActionValidatorManager.java?rev=1406145&r1=1406144&r2=1406145&view=diff
==============================================================================
--- struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/validator/AnnotationActionValidatorManager.java
(original)
+++ struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/validator/AnnotationActionValidatorManager.java
Tue Nov  6 14:23:51 2012
@@ -21,6 +21,7 @@ import com.opensymphony.xwork2.ActionInv
 import com.opensymphony.xwork2.ActionProxy;
 import com.opensymphony.xwork2.FileManager;
 import com.opensymphony.xwork2.FileManagerFactory;
+import com.opensymphony.xwork2.XWorkConstants;
 import com.opensymphony.xwork2.config.entities.ActionConfig;
 import com.opensymphony.xwork2.inject.Inject;
 import com.opensymphony.xwork2.util.ClassLoaderUtil;
@@ -63,6 +64,7 @@ public class AnnotationActionValidatorMa
     private ValidatorFactory validatorFactory;
     private ValidatorFileParser validatorFileParser;
     private FileManager fileManager;
+    private boolean reloadingConfigs;
 
     @Inject
     public void setValidatorFactory(ValidatorFactory fac) {
@@ -79,6 +81,11 @@ public class AnnotationActionValidatorMa
         this.fileManager = fileManagerFactory.getFileManager();
     }
 
+    @Inject(value = XWorkConstants.RELOAD_XML_CONFIGURATION, required = false)
+    public void setReloadingConfigs(String reloadingConfigs) {
+        this.reloadingConfigs = Boolean.parseBoolean(reloadingConfigs);
+    }
+
     public List<Validator> getValidators(Class clazz, String context) {
         return getValidators(clazz, context, null);
     }
@@ -88,7 +95,7 @@ public class AnnotationActionValidatorMa
         final List<ValidatorConfig> cfgs;
 
         if (validatorCache.containsKey(validatorKey)) {
-            if (fileManager.isReloadingConfigs()) {
+            if (reloadingConfigs) {
                 validatorCache.put(validatorKey, buildValidatorConfigs(clazz, context, true,
null));
             }
         } else {

Modified: struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/validator/DefaultActionValidatorManager.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/validator/DefaultActionValidatorManager.java?rev=1406145&r1=1406144&r2=1406145&view=diff
==============================================================================
--- struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/validator/DefaultActionValidatorManager.java
(original)
+++ struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/validator/DefaultActionValidatorManager.java
Tue Nov  6 14:23:51 2012
@@ -18,6 +18,7 @@ package com.opensymphony.xwork2.validato
 import com.opensymphony.xwork2.ActionContext;
 import com.opensymphony.xwork2.FileManager;
 import com.opensymphony.xwork2.FileManagerFactory;
+import com.opensymphony.xwork2.XWorkConstants;
 import com.opensymphony.xwork2.inject.Inject;
 import com.opensymphony.xwork2.util.ClassLoaderUtil;
 import com.opensymphony.xwork2.util.ValueStack;
@@ -55,6 +56,7 @@ public class DefaultActionValidatorManag
     private ValidatorFactory validatorFactory;
     private ValidatorFileParser validatorFileParser;
     private FileManager fileManager;
+    private boolean reloadingConfigs;
 
     @Inject
     public void setValidatorFileParser(ValidatorFileParser parser) {
@@ -71,6 +73,11 @@ public class DefaultActionValidatorManag
         this.fileManager = fileManagerFactory.getFileManager();
     }
 
+    @Inject(value = XWorkConstants.RELOAD_XML_CONFIGURATION, required = false)
+    public void setReloadingConfigs(String reloadingConfigs) {
+        this.reloadingConfigs = Boolean.parseBoolean(reloadingConfigs);
+    }
+
     public synchronized List<Validator> getValidators(Class clazz, String context)
{
         return getValidators(clazz, context, null);
     }
@@ -79,7 +86,7 @@ public class DefaultActionValidatorManag
         final String validatorKey = buildValidatorKey(clazz, context);
 
         if (validatorCache.containsKey(validatorKey)) {
-            if (fileManager.isReloadingConfigs()) {
+            if (reloadingConfigs) {
                 validatorCache.put(validatorKey, buildValidatorConfigs(clazz, context, true,
null));
             }
         } else {

Modified: struts/struts2/trunk/xwork-core/src/test/java/com/opensymphony/xwork2/util/DefaultFileManagerTest.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/xwork-core/src/test/java/com/opensymphony/xwork2/util/DefaultFileManagerTest.java?rev=1406145&r1=1406144&r2=1406145&view=diff
==============================================================================
--- struts/struts2/trunk/xwork-core/src/test/java/com/opensymphony/xwork2/util/DefaultFileManagerTest.java
(original)
+++ struts/struts2/trunk/xwork-core/src/test/java/com/opensymphony/xwork2/util/DefaultFileManagerTest.java
Tue Nov  6 14:23:51 2012
@@ -4,8 +4,11 @@ import com.opensymphony.xwork2.FileManag
 import com.opensymphony.xwork2.FileManagerFactory;
 import com.opensymphony.xwork2.XWorkTestCase;
 
+import java.io.File;
 import java.io.InputStream;
+import java.net.URISyntaxException;
 import java.net.URL;
+import java.util.Date;
 
 /**
  * FileManager Tester.
@@ -17,6 +20,7 @@ import java.net.URL;
 public class DefaultFileManagerTest extends XWorkTestCase {
 
     private FileManager fileManager;
+    private long lastModified;
 
     @Override
     public void setUp() throws Exception {
@@ -47,14 +51,30 @@ public class DefaultFileManagerTest exte
         // given
         container.getInstance(FileManagerFactory.class).setReloadingConfigs("false");
         FileManager fm = container.getInstance(FileManagerFactory.class).getFileManager();
-        assertFalse(fm.isReloadingConfigs());
+        String resourceName = "xwork-sample.xml";
+        URL url = ClassLoaderUtil.getResource(resourceName, DefaultFileManagerTest.class);
+        assertFalse(fm.fileNeedsReloading(url));
 
         // when
         container.getInstance(FileManagerFactory.class).setReloadingConfigs("true");
-        fm = container.getInstance(FileManagerFactory.class).getFileManager();
+        changeLastModified(resourceName);
 
         // then
-        assertTrue(fm.isReloadingConfigs());
+        url = ClassLoaderUtil.getResource(resourceName, DefaultFileManagerTest.class);
+        fm = container.getInstance(FileManagerFactory.class).getFileManager();
+        assertTrue("Url is " + url, fm.fileNeedsReloading(url));
+        restoreLastModified(resourceName);
+    }
+
+    private void changeLastModified(String resourceName) throws URISyntaxException {
+        URL url = ClassLoaderUtil.getResource(resourceName, DefaultFileManagerTest.class);
+        lastModified = new File(url.toURI()).lastModified();
+        new File(url.toURI()).setLastModified(new Date().getTime() - 1000*10);
+    }
+
+    private void restoreLastModified(String resourceName) throws URISyntaxException {
+        URL url = ClassLoaderUtil.getResource(resourceName, DefaultFileManagerTest.class);
+        new File(url.toURI()).setLastModified(lastModified);
     }
 
 }

Modified: struts/struts2/trunk/xwork-core/src/test/java/com/opensymphony/xwork2/util/fs/DefaultFileManagerFactoryTest.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/xwork-core/src/test/java/com/opensymphony/xwork2/util/fs/DefaultFileManagerFactoryTest.java?rev=1406145&r1=1406144&r2=1406145&view=diff
==============================================================================
--- struts/struts2/trunk/xwork-core/src/test/java/com/opensymphony/xwork2/util/fs/DefaultFileManagerFactoryTest.java
(original)
+++ struts/struts2/trunk/xwork-core/src/test/java/com/opensymphony/xwork2/util/fs/DefaultFileManagerFactoryTest.java
Tue Nov  6 14:23:51 2012
@@ -101,10 +101,6 @@ class DummyFileManager implements FileMa
     public void setReloadingConfigs(boolean reloadingConfigs) {
     }
 
-    public boolean isReloadingConfigs() {
-        return false;
-    }
-
     public boolean fileNeedsReloading(String fileName) {
         return false;
     }



Mime
View raw message