Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ICD-RxJS Part 2 migration #56

Merged
merged 102 commits into from
Aug 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
102 commits
Select commit Hold shift + click to select a range
6bb2de6
finish ACCESS_CARTA_DEFAULT.test.ts
Feb 7, 2023
21e90a5
modify ACCESS_CARTA_DEFAULT.test.ts and add ACCESS_CARTA_DEFAULT_CONC…
Feb 8, 2023
5c242a9
finish ACCESS_CARTA_DEFAULT_CONCURRENT.test.ts
Feb 9, 2023
1bfc1de
finish ACCESS_CARTA_KNOWN_SESSION.test.ts and remove pingpong in Mess…
Feb 20, 2023
aa11c13
finish ACCESS_CARTA_NO_CLIENT_FEATURE.test.ts and add close session i…
Feb 20, 2023
eebd147
finish ACCESS_CARTA_SAME_ID_TWICE.test.ts
Feb 20, 2023
d81b4c3
unify the icdVersion in config.json
Feb 22, 2023
316dc7b
put icdVersion parameter in config in MessageController-concurrent.ts
Feb 22, 2023
7752ca9
finish CATALOG_FITS_VOT.test.ts
Feb 22, 2023
d1beb40
minor change in CATALOG_FITS_VOT.test.ts
Feb 22, 2023
07da268
finish CATALOG_LARGE.test.ts
Feb 22, 2023
9da5143
finish CLOSE_FILE_MULTI_FILES.test.ts
Mar 1, 2023
1cf2862
Merge branch 'dev' into mylin/#Add-part2
acdo2002 Mar 23, 2023
f72580e
Merge branch 'dev' into mylin/#Add-part2
acdo2002 May 3, 2023
e5e5d0e
Merge branch 'dev' into mylin/#Add-part2
acdo2002 Jun 2, 2023
7352736
Merge branch 'dev' into mylin/#Add-part2
acdo2002 Jun 13, 2023
50f6926
Merge branch 'dev' into mylin/#Add-part2
acdo2002 Jul 3, 2023
c654dd0
Merge branch 'dev' into mylin/#Add-part2
acdo2002 Nov 21, 2023
9c2e358
Merge branch 'dev' into mylin/#Add-part2
acdo2002 Nov 21, 2023
7768d8a
prelimary of CONCAT_ERROR_MESSAGE.test.ts and CONCAT_STOKES_IMAGES.te…
acdo2002 Nov 27, 2023
d7c78bc
finish case 1 of CONCAT_STOKES_IMAGES.test.ts
acdo2002 Nov 29, 2023
d9a35bb
finish case 3 in CONCAT_STOKES_IMAGES.test.ts
acdo2002 Nov 29, 2023
9b40903
finish CONCAT_STOKES_IMAGES.test.ts
acdo2002 Nov 29, 2023
e14841f
finish CONCAT_STOKES_IMAGES_AXIS_DEGENERACY.test.ts
acdo2002 Nov 30, 2023
a207bbd
working on CONCAT_ERROR_MESSAGE.test.ts
acdo2002 Dec 1, 2023
836167f
Merge branch 'dev' into mylin/#Add-part2
acdo2002 Dec 1, 2023
7781ce2
change the document, remove U & V, move Q & axis-degeneracy U to case 1
acdo2002 Dec 4, 2023
6fa9996
move Q & axis-degeneracy Q to case 3 and finished it in CONCAT_ERROR…
acdo2002 Dec 4, 2023
4640a55
add CONTOUR_DATA_STREAM.test.ts
acdo2002 Dec 7, 2023
819a455
add step 1 in CONTOUR_DATA_STREAM.test.ts
acdo2002 Dec 7, 2023
e1cc10a
finish CONTOUR_DATA_STREAM.test.ts
acdo2002 Dec 8, 2023
b8e038e
add CONTOUR_IMAGE_DATA.test.ts
acdo2002 Dec 8, 2023
09e5f21
finish CONTOUR_IMAGE_DATA.test.ts
acdo2002 Dec 11, 2023
fe84c9d
finish CONTOUR_IMAGE_DATA_NAN.test.ts
acdo2002 Dec 12, 2023
cb54fc3
finish CONTOUR_CHANGE_SMOOTH_AND_DEMICATION_FACTOR.test.ts
acdo2002 Dec 14, 2023
1c91a3a
Merge branch 'dev' into mylin/#Add-part2
acdo2002 Dec 14, 2023
023be39
Merge branch 'dev' into mylin/#Add-part2
acdo2002 Jan 2, 2024
365bf85
finish CURSOR_SPATIAL_PROFILE.test.ts
acdo2002 Jan 3, 2024
8988470
remove unnecessary in CURSOR_SPATIAL_PROFILE.test.ts
acdo2002 Jan 3, 2024
242b4bf
start CURSOR_SPATIAL_PROFILE_NaN.test.ts
acdo2002 Jan 3, 2024
a81a31a
finish CURSOR_SPATIAL_PROFILE_NaN.test.ts
acdo2002 Jan 3, 2024
df30183
finish CURSOR_SPECTRAL_PROFILE.test.ts
acdo2002 Jan 4, 2024
4b73bb0
finish CURSOR_SPECTRAL_PROFILE_NaN.test.ts
acdo2002 Jan 4, 2024
4be153b
Merge branch 'dev' into mylin/#Add-part2
acdo2002 Jan 10, 2024
2d58ce8
finish DS9_REGION_IMPORT_INTERNAL.test.ts
acdo2002 Jan 10, 2024
f140cdd
finish DS9_REGION_INFO.test.ts
acdo2002 Jan 10, 2024
5cd8d30
Merge branch 'dev' into mylin/#Add-part2
acdo2002 Mar 21, 2024
3b813d2
update protobuf
acdo2002 Mar 21, 2024
3ac8eab
add MATCH_STATS_WIDE.test.ts
acdo2002 Mar 25, 2024
90cc758
finish MATCH_STATS_WIDE.test.ts
acdo2002 Mar 25, 2024
d3af877
finish MATCH_STATS_BORDERLINE.test.ts
acdo2002 Mar 25, 2024
cb7ad8f
finish MATCH_STATS_WIDE_BORDERLINE.test.ts
acdo2002 Mar 26, 2024
47c7fa4
finish EXPORT_IMAGE_ORIGINAL.test.ts
acdo2002 Mar 26, 2024
20b55fb
finish EXPORT_IMAGE_CHANNEL.test.ts
acdo2002 Mar 27, 2024
d742473
move set_StokesCube to set_QA
acdo2002 Mar 28, 2024
a0edfc9
change EXPORT* to SAVE*
acdo2002 Apr 1, 2024
39d37a3
finish SAVE_IMAGE_STOKES.test.ts
acdo2002 Apr 1, 2024
15cb9a7
finish SAVE_IMAGE_CHOP.test.ts
acdo2002 Apr 1, 2024
c8acc7f
finish SAVE_IMAGE_CHOP_SHARED.test.ts
acdo2002 Apr 1, 2024
776b855
finish SAVE_IMAGE_DROP_DEG.test.ts
acdo2002 Apr 1, 2024
a1a0dc5
finish SAVE_IMAGE_ERROR_MESSAGE.test.ts
acdo2002 Apr 1, 2024
8f676d6
finish REGION_DATA_STREAM.test.ts
acdo2002 Apr 8, 2024
6325513
finish REGION_HISTOGRAM.test.ts
acdo2002 Apr 8, 2024
5f68627
finish REGION_HISTOGRAM_ITERATION.test.ts
acdo2002 Apr 8, 2024
65b6bf8
finish REGION_REGISTER.test.ts
acdo2002 Apr 8, 2024
541ce65
finish REGION_SPECTRAL_PROFILE_ELLIPSE.test.ts
acdo2002 Apr 9, 2024
0edb12a
finish REGION_SPECTRAL_PROFILE_POLYGON.test.ts
acdo2002 Apr 10, 2024
843b1f7
minor change in REGION_SPECTRAL_PROFILE_ELLIPSE.test.ts REGION_SPECTR…
acdo2002 Apr 10, 2024
c61fc90
finish REGION_SPECTRAL_PROFILE_RECTANGLE.test.ts
acdo2002 Apr 10, 2024
764afef
finish REGION_SPECTRAL_PROFILE_STOKES.test.ts
acdo2002 Apr 10, 2024
e2533ec
Merge branch 'dev' into mylin/#Add-part2
acdo2002 Apr 11, 2024
032fa84
update REGION_SPECTRAL_PROFILE_ELLIPSE.test.ts
acdo2002 Apr 15, 2024
236b3d3
minor change in REGION_SPECTRAL_PROFILE_ELLIPSE.test.ts
acdo2002 Apr 15, 2024
b5fe7de
update and finish REGION_SPECTRAL_PROFILE_RECTANGLE.test.ts
acdo2002 Apr 16, 2024
cbde1bd
update and finish REGION_SPECTRAL_PROFILE_POLYGON.test.ts
acdo2002 Apr 16, 2024
50d60ba
update and finish REGION_SPECTRAL_PROFILE_STOKES.test.ts
acdo2002 Apr 16, 2024
590ebd3
finish MULTI-SPECTRAL-PROFILE-IMAGE.test.ts
acdo2002 Apr 18, 2024
63c7ef6
finish MULTI-SPECTRAL-PROFILE-POLARIZATION.test.ts
acdo2002 Apr 19, 2024
1f5720f
finish MULTI-SPECTRAL-PROFILE-REGION.test.ts
acdo2002 Apr 19, 2024
8ef9b0e
finish MULTI-SPECTRAL-PROFILE-STATISTIC.test.ts
acdo2002 Apr 23, 2024
e717a2f
Merge branch 'dev' into mylin/#Add-part2
acdo2002 Apr 23, 2024
73d29a7
finish OPENFILE_CASA_BEAMTABLE.test.ts
acdo2002 Apr 23, 2024
1c4bbe3
finish OPENFILE_FITS_BEAMTABLE.test.ts
acdo2002 Apr 23, 2024
f6d46e9
Merge branch 'dev' into mylin/#Add-part2
acdo2002 May 6, 2024
c4f8287
finish OPEN_FITS_GZ.test.ts
acdo2002 May 8, 2024
82d99cd
finish OPEN_IMAGE_APPEND.test.ts
acdo2002 May 13, 2024
8b28781
finish OPEN_IMAGE_PV.test.ts
acdo2002 May 13, 2024
df879a2
fixed line 214: expect(difference).toBeLessThanOrEqual(2);
acdo2002 May 13, 2024
74a46ca
finish OPEN_IMAGE_CASA_VARIENTS.test.ts
acdo2002 May 13, 2024
ccfb4ea
finish IMPORT_MULTIPLE_CATALOG.test.ts
acdo2002 May 14, 2024
ae16e08
finish IMPORT_MULTIPLE_REGION.test.ts
acdo2002 May 14, 2024
c09ad7d
working on FITS_DS9_REGION_EXPORT_IMPORT_MATCHING.test.ts
acdo2002 May 15, 2024
6909328
finish FITS_DS9_REGION_EXPORT_IMPORT_MATCHING.test.ts and FITS_REGION…
acdo2002 May 15, 2024
30890cf
finish GET_FILELIST.test.ts
acdo2002 May 21, 2024
3d31534
finish FILE_LIST_PROGRESS_CANCELLATION.test.ts
acdo2002 May 21, 2024
d05a6cd
finish FILE_LIST_PROGRESS_COMPLETE.test.ts
acdo2002 May 21, 2024
8593409
minor changes
acdo2002 May 27, 2024
b2d4fa3
improve MULTI-SPECTRAL-PROFILE-IMAGE.test.ts to fit macos 13
acdo2002 May 28, 2024
6906132
testing CONTOUR_CHANGE_SMOOTH_AND_DEMICATION_FACTOR.test.ts rawCoordi…
acdo2002 May 28, 2024
123f089
remove chekcing rawCoordinate and add check rawCoordinate length in C…
acdo2002 May 29, 2024
6656b56
Merge branch 'dev' into mylin/#Add-part2
acdo2002 Jul 22, 2024
f5bfb48
Merge branch 'dev' into mylin/#Add-part2
acdo2002 Aug 2, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions src/test/ACCESS_CARTA_DEFAULT.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import { CARTA } from "carta-protobuf";
import config from "./config.json";
const WebSocket = require("ws");
import { MessageController } from "./MessageController";

let testServerUrl = config.serverURL0;
let connectTimeout = config.timeout.connection;

describe(`ACCESS_CARTA_DEFAULT tests: Testing connections to the backend`, () => {
describe(`create a Websocket connection and receive REGISTER_VIEWER_ACK`, () => {
let RegisterViewerAckResponse: CARTA.IRegisterViewerAck;
const msgController = MessageController.Instance;

test(`Receive REGISTER_VIEWER_ACK`, async () => {
RegisterViewerAckResponse = await msgController.connect(testServerUrl);
});

test(`REGISTER_VIEWER_ACK.message is not empty`, () => {
expect(RegisterViewerAckResponse.message).toBeDefined();
})

test(`REGISTER_VIEWER_ACK.platformStrings is not empty`, () => {
expect(RegisterViewerAckResponse.platformStrings).toBeDefined();
})

test("REGISTER_VIEWER_ACK.success = True", () => {
expect(RegisterViewerAckResponse.success).toBe(true);
});

test("REGISTER_VIEWER_ACK.session_id is not None", () => {
expect(RegisterViewerAckResponse.sessionId).toBeDefined();
console.log(`Registered session ID is ${RegisterViewerAckResponse.sessionId} @${new Date()}`);
});

test("REGISTER_VIEWER_ACK.user_preferences = None", () => {
expect(RegisterViewerAckResponse.userPreferences).toMatchObject({});
});

test("REGISTER_VIEWER_ACK.user_layouts = None", () => {
expect(RegisterViewerAckResponse.userLayouts).toMatchObject({});
});

afterAll(async () => {
await msgController.closeConnection();
})
})
});
76 changes: 76 additions & 0 deletions src/test/ACCESS_CARTA_DEFAULT_CONCURRENT.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
import { CARTA } from "carta-protobuf";
import { BackendService } from "./MessageController-concurrent";
import config from "./config.json";
const WebSocket = require("ws");

let testServerUrl = config.serverURL0;
let connectTimeout = config.timeout.connection;
let testNumber = config.repeat.concurrent

let client: BackendService[] = Array(testNumber);
let RegisterViewerAckResponse: CARTA.RegisterViewerAck[] = new Array(testNumber);

describe(`ACCESS_CARTA_DEFAULT_CONCURRENT: Testing multiple concurrent connections to the backend.`, () => {
test(`establish ${testNumber} connections to "${testServerUrl}".`, async () => {
for (let i = 0; i < client.length; i++) {
client[i] = new BackendService;
RegisterViewerAckResponse[i] = await client[i].connect(testServerUrl);
expect(client[i].connection.readyState).toBe(WebSocket.OPEN)
}
}, connectTimeout);

test(`assert every REGISTER_VIEWER_ACK.success is True.`, () => {
RegisterViewerAckResponse.forEach((item, index, array) => {
expect(item.success).toBe(true);
});
});

test(`assert every REGISTER_VIEWER_ACK.session_id is not None.`, () => {
RegisterViewerAckResponse.forEach((item, index, array) => {
expect(item.sessionId).toBeDefined();
});
});

test(`assert every REGISTER_VIEWER_ACK.message is not empty`, () => {
RegisterViewerAckResponse.forEach((item, index, array) => {
expect(item.message).toBeDefined();
});
})

test(`assert every REGISTER_VIEWER_ACK.platformStrings is not empty`, () => {
RegisterViewerAckResponse.forEach((item, index, array) => {
expect(item.platformStrings).toBeDefined();
});
})

test(`assert every REGISTER_VIEWER_ACK.session_id is unique.`, () => {
RegisterViewerAckResponse.forEach((item, index, array) => {
expect(array.filter(f => f.sessionId === item.sessionId).length).toEqual(1);
});
});

test(`assert every REGISTER_VIEWER_ACK.session_type is "CARTA.SessionType.NEW".`, () => {
RegisterViewerAckResponse.forEach((item, index, array) => {
expect(item.sessionType).toEqual(CARTA.SessionType.NEW);
});
});

test("assert every REGISTER_VIEWER_ACK.user_preferences = None", () => {
RegisterViewerAckResponse.forEach((item, index, array) => {
expect(item.userPreferences).toMatchObject({});
});
});

test("assert every REGISTER_VIEWER_ACK.user_layouts = None", () => {
RegisterViewerAckResponse.forEach((item, index, array) => {
expect(item.userLayouts).toMatchObject({});
});
});

afterAll(async () => {
for (let i = 0; i < client.length; i++) {
await client[i].closeConnection();
}
});

});
Loading