Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse McConnell2010-12-01 19:42:42 +0000
committerJesse McConnell2010-12-01 19:42:42 +0000
commit0c0253bada1172faf2d99cecc39ccc6509cd4ac4 (patch)
treea530bdc1adbb83fd70ac1d783bc3282d40cba2c0
parente4bdd5b62ff6d2c24b3906dfd8c3b27ce076a926 (diff)
parente22e9eec6fd77e3dbe4aae57655654586d5fb8e6 (diff)
downloadorg.eclipse.jetty.project-0c0253bada1172faf2d99cecc39ccc6509cd4ac4.tar.gz
org.eclipse.jetty.project-0c0253bada1172faf2d99cecc39ccc6509cd4ac4.tar.xz
org.eclipse.jetty.project-0c0253bada1172faf2d99cecc39ccc6509cd4ac4.zip
[maven-release-plugin] copy for tag jetty-7.2.2.v20101201jetty-7.2.2.v20101201
git-svn-id: svn+ssh://dev.eclipse.org/svnroot/rt/org.eclipse.jetty/jetty/tags/jetty-7.2.2.v20101201@2571 7e9141cc-0065-0410-87d8-b60c137991c4
-rw-r--r--VERSION.txt4
-rw-r--r--jetty-osgi/test-jetty-osgi/pom.xml1
-rw-r--r--jetty-server/src/main/java/org/eclipse/jetty/server/AbstractConnector.java10
-rw-r--r--jetty-server/src/test/java/org/eclipse/jetty/server/handler/IPAccessHandlerTest.java3
-rw-r--r--jetty-servlets/src/test/java/org/eclipse/jetty/servlets/MultipartFilterTest.java17
-rw-r--r--jetty-util/src/main/java/org/eclipse/jetty/util/thread/ExecutorThreadPool.java4
-rw-r--r--jetty-util/src/main/java/org/eclipse/jetty/util/thread/QueuedThreadPool.java13
-rw-r--r--jetty-util/src/test/java/org/eclipse/jetty/util/resource/ResourceCollectionTest.java14
-rw-r--r--jetty-util/src/test/java/org/eclipse/jetty/util/resource/ResourceTest.java13
9 files changed, 40 insertions, 39 deletions
diff --git a/VERSION.txt b/VERSION.txt
index 463318fa8f..3466aebd0f 100644
--- a/VERSION.txt
+++ b/VERSION.txt
@@ -1,3 +1,7 @@
+ + 331567 IPAccessHandlerTest failed on MacOS fix
+ + 328789 Clean up tmp files from test harnesses
+ + 331230 Fixed low thread warnings when acceptors>threadpool
+
jetty-7.2.2.v20101201 1 December 2010
+ 330210 Improve performance of writing large bytes arrays
+ 330208 Support new wording on servlet-mapping and filter-mapping merging from servlet3.0a
diff --git a/jetty-osgi/test-jetty-osgi/pom.xml b/jetty-osgi/test-jetty-osgi/pom.xml
index d6b96f6fe3..a880e90280 100644
--- a/jetty-osgi/test-jetty-osgi/pom.xml
+++ b/jetty-osgi/test-jetty-osgi/pom.xml
@@ -257,6 +257,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-eclipse-plugin</artifactId>
+ <version>2.8</version>
<configuration>
<manifest>prevent/overwriting/by/pointing/to/nonexisting/MANIFEST.MF</manifest>
<pde>false</pde>
diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/AbstractConnector.java b/jetty-server/src/main/java/org/eclipse/jetty/server/AbstractConnector.java
index 6c890f6b47..8567209913 100644
--- a/jetty-server/src/main/java/org/eclipse/jetty/server/AbstractConnector.java
+++ b/jetty-server/src/main/java/org/eclipse/jetty/server/AbstractConnector.java
@@ -374,13 +374,9 @@ public abstract class AbstractConnector extends HttpBuffers implements Connector
_acceptorThread = new Thread[getAcceptors()];
for (int i = 0; i < _acceptorThread.length; i++)
- {
- if (!_threadPool.dispatch(new Acceptor(i)))
- {
- Log.warn("insufficient maxThreads configured for {}",this);
- break;
- }
- }
+ _threadPool.dispatch(new Acceptor(i));
+ if (_threadPool.isLowOnThreads())
+ Log.warn("insufficient threads configured for {}",this);
}
Log.info("Started {}",this);
diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/handler/IPAccessHandlerTest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/handler/IPAccessHandlerTest.java
index 6ac5e7969f..f6adcd6b83 100644
--- a/jetty-server/src/test/java/org/eclipse/jetty/server/handler/IPAccessHandlerTest.java
+++ b/jetty-server/src/test/java/org/eclipse/jetty/server/handler/IPAccessHandlerTest.java
@@ -38,7 +38,6 @@ import org.eclipse.jetty.server.Connector;
import org.eclipse.jetty.server.Request;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.server.bio.SocketConnector;
-import org.eclipse.jetty.util.log.Log;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -107,7 +106,7 @@ public class IPAccessHandlerTest
_handler.setBlack(_black.split(";",-1));
String request = "GET " + _uri + " HTTP/1.1\n" + "Host: "+ _host + "\n\n";
- Socket socket = new Socket("localhost", _connector.getLocalPort());
+ Socket socket = new Socket("127.0.0.1", _connector.getLocalPort());
socket.setSoTimeout(5000);
try
{
diff --git a/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/MultipartFilterTest.java b/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/MultipartFilterTest.java
index 0bb48cc3cd..cfeacaec31 100644
--- a/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/MultipartFilterTest.java
+++ b/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/MultipartFilterTest.java
@@ -13,13 +13,12 @@
package org.eclipse.jetty.servlets;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
-import java.io.OutputStream;
-import java.net.Socket;
-import java.net.URL;
-import java.util.Enumeration;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
@@ -35,9 +34,6 @@ import org.junit.After;
import org.junit.Before;
import org.junit.Test;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
public class MultipartFilterTest
{
private File _dir;
@@ -56,7 +52,8 @@ public class MultipartFilterTest
tester.setContextPath("/context");
tester.setResourceBase(_dir.getCanonicalPath());
tester.addServlet(DumpServlet.class, "/");
- tester.addFilter(MultiPartFilter.class,"/*",FilterMapping.DEFAULT);
+ FilterHolder multipartFilter = tester.addFilter(MultiPartFilter.class,"/*",FilterMapping.DEFAULT);
+ multipartFilter.setInitParameter("deleteFiles", "true");
tester.start();
}
@@ -232,7 +229,9 @@ public class MultipartFilterTest
public static class DumpServlet extends HttpServlet
{
- /* ------------------------------------------------------------ */
+ private static final long serialVersionUID = 201012011130L;
+
+ /* ------------------------------------------------------------ */
/**
* @see javax.servlet.http.HttpServlet#doPost(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
*/
diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/thread/ExecutorThreadPool.java b/jetty-util/src/main/java/org/eclipse/jetty/util/thread/ExecutorThreadPool.java
index c00a3cb1fe..85de89eaa3 100644
--- a/jetty-util/src/main/java/org/eclipse/jetty/util/thread/ExecutorThreadPool.java
+++ b/jetty-util/src/main/java/org/eclipse/jetty/util/thread/ExecutorThreadPool.java
@@ -137,8 +137,8 @@ public class ExecutorThreadPool extends AbstractLifeCycle implements ThreadPool,
{
if (_executor instanceof ThreadPoolExecutor)
{
- final ThreadPoolExecutor tpe = (ThreadPoolExecutor)_executor;
- return tpe.getActiveCount()>=tpe.getMaximumPoolSize();
+ final ThreadPoolExecutor tpe = (ThreadPoolExecutor)_executor;
+ return tpe.getTaskCount()>=(tpe.getMaximumPoolSize());
}
return false;
}
diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/thread/QueuedThreadPool.java b/jetty-util/src/main/java/org/eclipse/jetty/util/thread/QueuedThreadPool.java
index 45a07b9fdb..48760f0b12 100644
--- a/jetty-util/src/main/java/org/eclipse/jetty/util/thread/QueuedThreadPool.java
+++ b/jetty-util/src/main/java/org/eclipse/jetty/util/thread/QueuedThreadPool.java
@@ -186,9 +186,9 @@ public class QueuedThreadPool extends AbstractLifeCycle implements ThreadPool, E
*/
public void setMaxThreads(int maxThreads)
{
- if (isStarted() && maxThreads<_minThreads)
- throw new IllegalArgumentException("!minThreads<maxThreads");
_maxThreads=maxThreads;
+ if (_minThreads>_maxThreads)
+ _minThreads=_maxThreads;
}
/* ------------------------------------------------------------ */
@@ -199,9 +199,10 @@ public class QueuedThreadPool extends AbstractLifeCycle implements ThreadPool, E
*/
public void setMinThreads(int minThreads)
{
- if (isStarted() && (minThreads<=0 || minThreads>_maxThreads))
- throw new IllegalArgumentException("!0<=minThreads<maxThreads");
_minThreads=minThreads;
+
+ if (_minThreads>_maxThreads)
+ _maxThreads=_minThreads;
int threads=_threadsStarted.get();
while (isStarted() && threads<_minThreads)
@@ -386,11 +387,11 @@ public class QueuedThreadPool extends AbstractLifeCycle implements ThreadPool, E
/* ------------------------------------------------------------ */
/**
- * @return True if the pool is at maxThreads and there are more queued jobs than idle threads
+ * @return True if the pool is at maxThreads and there are not more idle threads than queued jobs
*/
public boolean isLowOnThreads()
{
- return _threadsStarted.get()==_maxThreads && _jobs.size()>_threadsIdle.get();
+ return _threadsStarted.get()==_maxThreads && _jobs.size()>=_threadsIdle.get();
}
/* ------------------------------------------------------------ */
diff --git a/jetty-util/src/test/java/org/eclipse/jetty/util/resource/ResourceCollectionTest.java b/jetty-util/src/test/java/org/eclipse/jetty/util/resource/ResourceCollectionTest.java
index 39fcd7ebf8..7f10b9c918 100644
--- a/jetty-util/src/test/java/org/eclipse/jetty/util/resource/ResourceCollectionTest.java
+++ b/jetty-util/src/test/java/org/eclipse/jetty/util/resource/ResourceCollectionTest.java
@@ -13,20 +13,15 @@
package org.eclipse.jetty.util.resource;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
import java.io.BufferedReader;
import java.io.File;
import java.io.InputStreamReader;
-import junit.framework.TestCase;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
+import org.eclipse.jetty.util.IO;
import org.junit.Test;
-import org.junit.BeforeClass;
-import org.junit.AfterClass;
public class ResourceCollectionTest
{
@@ -97,6 +92,7 @@ public class ResourceCollectionTest
assertEquals("2 - two", getContent(r, "2.txt"));
assertEquals("3 - three", getContent(r, "3.txt"));
+ IO.delete(dest);
}
static String getContent(Resource r, String path) throws Exception
diff --git a/jetty-util/src/test/java/org/eclipse/jetty/util/resource/ResourceTest.java b/jetty-util/src/test/java/org/eclipse/jetty/util/resource/ResourceTest.java
index daa8f0a6c9..dbb9f87637 100644
--- a/jetty-util/src/test/java/org/eclipse/jetty/util/resource/ResourceTest.java
+++ b/jetty-util/src/test/java/org/eclipse/jetty/util/resource/ResourceTest.java
@@ -22,11 +22,10 @@ import java.io.File;
import java.io.FilePermission;
import java.io.FilenameFilter;
import java.io.InputStream;
+import java.net.URI;
import java.net.URL;
import java.util.jar.JarInputStream;
-import junit.framework.TestSuite;
-
import org.eclipse.jetty.util.IO;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -111,7 +110,8 @@ public class ResourceTest
File file = new File(__userDir);
file=new File(file.getCanonicalPath());
- __userURL=file.toURL();
+ URI uri = file.toURI();
+ __userURL=uri.toURL();
__userURL = new URL(__userURL.toString() + "src/test/java/org/eclipse/jetty/util/resource/");
FilePermission perm = (FilePermission) __userURL.openConnection().getPermission();
@@ -228,6 +228,8 @@ public class ResourceTest
Resource r =Resource.newResource("/tmp/a file with,spe#ials/");
assertTrue(r.getURL().toString().indexOf("a%20file%20with,spe%23ials")>0);
assertTrue(r.getFile().toString().indexOf("a file with,spe#ials")>0);
+ r.delete();
+ assertFalse("File should have been deleted.",r.exists());
}
/* ------------------------------------------------------------ */
@@ -314,7 +316,10 @@ public class ResourceTest
}
};
assertEquals(1, dest.listFiles(currentDirectoryFilenameFilter).length);
- assertEquals(0, dest.getParentFile().listFiles(currentDirectoryFilenameFilter).length);
+ assertEquals(0, dest.getParentFile().listFiles(currentDirectoryFilenameFilter).length);
+
+ IO.delete(dest);
+ assertFalse(dest.exists());
}
/**

Back to the top