Reworking cdi-webapp-it to also use new cdi module
This commit is contained in:
parent
c3670d01e1
commit
bf7637a2df
|
@ -82,7 +82,6 @@ import org.eclipse.jetty.start.config.CommandLineConfigSource;
|
||||||
public class Main
|
public class Main
|
||||||
{
|
{
|
||||||
private static final int EXIT_USAGE = 1;
|
private static final int EXIT_USAGE = 1;
|
||||||
private static BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
|
|
||||||
|
|
||||||
public static String join(Collection<?> objs, String delim)
|
public static String join(Collection<?> objs, String delim)
|
||||||
{
|
{
|
||||||
|
@ -435,13 +434,28 @@ public class Main
|
||||||
System.err.printf(" + has not been audited for compliance with its license%n");
|
System.err.printf(" + has not been audited for compliance with its license%n");
|
||||||
System.err.printf("%n");
|
System.err.printf("%n");
|
||||||
for (String l : module.getLicense())
|
for (String l : module.getLicense())
|
||||||
|
{
|
||||||
System.err.printf(" %s%n",l);
|
System.err.printf(" %s%n",l);
|
||||||
|
}
|
||||||
|
|
||||||
System.err.printf("%nProceed (y/N)? ");
|
if (args.isApproveAllLicenses())
|
||||||
String line = input.readLine();
|
{
|
||||||
|
System.err.println("All licenses approved via command line");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
try (BufferedReader input = new BufferedReader(new InputStreamReader(System.in)))
|
||||||
|
{
|
||||||
|
System.err.printf("%nProceed (y/N)? ");
|
||||||
|
String line = input.readLine();
|
||||||
|
|
||||||
if (line==null || line.length()==0 || !line.toLowerCase().startsWith("y"))
|
if (line == null || line.length() == 0 || !line.toLowerCase().startsWith("y"))
|
||||||
System.exit(1);
|
{
|
||||||
|
System.err.printf("Exiting: license not acknowledged%n");
|
||||||
|
System.exit(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -78,7 +78,7 @@ public class StartArgs
|
||||||
private Map<String, String> propertySource = new HashMap<>();
|
private Map<String, String> propertySource = new HashMap<>();
|
||||||
/** List of all active [files] sections from enabled modules */
|
/** List of all active [files] sections from enabled modules */
|
||||||
private List<FileArg> files = new ArrayList<>();
|
private List<FileArg> files = new ArrayList<>();
|
||||||
/** List of all active [lib] sectinos from enabled modules */
|
/** List of all active [lib] sections from enabled modules */
|
||||||
private Classpath classpath;
|
private Classpath classpath;
|
||||||
/** List of all active [xml] sections from enabled modules */
|
/** List of all active [xml] sections from enabled modules */
|
||||||
private List<Path> xmls = new ArrayList<>();
|
private List<Path> xmls = new ArrayList<>();
|
||||||
|
@ -122,6 +122,7 @@ public class StartArgs
|
||||||
private boolean dryRun = false;
|
private boolean dryRun = false;
|
||||||
|
|
||||||
private boolean exec = false;
|
private boolean exec = false;
|
||||||
|
private boolean approveAllLicenses = false;
|
||||||
|
|
||||||
public StartArgs()
|
public StartArgs()
|
||||||
{
|
{
|
||||||
|
@ -583,6 +584,11 @@ public class StartArgs
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isApproveAllLicenses()
|
||||||
|
{
|
||||||
|
return approveAllLicenses;
|
||||||
|
}
|
||||||
|
|
||||||
public boolean isDownload()
|
public boolean isDownload()
|
||||||
{
|
{
|
||||||
return download;
|
return download;
|
||||||
|
@ -748,6 +754,13 @@ public class StartArgs
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Enable forked execution of Jetty server
|
||||||
|
if ("--approve-all-licenses".equals(arg))
|
||||||
|
{
|
||||||
|
approveAllLicenses = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Arbitrary Libraries
|
// Arbitrary Libraries
|
||||||
if (arg.startsWith("--lib="))
|
if (arg.startsWith("--lib="))
|
||||||
{
|
{
|
||||||
|
|
|
@ -135,7 +135,7 @@
|
||||||
<arg file="${jetty.base}"/>
|
<arg file="${jetty.base}"/>
|
||||||
</exec>
|
</exec>
|
||||||
|
|
||||||
<echo>Integration Test : Start Jetty</echo>
|
<echo>Integration Test : Starting Jetty ...</echo>
|
||||||
<exec executable="${run.command}"
|
<exec executable="${run.command}"
|
||||||
dir="${scripts-dir}"
|
dir="${scripts-dir}"
|
||||||
spawn="true">
|
spawn="true">
|
||||||
|
|
|
@ -26,6 +26,9 @@ import java.net.URI;
|
||||||
import org.eclipse.jetty.toolchain.test.SimpleRequest;
|
import org.eclipse.jetty.toolchain.test.SimpleRequest;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Basic tests for a simple @WebServlet with no CDI
|
||||||
|
*/
|
||||||
public class HelloIT
|
public class HelloIT
|
||||||
{
|
{
|
||||||
@Test
|
@Test
|
||||||
|
@ -33,6 +36,6 @@ public class HelloIT
|
||||||
{
|
{
|
||||||
URI serverURI = new URI("http://localhost:58080/cdi-webapp/");
|
URI serverURI = new URI("http://localhost:58080/cdi-webapp/");
|
||||||
SimpleRequest req = new SimpleRequest(serverURI);
|
SimpleRequest req = new SimpleRequest(serverURI);
|
||||||
assertThat( req.getString("hello"), is("hi"));
|
assertThat(req.getString("hello"),is("Hello World"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,37 @@
|
||||||
|
//
|
||||||
|
// ========================================================================
|
||||||
|
// Copyright (c) 1995-2014 Mort Bay Consulting Pty. Ltd.
|
||||||
|
// ------------------------------------------------------------------------
|
||||||
|
// All rights reserved. This program and the accompanying materials
|
||||||
|
// are made available under the terms of the Eclipse Public License v1.0
|
||||||
|
// and Apache License v2.0 which accompanies this distribution.
|
||||||
|
//
|
||||||
|
// The Eclipse Public License is available at
|
||||||
|
// http://www.eclipse.org/legal/epl-v10.html
|
||||||
|
//
|
||||||
|
// The Apache License v2.0 is available at
|
||||||
|
// http://www.opensource.org/licenses/apache2.0.php
|
||||||
|
//
|
||||||
|
// You may elect to redistribute this code under either of these licenses.
|
||||||
|
// ========================================================================
|
||||||
|
//
|
||||||
|
|
||||||
|
package org.eclipse.jetty.tests;
|
||||||
|
|
||||||
|
import static org.hamcrest.Matchers.*;
|
||||||
|
import static org.junit.Assert.*;
|
||||||
|
|
||||||
|
import java.net.URI;
|
||||||
|
|
||||||
|
import org.eclipse.jetty.toolchain.test.SimpleRequest;
|
||||||
|
import org.junit.Test;
|
||||||
|
|
||||||
|
public class ServerInfoIT
|
||||||
|
{
|
||||||
|
@Test
|
||||||
|
public void testGET() throws Exception {
|
||||||
|
URI serverURI = new URI("http://localhost:58080/cdi-webapp/");
|
||||||
|
SimpleRequest req = new SimpleRequest(serverURI);
|
||||||
|
assertThat(req.getString("serverinfo"),is("Hello World"));
|
||||||
|
}
|
||||||
|
}
|
|
@ -9,10 +9,11 @@ echo \${jetty.home} : $JETTY_HOME
|
||||||
echo \${jetty.base} : $JETTY_BASE
|
echo \${jetty.base} : $JETTY_BASE
|
||||||
|
|
||||||
cd "$JETTY_BASE"
|
cd "$JETTY_BASE"
|
||||||
|
|
||||||
"$JAVA_HOME/bin/java" -jar "$JETTY_HOME/start.jar" \
|
"$JAVA_HOME/bin/java" -jar "$JETTY_HOME/start.jar" \
|
||||||
--add-to-start=deploy,http,annotations
|
--approve-all-licenses \
|
||||||
|
--add-to-start=deploy,http,annotations,cdi,logging
|
||||||
|
|
||||||
"$JAVA_HOME/bin/java" -jar "$JETTY_HOME/start.jar" \
|
"$JAVA_HOME/bin/java" -jar "$JETTY_HOME/start.jar" \
|
||||||
--version
|
--version
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -9,6 +9,7 @@ echo \${jetty.home} : $JETTY_HOME
|
||||||
echo \${jetty.base} : $JETTY_BASE
|
echo \${jetty.base} : $JETTY_BASE
|
||||||
|
|
||||||
cd "$JETTY_BASE"
|
cd "$JETTY_BASE"
|
||||||
|
|
||||||
"$JAVA_HOME/bin/java" -jar "$JETTY_HOME/start.jar" \
|
"$JAVA_HOME/bin/java" -jar "$JETTY_HOME/start.jar" \
|
||||||
jetty.port=58080 \
|
jetty.port=58080 \
|
||||||
STOP.PORT=58181 STOP.KEY=it
|
STOP.PORT=58181 STOP.KEY=it
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
<url>http://www.eclipse.org/jetty</url>
|
<url>http://www.eclipse.org/jetty</url>
|
||||||
<modules>
|
<modules>
|
||||||
<module>cdi-webapp</module>
|
<module>cdi-webapp</module>
|
||||||
|
<module>cdi-webapp-it</module>
|
||||||
<module>cdi-client</module>
|
<module>cdi-client</module>
|
||||||
<module>cdi-tests</module>
|
|
||||||
</modules>
|
</modules>
|
||||||
</project>
|
</project>
|
||||||
|
|
Loading…
Reference in New Issue