NIHVIVO-222 Embed the CSS file in the source, so we don't need to configure it.
This commit is contained in:
parent
dddc423a9e
commit
6f978160cf
7 changed files with 108 additions and 37 deletions
|
@ -117,7 +117,10 @@ run - Run the tester.
|
||||||
fork="yes"
|
fork="yes"
|
||||||
dir="${acceptance.dir}"
|
dir="${acceptance.dir}"
|
||||||
failonerror="true">
|
failonerror="true">
|
||||||
<classpath location="${build.dir}" />
|
<classpath >
|
||||||
|
<pathelement location="${build.dir}"/>
|
||||||
|
<pathelement location="${source.dir}"/>
|
||||||
|
</classpath>
|
||||||
<arg file="${acceptance.properties.file}" />
|
<arg file="${acceptance.properties.file}" />
|
||||||
<arg value="${acceptance.interactive.arg}" />
|
<arg value="${acceptance.interactive.arg}" />
|
||||||
</java>
|
</java>
|
||||||
|
|
|
@ -34,4 +34,3 @@ upload_directory = /Vivoweb_Stuff/test_deploy/uploads
|
||||||
# These properties control the output formatting of the tests.
|
# These properties control the output formatting of the tests.
|
||||||
#
|
#
|
||||||
ignored_tests_file = /eclipseVitroWorkspace/vivo/utilities/acceptance-tests/suites/ignored_tests.txt
|
ignored_tests_file = /eclipseVitroWorkspace/vivo/utilities/acceptance-tests/suites/ignored_tests.txt
|
||||||
summary_css_file = /eclipseVitroWorkspace/vivo/utilities/acceptance-tests/script/output_summary.css
|
|
|
@ -97,17 +97,11 @@ public class FileHelper {
|
||||||
*/
|
*/
|
||||||
public static void copy(File source, File target) throws IOException {
|
public static void copy(File source, File target) throws IOException {
|
||||||
InputStream input = null;
|
InputStream input = null;
|
||||||
OutputStream output = null;
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
input = new FileInputStream(source);
|
input = new FileInputStream(source);
|
||||||
output = new FileOutputStream(target);
|
copy(input, target);
|
||||||
int howMany;
|
} finally {
|
||||||
byte[] buffer = new byte[4096];
|
|
||||||
while (-1 != (howMany = input.read(buffer))) {
|
|
||||||
output.write(buffer, 0, howMany);
|
|
||||||
}
|
|
||||||
}finally {
|
|
||||||
if (input != null) {
|
if (input != null) {
|
||||||
try {
|
try {
|
||||||
input.close();
|
input.close();
|
||||||
|
@ -115,6 +109,24 @@ public class FileHelper {
|
||||||
e1.printStackTrace();
|
e1.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Copy the contents of an InputStream to a file. If the target file already
|
||||||
|
* exists, it will be over-written. Doesn't close the input stream.
|
||||||
|
*/
|
||||||
|
public static void copy(InputStream input, File target) throws IOException {
|
||||||
|
OutputStream output = null;
|
||||||
|
|
||||||
|
try {
|
||||||
|
output = new FileOutputStream(target);
|
||||||
|
int howMany;
|
||||||
|
byte[] buffer = new byte[4096];
|
||||||
|
while (-1 != (howMany = input.read(buffer))) {
|
||||||
|
output.write(buffer, 0, howMany);
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
if (output != null) {
|
if (output != null) {
|
||||||
try {
|
try {
|
||||||
output.close();
|
output.close();
|
||||||
|
|
|
@ -5,6 +5,7 @@ package edu.cornell.mannlib.vitro.utilities.testrunner;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileReader;
|
import java.io.FileReader;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.io.InputStream;
|
||||||
import java.io.PrintWriter;
|
import java.io.PrintWriter;
|
||||||
import java.io.Reader;
|
import java.io.Reader;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
|
@ -76,13 +77,20 @@ public class OutputSummaryFormatter {
|
||||||
* Copy the CSS file into the output directory.
|
* Copy the CSS file into the output directory.
|
||||||
*/
|
*/
|
||||||
private void copyCssFile() {
|
private void copyCssFile() {
|
||||||
File cssSource = parms.getSummaryCssFile();
|
InputStream cssStream = this.getClass().getResourceAsStream(
|
||||||
File cssTarget = new File(parms.getOutputDirectory(),
|
|
||||||
SUMMARY_CSS_FILENAME);
|
SUMMARY_CSS_FILENAME);
|
||||||
try {
|
if (cssStream == null) {
|
||||||
FileHelper.copy(cssSource, cssTarget);
|
System.out.println("Couldn't find the CSS file: '"
|
||||||
} catch (IOException e) {
|
+ SUMMARY_CSS_FILENAME + "'");
|
||||||
e.printStackTrace();
|
} else {
|
||||||
|
File cssTarget = new File(parms.getOutputDirectory(),
|
||||||
|
SUMMARY_CSS_FILENAME);
|
||||||
|
try {
|
||||||
|
FileHelper.copy(cssStream, cssTarget);
|
||||||
|
cssStream.close();
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -200,8 +208,7 @@ public class OutputSummaryFormatter {
|
||||||
writer.println(" <table cellspacing=\"0\">");
|
writer.println(" <table cellspacing=\"0\">");
|
||||||
|
|
||||||
if ((!log.hasErrors()) && (!log.hasWarnings())) {
|
if ((!log.hasErrors()) && (!log.hasWarnings())) {
|
||||||
writer
|
writer.println(" <tr><td colspan=\"2\">No errors or warnings</td></tr>");
|
||||||
.println(" <tr><td colspan=\"2\">No errors or warnings</td></tr>");
|
|
||||||
} else {
|
} else {
|
||||||
for (String e : log.getErrors()) {
|
for (String e : log.getErrors()) {
|
||||||
writer.println(" <tr class=\"" + errorClass
|
writer.println(" <tr class=\"" + errorClass
|
||||||
|
|
|
@ -44,7 +44,6 @@ public class SeleniumRunnerParameters {
|
||||||
private final Collection<File> suiteParentDirectories;
|
private final Collection<File> suiteParentDirectories;
|
||||||
private final ModelCleanerProperties modelCleanerProperties;
|
private final ModelCleanerProperties modelCleanerProperties;
|
||||||
private final IgnoredTests ignoredTests;
|
private final IgnoredTests ignoredTests;
|
||||||
private final File summaryCssFile;
|
|
||||||
|
|
||||||
private Collection<File> selectedSuites = Collections.emptySet();
|
private Collection<File> selectedSuites = Collections.emptySet();
|
||||||
private boolean cleanModel = true;
|
private boolean cleanModel = true;
|
||||||
|
@ -70,8 +69,6 @@ public class SeleniumRunnerParameters {
|
||||||
this.uploadDirectory = checkReadWriteDirectory(props,
|
this.uploadDirectory = checkReadWriteDirectory(props,
|
||||||
PROP_UPLOAD_DIRECTORY);
|
PROP_UPLOAD_DIRECTORY);
|
||||||
|
|
||||||
this.summaryCssFile = checkSummaryCssFile(props);
|
|
||||||
|
|
||||||
this.outputDirectory = checkOutputDirectory(props);
|
this.outputDirectory = checkOutputDirectory(props);
|
||||||
this.logFile = new File(this.outputDirectory, LOGFILE_NAME);
|
this.logFile = new File(this.outputDirectory, LOGFILE_NAME);
|
||||||
this.listener = new Listener(this.logFile);
|
this.listener = new Listener(this.logFile);
|
||||||
|
@ -116,16 +113,6 @@ public class SeleniumRunnerParameters {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* The CSS file must be specified, must exist, and must be readable.
|
|
||||||
*/
|
|
||||||
private File checkSummaryCssFile(Properties props) {
|
|
||||||
String summaryCssPath = getRequiredProperty(props, PROP_SUMMARY_CSS);
|
|
||||||
File cssFile = new File(summaryCssPath);
|
|
||||||
FileHelper.checkReadableFile(cssFile, "File '" + summaryCssPath + "'");
|
|
||||||
return cssFile;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If there is a parameter for this key, it should point to a readable
|
* If there is a parameter for this key, it should point to a readable
|
||||||
* directory.
|
* directory.
|
||||||
|
@ -361,10 +348,6 @@ public class SeleniumRunnerParameters {
|
||||||
return logFile;
|
return logFile;
|
||||||
}
|
}
|
||||||
|
|
||||||
public File getSummaryCssFile() {
|
|
||||||
return summaryCssFile;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Collection<File> getSuiteParentDirectories() {
|
public Collection<File> getSuiteParentDirectories() {
|
||||||
return suiteParentDirectories;
|
return suiteParentDirectories;
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,67 @@
|
||||||
|
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
|
||||||
|
|
||||||
|
/*
|
||||||
|
Formats for the output summary from the acceptance tests.
|
||||||
|
*/
|
||||||
|
body {
|
||||||
|
background: rgb(95%, 95%, 95%);
|
||||||
|
font-family: sans-serif;
|
||||||
|
}
|
||||||
|
|
||||||
|
.heading {
|
||||||
|
border: groove;
|
||||||
|
background: white;
|
||||||
|
padding: 10px 20px 8px 20px;
|
||||||
|
margin-top: 50px;
|
||||||
|
font-size: large;
|
||||||
|
}
|
||||||
|
|
||||||
|
table {
|
||||||
|
border: thin double gray;
|
||||||
|
background: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
td,th {
|
||||||
|
padding: 4px 12px 2px 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
th {
|
||||||
|
border-bottom: 1px solid black;
|
||||||
|
}
|
||||||
|
|
||||||
|
table.summary {
|
||||||
|
border: none;
|
||||||
|
background: inherit;
|
||||||
|
}
|
||||||
|
|
||||||
|
table.summary td {
|
||||||
|
padding-right: 30;
|
||||||
|
border: none;
|
||||||
|
vertical-align: top;
|
||||||
|
}
|
||||||
|
|
||||||
|
.section {
|
||||||
|
background: rgb(70%, 85%, 85%);
|
||||||
|
font-size: larger;
|
||||||
|
margin: 50px 0px 15px 0px;
|
||||||
|
padding: 4px 12px 2px 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.good {
|
||||||
|
background: rgb(60%, 100%, 60%);
|
||||||
|
}
|
||||||
|
|
||||||
|
.bad {
|
||||||
|
background: rgb(100%, 60%, 60%);
|
||||||
|
}
|
||||||
|
|
||||||
|
.fair {
|
||||||
|
background: rgb(100%, 100%, 60%);
|
||||||
|
}
|
||||||
|
|
||||||
|
.one-word {
|
||||||
|
width: 20%;
|
||||||
|
text-align: center;
|
||||||
|
margin: 15px 0px 0px 0px;
|
||||||
|
border: 1px solid black;
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue