This work is based on the ol.expr package by @tschaub. It adds a few named expression functions to that package: * INTERSECTS, CONTAINS, DWITHIN, WITHIN (no client-side implementation as yet) * LIKE (like comparison with wildcard, singleChar and escapeChar) * IEQ (case-insensitive equality) * INEQ (case-insensitive non-equality) It also adds a few extra parameters to the existing EXTENT function to be able to deserialize and serialize all info (i.e. projection and property name). Some changes were needed for the GML parser as well: * createGeometry function needed to be public * when parsing Box (GML2) and Envelope (GML3) also parse the srsName * fix up writing for Box and Envelope now that bounds is an array Also added createDocumentFragment function to the XML parser. Implementation is similar to OpenLayers 2. Some addtional notes on the implementation: * PropertyIsBetween was implemented as an ol.expr.Logical with operator ol.expr.LogicalOp.AND and two ol.expr.Comparison instances with operator ol.expr.ComparisonOp.GTE and ol.expr.ComparisonOp.LTE * In OGC Filter And and Or can contain more than 2 sub filters, so this is translated into a hierarchy of ol.expr.Logical
Included in this directory
-
ol.html - the web page used to run the test suite.
-
spec - includes the OpenLayers test/spec files.
-
expect-0.2.0 - Minimalistic BDD-style assertion framework. https://github.com/LearnBoost/expect.js/
-
jquery-1.9.1 - The Write Less, Do More, JavaScript Library. http://jquery.com/
-
mocha-1.8.1 - the fun, simple, flexible JavaScript test framework. http://visionmedia.github.com/mocha/
-
sinon-1.6.0 - Standalone test spies, stubs and mocks for JavaScript. http://sinonjs.org/
-
test-extensions.js - includes OpenLayers-specific extensions to the testing frameworks.
-
mocha-phantom - a PhantomJS script for headless testing with mocha. http://metaskills.net/mocha-phantomjs/
Run the test suite with PhantomJS
With PhantomJS installed, and assuming phantomjs is in the PATH:
$ phantomjs mocha-phantom.coffee ol.html
(Works with PhantomJS 1.6.1, untested with other versions.)
This command can also be run by doing ./build.py test at the root of ol3.
Make sure that the polvr web server is running (./build.py serve), otherwise
you will most likely see something like 0 specs, 0 failures in 0.001s..
Tip for TDD'ers: to make PhantomJS run the test suite continuously each time
a spec file is changed you can use nosier (http://pypi.python.org/pypi/nosier)
and do nosier -p test -p src "./build.py test".