sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r1794605 - in /sling/trunk/testing/junit/scriptable: ./ src/main/java/org/apache/sling/junit/scriptable/
Date Tue, 09 May 2017 16:10:01 GMT
Author: cziegeler
Date: Tue May  9 16:10:00 2017
New Revision: 1794605

URL: http://svn.apache.org/viewvc?rev=1794605&view=rev
Log:
Update to parent pom 30 and R6 OSGi annotations

Modified:
    sling/trunk/testing/junit/scriptable/pom.xml
    sling/trunk/testing/junit/scriptable/src/main/java/org/apache/sling/junit/scriptable/HttpRequest.java
    sling/trunk/testing/junit/scriptable/src/main/java/org/apache/sling/junit/scriptable/HttpResponse.java
    sling/trunk/testing/junit/scriptable/src/main/java/org/apache/sling/junit/scriptable/ScriptableTestsProvider.java
    sling/trunk/testing/junit/scriptable/src/main/java/org/apache/sling/junit/scriptable/TestServletOutputStream.java

Modified: sling/trunk/testing/junit/scriptable/pom.xml
URL: http://svn.apache.org/viewvc/sling/trunk/testing/junit/scriptable/pom.xml?rev=1794605&r1=1794604&r2=1794605&view=diff
==============================================================================
--- sling/trunk/testing/junit/scriptable/pom.xml (original)
+++ sling/trunk/testing/junit/scriptable/pom.xml Tue May  9 16:10:00 2017
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.sling</groupId>
         <artifactId>sling</artifactId>
-        <version>26</version>
+        <version>30</version>
         <relativePath />
     </parent>
 
@@ -47,10 +47,6 @@
         <plugins>
             <plugin>
                 <groupId>org.apache.felix</groupId>
-                <artifactId>maven-scr-plugin</artifactId>
-            </plugin>
-            <plugin>
-                <groupId>org.apache.felix</groupId>
                 <artifactId>maven-bundle-plugin</artifactId>
                 <extensions>true</extensions>
                 <configuration>
@@ -67,16 +63,7 @@
     <dependencies>
         <dependency>
             <groupId>org.osgi</groupId>
-            <artifactId>org.osgi.core</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.osgi</groupId>
-            <artifactId>org.osgi.compendium</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.felix</groupId>
-            <artifactId>org.apache.felix.scr.annotations</artifactId>
-            <scope>provided</scope>
+            <artifactId>osgi.core</artifactId>
         </dependency>
         <dependency>
             <groupId>org.apache.sling</groupId>
@@ -115,19 +102,15 @@
         <dependency>
             <groupId>junit</groupId>
             <artifactId>junit</artifactId>
-            <version>4.8.2</version>
-            <scope>provided</scope>
+            <scope>compile</scope>
         </dependency>
         <dependency>
             <groupId>javax.servlet</groupId>
-            <artifactId>servlet-api</artifactId>
-            <version>2.4</version>
+            <artifactId>javax.servlet-api</artifactId>
         </dependency>
         <dependency>
             <groupId>org.slf4j</groupId>
             <artifactId>slf4j-api</artifactId>
-            <version>1.5.11</version>
-            <scope>provided</scope>
         </dependency>
     </dependencies>
 </project>

Modified: sling/trunk/testing/junit/scriptable/src/main/java/org/apache/sling/junit/scriptable/HttpRequest.java
URL: http://svn.apache.org/viewvc/sling/trunk/testing/junit/scriptable/src/main/java/org/apache/sling/junit/scriptable/HttpRequest.java?rev=1794605&r1=1794604&r2=1794605&view=diff
==============================================================================
--- sling/trunk/testing/junit/scriptable/src/main/java/org/apache/sling/junit/scriptable/HttpRequest.java
(original)
+++ sling/trunk/testing/junit/scriptable/src/main/java/org/apache/sling/junit/scriptable/HttpRequest.java
Tue May  9 16:10:00 2017
@@ -20,16 +20,26 @@ import java.io.BufferedReader;
 import java.io.IOException;
 import java.io.UnsupportedEncodingException;
 import java.security.Principal;
+import java.util.Collection;
 import java.util.Enumeration;
 import java.util.HashMap;
 import java.util.Locale;
 import java.util.Map;
 
+import javax.servlet.AsyncContext;
+import javax.servlet.DispatcherType;
 import javax.servlet.RequestDispatcher;
+import javax.servlet.ServletContext;
+import javax.servlet.ServletException;
 import javax.servlet.ServletInputStream;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
 import javax.servlet.http.Cookie;
 import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
 import javax.servlet.http.HttpSession;
+import javax.servlet.http.HttpUpgradeHandler;
+import javax.servlet.http.Part;
 
 /** Fake request used to acquire content from Sling */
 public class HttpRequest implements HttpServletRequest {
@@ -37,227 +47,363 @@ public class HttpRequest implements Http
     public static final String FAKE_URL_BASE = "http://example.com";
     private final String path;
     private final Map<String, Object> attributes;
-    private final Map<String, String> parameters;
-    
+    private final Map<String, String[]> parameters;
+
     HttpRequest(String path) {
         this.path = path;
-        attributes = new HashMap<String, Object>();
-        parameters = new HashMap<String, String>();
+        attributes = new HashMap<>();
+        parameters = new HashMap<>();
     }
-    
+
+    @Override
     public String getAuthType() {
         return null;
     }
 
+    @Override
     public String getContextPath() {
         return "";
     }
 
+    @Override
     public Cookie[] getCookies() {
         return null;
     }
 
+    @Override
     public long getDateHeader(String name) {
         return 0;
     }
 
+    @Override
     public String getHeader(String name) {
         return null;
     }
 
-    public Enumeration<?> getHeaderNames() {
+    @Override
+    public Enumeration<String> getHeaderNames() {
         return null;
     }
 
-    public Enumeration<?> getHeaders(String name) {
+    @Override
+    public Enumeration<String> getHeaders(String name) {
         return null;
     }
 
+    @Override
     public int getIntHeader(String name) {
         return 0;
     }
 
+    @Override
     public String getMethod() {
         return "GET";
     }
 
+    @Override
     public String getPathInfo() {
         return null;
     }
 
+    @Override
     public String getPathTranslated() {
         return null;
     }
 
+    @Override
     public String getQueryString() {
         return null;
     }
 
+    @Override
     public String getRemoteUser() {
         return null;
     }
 
+    @Override
     public String getRequestedSessionId() {
         return null;
     }
 
+    @Override
     public String getRequestURI() {
         return path;
     }
 
+    @Override
     public StringBuffer getRequestURL() {
         return new StringBuffer(FAKE_URL_BASE + path);
     }
 
+    @Override
     public String getServletPath() {
-        return path; 
+        return path;
     }
 
+    @Override
     public HttpSession getSession() {
         return null;
     }
 
+    @Override
     public HttpSession getSession(boolean create) {
         return null;
     }
 
+    @Override
     public Principal getUserPrincipal() {
         return null;
     }
 
+    @Override
     public boolean isRequestedSessionIdFromCookie() {
         return false;
     }
 
+    @Override
     public boolean isRequestedSessionIdFromUrl() {
         return false;
     }
 
+    @Override
     public boolean isRequestedSessionIdFromURL() {
         return false;
     }
 
+    @Override
     public boolean isRequestedSessionIdValid() {
         return false;
     }
 
+    @Override
     public boolean isUserInRole(String role) {
         return false;
     }
 
+    @Override
     public Object getAttribute(String name) {
         return attributes.get(name);
     }
 
-    public Enumeration<?> getAttributeNames() {
+    @Override
+    public Enumeration<String> getAttributeNames() {
         return null;
     }
 
+    @Override
     public String getCharacterEncoding() {
         return null;
     }
 
+    @Override
     public int getContentLength() {
         return 0;
     }
 
+    @Override
     public String getContentType() {
         return null;
     }
 
+    @Override
     public ServletInputStream getInputStream() throws IOException {
         return null;
     }
 
+    @Override
     public String getLocalAddr() {
         return null;
     }
 
+    @Override
     public Locale getLocale() {
         return null;
     }
 
-    public Enumeration<?> getLocales() {
+    @Override
+    public Enumeration<Locale> getLocales() {
         return null;
     }
 
+    @Override
     public String getLocalName() {
         return null;
     }
 
+    @Override
     public int getLocalPort() {
         return 0;
     }
 
+    @Override
     public String getParameter(String name) {
         return null;
     }
 
-    public Map<?,?> getParameterMap() {
+    @Override
+    public Map<String, String[]> getParameterMap() {
         return parameters;
     }
 
-    public Enumeration<?> getParameterNames() {
+    @Override
+    public Enumeration<String> getParameterNames() {
         return null;
     }
 
+    @Override
     public String[] getParameterValues(String name) {
         return null;
     }
 
+    @Override
     public String getProtocol() {
         return null;
     }
 
+    @Override
     public BufferedReader getReader() throws IOException {
         return null;
     }
 
+    @Override
     public String getRealPath(String path) {
         return null;
     }
 
+    @Override
     public String getRemoteAddr() {
         return null;
     }
 
+    @Override
     public String getRemoteHost() {
         return null;
     }
 
+    @Override
     public int getRemotePort() {
         return 0;
     }
 
+    @Override
     public RequestDispatcher getRequestDispatcher(String path) {
         return null;
     }
 
+    @Override
     public String getScheme() {
         return "http";
     }
 
+    @Override
     public String getServerName() {
         return null;
     }
 
+    @Override
     public int getServerPort() {
         return 0;
     }
 
+    @Override
     public boolean isSecure() {
         return false;
     }
 
+    @Override
     public void removeAttribute(String name) {
         attributes.remove(name);
     }
 
+    @Override
     public void setAttribute(String name, Object o) {
         attributes.put(name, o);
     }
 
+    @Override
     public void setCharacterEncoding(String env)
             throws UnsupportedEncodingException {
     }
+
+    @Override
+    public long getContentLengthLong() {
+        // TODO Auto-generated method stub
+        return 0;
+    }
+
+    @Override
+    public ServletContext getServletContext() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    @Override
+    public AsyncContext startAsync() throws IllegalStateException {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    @Override
+    public AsyncContext startAsync(ServletRequest servletRequest, ServletResponse servletResponse)
+            throws IllegalStateException {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    @Override
+    public boolean isAsyncStarted() {
+        // TODO Auto-generated method stub
+        return false;
+    }
+
+    @Override
+    public boolean isAsyncSupported() {
+        // TODO Auto-generated method stub
+        return false;
+    }
+
+    @Override
+    public AsyncContext getAsyncContext() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    @Override
+    public DispatcherType getDispatcherType() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    @Override
+    public String changeSessionId() {
+        return null;
+    }
+
+    @Override
+    public boolean authenticate(HttpServletResponse response) throws IOException, ServletException
{
+        return false;
+    }
+
+    @Override
+    public void login(String username, String password) throws ServletException {
+    }
+
+    @Override
+    public void logout() throws ServletException {
+    }
+
+    @Override
+    public Collection<Part> getParts() throws IOException, ServletException {
+        return null;
+    }
+
+    @Override
+    public Part getPart(String name) throws IOException, ServletException {
+        return null;
+    }
+
+    @Override
+    public <T extends HttpUpgradeHandler> T upgrade(Class<T> handlerClass) throws
IOException, ServletException {
+        return null;
+    }
 }

Modified: sling/trunk/testing/junit/scriptable/src/main/java/org/apache/sling/junit/scriptable/HttpResponse.java
URL: http://svn.apache.org/viewvc/sling/trunk/testing/junit/scriptable/src/main/java/org/apache/sling/junit/scriptable/HttpResponse.java?rev=1794605&r1=1794604&r2=1794605&view=diff
==============================================================================
--- sling/trunk/testing/junit/scriptable/src/main/java/org/apache/sling/junit/scriptable/HttpResponse.java
(original)
+++ sling/trunk/testing/junit/scriptable/src/main/java/org/apache/sling/junit/scriptable/HttpResponse.java
Tue May  9 16:10:00 2017
@@ -20,6 +20,7 @@ import java.io.IOException;
 import java.io.OutputStreamWriter;
 import java.io.PrintWriter;
 import java.io.UnsupportedEncodingException;
+import java.util.Collection;
 import java.util.Locale;
 
 import javax.servlet.ServletOutputStream;
@@ -35,125 +36,157 @@ public class HttpResponse implements Htt
     private String contentType;
     private final TestServletOutputStream outputStream;
     private final PrintWriter writer;
-    
+
     HttpResponse() throws UnsupportedEncodingException {
         outputStream = new TestServletOutputStream();
         writer = new PrintWriter(new OutputStreamWriter(outputStream, encoding));
     }
-    
+
+    @Override
     public void addCookie(Cookie cookie) {
     }
 
+    @Override
     public void addDateHeader(String name, long date) {
     }
 
+    @Override
     public void addHeader(String name, String value) {
     }
 
+    @Override
     public void addIntHeader(String name, int value) {
     }
 
+    @Override
     public boolean containsHeader(String name) {
         return false;
     }
 
+    @Override
     public String encodeRedirectUrl(String url) {
         return null;
     }
 
+    @Override
     public String encodeRedirectURL(String url) {
         return null;
     }
 
+    @Override
     public String encodeUrl(String url) {
         return null;
     }
 
+    @Override
     public String encodeURL(String url) {
         return null;
     }
 
+    @Override
     public void sendError(int sc, String msg) throws IOException {
         status = sc;
         message = msg;
     }
 
+    @Override
     public void sendError(int sc) throws IOException {
         status = sc;
     }
 
+    @Override
     public void sendRedirect(String location) throws IOException {
     }
 
+    @Override
     public void setDateHeader(String name, long date) {
     }
 
+    @Override
     public void setHeader(String name, String value) {
     }
 
+    @Override
     public void setIntHeader(String name, int value) {
     }
 
+    @Override
     public void setStatus(int sc, String sm) {
         status = sc;
         message = sm;
     }
 
+    @Override
     public void setStatus(int sc) {
         status = sc;
     }
 
+    @Override
     public void flushBuffer() throws IOException {
     }
 
+    @Override
     public int getBufferSize() {
         return 0;
     }
 
+    @Override
     public String getCharacterEncoding() {
         return encoding;
     }
 
+    @Override
     public String getContentType() {
         return contentType;
     }
 
+    @Override
     public Locale getLocale() {
         return null;
     }
 
+    @Override
     public ServletOutputStream getOutputStream() throws IOException {
         return outputStream;
     }
 
+    @Override
     public PrintWriter getWriter() throws IOException {
         return writer;
     }
 
+    @Override
     public boolean isCommitted() {
         return false;
     }
 
+    @Override
     public void reset() {
     }
 
+    @Override
     public void resetBuffer() {
     }
 
+    @Override
     public void setBufferSize(int size) {
     }
 
+    @Override
     public void setCharacterEncoding(String charset) {
         encoding = charset;
     }
 
+    @Override
     public void setContentLength(int len) {
     }
 
+    @Override
     public void setContentType(String type) {
         contentType = type;
     }
 
+    @Override
     public void setLocale(Locale loc) {
     }
 
@@ -173,12 +206,32 @@ public class HttpResponse implements Htt
         this.encoding = encoding;
     }
 
+    @Override
     public int getStatus() {
         return status;
     }
-    
+
     public String getContent() {
         writer.flush();
         return outputStream.toString();
     }
+
+    @Override
+    public void setContentLengthLong(long len) {
+    }
+
+    @Override
+    public String getHeader(String name) {
+        return null;
+    }
+
+    @Override
+    public Collection<String> getHeaders(String name) {
+        return null;
+    }
+
+    @Override
+    public Collection<String> getHeaderNames() {
+        return null;
+    }
 }

Modified: sling/trunk/testing/junit/scriptable/src/main/java/org/apache/sling/junit/scriptable/ScriptableTestsProvider.java
URL: http://svn.apache.org/viewvc/sling/trunk/testing/junit/scriptable/src/main/java/org/apache/sling/junit/scriptable/ScriptableTestsProvider.java?rev=1794605&r1=1794604&r2=1794605&view=diff
==============================================================================
--- sling/trunk/testing/junit/scriptable/src/main/java/org/apache/sling/junit/scriptable/ScriptableTestsProvider.java
(original)
+++ sling/trunk/testing/junit/scriptable/src/main/java/org/apache/sling/junit/scriptable/ScriptableTestsProvider.java
Tue May  9 16:10:00 2017
@@ -31,26 +31,22 @@ import javax.jcr.observation.EventIterat
 import javax.jcr.observation.EventListener;
 import javax.jcr.query.Query;
 
-import org.apache.felix.scr.annotations.Component;
-import org.apache.felix.scr.annotations.Reference;
-import org.apache.felix.scr.annotations.Service;
 import org.apache.sling.api.resource.ResourceResolver;
 import org.apache.sling.api.resource.ResourceResolverFactory;
 import org.apache.sling.engine.SlingRequestProcessor;
 import org.apache.sling.jcr.api.SlingRepository;
 import org.apache.sling.jcr.resource.api.JcrResourceConstants;
 import org.apache.sling.junit.TestsProvider;
-import org.apache.sling.spi.resource.provider.ResourceProvider;
 import org.osgi.framework.Constants;
-import org.osgi.service.component.ComponentContext;
+import org.osgi.service.component.annotations.Component;
+import org.osgi.service.component.annotations.Reference;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /** TestsProvider that provides test classes for repository
  *  nodes that have a sling:Test mixin.
  */
-@Component
-@Service
+@Component(service = TestsProvider.class)
 public class ScriptableTestsProvider implements TestsProvider {
     private final Logger log = LoggerFactory.getLogger(getClass());
     private String pid;
@@ -58,13 +54,13 @@ public class ScriptableTestsProvider imp
     private ResourceResolver resolver;
     private long lastModified = System.currentTimeMillis();
     private long lastReloaded;
-    
+
     /** List of resource paths that point to tests */
-    private static List<String> testPaths = new LinkedList<String>();
-    
+    private static List<String> testPaths = new LinkedList<>();
+
     public static final String SLING_TEST_NODETYPE = "sling:Test";
     public static final String TEST_CLASS_NAME = ScriptableTestsProvider.class.getName();
-    
+
     /** Context that's passed to TestAllPaths */
     static class TestContext {
         final List<String> testPaths;
@@ -77,51 +73,52 @@ public class ScriptableTestsProvider imp
             resourceResolver = rr;
         }
     }
-    
+
     /** Need a ThreadLocal to pass context, as it's JUnit who instantiates the
      *  test classes, we can't easily decorate them (AFAIK).
      */
-    static final ThreadLocal<TestContext> testContext = new ThreadLocal<TestContext>();

-    
+    static final ThreadLocal<TestContext> testContext = new ThreadLocal<>();
+
     /** We only consider test resources under the search path
-     *  of the JCR resource resolver. These paths are supposed 
-     *  to be secured, as they contain other admin stuff anyway, 
-     *  so non-admin users are prevented from creating test nodes. 
+     *  of the JCR resource resolver. These paths are supposed
+     *  to be secured, as they contain other admin stuff anyway,
+     *  so non-admin users are prevented from creating test nodes.
      */
     private String[] allowedRoots;
-    
+
     @Reference
     private SlingRepository repository;
-    
+
     @Reference
     private SlingRequestProcessor requestProcessor;
-    
+
     @Reference
     private ResourceResolverFactory resolverFactory;
-    
+
     // Need one listener per root path
-    private List<EventListener> listeners = new ArrayList<EventListener>();
-    
+    private List<EventListener> listeners = new ArrayList<>();
+
     class RootListener implements EventListener {
         private final String path;
-        
+
         RootListener(String path) {
             this.path = path;
         }
-        
+
+        @Override
         public void onEvent(EventIterator it) {
             log.debug("Change detected under {}, will reload list of test paths", path);
             lastModified = System.currentTimeMillis();
         }
     };
-    
-    protected void activate(ComponentContext ctx) throws Exception {
-        pid = (String)ctx.getProperties().get(Constants.SERVICE_PID);
+
+    protected void activate(final Map<String, Object> props) throws Exception {
+        pid = (String)props.get(Constants.SERVICE_PID);
         session = repository.loginAdministrative(repository.getDefaultWorkspace());
-        Map<String, Object> auth = new HashMap<String, Object>();
+        Map<String, Object> auth = new HashMap<>();
         auth.put(JcrResourceConstants.AUTHENTICATION_INFO_SESSION, session);
         resolver = resolverFactory.getResourceResolver(auth);
-        
+
         // Copy resource resolver paths and make sure they end with a /
         final String [] paths = resolver.getSearchPath();
         allowedRoots = new String[paths.length];
@@ -131,9 +128,9 @@ public class ScriptableTestsProvider imp
                 allowedRoots[i] += "/";
             }
         }
-        
+
         // Listen to changes to sling:Test nodes under allowed roots
-        final int eventTypes = 
+        final int eventTypes =
             Event.NODE_ADDED | Event.NODE_REMOVED | Event.PROPERTY_ADDED | Event.PROPERTY_CHANGED
| Event.PROPERTY_REMOVED;
         final boolean isDeep = true;
         final boolean noLocal = true;
@@ -144,13 +141,13 @@ public class ScriptableTestsProvider imp
             listeners.add(listener);
             session.getWorkspace().getObservationManager().addEventListener(listener, eventTypes,
path, isDeep, uuid, nodeTypes, noLocal);
             log.debug("Listening for JCR events under {}", path);
-            
+
         }
-        
+
         log.info("Activated, will look for test resources under {}", Arrays.asList(allowedRoots));
     }
-    
-    protected void deactivate(ComponentContext ctx) throws RepositoryException {
+
+    protected void deactivate() throws RepositoryException {
         if (resolver != null) {
             resolver.close();
             resolver = null;
@@ -164,18 +161,19 @@ public class ScriptableTestsProvider imp
         }
         session = null;
     }
-    
+
+    @Override
     public Class<?> createTestClass(String testName) throws ClassNotFoundException
{
         if(!testName.equals(TEST_CLASS_NAME)) {
             throw new ClassNotFoundException(testName + " - the only valid name is " + TEST_CLASS_NAME);
         }
-        
+
         try {
             maybeQueryTestResources();
         } catch(Exception e) {
             throw new RuntimeException("Exception in maybeQueryTestResources()", e);
         }
-        
+
         if(testPaths.size() == 0) {
             return ExplainTests.class;
         } else {
@@ -184,29 +182,31 @@ public class ScriptableTestsProvider imp
         }
     }
 
+    @Override
     public String getServicePid() {
         return pid;
     }
 
+    @Override
     public List<String> getTestNames() {
         // We have a single test to run, would be better to have one
         // test class per test resource but that looks harder. Maybe
-        // use the Sling compiler to generate test classes? 
-        final List<String> result = new LinkedList<String>();
+        // use the Sling compiler to generate test classes?
+        final List<String> result = new LinkedList<>();
         result.add(TEST_CLASS_NAME);
         return result;
     }
-    
+
     private List<String> maybeQueryTestResources() throws RepositoryException {
         if(lastModified <= lastReloaded) {
             log.debug("No changes detected, keeping existing list of {} test resources",
testPaths.size());
             return testPaths;
         }
-        
+
         log.info("Changes detected, reloading list of test resources");
         final long reloadTime = System.currentTimeMillis();
-        final List<String> newList = new LinkedList<String>();
-        
+        final List<String> newList = new LinkedList<>();
+
         for(String root : allowedRoots) {
             final String statement = "/jcr:root" + root + "/element(*, " + SLING_TEST_NODETYPE
+ ")";
             log.debug("Querying for test nodes: {}", statement);
@@ -219,23 +219,24 @@ public class ScriptableTestsProvider imp
                 log.debug("Test resource found: {}", path);
             }
         }
-        log.info("List of test resources updated, {} resource(s) found under {}", 
+        log.info("List of test resources updated, {} resource(s) found under {}",
                 newList.size(), Arrays.asList(allowedRoots));
 
         synchronized (testPaths) {
             testPaths.clear();
             testPaths.addAll(newList);
         }
-        
+
         lastReloaded = reloadTime;
-        
+
         return testPaths;
     }
-    
+
+    @Override
     public long lastModified() {
         return lastModified;
     }
-    
+
     static TestContext getTestContext() {
         return testContext.get();
     }

Modified: sling/trunk/testing/junit/scriptable/src/main/java/org/apache/sling/junit/scriptable/TestServletOutputStream.java
URL: http://svn.apache.org/viewvc/sling/trunk/testing/junit/scriptable/src/main/java/org/apache/sling/junit/scriptable/TestServletOutputStream.java?rev=1794605&r1=1794604&r2=1794605&view=diff
==============================================================================
--- sling/trunk/testing/junit/scriptable/src/main/java/org/apache/sling/junit/scriptable/TestServletOutputStream.java
(original)
+++ sling/trunk/testing/junit/scriptable/src/main/java/org/apache/sling/junit/scriptable/TestServletOutputStream.java
Tue May  9 16:10:00 2017
@@ -20,19 +20,29 @@ import java.io.ByteArrayOutputStream;
 import java.io.IOException;
 
 import javax.servlet.ServletOutputStream;
+import javax.servlet.WriteListener;
 
 /** Output stream for our fake HTTP response class */
 public class TestServletOutputStream extends ServletOutputStream {
 
     private final ByteArrayOutputStream bos = new ByteArrayOutputStream();
-    
+
     @Override
     public String toString() {
         return bos.toString();
     }
-    
+
     @Override
     public void write(int b) throws IOException {
         bos.write(b);
     }
+
+    @Override
+    public boolean isReady() {
+        return true;
+    }
+
+    @Override
+    public void setWriteListener(WriteListener writeListener) {
+    }
 }



Mime
View raw message