sugar syntax changes

Signed-off-by: olivier lamy <oliver.lamy@gmail.com>
This commit is contained in:
olivier lamy 2018-09-24 19:24:29 +10:00
parent 875af5c692
commit 972dc015bb
3 changed files with 9 additions and 11 deletions

View File

@ -67,5 +67,6 @@
<module>test-quickstart</module> <module>test-quickstart</module>
<module>test-jmx</module> <module>test-jmx</module>
<module>test-http-client-transport</module> <module>test-http-client-transport</module>
<module>test-modules</module>
</modules> </modules>
</project> </project>

View File

@ -56,6 +56,7 @@ import org.eclipse.jetty.toolchain.test.JAR;
import org.eclipse.jetty.toolchain.test.MavenTestingUtils; import org.eclipse.jetty.toolchain.test.MavenTestingUtils;
import org.eclipse.jetty.toolchain.test.PathAssert; import org.eclipse.jetty.toolchain.test.PathAssert;
import org.eclipse.jetty.toolchain.test.jupiter.WorkDir; import org.eclipse.jetty.toolchain.test.jupiter.WorkDir;
import org.junit.jupiter.api.Assertions;
/** /**
@ -315,19 +316,15 @@ public class JettyDistro
// The actual jetty-distribution-${version} directory is under this directory. // The actual jetty-distribution-${version} directory is under this directory.
// Lets find it. // Lets find it.
File subdirs[] = distroUnpackDir.listFiles(new FileFilter() File subdirs[] = distroUnpackDir.listFiles( path ->
{
@Override
public boolean accept(File path)
{ {
if (!path.isDirectory()) if (!path.isDirectory())
{ {
return false; return false;
} }
return path.getName().startsWith(artifactName + "-"); return path.getName().startsWith(artifactName + "-");
} }
}); );
if (subdirs.length == 0) if (subdirs.length == 0)
{ {
@ -550,7 +547,7 @@ public class JettyDistro
if (cmdLine == null || !cmdLine.contains("XmlConfiguration")) if (cmdLine == null || !cmdLine.contains("XmlConfiguration"))
{ {
fail("Unable to get Jetty command line"); Assertions.fail( "Unable to get Jetty command line");
} }
// Need to breakdown commandline into parts, as spaces in command line will cause failures. // Need to breakdown commandline into parts, as spaces in command line will cause failures.
@ -595,7 +592,7 @@ public class JettyDistro
catch (InterruptedException e) catch (InterruptedException e)
{ {
pid.destroy(); pid.destroy();
fail("Unable to get required information within time limit"); Assertions.fail( "Unable to get required information within time limit");
} }
} }
@ -804,7 +801,7 @@ public class JettyDistro
} }
} }
fail("Unable to find java bin"); Assertions.fail( "Unable to find java bin");
return "java"; return "java";
} }

View File

@ -49,7 +49,7 @@ import org.junit.jupiter.api.Disabled;
public class TestableJettyServer public class TestableJettyServer
{ {
private List<URL> _xmlConfigurations; private List<URL> _xmlConfigurations;
private final Map<String,String> _properties = new HashMap<String, String>(); private final Map<String,String> _properties = new HashMap<>();
private Server _server; private Server _server;
private int _serverPort; private int _serverPort;
private String _scheme = HttpScheme.HTTP.asString(); private String _scheme = HttpScheme.HTTP.asString();
@ -60,7 +60,7 @@ public class TestableJettyServer
public TestableJettyServer() throws IOException public TestableJettyServer() throws IOException
{ {
_xmlConfigurations = new ArrayList<URL>(); _xmlConfigurations = new ArrayList<>();
Properties properties = new Properties(); Properties properties = new Properties();
/* Establish Popular Directories */ /* Establish Popular Directories */