fable 3.0.86 → 3.0.87
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/debug/Harness.js +8 -10
- package/package.json +2 -2
- package/retold-harness/bookstore-serve-api.js +2 -2
- package/source/Fable.js +187 -50
- package/source/services/Fable-Service-Anticipate.js +1 -1
- package/source/services/Fable-Service-DataGeneration.js +1 -1
- package/source/services/Fable-Service-EnvironmentData-Web.js +1 -1
- package/source/services/Fable-Service-EnvironmentData.js +1 -1
- package/source/services/Fable-Service-FilePersistence-Web.js +2 -1
- package/source/services/Fable-Service-FilePersistence.js +25 -7
- package/source/services/Fable-Service-MetaTemplate.js +1 -1
- package/source/services/Fable-Service-Operation-DefaultSettings.js +4 -6
- package/source/services/Fable-Service-Operation.js +97 -2
- package/source/services/Fable-Service-RestClient.js +1 -1
- package/source/services/Fable-Service-Template.js +1 -1
- package/source/services/Fable-Service-Utility.js +3 -3
- package/test/Anticipate_tests.js +2 -2
- package/test/CSVParser_tests.js +1 -1
- package/test/Cache_tests.js +1 -1
- package/test/DataGeneration_tests.js +7 -7
- package/test/DateManipulation_tests.js +1 -1
- package/test/FableOperation_tests.js +33 -4
- package/test/FableServiceManager_tests.js +51 -51
- package/test/FilePersistence_tests.js +9 -9
- package/test/Manifest_tests.js +1 -1
- package/test/MetaTemplating_tests.js +1 -1
- package/test/RestClient_test.js +6 -6
- package/dist/fable.compatible.js +0 -3353
- package/dist/fable.compatible.min.js +0 -12
- package/dist/fable.compatible.min.js.map +0 -1
- package/dist/fable.js +0 -3353
- package/dist/fable.min.js +0 -12
- package/dist/fable.min.js.map +0 -1
- package/source/Fable-ServiceManager.js +0 -164
package/test/Anticipate_tests.js
CHANGED
|
@@ -26,7 +26,7 @@ suite
|
|
|
26
26
|
function (fTestComplete)
|
|
27
27
|
{
|
|
28
28
|
let testFable = new libFable();
|
|
29
|
-
let tmpAnticipate = testFable.
|
|
29
|
+
let tmpAnticipate = testFable.instantiateServiceProvider('Anticipate');
|
|
30
30
|
tmpAnticipate.anticipate(function (fCallback)
|
|
31
31
|
{
|
|
32
32
|
testFable.log.info('Operation First test timeout entered...');
|
|
@@ -58,7 +58,7 @@ suite
|
|
|
58
58
|
function (fTestComplete)
|
|
59
59
|
{
|
|
60
60
|
let testFable = new libFable();
|
|
61
|
-
let tmpAnticipate = testFable.
|
|
61
|
+
let tmpAnticipate = testFable.instantiateServiceProvider('Anticipate');
|
|
62
62
|
tmpAnticipate.maxOperations = 2;
|
|
63
63
|
tmpAnticipate.anticipate(function (fCallback)
|
|
64
64
|
{
|
package/test/CSVParser_tests.js
CHANGED
|
@@ -30,7 +30,7 @@ suite
|
|
|
30
30
|
function(fDone)
|
|
31
31
|
{
|
|
32
32
|
let testFable = new libFable();
|
|
33
|
-
let tmpCSVParser = testFable.
|
|
33
|
+
let tmpCSVParser = testFable.instantiateServiceProvider('CSVParser', {Name: 'Big Complex Integration Operation'}, 'CSV Parser-123');
|
|
34
34
|
let tmpRecords = [];
|
|
35
35
|
|
|
36
36
|
const tmpReadline = libReadline.createInterface(
|
package/test/Cache_tests.js
CHANGED
|
@@ -26,7 +26,7 @@ suite
|
|
|
26
26
|
function (fTestComplete)
|
|
27
27
|
{
|
|
28
28
|
let testFable = new libFable();
|
|
29
|
-
let tmpDataGeneration = testFable.
|
|
29
|
+
let tmpDataGeneration = testFable.instantiateServiceProvider('DataGeneration');
|
|
30
30
|
Expect(tmpDataGeneration.randomIntegerUpTo(100)).to.be.within(0, 100);
|
|
31
31
|
return fTestComplete();
|
|
32
32
|
}
|
|
@@ -37,7 +37,7 @@ suite
|
|
|
37
37
|
function (fTestComplete)
|
|
38
38
|
{
|
|
39
39
|
let testFable = new libFable();
|
|
40
|
-
let tmpDataGeneration = testFable.
|
|
40
|
+
let tmpDataGeneration = testFable.instantiateServiceProvider('DataGeneration');
|
|
41
41
|
Expect(tmpDataGeneration.randomNumericString()).to.be.a('string');
|
|
42
42
|
Expect(tmpDataGeneration.randomNumericString().length).to.equal(10);
|
|
43
43
|
return fTestComplete();
|
|
@@ -49,7 +49,7 @@ suite
|
|
|
49
49
|
function (fTestComplete)
|
|
50
50
|
{
|
|
51
51
|
let testFable = new libFable();
|
|
52
|
-
let tmpDataGeneration = testFable.
|
|
52
|
+
let tmpDataGeneration = testFable.instantiateServiceProvider('DataGeneration');
|
|
53
53
|
testFable.log.info(`Random color: ${tmpDataGeneration.randomColor()}`);
|
|
54
54
|
Expect(tmpDataGeneration.randomColor()).to.be.a('string');
|
|
55
55
|
return fTestComplete();
|
|
@@ -61,7 +61,7 @@ suite
|
|
|
61
61
|
function (fTestComplete)
|
|
62
62
|
{
|
|
63
63
|
let testFable = new libFable();
|
|
64
|
-
let tmpDataGeneration = testFable.
|
|
64
|
+
let tmpDataGeneration = testFable.instantiateServiceProvider('DataGeneration');
|
|
65
65
|
testFable.log.info(`Random Day of Week: ${tmpDataGeneration.randomDayOfWeek()}`);
|
|
66
66
|
Expect(tmpDataGeneration.randomDayOfWeek()).to.be.a('string');
|
|
67
67
|
return fTestComplete();
|
|
@@ -73,7 +73,7 @@ suite
|
|
|
73
73
|
function (fTestComplete)
|
|
74
74
|
{
|
|
75
75
|
let testFable = new libFable();
|
|
76
|
-
let tmpDataGeneration = testFable.
|
|
76
|
+
let tmpDataGeneration = testFable.instantiateServiceProvider('DataGeneration');
|
|
77
77
|
testFable.log.info(`Random Month: ${tmpDataGeneration.randomMonth()}`);
|
|
78
78
|
Expect(tmpDataGeneration.randomMonth()).to.be.a('string');
|
|
79
79
|
return fTestComplete();
|
|
@@ -85,7 +85,7 @@ suite
|
|
|
85
85
|
function (fTestComplete)
|
|
86
86
|
{
|
|
87
87
|
let testFable = new libFable();
|
|
88
|
-
let tmpDataGeneration = testFable.
|
|
88
|
+
let tmpDataGeneration = testFable.instantiateServiceProvider('DataGeneration');
|
|
89
89
|
testFable.log.info(`Random Name: ${tmpDataGeneration.randomName()}`);
|
|
90
90
|
Expect(tmpDataGeneration.randomName()).to.be.a('string');
|
|
91
91
|
return fTestComplete();
|
|
@@ -97,7 +97,7 @@ suite
|
|
|
97
97
|
function (fTestComplete)
|
|
98
98
|
{
|
|
99
99
|
let testFable = new libFable();
|
|
100
|
-
let tmpDataGeneration = testFable.
|
|
100
|
+
let tmpDataGeneration = testFable.instantiateServiceProvider('DataGeneration');
|
|
101
101
|
testFable.log.info(`Random Surname: ${tmpDataGeneration.randomSurname()}`);
|
|
102
102
|
Expect(tmpDataGeneration.randomSurname()).to.be.a('string');
|
|
103
103
|
return fTestComplete();
|
|
@@ -29,7 +29,7 @@ suite
|
|
|
29
29
|
function(fDone)
|
|
30
30
|
{
|
|
31
31
|
let testFable = new libFable();
|
|
32
|
-
let tmpDates = testFable.
|
|
32
|
+
let tmpDates = testFable.instantiateServiceProvider('Dates');
|
|
33
33
|
|
|
34
34
|
testFable.log.info(`Guessing your timezone: ${tmpDates.dayJS.tz.guess()}`);
|
|
35
35
|
|
|
@@ -27,7 +27,7 @@ suite
|
|
|
27
27
|
function()
|
|
28
28
|
{
|
|
29
29
|
let testFable = new libFable();
|
|
30
|
-
let tmpOperation = testFable.
|
|
30
|
+
let tmpOperation = testFable.instantiateServiceProvider('Operation', {Name: 'Big Complex Integration Operation'}, 'INTEGRATION-123');
|
|
31
31
|
Expect(tmpOperation).to.be.an('object');
|
|
32
32
|
Expect(testFable.servicesMap.Operation['INTEGRATION-123']).to.equal(tmpOperation);
|
|
33
33
|
Expect(testFable.servicesMap.Operation['BADHASH']).to.be.undefined;
|
|
@@ -43,11 +43,11 @@ suite
|
|
|
43
43
|
function()
|
|
44
44
|
{
|
|
45
45
|
let testFable = new libFable();
|
|
46
|
-
let tmpOperation = testFable.
|
|
46
|
+
let tmpOperation = testFable.instantiateServiceProvider('Operation', {Name: 'Big Complex Integration Operation'}, 'INTEGRATION-123');;
|
|
47
47
|
Expect(tmpOperation).to.be.an('object');
|
|
48
48
|
Expect(tmpOperation.name).to.equal('Big Complex Integration Operation');
|
|
49
49
|
|
|
50
|
-
let tmpCollisionOperation = testFable.
|
|
50
|
+
let tmpCollisionOperation = testFable.instantiateServiceProvider('Operation', {Name: 'Another Big Complex Integration Operation with Colliding Name'}, 'INTEGRATION-123');;
|
|
51
51
|
Expect(tmpCollisionOperation).to.be.an('object');
|
|
52
52
|
Expect(tmpCollisionOperation.name).to.equal('Another Big Complex Integration Operation with Colliding Name');
|
|
53
53
|
|
|
@@ -61,7 +61,7 @@ suite
|
|
|
61
61
|
function()
|
|
62
62
|
{
|
|
63
63
|
let testFable = new libFable();
|
|
64
|
-
let tmpOperation = testFable.
|
|
64
|
+
let tmpOperation = testFable.instantiateServiceProvider('Operation', {Name:'Another Big Complex Integration Operation'});
|
|
65
65
|
Expect(tmpOperation).to.be.an('object');
|
|
66
66
|
Expect(testFable.servicesMap.Operation.hasOwnProperty(tmpOperation.Hash)).to.equal(true);
|
|
67
67
|
Expect(tmpOperation.state.Log.length).to.equal(0);
|
|
@@ -80,6 +80,35 @@ suite
|
|
|
80
80
|
Expect(tmpOperation.state.Errors.length).to.equal(4);
|
|
81
81
|
}
|
|
82
82
|
);
|
|
83
|
+
test
|
|
84
|
+
(
|
|
85
|
+
'Timing Stuff for Operations',
|
|
86
|
+
function(fDone)
|
|
87
|
+
{
|
|
88
|
+
let testFable = new libFable();
|
|
89
|
+
let tmpOperation = testFable.instantiateServiceProvider('Operation', {Name:'The last operation in town.'});
|
|
90
|
+
Expect(tmpOperation).to.be.an('object');
|
|
91
|
+
Expect(testFable.servicesMap.Operation.hasOwnProperty(tmpOperation.Hash)).to.equal(true);
|
|
92
|
+
Expect(tmpOperation.state.Log.length).to.equal(0);
|
|
93
|
+
let tmpText = `Operation ${tmpOperation.Hash} starting up...`;
|
|
94
|
+
tmpOperation.log.info(tmpText);
|
|
95
|
+
Expect(tmpOperation.state.Log.length).to.equal(1);
|
|
96
|
+
Expect(tmpOperation.state.Log[0]).to.contain(tmpText);
|
|
97
|
+
|
|
98
|
+
tmpOperation.addStep('001-Login',
|
|
99
|
+
(fStepComplete) =>
|
|
100
|
+
{
|
|
101
|
+
setTimeout(
|
|
102
|
+
() =>
|
|
103
|
+
{
|
|
104
|
+
tmpOperation.log.trace('Login thingy complete!');
|
|
105
|
+
return fStepComplete();
|
|
106
|
+
}, 150);
|
|
107
|
+
}, 'Example step 1!');
|
|
108
|
+
|
|
109
|
+
tmpOperation.execute(fDone);
|
|
110
|
+
}
|
|
111
|
+
);
|
|
83
112
|
}
|
|
84
113
|
);
|
|
85
114
|
}
|
|
@@ -87,10 +87,10 @@ suite
|
|
|
87
87
|
function ()
|
|
88
88
|
{
|
|
89
89
|
testFable = new libFable();
|
|
90
|
-
testFable.
|
|
91
|
-
testFable.
|
|
90
|
+
testFable.addServiceType('SimpleService');
|
|
91
|
+
testFable.instantiateServiceProvider('SimpleService', { SomeOption: true }, 'SimpleService-123');
|
|
92
92
|
|
|
93
|
-
Expect(testFable.
|
|
93
|
+
Expect(testFable.servicesMap['SimpleService']['SimpleService-123']).to.be.an('object');
|
|
94
94
|
}
|
|
95
95
|
);
|
|
96
96
|
test
|
|
@@ -99,17 +99,17 @@ suite
|
|
|
99
99
|
function ()
|
|
100
100
|
{
|
|
101
101
|
testFable = new libFable();
|
|
102
|
-
testFable.
|
|
103
|
-
testFable.
|
|
102
|
+
testFable.addServiceType('SimpleService');
|
|
103
|
+
testFable.extraServiceInitialization = (pService) =>
|
|
104
104
|
{
|
|
105
105
|
pService.MyFancyProperty = 'Fancy';
|
|
106
106
|
return pService;
|
|
107
107
|
}
|
|
108
|
-
testFable.
|
|
108
|
+
testFable.instantiateServiceProvider('SimpleService', { SomeOption: true }, 'TheBestOne');
|
|
109
109
|
|
|
110
|
-
Expect(testFable.
|
|
111
|
-
Expect(testFable.
|
|
112
|
-
Expect(testFable.
|
|
110
|
+
Expect(testFable.services.SimpleService).to.be.an('object');
|
|
111
|
+
Expect(testFable.services.SimpleService.MyFancyProperty).to.equal('Fancy');
|
|
112
|
+
Expect(testFable.servicesMap.SimpleService.TheBestOne.MyFancyProperty).to.equal('Fancy');
|
|
113
113
|
}
|
|
114
114
|
);
|
|
115
115
|
test
|
|
@@ -118,16 +118,16 @@ suite
|
|
|
118
118
|
function ()
|
|
119
119
|
{
|
|
120
120
|
testFable = new libFable();
|
|
121
|
-
testFable.
|
|
122
|
-
testFable.
|
|
121
|
+
testFable.addServiceType('SimpleService', SimpleService);
|
|
122
|
+
testFable.instantiateServiceProvider('SimpleService', { SomeOption: true }, 'SimpleService-123');
|
|
123
123
|
|
|
124
|
-
Expect(testFable.
|
|
124
|
+
Expect(testFable.servicesMap['SimpleService']['SimpleService-123']).to.be.an('object');
|
|
125
125
|
|
|
126
|
-
Expect(testFable.
|
|
126
|
+
Expect(testFable.services['SimpleService']).to.be.an('object');
|
|
127
127
|
|
|
128
|
-
testFable.
|
|
128
|
+
testFable.services.SimpleService.doSomething();
|
|
129
129
|
|
|
130
|
-
Expect(testFable.
|
|
130
|
+
Expect(testFable.services['SimpleService'].Hash).to.equal('SimpleService-123');
|
|
131
131
|
}
|
|
132
132
|
);
|
|
133
133
|
test
|
|
@@ -137,13 +137,13 @@ suite
|
|
|
137
137
|
{
|
|
138
138
|
let testFable = new libFable({});
|
|
139
139
|
|
|
140
|
-
testFable.
|
|
140
|
+
testFable.addServiceType('SimpleService', SimpleService);
|
|
141
141
|
|
|
142
|
-
testFable.
|
|
142
|
+
testFable.instantiateServiceProvider('SimpleService', { SomeOption: true }, 'SimpleService-13');
|
|
143
143
|
|
|
144
|
-
testFable.
|
|
144
|
+
testFable.servicesMap['SimpleService']['SimpleService-13'].doSomething();
|
|
145
145
|
|
|
146
|
-
Expect(testFable.
|
|
146
|
+
Expect(testFable.servicesMap['SimpleService']['SimpleService-13']).to.be.an('object');
|
|
147
147
|
}
|
|
148
148
|
);
|
|
149
149
|
|
|
@@ -154,10 +154,10 @@ suite
|
|
|
154
154
|
{
|
|
155
155
|
let testFable = new libFable({});
|
|
156
156
|
|
|
157
|
-
testFable.
|
|
157
|
+
testFable.addServiceType('SimpleService', SimpleService);
|
|
158
158
|
|
|
159
|
-
let tmpService = testFable.
|
|
160
|
-
let tmpServiceFromPrototype = testFable.
|
|
159
|
+
let tmpService = testFable.instantiateServiceProviderWithoutRegistration('SimpleService', { SomeOption: true }, 'SimpleService-99');
|
|
160
|
+
let tmpServiceFromPrototype = testFable.instantiateServiceProviderFromPrototype('SimpleService', { SomeOption: true }, 'SimpleService-100', SimpleService);
|
|
161
161
|
|
|
162
162
|
Expect(testFable.servicesMap.SimpleService['SimpleService-99']).to.be.an('undefined');
|
|
163
163
|
Expect(testFable.servicesMap.SimpleService['SimpleService-100']).to.be.an('object');
|
|
@@ -174,29 +174,29 @@ suite
|
|
|
174
174
|
{
|
|
175
175
|
let testFable = new libFable({});
|
|
176
176
|
|
|
177
|
-
testFable.
|
|
178
|
-
testFable.
|
|
177
|
+
testFable.addServiceType('SimpleService', SimpleService);
|
|
178
|
+
testFable.addServiceType('DatabaseService', MockDatabaseService);
|
|
179
179
|
|
|
180
|
-
testFable.
|
|
181
|
-
testFable.
|
|
180
|
+
testFable.instantiateServiceProvider('SimpleService', { SomeOption: true });
|
|
181
|
+
testFable.services.SimpleService.doSomething();
|
|
182
182
|
|
|
183
|
-
testFable.
|
|
183
|
+
testFable.instantiateServiceProvider('DatabaseService', { ConnectionString: 'mongodb://localhost:27017/test' }, 'PrimaryConnection');
|
|
184
184
|
|
|
185
|
-
Expect(testFable.
|
|
185
|
+
Expect(testFable.services.DatabaseService.Hash).to.equal('PrimaryConnection');
|
|
186
186
|
|
|
187
|
-
testFable.
|
|
187
|
+
testFable.instantiateServiceProvider('DatabaseService', { ConnectionString: 'mongodb://localhost:27017/test' }, 'SecondaryConnection');
|
|
188
188
|
|
|
189
|
-
Expect(testFable.
|
|
189
|
+
Expect(testFable.services.DatabaseService.Hash).to.equal('PrimaryConnection');
|
|
190
190
|
|
|
191
|
-
testFable.
|
|
192
|
-
testFable.
|
|
191
|
+
testFable.services.DatabaseService.connect();
|
|
192
|
+
testFable.services.DatabaseService.commit('Test Record');
|
|
193
193
|
|
|
194
|
-
testFable.
|
|
194
|
+
testFable.setDefaultServiceInstantiation('DatabaseService', 'SecondaryConnection');
|
|
195
195
|
|
|
196
|
-
testFable.
|
|
197
|
-
testFable.
|
|
196
|
+
testFable.services.DatabaseService.connect();
|
|
197
|
+
testFable.services.DatabaseService.commit('Another Test Record');
|
|
198
198
|
|
|
199
|
-
Expect(testFable.
|
|
199
|
+
Expect(testFable.services.DatabaseService.Hash).to.equal('SecondaryConnection');
|
|
200
200
|
}
|
|
201
201
|
);
|
|
202
202
|
|
|
@@ -239,7 +239,7 @@ suite
|
|
|
239
239
|
|
|
240
240
|
let testFable = new libFable({});
|
|
241
241
|
|
|
242
|
-
testFable.
|
|
242
|
+
testFable.connectPreinitServiceProviderInstance(tmpCoreService);
|
|
243
243
|
|
|
244
244
|
Expect(testFable.servicesMap.MockCoreService['MockCoreService-2']).to.be.an('object');
|
|
245
245
|
Expect(testFable.services.MockCoreService).to.be.an('object');
|
|
@@ -255,29 +255,29 @@ suite
|
|
|
255
255
|
{
|
|
256
256
|
let testFable = new libFable({});
|
|
257
257
|
|
|
258
|
-
testFable.
|
|
259
|
-
testFable.
|
|
258
|
+
testFable.addServiceType('SimpleService', SimpleService);
|
|
259
|
+
testFable.addServiceType('DatabaseService', MockDatabaseService);
|
|
260
260
|
|
|
261
|
-
testFable.
|
|
262
|
-
testFable.
|
|
261
|
+
testFable.instantiateServiceProvider('SimpleService', { SomeOption: true });
|
|
262
|
+
testFable.services.SimpleService.doSomething();
|
|
263
263
|
|
|
264
|
-
testFable.
|
|
264
|
+
testFable.instantiateServiceProvider('DatabaseService', { ConnectionString: 'mongodb://localhost:27017/test' }, 'PrimaryConnection');
|
|
265
265
|
|
|
266
|
-
Expect(testFable.
|
|
266
|
+
Expect(testFable.services.DatabaseService.Hash).to.equal('PrimaryConnection');
|
|
267
267
|
|
|
268
|
-
testFable.
|
|
268
|
+
testFable.instantiateServiceProvider('DatabaseService', { ConnectionString: 'mongodb://localhost:27017/test' }, 'SecondaryConnection');
|
|
269
269
|
|
|
270
|
-
Expect(testFable.
|
|
270
|
+
Expect(testFable.services.DatabaseService.Hash).to.equal('PrimaryConnection');
|
|
271
271
|
|
|
272
|
-
testFable.
|
|
273
|
-
testFable.
|
|
272
|
+
testFable.services.DatabaseService.connect();
|
|
273
|
+
testFable.services.DatabaseService.commit('Test Record');
|
|
274
274
|
|
|
275
|
-
Expect(testFable.
|
|
275
|
+
Expect(testFable.setDefaultServiceInstantiation('DatabaseService', 'TertiaryConnection')).to.be.false;
|
|
276
276
|
|
|
277
|
-
testFable.
|
|
278
|
-
testFable.
|
|
277
|
+
testFable.services.DatabaseService.connect();
|
|
278
|
+
testFable.services.DatabaseService.commit('Another Test Record');
|
|
279
279
|
|
|
280
|
-
Expect(testFable.
|
|
280
|
+
Expect(testFable.services.DatabaseService.Hash).to.equal('PrimaryConnection');
|
|
281
281
|
}
|
|
282
282
|
);
|
|
283
283
|
}
|
|
@@ -32,7 +32,7 @@ suite
|
|
|
32
32
|
function(fTestComplete)
|
|
33
33
|
{
|
|
34
34
|
let testFable = new libFable();
|
|
35
|
-
let tmpFilePersistence = testFable.
|
|
35
|
+
let tmpFilePersistence = testFable.instantiateServiceProvider('FilePersistence');
|
|
36
36
|
Expect(tmpFilePersistence).is.an('object');
|
|
37
37
|
Expect(tmpFilePersistence.existsSync(`${__dirname}/../package.json`)).to.equal(true);
|
|
38
38
|
Expect(tmpFilePersistence.existsSync(`${__dirname}/package.json`)).to.equal(false);
|
|
@@ -45,7 +45,7 @@ suite
|
|
|
45
45
|
function(fTestComplete)
|
|
46
46
|
{
|
|
47
47
|
let testFable = new libFable();
|
|
48
|
-
let tmpFilePersistence = testFable.
|
|
48
|
+
let tmpFilePersistence = testFable.instantiateServiceProvider('FilePersistence');
|
|
49
49
|
let tmpFirstLine = 'id,book_id,best_book_id,work_id,books_count,isbn,isbn13,authors,original_publication_year,original_title,title,language_code,average_rating,ratings_count,work_ratings_count,work_text_reviews_count,ratings_1,ratings_2,ratings_3,ratings_4,ratings_5,image_url,small_image_url';
|
|
50
50
|
|
|
51
51
|
let tmpLineReader = tmpFilePersistence.lineReaderFactory(`${__dirname}/data/books.csv`,
|
|
@@ -80,8 +80,8 @@ suite
|
|
|
80
80
|
function(fTestComplete)
|
|
81
81
|
{
|
|
82
82
|
let testFable = new libFable();
|
|
83
|
-
let tmpFilePersistence = testFable.
|
|
84
|
-
let tmpDataGeneration = testFable.
|
|
83
|
+
let tmpFilePersistence = testFable.instantiateServiceProvider('FilePersistence');
|
|
84
|
+
let tmpDataGeneration = testFable.instantiateServiceProvider('DataGeneration');
|
|
85
85
|
|
|
86
86
|
let tmpLogFilePath = `/tmp/Fable-Test-${tmpDataGeneration.randomNumericString()}.log`;
|
|
87
87
|
testFable.log.info(`Writing test log file: [${tmpLogFilePath}]`);
|
|
@@ -107,7 +107,7 @@ suite
|
|
|
107
107
|
function(fTestComplete)
|
|
108
108
|
{
|
|
109
109
|
let testFable = new libFable();
|
|
110
|
-
let tmpFilePersistence = testFable.
|
|
110
|
+
let tmpFilePersistence = testFable.instantiateServiceProvider('FilePersistence');
|
|
111
111
|
|
|
112
112
|
Expect(tmpFilePersistence.joinPath('/tmp/tests/../othertests/names/'))
|
|
113
113
|
.to.equal('/tmp/othertests/names');
|
|
@@ -121,8 +121,8 @@ suite
|
|
|
121
121
|
function(fTestComplete)
|
|
122
122
|
{
|
|
123
123
|
let testFable = new libFable();
|
|
124
|
-
let tmpFilePersistence = testFable.
|
|
125
|
-
let tmpDataGeneration = testFable.
|
|
124
|
+
let tmpFilePersistence = testFable.instantiateServiceProvider('FilePersistence');
|
|
125
|
+
let tmpDataGeneration = testFable.instantiateServiceProvider('DataGeneration');
|
|
126
126
|
|
|
127
127
|
let tmpFolderExtras = [];
|
|
128
128
|
|
|
@@ -154,8 +154,8 @@ suite
|
|
|
154
154
|
function(fTestComplete)
|
|
155
155
|
{
|
|
156
156
|
let testFable = new libFable();
|
|
157
|
-
let tmpFilePersistence = testFable.
|
|
158
|
-
let tmpDataGeneration = testFable.
|
|
157
|
+
let tmpFilePersistence = testFable.instantiateServiceProvider('FilePersistence');
|
|
158
|
+
let tmpDataGeneration = testFable.instantiateServiceProvider('DataGeneration');
|
|
159
159
|
|
|
160
160
|
let tmpLogFilePath = `/tmp/Fable-Test-${tmpDataGeneration.randomNumericString()}.log`;
|
|
161
161
|
testFable.log.info(`Writing test log file: [${tmpLogFilePath}]`);
|
package/test/Manifest_tests.js
CHANGED
|
@@ -15,7 +15,7 @@ const Expect = Chai.expect;
|
|
|
15
15
|
const loadMetaTemplateModule = () =>
|
|
16
16
|
{
|
|
17
17
|
let tmpFable = new libFable();
|
|
18
|
-
return tmpFable.
|
|
18
|
+
return tmpFable.instantiateServiceProviderWithoutRegistration('MetaTemplate', {});
|
|
19
19
|
};
|
|
20
20
|
|
|
21
21
|
const configMetaTemplate = (pModule) =>
|
package/test/RestClient_test.js
CHANGED
|
@@ -35,7 +35,7 @@ suite
|
|
|
35
35
|
{
|
|
36
36
|
let testFable = new libFable();
|
|
37
37
|
// Instantiate the RestClient Service Provider
|
|
38
|
-
let tmpRestClient = testFable.
|
|
38
|
+
let tmpRestClient = testFable.instantiateServiceProvider('RestClient', { TraceLog: true }, 'RestClient-99');
|
|
39
39
|
|
|
40
40
|
// Download the wiktionary entry for dog!
|
|
41
41
|
tmpRestClient.getJSON('http://localhost:8086/1.0/Author/1',
|
|
@@ -55,7 +55,7 @@ suite
|
|
|
55
55
|
{
|
|
56
56
|
let testFable = new libFable();
|
|
57
57
|
// Instantiate the RestClient Service Provider
|
|
58
|
-
let tmpRestClient = testFable.
|
|
58
|
+
let tmpRestClient = testFable.instantiateServiceProvider('RestClient', { TraceLog: true }, 'RestClient-99');
|
|
59
59
|
|
|
60
60
|
tmpRestClient.prepareRequestOptions = (pOptions) =>
|
|
61
61
|
{
|
|
@@ -81,14 +81,14 @@ suite
|
|
|
81
81
|
{
|
|
82
82
|
let testFable = new libFable();
|
|
83
83
|
// Instantiate the RestClient Service Provider
|
|
84
|
-
let tmpRestClient = testFable.
|
|
84
|
+
let tmpRestClient = testFable.instantiateServiceProvider('RestClient', { TraceLog: true }, 'RestClient-99');
|
|
85
85
|
|
|
86
86
|
// Download the wiktionary entry for dog!
|
|
87
87
|
tmpRestClient.executeChunkedRequestBinary({ url: 'http://localhost:8086/1.0/Author/1', method: 'GET' },
|
|
88
88
|
(pError, pResponse, pBuffer) =>
|
|
89
89
|
{
|
|
90
90
|
Expect(pBuffer).to.be.instanceof(Buffer);
|
|
91
|
-
testFable.
|
|
91
|
+
testFable.instantiateServiceProvider('FilePersistence');
|
|
92
92
|
// TODO: How to test this on all operating systems safely?
|
|
93
93
|
//testFable.FilePersistence.writeFileSync(`/tmp/RestClient_binary_test.jpg`, pBuffer);
|
|
94
94
|
fTestComplete();
|
|
@@ -102,7 +102,7 @@ suite
|
|
|
102
102
|
{
|
|
103
103
|
let testFable = new libFable();
|
|
104
104
|
// Instantiate the RestClient Service Provider
|
|
105
|
-
let tmpRestClient = testFable.
|
|
105
|
+
let tmpRestClient = testFable.instantiateServiceProvider('RestClient', { TraceLog: true }, 'RestClient-99');
|
|
106
106
|
|
|
107
107
|
// Download the wiktionary entry for dog!
|
|
108
108
|
tmpRestClient.putJSON({ url: 'http://localhost:8086/1.0/Author/Upsert', body: { GUIDAuthor: 'TestAuthor', Name: 'Test Author 2' } },
|
|
@@ -122,7 +122,7 @@ suite
|
|
|
122
122
|
{
|
|
123
123
|
let testFable = new libFable();
|
|
124
124
|
// Instantiate the RestClient Service Provider
|
|
125
|
-
let tmpRestClient = testFable.
|
|
125
|
+
let tmpRestClient = testFable.instantiateServiceProvider('RestClient', { TraceLog: true }, 'RestClient-99');
|
|
126
126
|
|
|
127
127
|
// Download the wiktionary entry for dog!
|
|
128
128
|
tmpRestClient.putJSON({ url: 'http://localhost:8086/1.0/Author/Upsert', body: { Name: 'Test Author 2 DELETE' } },
|