Skip to content

Commit

Permalink
SMC-3689: updated happn and happner dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
southbite committed Aug 23, 2021
1 parent adc9702 commit 50df07a
Show file tree
Hide file tree
Showing 11 changed files with 379 additions and 25 deletions.
2 changes: 2 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@
example
.travis.yml
.vscode
/test
/test/*
42 changes: 21 additions & 21 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "happner-cluster",
"version": "10.4.0",
"version": "10.4.0-prerelease-4",
"description": "Extends happner with clustering capabilities",
"main": "index.js",
"scripts": {
Expand Down Expand Up @@ -43,9 +43,10 @@
},
"dependencies": {
"bluebird": "^3.5.0",
"happn-3": "^11.13.1",
"happn-cluster": "^10.3.0",
"happner-2": "^11.11.0",
"happner-client": "^11.4.0",
"happner-2": "^11.11.1",
"happner-client": "prerelease-11",
"hashring": "^3.2.0",
"node-http-proxy": "^0.2.3",
"semver": "^5.3.0"
Expand Down
19 changes: 19 additions & 0 deletions test/_lib/integration-26-local-component1/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
module.exports = Component;

function Component() {}

Component.prototype.start = function($happn, callback) {
callback();
};

Component.prototype.stop = function($happn, callback) {
callback();
};

Component.prototype.callDependency = async function($happn, component, method) {
//$happn.exchange[component][method](callback);
return await $happn.exchange.$call({
component,
method
});
};
24 changes: 24 additions & 0 deletions test/_lib/integration-26-local-component1/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"name": "local-component1",
"version": "1.0.1",
"happner": {
"dependencies": {
"localComponent1": {
"remoteComponent0": {
"version": "^1.0.0",
"methods": {
"method1": {},
"method2": {}
}
},
"remoteComponent4": {
"version": "^2.0.0",
"methods": {
"method1": {},
"method2": {}
}
}
}
}
}
}
53 changes: 53 additions & 0 deletions test/_lib/integration-26-local-component2/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
module.exports = Component;

function Component() {}

Component.prototype.start = function($happn, callback) {
callback();
};

Component.prototype.stop = function($happn, callback) {
callback();
};

Component.prototype.listTestEvents = function($happn, callback) {
var events = {};

$happn.event.remoteComponent3.on(
'testevent/*',
function(data, meta) {
events[meta.path] = 1;
},
function(e, subscriptionId) {
if (e) return callback(e);

setTimeout(function() {
$happn.event.remoteComponent3.off(subscriptionId, function(e) {
if (e) return callback(e);
callback(null, events);
});
}, 600);
}
);
};

Component.prototype.listTestCompatibleEvents = function($happn, callback) {
var events = {};

$happn.event.remoteComponent5.on(
'testevent/*/*',
function(data, meta) {
events[meta.path] = 1;
},
function(e, subscriptionId) {
if (e) return callback(e);

setTimeout(function() {
$happn.event.remoteComponent4.off(subscriptionId, function(e) {
if (e) return callback(e);
callback(null, events);
});
}, 600);
}
);
};
20 changes: 20 additions & 0 deletions test/_lib/integration-26-local-component2/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"name": "local-component2",
"version": "2.0.0",
"happner": {
"dependencies": {
"localComponent2": {
"remoteComponent3": {
"version": "^2.0.0",
"methods": {
"method1": {},
"method2": {}
}
},
"remoteComponent5": {
"version": "^2.0.0"
}
}
}
}
}
19 changes: 19 additions & 0 deletions test/_lib/integration-26-remote-component4-v1/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
module.exports = Component;

function Component() {}

Component.prototype.start = function($happn, callback) {
callback();
};

Component.prototype.stop = function($happn, callback) {
callback();
};

Component.prototype.method1 = function($happn, callback) {
callback(null, $happn.info.mesh.name + ':component4-v1:method1');
};

Component.prototype.method2 = function($happn, callback) {
callback(null, $happn.info.mesh.name + ':component4-v1:method2');
};
4 changes: 4 additions & 0 deletions test/_lib/integration-26-remote-component4-v1/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"name": "remote-component4",
"version": "1.2.0"
}
1 change: 0 additions & 1 deletion test/functional/01-cluster-broker-multiple-brokers.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ var users = require('../_lib/users');
var testclient = require('../_lib/client');
var path = require('path');
var clearMongoCollection = require('../_lib/clear-mongo-collection');
const { delay } = require('../_lib/test-helper');

describe(require('../_lib/test-helper').testName(__filename, 3), function() {
this.timeout(600000);
Expand Down
Loading

0 comments on commit 50df07a

Please sign in to comment.