350287 ScanningAppProviderRuntimeUpdatesTest fails on Windows
git-svn-id: svn+ssh://dev.eclipse.org/svnroot/rt/org.eclipse.jetty/jetty/trunk@3426 7e9141cc-0065-0410-87d8-b60c137991c4
This commit is contained in:
parent
47e199af79
commit
dbd782dfbc
|
@ -14,6 +14,7 @@ jetty-7.4.3-SNAPSHOT
|
|||
+ 349896 SCEP supports zero maxIdleTime
|
||||
+ 349897 draft -09 websockets
|
||||
+ 349997 MBeanContainer uses weak references
|
||||
+ 350287 ScanningAppProviderRuntimeUpdatesTest fails on Windows
|
||||
+ JETTY-1342 Recreate selector in change task
|
||||
|
||||
jetty-7.4.2.v20110526
|
||||
|
|
|
@ -16,11 +16,14 @@
|
|||
package org.eclipse.jetty.deploy.providers;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Collection;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
import org.eclipse.jetty.deploy.AppProvider;
|
||||
import org.eclipse.jetty.deploy.DeploymentManager;
|
||||
import org.eclipse.jetty.deploy.DeploymentManager.AppEntry;
|
||||
import org.eclipse.jetty.deploy.test.XmlConfiguredJetty;
|
||||
import org.eclipse.jetty.server.Handler;
|
||||
import org.eclipse.jetty.toolchain.test.TestingDir;
|
||||
import org.eclipse.jetty.util.Scanner;
|
||||
import org.eclipse.jetty.util.log.Log;
|
||||
|
@ -83,18 +86,53 @@ public class ScanningAppProviderRuntimeUpdatesTest
|
|||
public void waitForDirectoryScan()
|
||||
{
|
||||
int scan=_scans.get()+2*_providers;
|
||||
do
|
||||
try
|
||||
{
|
||||
try
|
||||
do
|
||||
{
|
||||
Thread.sleep(200);
|
||||
}
|
||||
catch(InterruptedException e)
|
||||
{
|
||||
Log.warn(e);
|
||||
}
|
||||
while(_scans.get()<scan);
|
||||
|
||||
Thread.sleep(200);
|
||||
}
|
||||
catch(InterruptedException e)
|
||||
{
|
||||
Log.ignore(e);
|
||||
}
|
||||
}
|
||||
|
||||
public void waitForDeployment()
|
||||
{
|
||||
DeploymentManager dm = jetty.getServer().getBeans(DeploymentManager.class).get(0);
|
||||
|
||||
long count = 10;
|
||||
boolean ready;
|
||||
Collection<AppEntry> entries = dm.getAppEntries();
|
||||
try
|
||||
{
|
||||
do
|
||||
{
|
||||
Thread.sleep(200);
|
||||
|
||||
ready = true;
|
||||
for(AppEntry entry: entries)
|
||||
{
|
||||
if(!entry.getLifecyleNode().getName().equals("deployed"))
|
||||
{
|
||||
ready = false;
|
||||
}
|
||||
}
|
||||
} while (!ready && --count > 0);
|
||||
}
|
||||
catch (InterruptedException e)
|
||||
{
|
||||
Log.ignore(e);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Log.warn(e);
|
||||
}
|
||||
while(_scans.get()<scan);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -144,6 +182,8 @@ public class ScanningAppProviderRuntimeUpdatesTest
|
|||
|
||||
jetty.assertWebAppContextsExists("/foo");
|
||||
|
||||
waitForDeployment();
|
||||
|
||||
// Test that webapp response contains "-1"
|
||||
jetty.assertResponseContains("/foo/info","FooServlet-1");
|
||||
|
||||
|
@ -154,8 +194,11 @@ public class ScanningAppProviderRuntimeUpdatesTest
|
|||
|
||||
// This should result in the existing foo.war being replaced with the new foo.war
|
||||
waitForDirectoryScan();
|
||||
|
||||
jetty.assertWebAppContextsExists("/foo");
|
||||
|
||||
waitForDeployment();
|
||||
|
||||
// Test that webapp response contains "-2"
|
||||
jetty.assertResponseContains("/foo/info","FooServlet-2");
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue