Making test more clear on assertion and failure (to help with windows failure)
git-svn-id: svn+ssh://dev.eclipse.org/svnroot/rt/org.eclipse.jetty/jetty/trunk@3259 7e9141cc-0065-0410-87d8-b60c137991c4
This commit is contained in:
parent
a00f7945a6
commit
52820832a1
|
@ -69,6 +69,12 @@
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.eclipse.jetty.toolchain</groupId>
|
||||||
|
<artifactId>jetty-test-helper</artifactId>
|
||||||
|
<version>1.5-SNAPSHOT</version>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.eclipse.jetty</groupId>
|
<groupId>org.eclipse.jetty</groupId>
|
||||||
<artifactId>jetty-webapp</artifactId>
|
<artifactId>jetty-webapp</artifactId>
|
||||||
|
@ -91,15 +97,5 @@
|
||||||
<version>${project.version}</version>
|
<version>${project.version}</version>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>org.eclipse.jetty.toolchain</groupId>
|
|
||||||
<artifactId>jetty-test-helper</artifactId>
|
|
||||||
<scope>test</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>junit</groupId>
|
|
||||||
<artifactId>junit</artifactId>
|
|
||||||
<scope>test</scope>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</project>
|
</project>
|
||||||
|
|
|
@ -15,9 +15,9 @@
|
||||||
// ========================================================================
|
// ========================================================================
|
||||||
package org.eclipse.jetty.deploy.bindings;
|
package org.eclipse.jetty.deploy.bindings;
|
||||||
|
|
||||||
import java.io.File;
|
import static org.hamcrest.Matchers.*;
|
||||||
|
|
||||||
import junit.framework.Assert;
|
import java.io.File;
|
||||||
|
|
||||||
import org.eclipse.jetty.deploy.providers.ScanningAppProvider;
|
import org.eclipse.jetty.deploy.providers.ScanningAppProvider;
|
||||||
import org.eclipse.jetty.deploy.test.XmlConfiguredJetty;
|
import org.eclipse.jetty.deploy.test.XmlConfiguredJetty;
|
||||||
|
@ -26,8 +26,8 @@ import org.eclipse.jetty.toolchain.test.MavenTestingUtils;
|
||||||
import org.eclipse.jetty.toolchain.test.TestingDir;
|
import org.eclipse.jetty.toolchain.test.TestingDir;
|
||||||
import org.eclipse.jetty.webapp.WebAppContext;
|
import org.eclipse.jetty.webapp.WebAppContext;
|
||||||
import org.junit.After;
|
import org.junit.After;
|
||||||
|
import org.junit.Assert;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Ignore;
|
|
||||||
import org.junit.Rule;
|
import org.junit.Rule;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
|
@ -70,22 +70,13 @@ public class GlobalWebappConfigBindingTest
|
||||||
|
|
||||||
WebAppContext context = jetty.getWebAppContexts().get(0);
|
WebAppContext context = jetty.getWebAppContexts().get(0);
|
||||||
|
|
||||||
Assert.assertNotNull(context);
|
Assert.assertNotNull("Context should not be null",context);
|
||||||
Assert.assertEquals(context.getDefaultServerClasses().length, context.getServerClasses().length - 1); // added a pattern
|
String defaultClasses[] = context.getDefaultServerClasses();
|
||||||
//Assert.assertEquals(context.getDefaultSystemClasses().length,context.getSystemClasses().length + 1); // removed a patter
|
String currentClasses[] = context.getServerClasses();
|
||||||
|
|
||||||
boolean fooPackage = false;
|
String addedClass = "org.eclipse.foo."; // What was added by the binding
|
||||||
|
Assert.assertThat("Default Server Classes",addedClass,not(isIn(defaultClasses)));
|
||||||
// we are inserting the foo package into the server classes
|
Assert.assertThat("Current Server Classes",addedClass,isIn(currentClasses));
|
||||||
for (String entry : context.getServerClasses())
|
|
||||||
{
|
|
||||||
if ("org.eclipse.foo.".equals(entry))
|
|
||||||
{
|
|
||||||
fooPackage = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Assert.assertTrue(fooPackage);
|
|
||||||
|
|
||||||
// boolean jndiPackage = false;
|
// boolean jndiPackage = false;
|
||||||
|
|
||||||
|
@ -102,4 +93,3 @@ public class GlobalWebappConfigBindingTest
|
||||||
// Assert.assertFalse(jndiPackage);
|
// Assert.assertFalse(jndiPackage);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue