350287 Disable ScanningAppProviderRuntimeUpdatesTest on Windows

This reverts commit 2edcef1343eca17e300dc1cd7fedcabf17c2baf6.

git-svn-id: svn+ssh://dev.eclipse.org/svnroot/rt/org.eclipse.jetty/jetty/trunk@3427 7e9141cc-0065-0410-87d8-b60c137991c4
This commit is contained in:
Michael Gorovoy 2011-06-25 01:21:01 +00:00
parent dbd782dfbc
commit 28a0c0ff75
2 changed files with 12 additions and 50 deletions

View File

@ -14,7 +14,6 @@ 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

View File

@ -16,18 +16,17 @@
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.OS;
import org.eclipse.jetty.toolchain.test.TestingDir;
import org.eclipse.jetty.util.Scanner;
import org.eclipse.jetty.util.log.Log;
import org.junit.After;
import org.junit.Assume;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
@ -86,53 +85,18 @@ public class ScanningAppProviderRuntimeUpdatesTest
public void waitForDirectoryScan()
{
int scan=_scans.get()+2*_providers;
try
do
{
do
try
{
Thread.sleep(200);
}
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
catch(InterruptedException e)
{
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);
Log.warn(e);
}
}
while(_scans.get()<scan);
}
/**
@ -175,6 +139,10 @@ public class ScanningAppProviderRuntimeUpdatesTest
@Test
public void testAfterStartupThenUpdateContext() throws Exception
{
// This test will not work on Windows as second war file would
// not be written over the first one because of a file lock
Assume.assumeTrue(!OS.IS_WINDOWS);
jetty.copyWebapp("foo-webapp-1.war","foo.war");
jetty.copyContext("foo.xml","foo.xml");
@ -182,8 +150,6 @@ public class ScanningAppProviderRuntimeUpdatesTest
jetty.assertWebAppContextsExists("/foo");
waitForDeployment();
// Test that webapp response contains "-1"
jetty.assertResponseContains("/foo/info","FooServlet-1");
@ -194,11 +160,8 @@ 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");
}