-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathtest.js
More file actions
45 lines (38 loc) · 1.35 KB
/
test.js
File metadata and controls
45 lines (38 loc) · 1.35 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
39
40
41
42
43
44
45
/*!
* Simple Test
* Copyright(c) 2009-2017 Marcus Ma
* E-mail:maji1991@sina.com
* GitHub : https://github.com/MarcusMa
* MIT Licensed
*/
'use strict';
const express = require('express');
const Log = require('./src/utils/Log');
const BusinessInfo = require('./src/entity/BusinessInfo');
const PatchVersionIno = require('./src/entity/PatchVersionInfo');
const BusinessManager = require('./src/service/BusinessManager');
const PatchManager = require('./src/service/PatchManager');
const TAG = "test";
Log.i(TAG, "### Test BusinessInfo ");
let info = new BusinessInfo("1", 2, 3);
let patchVersion = new PatchVersionIno(1, '1.1.1', "234", "/sdaf/sdfasdf");
let patchVersion2 = new PatchVersionIno(2, '1.1.2', "aasdf", "asdfa/asdfas/asdfasd");
info.addNewPatchVersion(patchVersion);
info.addNewPatchVersion(patchVersion2);
Log.d(TAG, info.toString());
Log.i(TAG, "### Test BusinessManager ");
let manager = new BusinessManager();
manager.add(info);
let findInfo = manager.getBusinessInfoById("1");
Log.d(TAG, findInfo.toString());
let findTagInfo = manager.getBusinessInfoByTag(3);
Log.d(findTagInfo.toString());
manager.add(info);
info.businessId = "2";
manager.add(info);
Log.d(manager.getBusinessInfoSize());
Log.i(TAG, "### Test PatchManager ");
let patchManager = new PatchManager();
patchManager.startPatch();
patchManager.init(manager);
patchManager.startPatch();