-
Notifications
You must be signed in to change notification settings - Fork 37
Expand file tree
/
Copy pathtest-ut-harness.js
More file actions
38 lines (32 loc) · 1.23 KB
/
test-ut-harness.js
File metadata and controls
38 lines (32 loc) · 1.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/**
* Part of a course on Hyperledger Fabric:
* http://ACloudFan.com
*
* Tested with Composer 0.20.5
*
* This is for testing the UT test harness itself :-)
*
* 1. utHarness = require('./ut-harness');
* 2. Call the initialize function on the ut-harness
* A) Folder for the model project
* B) Callback function receives the:
* adminConnection,
* businessNetworkConnection,
* businessNetworkDefinition
* 3. The unit test code is written in the callback function
*/
const utHarness = require('./ut-harness');
var modelFolder = 'C:/Users/Rajeev/Documents/Course/Hyperledger-Course/workspace/HLF-Course-Domain-Model/airlinev7';
//var modelFolder = '';
// Set this to false for suppressing the UTH messages
utHarness.debug=true;
utHarness.initialize(modelFolder, (adminCon, bnCon, definition)=>{
// Get the registry names
console.log("BNA =",definition.getName(),'@',definition.getVersion());
// Lets geth the registries
return bnCon.getAllAssetRegistries(false).then((registries)=>{
registries.forEach((registry)=>{
console.log(registry.id)
});
});
});