Merge remote-tracking branch 'origin/jetty-9.4.x'
This commit is contained in:
commit
f1d9cf89a4
|
@ -20,6 +20,7 @@ package org.eclipse.jetty.start;
|
|||
|
||||
import java.io.IOException;
|
||||
import java.net.URI;
|
||||
import java.nio.file.CopyOption;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.util.ArrayList;
|
||||
|
@ -113,23 +114,21 @@ public class BaseBuilder
|
|||
Modules modules = startArgs.getAllModules();
|
||||
|
||||
// Select all the added modules to determine which ones are newly enabled
|
||||
|
||||
|
||||
Set<String> newly_enabled = new HashSet<>();
|
||||
Set<String> newly_added = new HashSet<>();
|
||||
if (!startArgs.getStartModules().isEmpty())
|
||||
{
|
||||
for (String name:startArgs.getStartModules())
|
||||
newly_enabled.addAll(modules.enable(name,"--add-to-start[d]"));
|
||||
newly_added.addAll(modules.enable(name,"--add-to-start"));
|
||||
}
|
||||
|
||||
if (StartLog.isDebugEnabled())
|
||||
StartLog.debug("start[d]=%s",newly_enabled);
|
||||
StartLog.debug("added=%s",newly_added);
|
||||
|
||||
// Check the licenses
|
||||
if (startArgs.isLicenseCheckRequired())
|
||||
{
|
||||
Licensing licensing = new Licensing();
|
||||
for (String name : newly_enabled)
|
||||
for (String name : newly_added)
|
||||
licensing.addModule(modules.get(name));
|
||||
|
||||
if (licensing.hasLicenses())
|
||||
|
@ -151,22 +150,36 @@ public class BaseBuilder
|
|||
AtomicReference<BaseBuilder.Config> builder = new AtomicReference<>();
|
||||
AtomicBoolean modified = new AtomicBoolean();
|
||||
|
||||
if (!newly_enabled.isEmpty())
|
||||
Path startd = getBaseHome().getBasePath("start.d");
|
||||
Path startini = getBaseHome().getBasePath("start.ini");
|
||||
|
||||
if (startArgs.isCreateStartd() && !Files.exists(startd))
|
||||
{
|
||||
Path startd = getBaseHome().getBasePath("start.d");
|
||||
Path startini = getBaseHome().getBasePath("start.ini");
|
||||
|
||||
if(FS.ensureDirectoryExists(startd))
|
||||
modified.set(true);
|
||||
if (Files.exists(startini))
|
||||
{
|
||||
if (Files.exists(startd))
|
||||
StartLog.warn("Should not use both %s and %s",getBaseHome().toShortForm(startd),getBaseHome().toShortForm(startini));
|
||||
else if (startArgs.isUseStartd())
|
||||
throw new UsageException("Cannot --add-to-startd when %s exists",getBaseHome().toShortForm(startini));
|
||||
int ini=0;
|
||||
Path startd_startini=startd.resolve("start.ini");
|
||||
while(Files.exists(startd_startini))
|
||||
{
|
||||
ini++;
|
||||
startd_startini=startd.resolve("start"+ini+".ini");
|
||||
}
|
||||
Files.move(startini,startd_startini);
|
||||
modified.set(true);
|
||||
}
|
||||
}
|
||||
|
||||
if (!newly_added.isEmpty())
|
||||
{
|
||||
|
||||
boolean useStartD=startArgs.isUseStartd() || Files.exists(startd);
|
||||
if (Files.exists(startini) && Files.exists(startd))
|
||||
StartLog.warn("Use both %s and %s is deprecated",getBaseHome().toShortForm(startd),getBaseHome().toShortForm(startini));
|
||||
|
||||
boolean useStartD=Files.exists(startd);
|
||||
builder.set(useStartD?new StartDirBuilder(this):new StartIniBuilder(this));
|
||||
newly_enabled.stream().map(n->modules.get(n)).forEach(module ->
|
||||
newly_added.stream().map(n->modules.get(n)).forEach(module ->
|
||||
{
|
||||
try
|
||||
{
|
||||
|
|
|
@ -76,7 +76,7 @@ public class Main
|
|||
}
|
||||
catch (UsageException e)
|
||||
{
|
||||
System.err.println(e.getMessage());
|
||||
StartLog.warn(e.getMessage());
|
||||
usageExit(e.getCause(),e.getExitCode(),test);
|
||||
}
|
||||
catch (Throwable e)
|
||||
|
@ -197,7 +197,7 @@ public class Main
|
|||
}
|
||||
catch (ClassNotFoundException e)
|
||||
{
|
||||
System.out.println("WARNING: Nothing to start, exiting ...");
|
||||
StartLog.warn("Nothing to start, exiting ...");
|
||||
StartLog.debug(e);
|
||||
usageExit(ERR_INVOKE_MAIN);
|
||||
return;
|
||||
|
@ -452,7 +452,7 @@ public class Main
|
|||
|
||||
if (args.hasJvmArgs() || args.hasSystemProperties())
|
||||
{
|
||||
System.err.println("WARNING: System properties and/or JVM args set. Consider using --dry-run or --exec");
|
||||
StartLog.warn("System properties and/or JVM args set. Consider using --dry-run or --exec");
|
||||
}
|
||||
|
||||
ClassLoader cl = classpath.getClassLoader();
|
||||
|
@ -507,13 +507,13 @@ public class Main
|
|||
{
|
||||
if (port <= 0)
|
||||
{
|
||||
System.err.println("STOP.PORT system property must be specified");
|
||||
StartLog.warn("STOP.PORT system property must be specified");
|
||||
}
|
||||
if (key == null)
|
||||
{
|
||||
key = "";
|
||||
System.err.println("STOP.KEY system property must be specified");
|
||||
System.err.println("Using empty key");
|
||||
StartLog.info("STOP.KEY system property must be specified");
|
||||
StartLog.info("Using empty key");
|
||||
}
|
||||
|
||||
try (Socket s = new Socket(InetAddress.getByName(host),port))
|
||||
|
@ -530,7 +530,7 @@ public class Main
|
|||
|
||||
if (timeout > 0)
|
||||
{
|
||||
System.err.printf("Waiting %,d seconds for jetty to stop%n",timeout);
|
||||
StartLog.info("Waiting %,d seconds for jetty to stop%n",timeout);
|
||||
LineNumberReader lin = new LineNumberReader(new InputStreamReader(s.getInputStream()));
|
||||
String response;
|
||||
while ((response = lin.readLine()) != null)
|
||||
|
@ -547,7 +547,7 @@ public class Main
|
|||
}
|
||||
catch (SocketTimeoutException e)
|
||||
{
|
||||
System.err.println("Timed out waiting for stop confirmation");
|
||||
StartLog.warn("Timed out waiting for stop confirmation");
|
||||
System.exit(ERR_UNKNOWN);
|
||||
}
|
||||
catch (ConnectException e)
|
||||
|
@ -565,7 +565,7 @@ public class Main
|
|||
StartLog.endStartLog();
|
||||
if(!printTextResource("org/eclipse/jetty/start/usage.txt"))
|
||||
{
|
||||
System.err.println("ERROR: detailed usage resource unavailable");
|
||||
StartLog.warn("detailed usage resource unavailable");
|
||||
}
|
||||
if (exit)
|
||||
{
|
||||
|
@ -592,7 +592,7 @@ public class Main
|
|||
}
|
||||
else
|
||||
{
|
||||
System.out.println("Unable to find resource: " + resourceName);
|
||||
StartLog.warn("Unable to find resource: " + resourceName);
|
||||
}
|
||||
}
|
||||
catch (IOException e)
|
||||
|
@ -613,7 +613,7 @@ public class Main
|
|||
}
|
||||
catch (UsageException e)
|
||||
{
|
||||
System.err.println(e.getMessage());
|
||||
StartLog.warn(e.getMessage());
|
||||
usageExit(e.getCause(),e.getExitCode(),startupArgs.isTestingModeEnabled());
|
||||
}
|
||||
catch (Throwable e)
|
||||
|
|
|
@ -19,8 +19,10 @@
|
|||
package org.eclipse.jetty.start;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.BufferedWriter;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
import java.io.PrintWriter;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
|
@ -486,4 +488,20 @@ public class Module
|
|||
{
|
||||
return isEnabled() && !_notTransitive;
|
||||
}
|
||||
|
||||
public void writeIniSection(BufferedWriter writer)
|
||||
{
|
||||
PrintWriter out = new PrintWriter(writer);
|
||||
out.println("# --------------------------------------- ");
|
||||
out.println("# Module: " + getName());
|
||||
for (String line : getDescription())
|
||||
out.append("# ").println(line);
|
||||
out.println("# --------------------------------------- ");
|
||||
out.println("--module=" + getName());
|
||||
out.println();
|
||||
for (String line : getIniTemplate())
|
||||
out.println(line);
|
||||
out.println();
|
||||
out.flush();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -364,7 +364,7 @@ public class Modules implements Iterable<Module>
|
|||
if (unsatisfied.length()>0)
|
||||
unsatisfied.append(',');
|
||||
unsatisfied.append(m.getName());
|
||||
System.err.printf("%nWARN: Module %s requires %s from one of %s%n",m.getName(),d,providers);
|
||||
StartLog.warn("Module %s requires %s from one of %s%n",m.getName(),d,providers);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
|
@ -175,7 +175,7 @@ public class StartArgs
|
|||
private boolean listConfig = false;
|
||||
private boolean version = false;
|
||||
private boolean dryRun = false;
|
||||
private boolean useStartd = false;
|
||||
private boolean createStartd = false;
|
||||
|
||||
private boolean exec = false;
|
||||
private String exec_properties;
|
||||
|
@ -775,9 +775,9 @@ public class StartArgs
|
|||
return version;
|
||||
}
|
||||
|
||||
public boolean isUseStartd()
|
||||
public boolean isCreateStartd()
|
||||
{
|
||||
return useStartd;
|
||||
return createStartd;
|
||||
}
|
||||
|
||||
public void parse(ConfigSources sources)
|
||||
|
@ -947,14 +947,28 @@ public class StartArgs
|
|||
}
|
||||
|
||||
// jetty.base build-out : add to ${jetty.base}/start.ini
|
||||
if (arg.startsWith("--add-to-startd=")||
|
||||
arg.startsWith("--add-to-start="))
|
||||
if ("--create-startd".equals(arg))
|
||||
{
|
||||
if (arg.startsWith("--add-to-startd="))
|
||||
useStartd=true;
|
||||
|
||||
List<String> moduleNames = Props.getValues(arg);
|
||||
startModules.addAll(moduleNames);
|
||||
createStartd=true;
|
||||
run = false;
|
||||
download = true;
|
||||
licenseCheckRequired = true;
|
||||
return;
|
||||
}
|
||||
if (arg.startsWith("--add-to-startd="))
|
||||
{
|
||||
String value = Props.getValue(arg);
|
||||
StartLog.warn("--add-to-startd is deprecated! Instead use:%n %s",value);
|
||||
createStartd=true;
|
||||
startModules.addAll(Props.getValues(arg));
|
||||
run = false;
|
||||
download = true;
|
||||
licenseCheckRequired = true;
|
||||
return;
|
||||
}
|
||||
if (arg.startsWith("--add=") || arg.startsWith("--add-to-start="))
|
||||
{
|
||||
startModules.addAll(Props.getValues(arg));
|
||||
run = false;
|
||||
download = true;
|
||||
licenseCheckRequired = true;
|
||||
|
|
|
@ -84,12 +84,12 @@ public class StartLog
|
|||
|
||||
public static void info(String format, Object... args)
|
||||
{
|
||||
log("INFO",format,args);
|
||||
log("INFO ",format,args);
|
||||
}
|
||||
|
||||
public static void warn(String format, Object... args)
|
||||
{
|
||||
log("WARNING",format,args);
|
||||
log("WARN ",format,args);
|
||||
}
|
||||
|
||||
public static void warn(Throwable t)
|
||||
|
|
|
@ -76,29 +76,11 @@ public class StartDirBuilder implements BaseBuilder.Config
|
|||
|
||||
try (BufferedWriter writer = Files.newBufferedWriter(ini,StandardCharsets.UTF_8,StandardOpenOption.CREATE,StandardOpenOption.TRUNCATE_EXISTING))
|
||||
{
|
||||
writeModuleSection(writer,module);
|
||||
module.writeIniSection(writer);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
protected void writeModuleSection(BufferedWriter writer, Module module)
|
||||
{
|
||||
PrintWriter out = new PrintWriter(writer);
|
||||
|
||||
out.println("# --------------------------------------- ");
|
||||
out.println("# Module: " + module.getName());
|
||||
out.println("--module=" + module.getName());
|
||||
out.println();
|
||||
|
||||
for (String line : module.getIniTemplate())
|
||||
{
|
||||
out.println(line);
|
||||
}
|
||||
|
||||
out.println();
|
||||
out.flush();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -118,29 +118,11 @@ public class StartIniBuilder implements BaseBuilder.Config
|
|||
// Append to start.ini
|
||||
try (BufferedWriter writer = Files.newBufferedWriter(startIni,StandardCharsets.UTF_8,StandardOpenOption.APPEND,StandardOpenOption.CREATE))
|
||||
{
|
||||
writeModuleSection(writer,module);
|
||||
module.writeIniSection(writer);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
protected void writeModuleSection(BufferedWriter writer, Module module)
|
||||
{
|
||||
PrintWriter out = new PrintWriter(writer);
|
||||
|
||||
out.println("# --------------------------------------- ");
|
||||
out.println("# Module: " + module.getName());
|
||||
out.println("--module=" + module.getName());
|
||||
out.println();
|
||||
|
||||
for (String line : module.getIniTemplate())
|
||||
{
|
||||
out.println(line);
|
||||
}
|
||||
|
||||
out.println();
|
||||
out.flush();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -73,23 +73,37 @@ Module Management:
|
|||
Note: this can also be used in the ${jetty.base}/start.ini
|
||||
or ${jetty.base}/start.d/*.ini files.
|
||||
|
||||
--add=<modulename>(,<modulename>)*
|
||||
--add-to-start=<modulename>(,<modulename>)*
|
||||
Enable a module. If the directory ${jetty.base}/start.d
|
||||
Add the modules to the list of modules enabled at start.
|
||||
Transitive dependencies are followed and dependent
|
||||
modules may also explicitly added.
|
||||
Modules are added to the start by creating an ini file
|
||||
that contains the --module argument and any other parameters
|
||||
defined in the modules ini template.
|
||||
If the directory ${jetty.base}/start.d
|
||||
exists then <modulename>.ini files are created within
|
||||
that directory, otherwise then enabling configuration
|
||||
is appended to the ${jetty.base}/start.ini file.
|
||||
|
||||
FS.ensureDirectoryExists(startDir);
|
||||
FS.ensureDirectoryExists(startDir);
|
||||
modules that the specified module depends on are also
|
||||
.
|
||||
If the directory ${jetty.base}/start.d
|
||||
exists then <modulename>.ini files are created within
|
||||
that directory, otherwise then enabling configuration
|
||||
is appended to the ${jetty.base}/start.ini file.
|
||||
Lines that are added come from the ini template that
|
||||
the module itself maintains.
|
||||
Transitive module dependencies are followed and all
|
||||
modules that the specified module depends on are also
|
||||
enabled.
|
||||
|
||||
Note: not all modules have ini templates and thus may
|
||||
be transitively enabled and not explicitly enabled in
|
||||
a ini file.
|
||||
|
||||
--add-to-startd=<modulename>(,<modulename>)*
|
||||
Ensure that a start.d directory exists and then enable
|
||||
the module as for --add-to-start
|
||||
--create-startd Ensure that a start.d directory exists for use by
|
||||
subsequent --add-to-start=*. If a start.ini file exists
|
||||
it is moved to the start.d directory
|
||||
|
||||
--write-module-graph=<filename>
|
||||
Create a graphviz *.dot file of the module graph as it
|
||||
|
|
|
@ -20,12 +20,15 @@ package org.eclipse.jetty.start;
|
|||
|
||||
import static org.hamcrest.Matchers.greaterThan;
|
||||
import static org.hamcrest.Matchers.greaterThanOrEqualTo;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
import java.io.PrintWriter;
|
||||
import java.io.StringWriter;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
|
@ -148,30 +151,14 @@ public class ConfigurationAssert
|
|||
}
|
||||
}
|
||||
assertContainsUnordered("Downloads",expectedDownloads,actualDownloads);
|
||||
|
||||
// Validate Files/Dirs creation
|
||||
List<String> expectedFiles = new ArrayList<>();
|
||||
for(String line: textFile)
|
||||
{
|
||||
if(line.startsWith("FILE|"))
|
||||
{
|
||||
expectedFiles.add(getValue(line));
|
||||
}
|
||||
}
|
||||
List<String> actualFiles = new ArrayList<>();
|
||||
for(FileArg farg: args.getFiles())
|
||||
{
|
||||
if(farg.uri == null)
|
||||
{
|
||||
actualFiles.add(farg.location);
|
||||
}
|
||||
}
|
||||
assertContainsUnordered("Files/Dirs",expectedFiles,actualFiles);
|
||||
|
||||
|
||||
textFile.stream()
|
||||
.filter(s->s.startsWith("EXISTS|"))
|
||||
.map(s->baseHome.getPath(s.substring(7)).toFile())
|
||||
.forEach(f->Assert.assertTrue(f+" exists?",f.exists()));
|
||||
.filter(s->s.startsWith("EXISTS|")).map(f->f.substring(7)).forEach(f->
|
||||
{
|
||||
Path path=baseHome.getBasePath().resolve(f);
|
||||
assertTrue(baseHome.toShortForm(path)+" exists?",Files.exists(path));
|
||||
assertEquals(baseHome.toShortForm(path)+" isDir?",f.endsWith("/"),Files.isDirectory(path));
|
||||
});
|
||||
}
|
||||
|
||||
private static String shorten(BaseHome baseHome, Path path, Path testResourcesDir)
|
||||
|
|
|
@ -28,6 +28,7 @@ public class PropertyDump
|
|||
{
|
||||
public static void main(String[] args)
|
||||
{
|
||||
System.out.printf("PropertyDump%n");
|
||||
// As System Properties
|
||||
Properties props = System.getProperties();
|
||||
Enumeration<?> names = props.propertyNames();
|
||||
|
@ -37,7 +38,7 @@ public class PropertyDump
|
|||
// only interested in "test." prefixed properties
|
||||
if (name.startsWith("test."))
|
||||
{
|
||||
System.out.printf("%s=%s%n",name,props.getProperty(name));
|
||||
System.out.printf("System %s=%s%n",name,props.getProperty(name));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -48,7 +49,6 @@ public class PropertyDump
|
|||
{
|
||||
Properties aprops = new Properties();
|
||||
File propFile = new File(arg);
|
||||
System.out.printf("[load file %s]%n",propFile.getName());
|
||||
try (FileReader reader = new FileReader(propFile))
|
||||
{
|
||||
aprops.load(reader);
|
||||
|
@ -58,7 +58,7 @@ public class PropertyDump
|
|||
String name = (String)anames.nextElement();
|
||||
if (name.startsWith("test."))
|
||||
{
|
||||
System.out.printf("%s=%s%n",name,aprops.getProperty(name));
|
||||
System.out.printf("%s %s=%s%n",propFile.getName(),name,aprops.getProperty(name));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -30,6 +30,8 @@ import java.io.PrintWriter;
|
|||
import java.io.StringWriter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import org.eclipse.jetty.toolchain.test.IO;
|
||||
import org.eclipse.jetty.toolchain.test.MavenTestingUtils;
|
||||
|
@ -45,6 +47,7 @@ public class PropertyPassingTest
|
|||
private String mode;
|
||||
private BufferedReader reader;
|
||||
private StringWriter output;
|
||||
private CountDownLatch latch=new CountDownLatch(1);
|
||||
|
||||
public ConsoleCapture(String mode, InputStream is)
|
||||
{
|
||||
|
@ -62,6 +65,7 @@ public class PropertyPassingTest
|
|||
while ((line = reader.readLine()) != (null))
|
||||
{
|
||||
out.println(line);
|
||||
out.flush();
|
||||
}
|
||||
}
|
||||
catch (IOException ignore)
|
||||
|
@ -71,11 +75,13 @@ public class PropertyPassingTest
|
|||
finally
|
||||
{
|
||||
IO.close(reader);
|
||||
latch.countDown();
|
||||
}
|
||||
}
|
||||
|
||||
public String getConsoleOutput()
|
||||
public String getConsoleOutput() throws InterruptedException
|
||||
{
|
||||
latch.await(30,TimeUnit.SECONDS);
|
||||
return output.toString();
|
||||
}
|
||||
|
||||
|
@ -154,9 +160,9 @@ public class PropertyPassingTest
|
|||
|
||||
// Run command, collect output
|
||||
String output = collectRunOutput(commands);
|
||||
|
||||
|
||||
// Test for values
|
||||
Assert.assertThat("output",output,containsString("foo=bar"));
|
||||
Assert.assertThat(output,containsString("test.foo=bar"));
|
||||
}
|
||||
|
||||
private String getClassPath()
|
||||
|
@ -201,6 +207,7 @@ public class PropertyPassingTest
|
|||
System.out.printf("STDOUT: [" + stdOutPump.getConsoleOutput() + "]%n");
|
||||
Assert.assertThat("Exit code",exitCode,is(0));
|
||||
}
|
||||
stdErrPump.getConsoleOutput();
|
||||
return stdOutPump.getConsoleOutput();
|
||||
}
|
||||
|
||||
|
|
|
@ -10,6 +10,3 @@ LIB|${jetty.base}/lib/agent-jdk-1.7.jar
|
|||
|
||||
# The Properties we expect (order is irrelevant)
|
||||
PROP|main.prop=value0
|
||||
|
||||
# Files / Directories to create
|
||||
FILE|maindir/
|
||||
|
|
|
@ -10,6 +10,3 @@ LIB|${jetty.home}/lib/other.jar
|
|||
# The Properties we expect (order is irrelevant)
|
||||
PROP|main.prop=value0
|
||||
PROP|noDft.option=A
|
||||
|
||||
# Files / Directories to create
|
||||
FILE|maindir/
|
||||
|
|
|
@ -13,6 +13,3 @@ LIB|${jetty.home}/lib/other.jar
|
|||
PROP|main.prop=value0
|
||||
PROP|default.option=default
|
||||
PROP|noDft.option=B
|
||||
|
||||
# Files / Directories to create
|
||||
FILE|maindir/
|
||||
|
|
|
@ -12,6 +12,3 @@ LIB|${jetty.home}/lib/other.jar
|
|||
PROP|main.prop=value0
|
||||
PROP|default.option=alternate
|
||||
PROP|noDft.option=B
|
||||
|
||||
# Files / Directories to create
|
||||
FILE|maindir/
|
||||
|
|
|
@ -12,6 +12,3 @@ LIB|${jetty.home}/lib/other.jar
|
|||
PROP|main.prop=value0
|
||||
PROP|default.option=alternate
|
||||
PROP|noDft.option=B
|
||||
|
||||
# Files / Directories to create
|
||||
FILE|maindir/
|
||||
|
|
|
@ -14,5 +14,5 @@ PROP|main.prop=value0
|
|||
PROP|optional.prop=value0
|
||||
|
||||
# Files / Directories to create
|
||||
FILE|maindir/
|
||||
EXISTS|maindir/
|
||||
EXISTS|start.ini
|
||||
|
|
|
@ -1 +1,19 @@
|
|||
EX|org.eclipse.jetty.start.UsageException: Cannot --add-to-startd when ${jetty.base}/start.ini exists
|
||||
## The XMLs we expect (order is important)
|
||||
XML|${jetty.home}/etc/optional.xml
|
||||
XML|${jetty.home}/etc/base.xml
|
||||
XML|${jetty.home}/etc/main.xml
|
||||
|
||||
# The LIBs we expect (order is irrelevant)
|
||||
LIB|${jetty.home}/lib/base.jar
|
||||
LIB|${jetty.home}/lib/main.jar
|
||||
LIB|${jetty.home}/lib/other.jar
|
||||
LIB|${jetty.home}/lib/optional.jar
|
||||
|
||||
# The Properties we expect (order is irrelevant)
|
||||
PROP|main.prop=value0
|
||||
PROP|optional.prop=value0
|
||||
|
||||
# Files / Directories to create
|
||||
EXISTS|maindir/
|
||||
EXISTS|start.d/start.ini
|
||||
EXISTS|start.d/optional.ini
|
||||
|
|
|
@ -1 +1 @@
|
|||
--add-to-startd=optional
|
||||
--create-startd --add=optional
|
||||
|
|
|
@ -1 +1 @@
|
|||
--add-to-startd=unknown
|
||||
--create-startd --add=unknown
|
||||
|
|
|
@ -9,6 +9,3 @@ LIB|${jetty.home}/lib/other.jar
|
|||
|
||||
# The Properties we expect (order is irrelevant)
|
||||
PROP|main.prop=value0
|
||||
|
||||
# Files / Directories to create
|
||||
FILE|maindir/
|
||||
|
|
|
@ -12,6 +12,3 @@ PROP|main.prop=value0
|
|||
PROP|port=9090
|
||||
PROP|other=value
|
||||
PROP|jetty.http.port=9090
|
||||
|
||||
# Files / Directories to create
|
||||
FILE|maindir/
|
||||
|
|
|
@ -14,7 +14,3 @@ LIB|${jetty.base}/lib/db/mysql-driver.jar
|
|||
PROP|main.prop=value0
|
||||
PROP|mysql.user=frank
|
||||
PROP|mysql.pass=secret
|
||||
|
||||
|
||||
# Files / Directories to create
|
||||
FILE|maindir/
|
||||
|
|
|
@ -1 +1 @@
|
|||
--add-to-startd=tom
|
||||
--create-startd --add=tom
|
||||
|
|
|
@ -10,6 +10,3 @@ LIB|${jetty.home}/lib/other.jar
|
|||
# The Properties we expect (order is irrelevant)
|
||||
PROP|main.prop=value0
|
||||
PROP|dynamic=1.7.0_31-from-mod
|
||||
|
||||
# Files / Directories to create
|
||||
FILE|maindir/
|
||||
|
|
|
@ -10,6 +10,3 @@ LIB|${jetty.home}/lib/other.jar
|
|||
# The Properties we expect (order is irrelevant)
|
||||
PROP|main.prop=value0
|
||||
PROP|dynamic=1.8.0_05_from_mod
|
||||
|
||||
# Files / Directories to create
|
||||
FILE|maindir/
|
||||
|
|
|
@ -18,5 +18,5 @@ PROP|main.prop=valueT
|
|||
PROP|optional.prop=value0
|
||||
|
||||
# Files / Directories to create
|
||||
FILE|maindir/
|
||||
EXISTS|maindir/
|
||||
EXISTS|start.ini
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
EX|org.eclipse.jetty.start.UsageException: Cannot --add-to-startd when ${jetty.base}/start.ini exists
|
|
@ -1,2 +0,0 @@
|
|||
--add-to-start=extra
|
||||
--add-to-startd=optional
|
|
@ -18,7 +18,6 @@ PROP|main.prop=valueT
|
|||
PROP|optional.prop=value0
|
||||
|
||||
# Files / Directories to create
|
||||
FILE|maindir/
|
||||
EXISTS|start.d/extra.ini
|
||||
EXISTS|maindir/
|
||||
EXISTS|start.d/start.ini
|
||||
EXISTS|start.d/optional.ini
|
||||
EXISTS|start.d/main.ini
|
|
@ -0,0 +1,2 @@
|
|||
--add=extra
|
||||
--create-startd --add=optional
|
|
@ -1 +0,0 @@
|
|||
--add-to-startd=extra,optional
|
|
@ -1,2 +0,0 @@
|
|||
--add-to-startd=extra
|
||||
--add-to-start=optional
|
|
@ -18,7 +18,8 @@ PROP|main.prop=valueT
|
|||
PROP|optional.prop=value0
|
||||
|
||||
# Files / Directories to create
|
||||
FILE|maindir/
|
||||
EXISTS|maindir/
|
||||
EXISTS|start.d/
|
||||
EXISTS|start.d/main.ini
|
||||
EXISTS|start.d/extra.ini
|
||||
EXISTS|start.d/optional.ini
|
||||
EXISTS|start.d/main.ini
|
|
@ -0,0 +1,2 @@
|
|||
--create-startd
|
||||
--add-to-start=extra,optional
|
|
@ -1 +1 @@
|
|||
--add-to-startd=demo
|
||||
--create-startd --add=demo
|
||||
|
|
|
@ -1 +1 @@
|
|||
--add-to-startd=tom
|
||||
--create-startd --add=tom
|
||||
|
|
|
@ -1 +1 @@
|
|||
--add-to-startd=abstractB,abstractA
|
||||
--create-startd --add=abstractB,abstractA
|
||||
|
|
|
@ -12,6 +12,3 @@ LIB|${jetty.home}/lib/other.jar
|
|||
# The Properties we expect (order is irrelevant)
|
||||
PROP|main.prop=value0
|
||||
PROP|direct.option=direct
|
||||
|
||||
# Files / Directories to create
|
||||
FILE|maindir/
|
||||
|
|
|
@ -13,6 +13,3 @@ LIB|${jetty.home}/lib/other.jar
|
|||
PROP|main.prop=value0
|
||||
PROP|transient.option=transient
|
||||
PROP|direct.option=direct
|
||||
|
||||
# Files / Directories to create
|
||||
FILE|maindir/
|
||||
|
|
|
@ -11,6 +11,3 @@ LIB|${jetty.home}/lib/other.jar
|
|||
PROP|main.prop=value0
|
||||
PROP|the-future=is-new
|
||||
PROP|from-module=old
|
||||
|
||||
# Files / Directories to create
|
||||
FILE|maindir/
|
||||
|
|
|
@ -10,8 +10,7 @@ jcl-impl
|
|||
jcl-api
|
||||
|
||||
[files]
|
||||
maven://org.slf4j/jcl-over-slf4j/1.7.21|lib/slf4j/jcl-over-slf4j-1.7.21.jar
|
||||
maven://org.slf4j/jcl-over-slf4j/${slf4j.version}|lib/slf4j/jcl-over-slf4j-${slf4j.version}.jar
|
||||
|
||||
[lib]
|
||||
lib/slf4j/jcl-over-slf4j-1.7.21.jar
|
||||
|
||||
lib/slf4j/jcl-over-slf4j-${slf4j.version}.jar
|
||||
|
|
|
@ -9,11 +9,18 @@ jcl-api
|
|||
jcl-impl
|
||||
|
||||
[files]
|
||||
maven://commons-logging/commons-logging/1.1.3|lib/jcl/commons-logging-1.1.3.jar
|
||||
maven://commons-logging/commons-logging/${jcl.version}|lib/jcl/commons-logging-${jcl.version}.jar
|
||||
|
||||
[lib]
|
||||
lib/jcl/commons-logging-1.1.3.jar
|
||||
lib/jcl/commons-logging-${jcl.version}.jar
|
||||
|
||||
[license]
|
||||
Log4j is released under the Apache 2.0 license.
|
||||
http://www.apache.org/licenses/LICENSE-2.0.html
|
||||
|
||||
[ini]
|
||||
jcl.version=1.1.3
|
||||
|
||||
[ini-template]
|
||||
## After changing versions, run 'java -jar $JETTY_HOME/start.jar --create-files'
|
||||
#jcl.version=1.1.3
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
[description]
|
||||
Provides a Jetty Logging implementation that logs to the log4j API.
|
||||
Uses the slf4j mechanism as an intermediary
|
||||
Requires another module that provides an log4j implementation.
|
||||
|
||||
[depend]
|
||||
jetty-slf4j
|
||||
slf4j-log4j
|
|
@ -4,6 +4,7 @@ Requires another module that provides and Log4j v2 implementation.
|
|||
To receive jetty logs the jetty-slf4j and slf4j-log4j must also be enabled.
|
||||
|
||||
[depends]
|
||||
log4j2-api
|
||||
log4j2-impl
|
||||
|
||||
[provides]
|
||||
|
@ -11,8 +12,7 @@ log4j-api
|
|||
log4j-impl
|
||||
|
||||
[files]
|
||||
maven://org.apache.logging.log4j/log4j-1.2-api/2.6.1|lib/log4j/log4j-1.2-api-2.6.1.jar
|
||||
maven://org.apache.logging.log4j/log4j-1.2-api/${log4j2.version}|lib/log4j/log4j-1.2-api-${log4j2.version}.jar
|
||||
|
||||
[lib]
|
||||
lib/log4j/log4j-1.2-api-2.6.1.jar
|
||||
|
||||
lib/log4j/log4j-1.2-api-${log4j2.version}.jar
|
||||
|
|
|
@ -11,11 +11,18 @@ log4j-impl
|
|||
|
||||
[files]
|
||||
basehome:modules/log4j/log4j.properties|resources/log4j.properties
|
||||
maven://log4j/log4j/1.2.17|lib/log4j/log4j-1.2.17.jar
|
||||
maven://log4j/log4j/${log4j.version}|lib/log4j/log4j-${log4j.version}.jar
|
||||
|
||||
[lib]
|
||||
lib/log4j/log4j-1.2.17.jar
|
||||
lib/log4j/log4j-${log4j.version}.jar
|
||||
|
||||
[license]
|
||||
Log4j is released under the Apache 2.0 license.
|
||||
http://www.apache.org/licenses/LICENSE-2.0.html
|
||||
|
||||
[ini]
|
||||
log4j.version=1.2.17
|
||||
|
||||
[ini-template]
|
||||
## After changing versions, run 'java -jar $JETTY_HOME/start.jar --create-files'
|
||||
#log4j.version=1.2.17
|
||||
|
|
|
@ -4,11 +4,18 @@ Requires another module that provides an Log4j v2 implementation.
|
|||
To receive jetty logs enable the jetty-slf4j, slf4j-log4j and log4j-log4j2 modules.
|
||||
|
||||
[files]
|
||||
maven://org.apache.logging.log4j/log4j-api/2.6.1|lib/log4j/log4j-api-2.6.1.jar
|
||||
maven://org.apache.logging.log4j/log4j-api/${log4j2.version}|lib/log4j/log4j-api-${log4j2.version}.jar
|
||||
|
||||
[lib]
|
||||
lib/log4j/log4j-api-2.6.1.jar
|
||||
lib/log4j/log4j-api-${log4j2.version}.jar
|
||||
|
||||
[license]
|
||||
Log4j is released under the Apache 2.0 license.
|
||||
http://www.apache.org/licenses/LICENSE-2.0.html
|
||||
|
||||
[ini]
|
||||
log4j2.version=2.6.1
|
||||
|
||||
[ini-template]
|
||||
## After changing versions, run 'java -jar $JETTY_HOME/start.jar --create-files'
|
||||
#log4j2.version=2.6.1
|
||||
|
|
|
@ -10,8 +10,8 @@ log4j2-impl
|
|||
|
||||
[files]
|
||||
basehome:modules/log4j2/log4j2.properties|resources/log4j2.properties
|
||||
maven://org.apache.logging.log4j/log4j-core/2.6.1|lib/log4j/log4j-core-2.6.1.jar
|
||||
maven://org.apache.logging.log4j/log4j-core/${log4j2.version}|lib/log4j/log4j-core-${log4j2.version}.jar
|
||||
|
||||
[lib]
|
||||
lib/log4j/log4j-core-2.6.1.jar
|
||||
lib/log4j/log4j-core-${log4j2.version}.jar
|
||||
|
||||
|
|
|
@ -11,8 +11,8 @@ slf4j-api
|
|||
log4j2-impl
|
||||
|
||||
[files]
|
||||
maven://org.apache.logging.log4j/log4j-to-slf4j/2.6.1|lib/log4j/log4j-to-slf4j-2.6.1.jar
|
||||
maven://org.apache.logging.log4j/log4j-to-slf4j/${log4j2.version}|lib/log4j/log4j-to-slf4j-${log4j2.version}.jar
|
||||
|
||||
[lib]
|
||||
lib/log4j/log4j-slf4j-to-2.6.1.jar
|
||||
lib/log4j/log4j-slf4j-to-${log4j2.version}.jar
|
||||
|
||||
|
|
|
@ -3,10 +3,17 @@ Provides SLF4J API. Requires a slf4j implementation (eg slf4j-simple)
|
|||
otherwise a noop implementation is used.
|
||||
|
||||
[files]
|
||||
maven://org.slf4j/slf4j-api/1.7.21|lib/slf4j/slf4j-api-1.7.21.jar
|
||||
maven://org.slf4j/slf4j-api/${slf4j.version}|lib/slf4j/slf4j-api-${slf4j.version}.jar
|
||||
|
||||
[lib]
|
||||
lib/slf4j/slf4j-api-1.7.21.jar
|
||||
lib/slf4j/slf4j-api-${slf4j.version}.jar
|
||||
|
||||
[ini]
|
||||
slf4j.version=1.7.21
|
||||
|
||||
[ini-template]
|
||||
## After changing versions, run 'java -jar $JETTY_HOME/start.jar --create-files'
|
||||
#slf4j.version=1.7.21
|
||||
|
||||
[license]
|
||||
SLF4J is distributed under the MIT License.
|
||||
|
|
|
@ -11,10 +11,10 @@ jcl-api
|
|||
slf4j-impl
|
||||
|
||||
[files]
|
||||
maven://org.slf4j/slf4j-jcl/1.7.21|lib/slf4j/slf4j-jcl-1.7.21.jar
|
||||
maven://org.slf4j/slf4j-jcl/${slf4j.version}|lib/slf4j/slf4j-jcl-${slf4j.version}.jar
|
||||
|
||||
[lib]
|
||||
lib/slf4j/slf4j-jcl-1.7.21.jar
|
||||
lib/slf4j/slf4j-jcl-${slf4j.version}.jar
|
||||
|
||||
[exec]
|
||||
-Dorg.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.Slf4jLog
|
||||
|
|
|
@ -11,8 +11,8 @@ log4j-api
|
|||
slf4j-impl
|
||||
|
||||
[files]
|
||||
maven://org.slf4j/slf4j-log4j12/1.7.21|lib/slf4j/slf4j-log4j12-1.7.21.jar
|
||||
maven://org.slf4j/slf4j-log4j12/${slf4j.version}|lib/slf4j/slf4j-log4j12-${slf4j.version}.jar
|
||||
|
||||
[lib]
|
||||
lib/slf4j/slf4j-log4j12-1.7.21.jar
|
||||
lib/slf4j/slf4j-log4j12-${slf4j.version}.jar
|
||||
|
||||
|
|
|
@ -9,10 +9,10 @@ slf4j-api
|
|||
slf4j-impl
|
||||
|
||||
[files]
|
||||
maven://org.slf4j/slf4j-simple/1.7.21|lib/slf4j/slf4j-simple-1.7.21.jar
|
||||
maven://org.slf4j/slf4j-simple/${slf4j.version}|lib/slf4j/slf4j-simple-${slf4j.version}.jar
|
||||
|
||||
[lib]
|
||||
lib/slf4j/slf4j-simple-1.7.21.jar
|
||||
lib/slf4j/slf4j-simple-${slf4j.version}.jar
|
||||
|
||||
[exec]
|
||||
-Dorg.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.Slf4jLog
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<configuration>
|
||||
<skipTests>true</skipTests>
|
||||
<test>GCloudTestSuite</test>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
|
|
|
@ -32,25 +32,18 @@ import org.junit.Test;
|
|||
*/
|
||||
public class ClientCrossContextSessionTest extends AbstractClientCrossContextSessionTest
|
||||
{
|
||||
static GCloudSessionTestSupport _testSupport;
|
||||
|
||||
@BeforeClass
|
||||
public static void setup () throws Exception
|
||||
{
|
||||
_testSupport = new GCloudSessionTestSupport();
|
||||
_testSupport.setUp();
|
||||
}
|
||||
|
||||
|
||||
@AfterClass
|
||||
public static void teardown () throws Exception
|
||||
{
|
||||
_testSupport.tearDown();
|
||||
GCloudTestSuite.__testSupport.deleteSessions();
|
||||
}
|
||||
|
||||
@Override
|
||||
public AbstractTestServer createServer(int port, int maxInactiveMs, int scavengeMs,int evictionPolicy)
|
||||
{
|
||||
return new GCloudTestServer(port, maxInactiveMs, scavengeMs, evictionPolicy, _testSupport.getConfiguration());
|
||||
return new GCloudTestServer(port, maxInactiveMs, scavengeMs, evictionPolicy, GCloudTestSuite.__testSupport.getConfiguration());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
@ -31,25 +31,18 @@ import org.junit.BeforeClass;
|
|||
*/
|
||||
public class ForwardedSessionTest extends AbstractForwardedSessionTest
|
||||
{
|
||||
static GCloudSessionTestSupport _testSupport;
|
||||
|
||||
@BeforeClass
|
||||
public static void setup () throws Exception
|
||||
{
|
||||
_testSupport = new GCloudSessionTestSupport();
|
||||
_testSupport.setUp();
|
||||
}
|
||||
|
||||
@AfterClass
|
||||
public static void teardown () throws Exception
|
||||
{
|
||||
_testSupport.tearDown();
|
||||
GCloudTestSuite.__testSupport.deleteSessions();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public AbstractTestServer createServer(int port, int maxInactiveMs, int scavengeMs,int evictionPolicy)
|
||||
{
|
||||
return new GCloudTestServer(port, maxInactiveMs, scavengeMs, evictionPolicy, _testSupport.getConfiguration());
|
||||
return new GCloudTestServer(port, maxInactiveMs, scavengeMs, evictionPolicy, GCloudTestSuite.__testSupport.getConfiguration());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,73 @@
|
|||
//
|
||||
// ========================================================================
|
||||
// Copyright (c) 1995-2016 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.gcloud.session;
|
||||
|
||||
import org.junit.AfterClass;
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.Suite;
|
||||
|
||||
/**
|
||||
* GCloudTestSuite
|
||||
*
|
||||
* Sets up the gcloud emulator once before running all tests.
|
||||
*
|
||||
*/
|
||||
@RunWith(Suite.class)
|
||||
@Suite.SuiteClasses({
|
||||
ClientCrossContextSessionTest.class,
|
||||
ForwardedSessionTest.class,
|
||||
ImmediateSaveTest.class,
|
||||
ImmortalSessionTest.class,
|
||||
InvalidationSessionTest.class,
|
||||
LastAccessTimeTest.class,
|
||||
LocalSessionScavengingTest.class,
|
||||
NewSessionTest.class,
|
||||
OrphanedSessionTest.class,
|
||||
ReentrantRequestSessionTest.class,
|
||||
RemoveSessionTest.class,
|
||||
SameNodeLoadTest.class,
|
||||
ServerCrossContextSessionTest.class,
|
||||
SessionExpiryTest.class,
|
||||
SessionInvalidateAndCreateTest.class,
|
||||
SessionMigrationTest.class,
|
||||
SessionRenewTest.class,
|
||||
SessionValueSavingTest.class,
|
||||
StopSessionManagerPreserveSessionTest.class
|
||||
})
|
||||
|
||||
|
||||
public class GCloudTestSuite
|
||||
{
|
||||
public static GCloudSessionTestSupport __testSupport;
|
||||
|
||||
|
||||
@BeforeClass
|
||||
public static void setUp () throws Exception
|
||||
{
|
||||
__testSupport = new GCloudSessionTestSupport();
|
||||
__testSupport.setUp();
|
||||
}
|
||||
|
||||
@AfterClass
|
||||
public static void tearDown () throws Exception
|
||||
{
|
||||
__testSupport.tearDown();
|
||||
}
|
||||
}
|
|
@ -36,34 +36,19 @@ import org.junit.BeforeClass;
|
|||
*/
|
||||
public class ImmediateSaveTest extends AbstractImmediateSaveTest
|
||||
{
|
||||
|
||||
static GCloudSessionTestSupport _testSupport;
|
||||
|
||||
@BeforeClass
|
||||
public static void setup () throws Exception
|
||||
{
|
||||
_testSupport = new GCloudSessionTestSupport();
|
||||
_testSupport.setUp();
|
||||
}
|
||||
|
||||
|
||||
@After
|
||||
public void deleteSessions () throws Exception
|
||||
{
|
||||
_testSupport.deleteSessions();
|
||||
GCloudTestSuite.__testSupport.deleteSessions();
|
||||
}
|
||||
|
||||
|
||||
@AfterClass
|
||||
public static void teardown () throws Exception
|
||||
{
|
||||
_testSupport.tearDown();
|
||||
}
|
||||
|
||||
|
||||
|
||||
public AbstractTestServer createServer(int port, int max, int scavenge, int evictionPolicy)
|
||||
{
|
||||
return new GCloudTestServer(port, max, scavenge, evictionPolicy,_testSupport.getConfiguration())
|
||||
return new GCloudTestServer(port, max, scavenge, evictionPolicy, GCloudTestSuite.__testSupport.getConfiguration())
|
||||
{
|
||||
public SessionHandler newSessionHandler()
|
||||
{
|
||||
|
|
|
@ -32,22 +32,12 @@ import org.junit.Test;
|
|||
*/
|
||||
public class ImmortalSessionTest extends AbstractImmortalSessionTest
|
||||
{
|
||||
static GCloudSessionTestSupport _testSupport;
|
||||
|
||||
/**
|
||||
* @throws Exception
|
||||
*/
|
||||
@BeforeClass
|
||||
public static void setup () throws Exception
|
||||
{
|
||||
_testSupport = new GCloudSessionTestSupport();
|
||||
_testSupport.setUp();
|
||||
}
|
||||
|
||||
|
||||
@AfterClass
|
||||
public static void teardown () throws Exception
|
||||
{
|
||||
_testSupport.tearDown();
|
||||
GCloudTestSuite.__testSupport.deleteSessions();
|
||||
}
|
||||
/**
|
||||
* @see org.eclipse.jetty.server.session.AbstractImmortalSessionTest#createServer(int, int, int)
|
||||
|
@ -55,7 +45,7 @@ public class ImmortalSessionTest extends AbstractImmortalSessionTest
|
|||
@Override
|
||||
public AbstractTestServer createServer(int port, int maxInactiveMs, int scavengeMs,int evictionPolicy)
|
||||
{
|
||||
return new GCloudTestServer(port, maxInactiveMs, scavengeMs, evictionPolicy, _testSupport.getConfiguration());
|
||||
return new GCloudTestServer(port, maxInactiveMs, scavengeMs, evictionPolicy, GCloudTestSuite.__testSupport.getConfiguration());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
@ -34,20 +34,11 @@ import org.junit.Ignore;
|
|||
*/
|
||||
public class InvalidationSessionTest extends AbstractInvalidationSessionTest
|
||||
{
|
||||
static GCloudSessionTestSupport _testSupport;
|
||||
|
||||
|
||||
@BeforeClass
|
||||
public static void setup () throws Exception
|
||||
{
|
||||
_testSupport = new GCloudSessionTestSupport();
|
||||
_testSupport.setUp();
|
||||
}
|
||||
|
||||
@AfterClass
|
||||
public static void teardown () throws Exception
|
||||
{
|
||||
_testSupport.tearDown();
|
||||
GCloudTestSuite.__testSupport.deleteSessions();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -56,7 +47,7 @@ public class InvalidationSessionTest extends AbstractInvalidationSessionTest
|
|||
@Override
|
||||
public AbstractTestServer createServer(int port, int maxInactive, int scavengeInterval, int evictionPolicy)
|
||||
{
|
||||
GCloudTestServer server = new GCloudTestServer(port, maxInactive, scavengeInterval, evictionPolicy, _testSupport.getConfiguration())
|
||||
GCloudTestServer server = new GCloudTestServer(port, maxInactive, scavengeInterval, evictionPolicy, GCloudTestSuite.__testSupport.getConfiguration())
|
||||
{
|
||||
/**
|
||||
* @see org.eclipse.jetty.gcloud.session.GCloudTestServer#newSessionManager()
|
||||
|
|
|
@ -32,19 +32,11 @@ import org.junit.Test;
|
|||
*/
|
||||
public class LastAccessTimeTest extends AbstractLastAccessTimeTest
|
||||
{
|
||||
static GCloudSessionTestSupport _testSupport;
|
||||
|
||||
@BeforeClass
|
||||
public static void setup () throws Exception
|
||||
{
|
||||
_testSupport = new GCloudSessionTestSupport();
|
||||
_testSupport.setUp();
|
||||
}
|
||||
|
||||
@AfterClass
|
||||
public static void teardown () throws Exception
|
||||
{
|
||||
_testSupport.tearDown();
|
||||
GCloudTestSuite.__testSupport.deleteSessions();
|
||||
}
|
||||
/**
|
||||
* @see org.eclipse.jetty.server.session.AbstractLastAccessTimeTest#createServer(int, int, int)
|
||||
|
@ -52,7 +44,7 @@ public class LastAccessTimeTest extends AbstractLastAccessTimeTest
|
|||
@Override
|
||||
public AbstractTestServer createServer(int port, int max, int scavenge,int evictionPolicy)
|
||||
{
|
||||
return new GCloudTestServer(port, max, scavenge, evictionPolicy, _testSupport.getConfiguration());
|
||||
return new GCloudTestServer(port, max, scavenge, evictionPolicy, GCloudTestSuite.__testSupport.getConfiguration());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
@ -32,19 +32,11 @@ import org.junit.Test;
|
|||
*/
|
||||
public class LocalSessionScavengingTest extends AbstractLocalSessionScavengingTest
|
||||
{
|
||||
static GCloudSessionTestSupport _testSupport;
|
||||
|
||||
@BeforeClass
|
||||
public static void setup () throws Exception
|
||||
{
|
||||
_testSupport = new GCloudSessionTestSupport();
|
||||
_testSupport.setUp();
|
||||
}
|
||||
|
||||
@AfterClass
|
||||
public static void teardown () throws Exception
|
||||
{
|
||||
_testSupport.tearDown();
|
||||
GCloudTestSuite.__testSupport.deleteSessions();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -53,7 +45,7 @@ public class LocalSessionScavengingTest extends AbstractLocalSessionScavengingTe
|
|||
@Override
|
||||
public AbstractTestServer createServer(int port, int max, int scavenge,int evictionPolicy)
|
||||
{
|
||||
return new GCloudTestServer(port, max, scavenge, evictionPolicy, _testSupport.getConfiguration());
|
||||
return new GCloudTestServer(port, max, scavenge, evictionPolicy, GCloudTestSuite.__testSupport.getConfiguration());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
@ -37,19 +37,12 @@ import org.junit.Test;
|
|||
*/
|
||||
public class NewSessionTest extends AbstractNewSessionTest
|
||||
{
|
||||
GCloudSessionTestSupport _testSupport;
|
||||
|
||||
@Before
|
||||
public void setup () throws Exception
|
||||
{
|
||||
_testSupport = new GCloudSessionTestSupport();
|
||||
_testSupport.setUp();
|
||||
}
|
||||
|
||||
|
||||
@After
|
||||
public void teardown () throws Exception
|
||||
{
|
||||
_testSupport.tearDown();
|
||||
GCloudTestSuite.__testSupport.deleteSessions();
|
||||
}
|
||||
|
||||
|
||||
|
@ -59,7 +52,7 @@ public class NewSessionTest extends AbstractNewSessionTest
|
|||
@Override
|
||||
public AbstractTestServer createServer(int port, int max, int scavenge,int evictionPolicy)
|
||||
{
|
||||
return new GCloudTestServer(port, max, scavenge, evictionPolicy, _testSupport.getConfiguration());
|
||||
return new GCloudTestServer(port, max, scavenge, evictionPolicy, GCloudTestSuite.__testSupport.getConfiguration());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
@ -32,19 +32,11 @@ import org.junit.Test;
|
|||
*/
|
||||
public class OrphanedSessionTest extends AbstractOrphanedSessionTest
|
||||
{
|
||||
static GCloudSessionTestSupport _testSupport;
|
||||
|
||||
@BeforeClass
|
||||
public static void setup () throws Exception
|
||||
{
|
||||
_testSupport = new GCloudSessionTestSupport();
|
||||
_testSupport.setUp();
|
||||
}
|
||||
|
||||
@AfterClass
|
||||
public static void teardown () throws Exception
|
||||
{
|
||||
_testSupport.tearDown();
|
||||
GCloudTestSuite.__testSupport.deleteSessions();
|
||||
}
|
||||
|
||||
|
||||
|
@ -54,7 +46,7 @@ public class OrphanedSessionTest extends AbstractOrphanedSessionTest
|
|||
@Override
|
||||
public AbstractTestServer createServer(int port, int max, int scavenge,int evictionPolicy)
|
||||
{
|
||||
return new GCloudTestServer(port, max, scavenge, evictionPolicy, _testSupport.getConfiguration());
|
||||
return new GCloudTestServer(port, max, scavenge, evictionPolicy, GCloudTestSuite.__testSupport.getConfiguration());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -62,7 +54,7 @@ public class OrphanedSessionTest extends AbstractOrphanedSessionTest
|
|||
public void testOrphanedSession() throws Exception
|
||||
{
|
||||
super.testOrphanedSession();
|
||||
_testSupport.assertSessions(0);
|
||||
GCloudTestSuite.__testSupport.assertSessions(0);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -32,19 +32,11 @@ import org.junit.Test;
|
|||
*/
|
||||
public class ReentrantRequestSessionTest extends AbstractReentrantRequestSessionTest
|
||||
{
|
||||
static GCloudSessionTestSupport _testSupport;
|
||||
|
||||
@BeforeClass
|
||||
public static void setup () throws Exception
|
||||
{
|
||||
_testSupport = new GCloudSessionTestSupport();
|
||||
_testSupport.setUp();
|
||||
}
|
||||
|
||||
@AfterClass
|
||||
public static void teardown () throws Exception
|
||||
{
|
||||
_testSupport.tearDown();
|
||||
GCloudTestSuite.__testSupport.deleteSessions();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -53,7 +45,7 @@ public class ReentrantRequestSessionTest extends AbstractReentrantRequestSession
|
|||
@Override
|
||||
public AbstractTestServer createServer(int port,int max, int scavengePeriod,int evictionPolicy)
|
||||
{
|
||||
return new GCloudTestServer(port, max, scavengePeriod, evictionPolicy, _testSupport.getConfiguration());
|
||||
return new GCloudTestServer(port, max, scavengePeriod, evictionPolicy, GCloudTestSuite.__testSupport.getConfiguration());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
@ -34,19 +34,11 @@ import org.junit.Test;
|
|||
*/
|
||||
public class RemoveSessionTest extends AbstractRemoveSessionTest
|
||||
{
|
||||
static GCloudSessionTestSupport _testSupport;
|
||||
|
||||
@BeforeClass
|
||||
public static void setup () throws Exception
|
||||
{
|
||||
_testSupport = new GCloudSessionTestSupport();
|
||||
_testSupport.setUp();
|
||||
}
|
||||
|
||||
|
||||
@AfterClass
|
||||
public static void teardown () throws Exception
|
||||
{
|
||||
_testSupport.tearDown();
|
||||
GCloudTestSuite.__testSupport.deleteSessions();
|
||||
}
|
||||
|
||||
|
||||
|
@ -56,7 +48,7 @@ public class RemoveSessionTest extends AbstractRemoveSessionTest
|
|||
@Override
|
||||
public AbstractTestServer createServer(int port, int max, int scavenge,int evictionPolicy)
|
||||
{
|
||||
return new GCloudTestServer(port, max, scavenge, evictionPolicy, _testSupport.getConfiguration());
|
||||
return new GCloudTestServer(port, max, scavenge, evictionPolicy, GCloudTestSuite.__testSupport.getConfiguration());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
@ -32,19 +32,10 @@ import org.junit.Test;
|
|||
*/
|
||||
public class SameNodeLoadTest extends AbstractSameNodeLoadTest
|
||||
{
|
||||
static GCloudSessionTestSupport _testSupport;
|
||||
|
||||
@BeforeClass
|
||||
public static void setup () throws Exception
|
||||
{
|
||||
_testSupport = new GCloudSessionTestSupport();
|
||||
_testSupport.setUp();
|
||||
}
|
||||
|
||||
@AfterClass
|
||||
public static void teardown () throws Exception
|
||||
{
|
||||
_testSupport.tearDown();
|
||||
GCloudTestSuite.__testSupport.deleteSessions();
|
||||
}
|
||||
|
||||
|
||||
|
@ -55,7 +46,7 @@ public class SameNodeLoadTest extends AbstractSameNodeLoadTest
|
|||
@Override
|
||||
public AbstractTestServer createServer(int port, int max, int scavenge, int evictionPolicy)
|
||||
{
|
||||
return new GCloudTestServer(port, max, scavenge, evictionPolicy, _testSupport.getConfiguration());
|
||||
return new GCloudTestServer(port, max, scavenge, evictionPolicy, GCloudTestSuite.__testSupport.getConfiguration());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
@ -32,26 +32,16 @@ import org.junit.Test;
|
|||
*/
|
||||
public class ServerCrossContextSessionTest extends AbstractServerCrossContextSessionTest
|
||||
{
|
||||
|
||||
static GCloudSessionTestSupport _testSupport;
|
||||
|
||||
@BeforeClass
|
||||
public static void setup () throws Exception
|
||||
{
|
||||
_testSupport = new GCloudSessionTestSupport();
|
||||
_testSupport.setUp();
|
||||
}
|
||||
|
||||
@AfterClass
|
||||
public static void teardown () throws Exception
|
||||
{
|
||||
_testSupport.tearDown();
|
||||
GCloudTestSuite.__testSupport.deleteSessions();
|
||||
}
|
||||
|
||||
@Override
|
||||
public AbstractTestServer createServer(int port, int maxInactiveMs, int scavengeMs,int evictionPolicy)
|
||||
{
|
||||
return new GCloudTestServer(port, maxInactiveMs, scavengeMs, evictionPolicy, _testSupport.getConfiguration());
|
||||
return new GCloudTestServer(port, maxInactiveMs, scavengeMs, evictionPolicy, GCloudTestSuite.__testSupport.getConfiguration());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
@ -37,19 +37,10 @@ import org.junit.Assert;
|
|||
public class SessionExpiryTest extends AbstractSessionExpiryTest
|
||||
{
|
||||
|
||||
static GCloudSessionTestSupport _testSupport;
|
||||
|
||||
@BeforeClass
|
||||
public static void setup () throws Exception
|
||||
{
|
||||
_testSupport = new GCloudSessionTestSupport();
|
||||
_testSupport.setUp();
|
||||
}
|
||||
|
||||
@AfterClass
|
||||
public static void teardown () throws Exception
|
||||
{
|
||||
_testSupport.tearDown();
|
||||
GCloudTestSuite.__testSupport.deleteSessions();
|
||||
}
|
||||
|
||||
|
||||
|
@ -59,7 +50,7 @@ public class SessionExpiryTest extends AbstractSessionExpiryTest
|
|||
@Override
|
||||
public AbstractTestServer createServer(int port, int max, int scavenge, int evictionPolicy)
|
||||
{
|
||||
return new GCloudTestServer(port, max, scavenge, evictionPolicy, _testSupport.getConfiguration());
|
||||
return new GCloudTestServer(port, max, scavenge, evictionPolicy, GCloudTestSuite.__testSupport.getConfiguration());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -67,7 +58,7 @@ public class SessionExpiryTest extends AbstractSessionExpiryTest
|
|||
public void testSessionNotExpired() throws Exception
|
||||
{
|
||||
super.testSessionNotExpired();
|
||||
_testSupport.deleteSessions();
|
||||
GCloudTestSuite.__testSupport.deleteSessions();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -78,20 +69,22 @@ public class SessionExpiryTest extends AbstractSessionExpiryTest
|
|||
public void testSessionExpiry() throws Exception
|
||||
{
|
||||
super.testSessionExpiry();
|
||||
_testSupport.deleteSessions();
|
||||
|
||||
GCloudTestSuite.__testSupport.deleteSessions();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void verifySessionCreated(TestHttpSessionListener listener, String sessionId)
|
||||
{
|
||||
super.verifySessionCreated(listener, sessionId);
|
||||
try {_testSupport.assertSessions(1);}catch(Exception e){ Assert.fail(e.getMessage());}
|
||||
try {GCloudTestSuite.__testSupport.assertSessions(1);}catch(Exception e){ Assert.fail(e.getMessage());}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void verifySessionDestroyed(TestHttpSessionListener listener, String sessionId)
|
||||
{
|
||||
super.verifySessionDestroyed(listener, sessionId);
|
||||
//try{GCloudTestSuite.__testSupport.assertSessions(0);}catch(Exception e) {Assert.fail(e.getMessage());}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -32,20 +32,10 @@ import org.junit.Test;
|
|||
*/
|
||||
public class SessionInvalidateAndCreateTest extends AbstractSessionInvalidateAndCreateTest
|
||||
{
|
||||
|
||||
static GCloudSessionTestSupport _testSupport;
|
||||
|
||||
@BeforeClass
|
||||
public static void setup () throws Exception
|
||||
{
|
||||
_testSupport = new GCloudSessionTestSupport();
|
||||
_testSupport.setUp();
|
||||
}
|
||||
|
||||
@AfterClass
|
||||
public static void teardown () throws Exception
|
||||
{
|
||||
_testSupport.tearDown();
|
||||
GCloudTestSuite.__testSupport.deleteSessions();
|
||||
}
|
||||
|
||||
|
||||
|
@ -55,7 +45,7 @@ public class SessionInvalidateAndCreateTest extends AbstractSessionInvalidateAnd
|
|||
@Override
|
||||
public AbstractTestServer createServer(int port, int max, int scavenge, int evictionPolicy)
|
||||
{
|
||||
return new GCloudTestServer(port, max, scavenge, evictionPolicy, _testSupport.getConfiguration());
|
||||
return new GCloudTestServer(port, max, scavenge, evictionPolicy, GCloudTestSuite.__testSupport.getConfiguration());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
@ -32,26 +32,20 @@ import org.junit.Test;
|
|||
*/
|
||||
public class SessionMigrationTest extends AbstractSessionMigrationTest
|
||||
{
|
||||
static GCloudSessionTestSupport _testSupport;
|
||||
|
||||
@BeforeClass
|
||||
public static void setup () throws Exception
|
||||
{
|
||||
_testSupport = new GCloudSessionTestSupport();
|
||||
_testSupport.setUp();
|
||||
}
|
||||
|
||||
@AfterClass
|
||||
public static void teardown () throws Exception
|
||||
{
|
||||
_testSupport.tearDown();
|
||||
GCloudTestSuite.__testSupport.deleteSessions();
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @see org.eclipse.jetty.server.session.AbstractSessionMigrationTest#createServer(int)
|
||||
*/
|
||||
@Override
|
||||
public AbstractTestServer createServer(int port, int maxInactiveMs, int scavengeMs,int evictionPolicy)
|
||||
{
|
||||
return new GCloudTestServer(port, maxInactiveMs, scavengeMs, evictionPolicy, _testSupport.getConfiguration());
|
||||
return new GCloudTestServer(port, maxInactiveMs, scavengeMs, evictionPolicy, GCloudTestSuite.__testSupport.getConfiguration());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -60,6 +54,4 @@ public class SessionMigrationTest extends AbstractSessionMigrationTest
|
|||
{
|
||||
super.testSessionMigration();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -37,19 +37,10 @@ import org.junit.Test;
|
|||
*/
|
||||
public class SessionRenewTest extends AbstractSessionRenewTest
|
||||
{
|
||||
static GCloudSessionTestSupport _testSupport;
|
||||
|
||||
@BeforeClass
|
||||
public static void setup () throws Exception
|
||||
{
|
||||
_testSupport = new GCloudSessionTestSupport();
|
||||
_testSupport.setUp();
|
||||
}
|
||||
|
||||
@AfterClass
|
||||
public static void teardown () throws Exception
|
||||
{
|
||||
_testSupport.tearDown();
|
||||
GCloudTestSuite.__testSupport.deleteSessions();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -58,7 +49,7 @@ public class SessionRenewTest extends AbstractSessionRenewTest
|
|||
@Override
|
||||
public AbstractTestServer createServer(int port, int max, int scavenge, int evictionPolicy)
|
||||
{
|
||||
return new GCloudTestServer(port,max, scavenge, evictionPolicy, _testSupport.getConfiguration());
|
||||
return new GCloudTestServer(port,max, scavenge, evictionPolicy, GCloudTestSuite.__testSupport.getConfiguration());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -76,7 +67,7 @@ public class SessionRenewTest extends AbstractSessionRenewTest
|
|||
{
|
||||
try
|
||||
{
|
||||
Set<String> ids = _testSupport.getSessionIds();
|
||||
Set<String> ids = GCloudTestSuite.__testSupport.getSessionIds();
|
||||
return (!ids.contains(oldSessionId) && ids.contains(newSessionId));
|
||||
}
|
||||
catch (Exception e)
|
||||
|
|
|
@ -32,20 +32,10 @@ import org.junit.Test;
|
|||
*/
|
||||
public class SessionValueSavingTest extends AbstractSessionValueSavingTest
|
||||
{
|
||||
|
||||
static GCloudSessionTestSupport _testSupport;
|
||||
|
||||
@BeforeClass
|
||||
public static void setup () throws Exception
|
||||
{
|
||||
_testSupport = new GCloudSessionTestSupport();
|
||||
_testSupport.setUp();
|
||||
}
|
||||
|
||||
@AfterClass
|
||||
public static void teardown () throws Exception
|
||||
{
|
||||
_testSupport.tearDown();
|
||||
GCloudTestSuite.__testSupport.deleteSessions();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -54,7 +44,7 @@ public class SessionValueSavingTest extends AbstractSessionValueSavingTest
|
|||
@Override
|
||||
public AbstractTestServer createServer(int port, int max, int scavenge, int evictionPolicy)
|
||||
{
|
||||
return new GCloudTestServer(port, max, scavenge, evictionPolicy, _testSupport.getConfiguration());
|
||||
return new GCloudTestServer(port, max, scavenge, evictionPolicy, GCloudTestSuite.__testSupport.getConfiguration());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
@ -34,19 +34,11 @@ import org.junit.Test;
|
|||
*/
|
||||
public class StopSessionManagerPreserveSessionTest extends AbstractStopSessionManagerPreserveSessionTest
|
||||
{
|
||||
static GCloudSessionTestSupport _testSupport;
|
||||
|
||||
@BeforeClass
|
||||
public static void setup () throws Exception
|
||||
{
|
||||
_testSupport = new GCloudSessionTestSupport();
|
||||
_testSupport.setUp();
|
||||
}
|
||||
|
||||
@AfterClass
|
||||
public static void teardown () throws Exception
|
||||
{
|
||||
_testSupport.tearDown();
|
||||
GCloudTestSuite.__testSupport.deleteSessions();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -57,7 +49,7 @@ public class StopSessionManagerPreserveSessionTest extends AbstractStopSessionMa
|
|||
{
|
||||
try
|
||||
{
|
||||
_testSupport.assertSessions(1);
|
||||
GCloudTestSuite.__testSupport.assertSessions(1);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
@ -70,7 +62,7 @@ public class StopSessionManagerPreserveSessionTest extends AbstractStopSessionMa
|
|||
@Override
|
||||
public AbstractTestServer createServer(int port, int maxInactiveMs, int scavengeMs,int evictionPolicy)
|
||||
{
|
||||
return new GCloudTestServer(port, maxInactiveMs, scavengeMs, evictionPolicy, _testSupport.getConfiguration());
|
||||
return new GCloudTestServer(port, maxInactiveMs, scavengeMs, evictionPolicy, GCloudTestSuite.__testSupport.getConfiguration());
|
||||
}
|
||||
/**
|
||||
* @see org.eclipse.jetty.server.session.AbstractStopSessionManagerPreserveSessionTest#configureSessionManagement(org.eclipse.jetty.servlet.ServletContextHandler)
|
||||
|
|
Loading…
Reference in New Issue