Skip to content

Commit 4a47997

Browse files
committed
Merge remote-tracking branch 'upstream/1.0' into 1.1
2 parents d3fba1d + f056d4d commit 4a47997

File tree

8 files changed

+158
-27
lines changed

8 files changed

+158
-27
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,4 @@ build
99
node_modules
1010
.idea
1111
docs/build
12-
/lib
1312
.npmrc

.npmignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,11 @@
1+
docs/
12
src/
23
build/
4+
test/
5+
lib/browser/neo4j-web.test.js
6+
bower.json
7+
.gitignore
8+
esdoc.json
9+
gulpfile.js
10+
runTests.sh
11+
runTests.ps1

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ Find detailed docs at [alpha.neohq.net](http://alpha.neohq.net/docs/javascript-d
99

1010
```shell
1111
npm install neo4j-driver
12+
// or
13+
bower install neo4j-driver
1214
```
1315

1416
```javascript

bower.json

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"name": "neo4j-driver",
3+
"description": "Connect to Neo4j 3.0.0 and up from JavaScript",
4+
"main": "lib/browser/neo4j-web.min.js",
5+
"authors": [{
6+
"name": "Neo Technology Inc."
7+
}],
8+
"license": "Apache-2.0",
9+
"keywords": [
10+
"neo4j"
11+
],
12+
"moduleType": [
13+
"amd",
14+
"es6",
15+
"globals",
16+
"node"
17+
],
18+
"ignore": [
19+
"docs",
20+
"src",
21+
"test",
22+
"build",
23+
"node_modules",
24+
"lib/browser/neo4j-web.test.js",
25+
"package.json",
26+
".gitignore",
27+
".npmignore",
28+
"esdoc.json",
29+
"gulpfile.js",
30+
"runTests.sh",
31+
"runTests.ps1"
32+
],
33+
"repository": {
34+
"type": "git",
35+
"url": "https://github.com/neo4j/neo4j-javascript-driver.git"
36+
}
37+
}

gulpfile.js

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ var path = require('path');
4343
var childProcess = require("child_process");
4444
var minimist = require('minimist');
4545
var cucumber = require('gulp-cucumber');
46+
var merge = require('merge-stream');
4647

4748
gulp.task('default', ["test"]);
4849

@@ -184,8 +185,20 @@ gulp.task('download-neo4j', function() {
184185
});
185186

186187
gulp.task('set-password', ['download-neo4j'], function() {
187-
return gulp.src('test/resources/auth')
188-
.pipe(gulp.dest(neo4jHome + "/data/dbms/"));
188+
var setPassword = gulp.src('test/resources/auth')
189+
.pipe(gulp.dest(neo4jHome + "/data/dbms/"));
190+
191+
if(isWin)
192+
{
193+
var setServerName = gulp.src('test/resources/neo4j-wrapper.conf')
194+
.pipe(gulp.dest(neo4jHome + "/conf/"));
195+
196+
return merge(setPassword, setServerName);
197+
}
198+
else
199+
{
200+
return setPassword;
201+
}
189202
});
190203

191204
var featureFiles = 'https://s3-eu-west-1.amazonaws.com/remoting.neotechnology.com/driver-compliance/tck.tar.gz';
@@ -207,8 +220,7 @@ gulp.task('run-tck', ['download-tck', 'nodejs'], function() {
207220

208221
var runPowershell = function( cmd ) {
209222
var spawn = childProcess.spawn, child;
210-
child = spawn("powershell.exe",[
211-
'Import-Module ' + neo4jHome + '/bin/Neo4j-Management.psd1;' + cmd]);
223+
child = spawn("powershell.exe",[cmd]);
212224
child.stdout.on("data",function(data){
213225
console.log("Powershell Data: " + data);
214226
});
@@ -235,8 +247,7 @@ gulp.task('set', function() {
235247

236248
gulp.task('start-neo4j', ['set-password'], function() {
237249
if(isWin) {
238-
runPowershell('Install-Neo4jServer -Neo4jServer ' + neo4jHome + ' -Name neo4j-js;' +
239-
'Start-Neo4jServer -Neo4jServer ' + neo4jHome + ' -ServiceName neo4j-js');
250+
return runPowershell(neo4jHome + '/bin/neo4j.bat install-service;' + neo4jHome + '/bin/neo4j.bat start');
240251
}
241252
else {
242253
return gulp.src('').pipe(shell([
@@ -248,8 +259,7 @@ gulp.task('start-neo4j', ['set-password'], function() {
248259

249260
gulp.task('stop-neo4j', function() {
250261
if(isWin) {
251-
runPowershell('Stop-Neo4jServer -Neo4jServer ' + neo4jHome + ' -ServiceName neo4j-js;' +
252-
'Uninstall-Neo4jServer -Neo4jServer ' + neo4jHome + ' -ServiceName neo4j-js');
262+
return runPowershell(neo4jHome + '/bin/neo4j.bat stop;' + neo4jHome + '/bin/neo4j.bat uninstall-service');
253263
} else {
254264
return gulp.src('').pipe(shell([
255265
neo4jHome + '/bin/neo4j stop',

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"esdoc": "^0.4.0",
2424
"esdoc-importpath-plugin": "0.0.1",
2525
"glob": "^5.0.14",
26-
"gulp": "^3.9.0",
26+
"gulp": "^3.9.1",
2727
"gulp-babel": "^5.2.1",
2828
"gulp-batch": "^1.0.5",
2929
"gulp-concat": "^2.6.0",
@@ -39,6 +39,7 @@
3939
"gulp-util": "^3.0.6",
4040
"gulp-watch": "^4.3.5",
4141
"jasmine-reporters": "^2.0.7",
42+
"merge-stream": "^1.0.0",
4243
"minimist": "^1.2.0",
4344
"phantomjs2-ext": "^0.1.0",
4445
"run-sequence": "^1.1.4",

test/resources/neo4j-wrapper.conf

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
#********************************************************************
2+
# JVM Parameters
3+
#********************************************************************
4+
5+
# Java Heap Size: by default the Java heap size is dynamically
6+
# calculated based on available system resources.
7+
# Uncomment these lines to set specific initial and maximum
8+
# heap size in MB.
9+
#dbms.memory.heap.initial_size=512
10+
#dbms.memory.heap.max_size=512
11+
12+
# G1GC generally strikes a good balance between throughput and tail
13+
# latency, without too much tuning.
14+
dbms.jvm.additional=-XX:+UseG1GC
15+
16+
# Have common exceptions keep producing stack traces, so they can be
17+
# debugged regardless of how often logs are rotated.
18+
dbms.jvm.additional=-XX:-OmitStackTraceInFastThrow
19+
20+
# Reduce probability of objects getting the same identity hash code
21+
# via a race, by computing them with thread-local PRNGs.
22+
dbms.jvm.additional=-XX:hashCode=5
23+
24+
# Make sure that `initmemory` is not only allocated, but committed to
25+
# the process, before starting the database. This reduces memory
26+
# fragmentation, increasing the effectiveness of transparent huge
27+
# pages. It also reduces the possibility of seeing performance drop
28+
# due to heap-growing GC events, where a decrease in available page
29+
# cache leads to an increase in mean IO response time.
30+
# Try reducing the heap memory, if this flag degrades performance.
31+
dbms.jvm.additional=-XX:+AlwaysPreTouch
32+
33+
# Trust that non-static final fields are really final.
34+
# This allows more optimisations and improves overall performance.
35+
# NOTE: Disable this if you use embedded mode, or have extensions or depencies that may use reflection or serialization
36+
# to change the value of final fields!
37+
dbms.jvm.additional=-XX:+UnlockExperimentalVMOptions
38+
dbms.jvm.additional=-XX:+TrustFinalNonStaticFields
39+
40+
# Disable explicit garbage collection, which is occasionally invoked by the JDK itself.
41+
dbms.jvm.additional=-XX:+DisableExplicitGC
42+
43+
# Remote JMX monitoring, uncomment and adjust the following lines as needed.
44+
# Also make sure to update the jmx.access and jmx.password files with appropriate permission roles and passwords,
45+
# the shipped configuration contains only a read only role called 'monitor' with password 'Neo4j'.
46+
# For more details, see: http://download.oracle.com/javase/7/docs/technotes/guides/management/agent.html
47+
# On Unix based systems the jmx.password file needs to be owned by the user that will run the server,
48+
# and have permissions set to 0600.
49+
# For details on setting these file permissions on Windows see:
50+
# http://docs.oracle.com/javase/7/docs/technotes/guides/management/security-windows.html
51+
#dbms.jvm.additional=-Dcom.sun.management.jmxremote.port=3637
52+
#dbms.jvm.additional=-Dcom.sun.management.jmxremote.authenticate=true
53+
#dbms.jvm.additional=-Dcom.sun.management.jmxremote.ssl=false
54+
#dbms.jvm.additional=-Dcom.sun.management.jmxremote.password.file=conf/jmx.password
55+
#dbms.jvm.additional=-Dcom.sun.management.jmxremote.access.file=conf/jmx.access
56+
57+
# Some systems cannot discover host name automatically, and need this line configured:
58+
#dbms.jvm.additional=-Djava.rmi.server.hostname=$THE_NEO4J_SERVER_HOSTNAME
59+
60+
#********************************************************************
61+
# Wrapper Windows NT/2000/XP Service Properties
62+
#********************************************************************
63+
# WARNING - Do not modify any of these properties when an application
64+
# using this configuration file has been installed as a service.
65+
# Please uninstall the service before modifying this section. The
66+
# service can then be reinstalled.
67+
68+
# Name of the service
69+
dbms.windows_service_name=js-driver-test-neo4j-server
70+
71+
#********************************************************************
72+
# Other Neo4j system properties
73+
#********************************************************************
74+
dbms.jvm.additional=-Dunsupported.dbms.udc.source=zip

test/v1/tck/steps/util.js

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ function restart(callback) {
362362

363363
function startDatabase() {
364364
if(isWin) {
365-
runPowerShell('Start-Neo4jServer -Neo4jServer ' + neo4jHome + ' -ServiceName neo4j-js');
365+
return runPowershell(neo4jHome + '/bin/neo4j.bat install-service;' + neo4jHome + '/bin/neo4j.bat start');
366366
} else {
367367
childProcess.execSync(neo4jHome + '/bin/neo4j start', function (err, stdout, stderr) {
368368
if (err) throw err;
@@ -372,26 +372,25 @@ function startDatabase() {
372372

373373
function stopDatabase() {
374374
if(isWin) {
375-
runPowerShell('Stop-Neo4jServer -Neo4jServer ' + neo4jHome + ' -ServiceName neo4j-js;');
375+
runPowershell(neo4jHome + '/bin/neo4j.bat stop;' + neo4jHome + '/bin/neo4j.bat uninstall-service');
376376
} else {
377377
childProcess.execSync(neo4jHome + '/bin/neo4j stop', function (err, stdout, stderr) {
378378
if (err) throw err;
379379
});
380380
}
381381
}
382382

383-
function runPowerShell( cmd ) {
384-
var spawn = childProcess.spawn, child;
385-
child = spawn("powershell.exe",[
386-
'Import-Module ' + neo4jHome + '/bin/Neo4j-Management.psd1;' + cmd]);
387-
child.stdout.on("data",function(data){
388-
console.log("Powershell Data: " + data);
389-
});
390-
child.stderr.on("data",function(data){
391-
console.log("Powershell Errors: " + data);
392-
});
393-
child.on("exit",function(){
394-
console.log("Powershell Script finished");
395-
});
396-
child.stdin.end(); //end input
397-
}
383+
var runPowershell = function( cmd ) {
384+
var spawn = childProcess.spawn, child;
385+
child = spawn("powershell.exe",[cmd]);
386+
child.stdout.on("data",function(data){
387+
console.log("Powershell Data: " + data);
388+
});
389+
child.stderr.on("data",function(data){
390+
console.error("Powershell Errors: " + data);
391+
});
392+
child.on("exit",function(){
393+
console.log("Powershell Script finished");
394+
});
395+
child.stdin.end(); //end input
396+
};

0 commit comments

Comments
 (0)