chaokunyang commented on code in PR #3394: URL: https://github.com/apache/fory/pull/3394#discussion_r3013435955
########## integration_tests/idl_tests/javascript/roundtrip.ts: ########## @@ -0,0 +1,205 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/** + * Cross-language roundtrip program for TypeScript IDL tests. + * + * This script is invoked by the Java IdlRoundTripTest as a peer process. + * It reads binary data files (written by Java), deserializes them, + * re-serializes the objects, and writes the bytes back to the same files. + * Java then reads the files back and verifies the roundtrip integrity. + * + * Environment variables: + * IDL_COMPATIBLE - "true" for compatible mode, "false" for schema_consistent + * DATA_FILE - AddressBook binary data file path + * DATA_FILE_AUTO_ID - Envelope (auto-id) binary data file path + * DATA_FILE_PRIMITIVES - PrimitiveTypes binary data file path + * DATA_FILE_COLLECTION - NumericCollections binary data file path + * DATA_FILE_COLLECTION_UNION - NumericCollectionUnion binary data file path + * DATA_FILE_COLLECTION_ARRAY - NumericCollectionsArray binary data file path + * DATA_FILE_COLLECTION_ARRAY_UNION - NumericCollectionArrayUnion binary data file path + * DATA_FILE_OPTIONAL_TYPES - OptionalHolder binary data file path + * DATA_FILE_TREE - TreeNode binary data file path (ref tracking) + * DATA_FILE_GRAPH - Graph binary data file path (ref tracking) + * DATA_FILE_FLATBUFFERS_MONSTER - Monster binary data file path + * DATA_FILE_FLATBUFFERS_TEST2 - Container binary data file path + */ + +import * as fs from "fs"; +import Fory, { Type } from "@apache-fory/core"; + +import { registerAddressbookTypes } from "./generated/addressbook"; +import { registerAutoIdTypes } from "./generated/auto_id"; +import { registerComplexPbTypes } from "./generated/complex_pb"; +import { registerCollectionTypes } from "./generated/collection"; +import { registerOptionalTypesTypes } from "./generated/optional_types"; +import { registerTreeTypes } from "./generated/tree"; +import { registerGraphTypes } from "./generated/graph"; +import { registerMonsterTypes } from "./generated/monster"; +import { registerComplexFbsTypes } from "./generated/complex_fbs"; + +// --------------------------------------------------------------------------- +// Capability: compatible mode +// --------------------------------------------------------------------------- +// The Fory JS runtime does not yet support compatible mode (class metadata / Review Comment: I left a review comment that compatible mode is supported, by you still skip tests, and don't address such issues. and also keep stale comments? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
