Fix Solr smoke tests: SYSTEM_REQUIREMENTS no longer exists where it was testing for it (merged from r1652718)

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1652721 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Erik Hatcher 2015-01-18 10:02:59 +00:00
parent 5fa8807541
commit 22d0422663
6 changed files with 138 additions and 7 deletions

View File

@ -635,8 +635,6 @@ def verifyUnpacked(java, project, artifact, unpackPath, svnRevision, version, te
textFiles.extend(('JRE_VERSION_MIGRATION', 'CHANGES', 'MIGRATE', 'SYSTEM_REQUIREMENTS'))
if isSrc:
textFiles.append('BUILD')
elif not isSrc:
textFiles.append('SYSTEM_REQUIREMENTS')
for fileName in textFiles:
fileName += '.txt'
@ -686,8 +684,6 @@ def verifyUnpacked(java, project, artifact, unpackPath, svnRevision, version, te
if project == 'lucene':
if len(l) > 0:
raise RuntimeError('%s: unexpected files/dirs in artifact %s: %s' % (project, artifact, l))
elif isSrc and not os.path.exists('%s/solr/SYSTEM_REQUIREMENTS.txt' % unpackPath):
raise RuntimeError('%s: solr/SYSTEM_REQUIREMENTS.txt does not exist in artifact %s' % (project, artifact))
if isSrc:
print(' make sure no JARs/WARs in src dist...')

View File

@ -16,9 +16,7 @@
# TODO wishlist:
# - handle stdin as well, such that `cat foo.csv | bin/post my_collection` works
# - bin/post collection "file with spaces.csv" does not work, breaks arguments at whitespace apparently.
# - support arbitrary posting like - java -Ddata=args org.apache.solr.util.SimplePostTool "<delete><id>SP2514N</id></delete>"
# - convert OPTIONS (key=val pass-through to SPT) to standard 'nix switches
# ====== Common code copied/adapted from bin/solr (TODO: centralize/share this kind of thing)

View File

@ -45,6 +45,7 @@ import org.apache.velocity.runtime.RuntimeConstants;
import org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader;
import org.apache.velocity.tools.ConversionUtils;
import org.apache.velocity.tools.generic.ComparisonDateTool;
import org.apache.velocity.tools.generic.ContextTool;
import org.apache.velocity.tools.generic.DisplayTool;
import org.apache.velocity.tools.generic.EscapeTool;
import org.apache.velocity.tools.generic.ListTool;
@ -185,6 +186,7 @@ public class VelocityResponseWriter implements QueryResponseWriter, SolrCoreAwar
context.put("request", request);
// Register useful Velocity "tools"
context.put("log", log); // TODO: add test
context.put("esc", new EscapeTool());
context.put("date", new ComparisonDateTool());
context.put("list", new ListTool());
@ -232,7 +234,7 @@ public class VelocityResponseWriter implements QueryResponseWriter, SolrCoreAwar
// Set some engine properties that improve the experience
// - these could be considered in the future for parameterization, but can also be overridden by using
// the init.properties.file setting. (TODO: add a test for this)
// the init.properties.file setting. (TODO: add a test for this properties set here overridden)
// load the built-in _macros.vm first, then load VM_global_library.vm for legacy (pre-5.0) support,
// and finally allow macros.vm to have the final say and override anything defined in the preceding files.

View File

@ -1,3 +1,9 @@
#*
- Make search box bigger
- Add in pivot and other facets?
- Work on template default selection logic
*#
## Show Error Message, if any
<div class="error">
#parse("error.vm")

View File

@ -0,0 +1,16 @@
bin/solr stop
rm -Rf server/solr/files/
# templates extracted with:
# unzip -j dist/solr-velocity-*.jar velocity/* -x *.properties -d example/files/templates/
bin/solr start -Dvelocity.template.base.dir=<absolute path to example/files/templates>
# TODO: make it so an install dir relative path can be used somehow?
bin/solr create_core -c files
bin/post -c files ~/Documents
curl http://localhost:8983/solr/files/config/params -H 'Content-type:application/json' -d '{
"update" : {
"facets": {
"facet.field":"content_type"
}
}
}'

View File

@ -0,0 +1,113 @@
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<title>Practice Assignment 1</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js" ></script>
<script type="text/javascript" src="http://d3js.org/d3.v3.js"></script>
<style>
body {
font: 10px sans-serif;
}
.chart {
font-family: Arial, sans-serif;
font-size: 10px;
}
.axis path, .axis line {
fill: none;
stroke: #0000ff;
shape-rendering: crispEdges;
}
.bar {
z-index: 1000;
}
/* #bar-demo {
border: solid;
}
*/
.chart {
border: solid;
}
</style>
<script type="text/javascript">
$(document).ready(function(){
#set($content_types=$response.response.facet_counts.facet_fields.content_type)
var data=[#foreach($facet in $content_types){"key": "$facet.key", "val": $facet.value}#if($velocityCount != $content_types.size()),#end$#end];
//var margin = {top: 40, right: 40, bottom: 40, left:40},
width = 600,
height = 500;
var x = d3.scale.linear()
.domain([0, d3.max(data, function(d) { return +d.val;})])
.range([0, width]);
var y = d3.scale.ordinal()
.domain(data.map(function(d) {return d.key;}))
.rangeBands([height,0])
var svg = d3.select('#bar-demo').append('svg')
.attr('class', 'chart')
.attr('width', width)
.attr('height', height)
.append('g');
var colors = d3.scale.category20();
svg.selectAll('.chart')
.data(data)
.enter().append('rect')
.attr('class', 'bar')
.attr("fill",function(d,i){return colors(i);})
.attr('x', function(d) { return 0; })
.attr('y', function(d) { return y(d.key); })
.attr('height', function(d) {return y.rangeBand();})
.attr('width', function(d) { return x(+d.val) });
svg.selectAll(".rect")
.data(data)
.enter().append("svg:text")
.attr("x", function(d) { return 0; })
.attr("y", function(d) { return y(d.key) + y.rangeBand()/2; })
.attr("dx", "0.5em")
.attr("dy", "1.50em")
.attr("text-anchor", "left")
.text(function(d) { return d.key + " (" + d.val + ")" });
});
</script>
</head>
<body>
<div id="admin"><a href="#url_root/#/#core_name">Solr Admin</a></div>
<div><a href="#url_for_home">Home</a></div>
<div id="head">
<a href="#url_for_home#if($debug)?debug=true#end"><img src="#{url_root}/img/solr.svg" id="logo"/></a>
</div>
<pre>
$response.response.facet_counts.facet_fields.content_type
</pre>
<hr/>
<div id="bar-demo" style="position: relative; top: 3px; left: 20px;"></div>
</body>
</html>