From b0082fd231f9812e657fd1adafeedb824ea1a785 Mon Sep 17 00:00:00 2001 From: gnosygnu Date: Sun, 28 Nov 2021 08:16:54 -0500 Subject: [PATCH] Refactor: @Test whitespace clean-up and other corelib changes --- 100_core/.classpath | 11 - 100_core/src/gplx/Array__tst.java | 38 +- 100_core/src/gplx/Bool__tst.java | 28 +- 100_core/src/gplx/Bry_bfr_tst.java | 108 ++--- 100_core/src/gplx/Bry_find_.java | 36 +- 100_core/src/gplx/Bry_find__tst.java | 42 +- 100_core/src/gplx/Bry_split__tst.java | 40 +- 100_core/src/gplx/Byte__tst.java | 34 +- 100_core/src/gplx/DateAdp_.java | 39 +- 100_core/src/gplx/DateAdp__tst.java | 50 +- 100_core/src/gplx/Double__tst.java | 24 +- 100_core/src/gplx/Err_tst.java | 34 +- 100_core/src/gplx/GfoMsg_tst.java | 34 +- 100_core/src/gplx/Gfo_evt_mgr.java | 30 +- 100_core/src/gplx/Gfo_evt_mgr_.java | 30 +- 100_core/src/gplx/Gfo_evt_mgr_tst.java | 40 +- 100_core/src/gplx/Gfo_invk_.java | 34 +- 100_core/src/gplx/Gfo_invk_to_str.java | 34 +- 100_core/src/gplx/GfsCtx.java | 66 +-- 100_core/src/gplx/Guid_adp__tst.java | 22 +- 100_core/src/gplx/Hash_adp_bry_tst.java | 36 +- 100_core/src/gplx/Int__tst.java | 36 +- 100_core/src/gplx/Int_ary__tst.java | 34 +- 100_core/src/gplx/Io_mgr__tst.java | 40 +- 100_core/src/gplx/Io_url__tst.java | 64 +-- 100_core/src/gplx/List_adp_tst.java | 82 ++-- 100_core/src/gplx/Long__tst.java | 36 +- 100_core/src/gplx/Math__tst.java | 44 +- 100_core/src/gplx/Object__tst.java | 34 +- 100_core/src/gplx/Ordered_hash_tst.java | 45 +- 100_core/src/gplx/String_.java | 44 +- 100_core/src/gplx/String__tst.java | 62 +-- .../src/gplx/core/brys/Bry_bfr_mkr_tst.java | 44 +- 100_core/src/gplx/core/brys/Bry_rdr.java | 77 ++- 100_core/src/gplx/core/brys/Bry_rdr_tst.java | 36 +- .../core/brys/args/Bfr_arg__time_tst.java | 32 +- .../gplx/core/brys/fmtrs/Bry_fmtr_tst.java | 56 +-- .../src/gplx/core/brys/fmts/Bry_fmt_tst.java | 48 +- .../core/brys/fmts/Bry_keys_parser_tst.java | 30 +- .../gplx/core/btries/Btrie_bwd_mgr_tst.java | 42 +- .../gplx/core/btries/Btrie_fast_mgr_tst.java | 44 +- .../gplx/core/btries/Btrie_slim_itm_tst.java | 38 +- .../gplx/core/btries/Btrie_slim_mgr_tst.java | 44 +- .../src/gplx/core/caches/Lru_cache_tst.java | 46 +- .../core/criterias/Criteria_ioItm_tst.java | 38 +- .../src/gplx/core/criterias/Criteria_tst.java | 46 +- .../src/gplx/core/encoders/B85_fp__tst.java | 28 +- .../src/gplx/core/encoders/Base85__tst.java | 36 +- .../src/gplx/core/encoders/Hex_utl__tst.java | 40 +- 100_core/src/gplx/core/envs/Env_.java | 74 +-- .../src/gplx/core/envs/Process_adp_tst.java | 30 +- .../core/gfo_regys/GfoRegy_RegDir_tst.java | 38 +- .../core/gfo_regys/GfoRegy_basic_tst.java | 28 +- .../gplx/core/interfaces/SrlAble__tst.java | 38 +- 100_core/src/gplx/core/intls/Utf16__tst.java | 36 +- 100_core/src/gplx/core/intls/Utf8__tst.java | 36 +- 100_core/src/gplx/core/ios/IoUrlTypeRegy.java | 44 +- 100_core/src/gplx/core/ios/IoZipWkr_tst.java | 22 +- .../gplx/core/ios/Io_download_fmt_tst.java | 34 +- 100_core/src/gplx/core/ios/Io_size__tst.java | 62 +-- .../core/ios/streams/IoStream_mem_tst.java | 26 +- .../core/ios/streams/IoStream_mock_tst.java | 34 +- .../core/ios/streams/Io_stream_rdr__tst.java | 32 +- .../gplx/core/ios/zips/Io_zip_mgr_tst.java | 28 +- 100_core/src/gplx/core/js/Js_wtr_tst.java | 32 +- .../gplx/core/lists/List_adp_sorter_tst.java | 34 +- .../src/gplx/core/lists/StackAdp_tst.java | 30 +- .../core/lists/rings/Ring__long__tst.java | 42 +- .../core/lists/rings/Ring__string__tst.java | 32 +- .../gplx/core/log_msgs/Gfo_msg_root_tst.java | 36 +- .../gplx/core/primitives/EnmParser_tst.java | 36 +- .../core/primitives/Gfo_number_parser.java | 388 ++++++++-------- .../src/gplx/core/primitives/Int_ary.java | 59 +++ .../security/algos/gplx_crypto/Crc32.java | 38 ++ .../security/algos/gplx_crypto/Crc32_tst.java | 66 +++ .../gplx_crypto/Hash_algo__tth_192__tst.java | 46 +- .../Hash_algo__tth_192_tree_tst.java | 34 +- .../gplx_crypto/Hash_console_wtr_tst.java | 32 +- .../algos/jre/Jre_hash_algo__md5__tst.java | 48 +- .../algos/jre/Jre_hash_algo__sha1__tst.java | 44 +- .../jre/Jre_hash_algo__sha2_256__tst.java | 44 +- .../gplx/core/texts/BaseXXConverter_tst.java | 34 +- .../src/gplx/core/texts/CharStream_tst.java | 40 +- .../core/texts/RegxPatn_cls_ioMatch_tst.java | 42 +- .../core/texts/RegxPatn_cls_like_tst.java | 44 +- .../gplx/core/texts/StringTableBldr_tst.java | 36 +- .../poolables/Gfo_poolable_mgr_tst.java | 38 +- .../gplx/core/times/DateAdp_parser_tst.java | 32 +- .../gplx/core/times/Time_span__basic_tst.java | 48 +- .../gplx/core/times/Time_span__parse_tst.java | 46 +- .../core/times/Time_span__to_str_tst.java | 46 +- .../core/type_xtns/DateAdpClassXtn_tst.java | 22 +- .../langs/dsvs/DsvDataRdr_csv_dat_tst.java | 70 +-- .../langs/dsvs/DsvDataRdr_dsv_dat_tst.java | 42 +- .../langs/dsvs/DsvDataRdr_dsv_hdr_tst.java | 42 +- .../langs/dsvs/DsvDataRdr_dsv_misc_tst.java | 44 +- .../langs/dsvs/DsvDataRdr_layout_tst.java | 48 +- .../gplx/langs/dsvs/DsvDataWtr_csv_tst.java | 52 +-- .../gplx/langs/dsvs/DsvDataWtr_tbls_tst.java | 38 +- 100_core/src/gplx/langs/gfs/GfsCore.java | 30 +- 100_core/src/gplx/langs/gfs/GfsCoreHelp.java | 71 --- 100_core/src/gplx/langs/gfs/GfsCore_.java | 44 +- .../src/gplx/langs/gfs/GfsLibIni_core.java | 38 +- 100_core/src/gplx/langs/gfs/Gfs_Date_tst.java | 34 +- .../src/gplx/langs/regxs/Regx_adp__tst.java | 44 +- .../src/gplx/langs/xmls/HierStrBldr_tst.java | 36 +- 100_core/src/gplx/langs/xmls/XmlDoc_tst.java | 38 +- .../gplx/langs/xmls/XmlFileSplitter_tst.java | 38 +- 100_core/src/gplx/langs/xmls/Xpath__tst.java | 32 +- 100_core/tst/gplx/GfoMsg_rdr_tst.java | 40 +- .../core/ios/IoEngine_dir_basic_base_tst.java | 46 +- .../ios/IoEngine_dir_basic_system_tst.java | 22 +- .../core/ios/IoEngine_dir_deep_base_tst.java | 46 +- .../ios/IoEngine_dir_deep_memory_tst.java | 38 +- .../core/ios/IoEngine_fil_basic_base_tst.java | 70 +-- .../ios/IoEngine_fil_basic_memory_tst.java | 36 +- .../ios/IoEngine_fil_basic_system_tst.java | 40 +- .../core/ios/IoEngine_fil_xfer_base_tst.java | 44 +- .../core/ios/IoEngine_stream_xfer_tst.java | 32 +- .../core/ios/IoEngine_xrg_queryDir_tst.java | 40 +- .../core/ios/IoEngine_xrg_recycleFil_tst.java | 30 +- .../ios/IoItmDir_FetchDeepOrNull_tst.java | 32 +- .../gplx/core/ios/IoUrlInfo_alias_tst.java | 42 +- 100_core/tst/gplx/core/ios/IoUrl_lnx_tst.java | 44 +- 100_core/tst/gplx/core/ios/IoUrl_map_tst.java | 28 +- 100_core/tst/gplx/core/ios/IoUrl_wnt_tst.java | 54 +-- .../gplx/core/stores/GfoNdeRdr_read_tst.java | 40 +- .../tst/gplx/core/stores/GfoNdeRdr_tst.java | 60 +-- .../gplx/core/stores/xmls/XmlDataRdr_tst.java | 44 +- .../gplx/core/stores/xmls/XmlDataWtr_tst.java | 42 +- 110_gfml/.classpath | 14 - 110_gfml/tst/gplx/gfml/GfmlDataRdr_tst.java | 42 +- .../tst/gplx/gfml/z011_IntObjHash_tst.java | 42 +- 110_gfml/tst/gplx/gfml/z012_GfmlTrie_tst.java | 44 +- .../tst/gplx/gfml/z015_GfmlDocPos_tst.java | 44 +- .../tst/gplx/gfml/z016_GfmlScopeList_tst.java | 36 +- .../gfml/z017_GfmlStringHighlighter_tst.java | 36 +- .../gplx/gfml/z051_GfmlFldPool_keyed_tst.java | 44 +- .../tst/gplx/gfml/z081_GfmlDataWtr_tst.java | 48 +- .../gplx/gfml/z082_GfmlDataWtrOpts_tst.java | 36 +- .../tst/gplx/gfml/z091_GfmlLxr_basic_tst.java | 38 +- .../gplx/gfml/z101_core_ndeInline_tst.java | 34 +- .../gplx/gfml/z102_core_whitespace_tst.java | 44 +- .../tst/gplx/gfml/z103_core_elmKey_tst.java | 38 +- .../tst/gplx/gfml/z111_core_comment0_tst.java | 36 +- .../tst/gplx/gfml/z112_core_comment1_tst.java | 42 +- .../tst/gplx/gfml/z120_quotes_eval0_tst.java | 34 +- .../gplx/gfml/z121_quotes_quotes0_tst.java | 36 +- .../gfml/z122_quotes_quote0_eval0_tst.java | 34 +- .../gplx/gfml/z123_quotes_quoteBlock_tst.java | 38 +- .../gplx/gfml/z124_quotes_quoteFold_tst.java | 48 +- .../tst/gplx/gfml/z151_ndeSubs_basic_tst.java | 40 +- .../tst/gplx/gfml/z152_ndeSubs_data_tst.java | 42 +- .../gplx/gfml/z161_ndeHdrs_inline_tst.java | 36 +- .../tst/gplx/gfml/z162_ndeHdrs_err_tst.java | 34 +- .../tst/gplx/gfml/z163_ndeHdrs_body_tst.java | 38 +- .../tst/gplx/gfml/z164_hdeHdrs_data_tst.java | 34 +- .../tst/gplx/gfml/z181_ndeDots_basic_tst.java | 34 +- .../tst/gplx/gfml/z182_ndeDots_subs_tst.java | 38 +- .../gplx/gfml/z183_ndeDots_parens_tst.java | 48 +- .../gplx/gfml/z184_ndeDots_atrSpr_tst.java | 32 +- .../gplx/gfml/z191_ndeProps_basic_tst.java | 56 +-- .../tst/gplx/gfml/z192_ndeProps_dots_tst.java | 32 +- .../tst/gplx/gfml/z400_GfmlTypeMakr_tst.java | 36 +- .../gfml/z401_types_compile_basic_tst.java | 38 +- .../gfml/z402_types_compile_implicit_tst.java | 36 +- .../gfml/z403_types_compile_default_tst.java | 36 +- .../gfml/z411_types_apply_atrs_basic_tst.java | 42 +- .../gfml/z421_types_apply_ndes_basic_tst.java | 34 +- .../gfml/z422_types_apply_ndes_multi_tst.java | 36 +- .../gfml/z423_types_apply_ndes_misc_tst.java | 34 +- .../gfml/z424_types_apply_ndes_nest_tst.java | 40 +- .../gplx/gfml/z441_types_parse_basic_tst.java | 36 +- .../gfml/z442_types_parse_default_tst.java | 40 +- .../gplx/gfml/z443_types_parse_keyd_tst.java | 32 +- .../tst/gplx/gfml/z451_dflts_compile_tst.java | 34 +- .../tst/gplx/gfml/z452_dflts_exec_tst.java | 38 +- .../tst/gplx/gfml/z455_dflts_scope_tst.java | 32 +- .../tst/gplx/gfml/z456_dflts_parse_tst.java | 32 +- .../tst/gplx/gfml/z481_vars_compile_tst.java | 32 +- .../tst/gplx/gfml/z482_vars_parse_tst.java | 40 +- .../tst/gplx/gfml/z501_lxr_parse_tst.java | 42 +- 110_gfml/tst/gplx/gfml/z601_edit_atr_tst.java | 58 +-- 110_gfml/tst/gplx/gfml/z602_edit_nde_tst.java | 14 +- .../gplx/gfml/z801_useCase_DataRdr_tst.java | 32 +- .../gfml/z803_useCase_KbdKeyboard_tst.java | 36 +- .../gplx/gfml/z811_useCase_GfmlIoSql_tst.java | 34 +- 110_gfml/tst/gplx/gfml/z901_perf_tst.java | 36 +- 140_dbs/.classpath | 13 - 140_dbs/src/gplx/dbs/Db_attach_mgr__tst.java | 32 +- 140_dbs/src/gplx/dbs/Db_conn_info_tst.java | 34 +- 140_dbs/src/gplx/dbs/Db_crt_.java | 1 + 140_dbs/src/gplx/dbs/Db_crt_tst.java | 38 +- 140_dbs/src/gplx/dbs/Dbmeta_fld_list.java | 31 +- .../dbs/diffs/builds/Gfdb_diff_bldr_tst.java | 40 +- .../cmds/Gfdb_diff_cmd_sql_bldr_tst.java | 36 +- .../gplx/dbs/engines/Db_engine_sql_base.java | 92 ++-- .../dbs/engines/mems/Mem_exec_select_tst.java | 36 +- .../gplx/dbs/engines/mysql/Mysql_engine.java | 17 +- .../dbs/engines/sqlite/Sqlite_engine.java | 62 ++- .../dbs/engines/sqlite/Sqlite_engine_.java | 36 +- .../dbs/engines/tdbs/TdbConnectInfo_tst.java | 30 +- .../dbs/engines/tdbs/TdbDbLoadMgr_tst.java | 36 +- .../dbs/engines/tdbs/TdbDbSaveMgr_tst.java | 36 +- .../gplx/dbs/engines/tdbs/TdbFlush_tst.java | 42 +- .../metas/parsers/Dbmeta_parser__fld_tst.java | 36 +- .../metas/parsers/Dbmeta_parser__idx_tst.java | 36 +- .../metas/parsers/Dbmeta_parser__tbl_tst.java | 34 +- .../dbs/metas/parsers/Sql_bry_rdr_tst.java | 34 +- .../src/gplx/dbs/qrys/Db_qry__select_cmd.java | 35 +- 140_dbs/src/gplx/dbs/qrys/Db_qry_dml_tst.java | 38 +- .../src/gplx/dbs/qrys/Db_qry_select_tst.java | 52 +-- 140_dbs/src/gplx/dbs/qrys/Db_qry_sql_tst.java | 36 +- 140_dbs/src/gplx/dbs/qrys/Db_stmt_cmd.java | 439 +++++++++++------- .../src/gplx/dbs/qrys/Db_stmt_sql_tst.java | 24 +- 140_dbs/src/gplx/dbs/qrys/Db_val_type.java | 112 ++++- .../gplx/dbs/sqls/itms/Db_obj_ary_tst.java | 34 +- .../gplx/dbs/sqls/wtrs/Sql_from_wtr_tst.java | 36 +- .../dbs/sqls/wtrs/Sql_qry_wtr__ansi__tst.java | 50 +- .../sqls/wtrs/Sql_qry_wtr__iosql__tst.java | 40 +- .../dbs/sqls/wtrs/Sql_schema_wtr_tst.java | 36 +- .../dbs/sqls/wtrs/Sql_select_wtr_tst.java | 22 +- .../gplx/dbs/sqls/wtrs/Sql_val_wtr_tst.java | 64 +-- .../gplx/dbs/sqls/wtrs/Sql_where_wtr_tst.java | 56 +-- 140_dbs/src/gplx/dbs/sys/Db_sys_mgr_tst.java | 32 +- .../src/gplx/dbs/utls/Db_cmd_backup_tst.java | 28 +- .../src/gplx/gfdbs/cores/GfdbCloseAble.java | 5 + .../src/gplx/gfdbs/cores/GfdbConnInfo.java | 5 + .../gplx/gfdbs/cores/GfdbConnInfoSqlite.java | 11 + 140_dbs/src/gplx/gfdbs/cores/GfdbItm.java | 7 + .../src/gplx/gfdbs/cores/GfdbItmFactory.java | 5 + 140_dbs/src/gplx/gfdbs/cores/GfdbMeta.java | 14 + .../src/gplx/gfdbs/cores/GfdbMetaBase.java | 19 + 140_dbs/src/gplx/gfdbs/cores/GfdbState.java | 11 + 140_dbs/src/gplx/gfdbs/cores/GfdbTbl.java | 47 ++ .../src/gplx/gfdbs/cores/cfgs/GfdbCfgItm.java | 34 ++ .../gplx/gfdbs/cores/cfgs/GfdbCfgMeta.java | 32 ++ .../cores/cfgs/GfdbCfgSelectWildcardWkr.java | 32 ++ .../src/gplx/gfdbs/cores/cfgs/GfdbCfgTbl.java | 18 + .../src/gplx/gfdbs/cores/cfgs/GfdbIdMgr.java | 35 ++ .../gplx/gfdbs/cores/cmds/GfdbModifyCmd.java | 63 +++ .../gplx/gfdbs/cores/cmds/GfdbSelectCmd.java | 50 ++ .../gplx/gfdbs/cores/cmds/GfdbSelectList.java | 8 + .../gfdbs/cores/cmds/GfoDbModifyCmdHash.java | 24 + .../gplx/gfdbs/cores/cmds/GfoDbSelectWkr.java | 9 + .../gfdbs/cores/cmds/GfoDbSelectWkrAll.java | 18 + .../gfdbs/cores/cmds/GfoDbSelectWkrOne.java | 30 ++ .../src/gplx/gfdbs/cores/txns/GfdbTxnMgr.java | 59 +++ .../src/gplx/gfdbs/cores/txns/GfdbTxnSub.java | 5 + .../gplx/gfdbs/cores/wkrs/GfdbListWkr.java | 65 +++ .../gplx/gfdbs/cores/wkrs/GfdbListWkrUtl.java | 14 + .../tst/gplx/core/stores/DbMaprMgr_tst.java | 46 +- .../tst/gplx/dbs/engines/db_CrudOps_tst.java | 38 +- .../gplx/dbs/engines/db_DataTypes_tst.java | 38 +- .../gplx/dbs/groupBys/GroupBys_mysql_tst.java | 22 +- .../gplx/dbs/groupBys/GroupBys_tdb_tst.java | 24 +- .../insertIntos/InsertIntos_mysql_tst.java | 14 +- .../dbs/insertIntos/InsertIntos_tdb_tst.java | 14 +- 140_dbs/tst/gplx/dbs/joins/Joins_tdb_tst.java | 28 +- .../gplx/dbs/orderBys/OrderBys_tdb_tst.java | 36 +- .../tst/gplx/dbs/qrys/Db_val_typeTest.java | 29 ++ 140_dbs/tst/gplx/dbs/utls/PoolIds_tst.java | 38 +- 150_gfui/.classpath | 10 - .../gplx/gfui/controls/GfuiBorderMgr_tst.java | 36 +- .../controls/customs/GfuiMoveElemBnd.java | 64 ++- .../controls/customs/GfuiMoveElemBtn.java | 65 ++- .../controls/customs/GfuiMoveElemBtn_tst.java | 47 +- .../controls/customs/GfuiStatusBarBnd.java | 30 +- .../controls/customs/GfuiStatusBoxBnd.java | 49 +- .../gfui/controls/elems/GfuiElemBase.java | 176 ++++--- .../gplx/gfui/controls/gxws/GxwCbkHost_.java | 49 +- .../gxws/GxwElemFactory_cls_lang.java | 30 +- .../gplx/gfui/controls/gxws/GxwElem_lang.java | 51 +- .../gfui/controls/gxws/GxwTextBox_lang.java | 71 +-- .../gplx/gfui/controls/standards/GfuiBtn.java | 30 +- .../gfui/controls/standards/Gfui_html.java | 34 +- .../standards/Gfui_tab_itm_data_tst.java | 30 +- .../src/gplx/gfui/controls/tabs/TabBnd.java | 52 ++- .../gplx/gfui/controls/tabs/TabBox_tst.java | 40 +- .../gfui/controls/windows/GfoConsoleWin.java | 78 +++- .../gfui/controls/windows/GfuiCmdForm.java | 45 +- .../windows/GfuiFocusOrderer_tst.java | 40 +- .../gfui/controls/windows/GfuiForm_menu.java | 48 +- .../gfui/controls/windows/GfuiMenuBar.java | 74 +-- .../gplx/gfui/controls/windows/GfuiWin.java | 82 ++-- .../controls/windows/GfuiWinFocusMgr.java | 42 +- .../controls/windows/GfuiWinKeyCmdMgr.java | 30 +- .../src/gplx/gfui/draws/ColorAdp__tst.java | 38 +- .../src/gplx/gfui/envs/ClipboardAdp__tst.java | 18 +- .../src/gplx/gfui/envs/ScreenAdp_tst.java | 24 +- 150_gfui/src/gplx/gfui/gfxs/GfxItm_base.java | 32 +- 150_gfui/src/gplx/gfui/imgs/IconAdp.java | 45 +- 150_gfui/src/gplx/gfui/imgs/ImageAdp_tst.java | 34 +- .../gplx/gfui/ipts/GfuiClickKeyMgr_tst.java | 28 +- .../gplx/gfui/ipts/IptArgChainMgr_tst.java | 34 +- 150_gfui/src/gplx/gfui/ipts/IptArg_.java | 40 +- .../src/gplx/gfui/ipts/IptArg_parser_tst.java | 49 +- 150_gfui/src/gplx/gfui/ipts/IptBndMgr.java | 50 +- .../src/gplx/gfui/ipts/IptBndMgr_tst.java | 32 +- 150_gfui/src/gplx/gfui/ipts/IptBnd_.java | 30 +- 150_gfui/src/gplx/gfui/ipts/IptCfg_tst.java | 42 +- 150_gfui/src/gplx/gfui/ipts/IptEventMgr.java | 46 +- .../src/gplx/gfui/ipts/IptEventType_tst.java | 34 +- .../src/gplx/gfui/ipts/IptKeyStrMgr_tst.java | 34 +- 150_gfui/src/gplx/gfui/ipts/IptKey_.java | 66 ++- 150_gfui/src/gplx/gfui/ipts/IptKey__tst.java | 42 +- .../gplx/gfui/kits/core/Gfui_kit_base.java | 54 +-- .../src/gplx/gfui/layouts/GftBand_tst.java | 56 +-- 400_xowa/.classpath | 21 - 400_xowa/src/gplx/core/brys/Bit__tst.java | 40 +- .../src/gplx/core/brys/Bit_heap_rdr_tst.java | 36 +- .../src/gplx/core/brys/Bit_heap_wtr_tst.java | 40 +- 400_xowa/src/gplx/core/brys/Bry_diff_tst.java | 34 +- .../gplx/core/brys/Int_flag_bldr__tst.java | 42 +- .../gplx/core/btries/Btrie_u8_mgr_tst.java | 44 +- .../gplx/core/caches/Gfo_cache_mgr_tst.java | 36 +- .../core/consoles/Gfo_cmd_arg_mgr_tst.java | 48 +- .../src/gplx/core/flds/Gfo_fld_rdr_tst.java | 54 +-- .../gplx/core/gfobjs/Gfobj_rdr__json_tst.java | 34 +- .../core/ios/BinaryHeap_Io_line_rdr_tst.java | 36 +- .../src/gplx/core/ios/Io_buffer_rdr_tst.java | 36 +- .../src/gplx/core/ios/Io_line_rdr_tst.java | 44 +- .../src/gplx/core/ios/Io_sort_misc_tst.java | 36 +- 400_xowa/src/gplx/core/ios/Io_sort_tst.java | 32 +- .../src/gplx/core/lists/Binary_heap_tst.java | 34 +- .../src/gplx/core/lists/Queue_adp_tst.java | 38 +- 400_xowa/src/gplx/core/lists/StatRng_tst.java | 38 +- .../binary_searches/Binary_search__tst.java | 36 +- .../core/lists/caches/Mru_cache_mgr_tst.java | 40 +- .../src/gplx/core/net/Gfo_url_parser_tst.java | 100 ++-- .../core/net/Http_request_parser_tst.java | 42 +- .../core/primitives/Int_ary_parser_tst.java | 26 +- .../gplx/core/primitives/Int_pool_tst.java | 42 +- .../core/threads/Gfo_thread_cmd_base.java | 60 +-- .../core/threads/Gfo_thread_cmd_download.java | 34 +- .../core/threads/Gfo_thread_cmd_replace.java | 36 +- .../core/threads/Gfo_thread_cmd_unzip.java | 34 +- .../src/gplx/dbs/bulks/Db_tbl_copy_tst.java | 32 +- .../metas/updates/Schema_update_mgr_tst.java | 34 +- .../dbs/percentiles/Percentile_rng_tst.java | 36 +- .../percentiles/Percentile_select_base.java | 42 +- 400_xowa/src/gplx/fsdb/data/Fsd_bin_tbl.java | 41 +- .../src/gplx/fsdb/data/Fsd_thm_tbl_tst.java | 34 +- .../src/gplx/gfui/Gfui_bnd_parser_tst.java | 44 +- .../langs/dsvs/Dsv_tbl_parser_int_tst.java | 32 +- .../langs/dsvs/Dsv_tbl_parser_str_tst.java | 38 +- .../src/gplx/langs/dsvs/Dsv_wkr_base.java | 38 +- .../src/gplx/langs/gfs/Gfs_msg_bldr_tst.java | 42 +- .../src/gplx/langs/gfs/Gfs_parser_tst.java | 68 +-- .../src/gplx/langs/htmls/Gfh_parser_tst.java | 42 +- .../gplx/langs/htmls/Gfh_utl__basic__tst.java | 36 +- .../langs/htmls/Gfh_utl__comments__tst.java | 18 +- .../langs/htmls/clses/Gfh_class__tst.java | 34 +- .../htmls/clses/Gfh_class_parser__tst.java | 34 +- .../langs/htmls/docs/Gfh_tag_rdr_tst.java | 42 +- .../htmls/encoders/Gfo_url_encoder_tst.java | 74 +-- .../htmls/styles/Gfh_style_parser__tst.java | 40 +- .../src/gplx/langs/jsons/Json_doc_tst.java | 32 +- .../gplx/langs/jsons/Json_doc_wtr_tst.java | 34 +- .../src/gplx/langs/jsons/Json_itm_base.java | 2 +- .../jsons/Json_parser__list_nde__base.java | 2 +- .../gplx/langs/jsons/Json_printer_tst.java | 42 +- .../src/gplx/langs/jsons/Json_wtr_tst.java | 42 +- .../mustaches/Mustache_itm_render_tst.java | 378 +++++++-------- .../langs/mustaches/Mustache_tkn_itm.java | 252 +++++----- .../mustaches/Mustache_tkn_parser_tst.java | 34 +- .../src/gplx/langs/phps/Php_parser_fxt.java | 34 +- .../src/gplx/langs/phps/Php_parser_tst.java | 102 ++-- 400_xowa/src/gplx/langs/phps/Php_srl_itm.java | 32 +- .../gplx/langs/phps/Php_srl_parser_tst.java | 68 +-- .../src/gplx/langs/phps/Php_text_itm_tst.java | 56 +-- .../src/gplx/langs/regxs/Gfo_pattern_tst.java | 44 +- .../src/gplx/langs/xmls/Gfo_xml_wtr_tst.java | 42 +- 400_xowa/src/gplx/xowa/Xoae_page__tst.java | 32 +- .../mgrs/caches/Xocfg_cache_mgr__tst.java | 36 +- .../edits/objs/Xoedit_itm_html_tst.java | 32 +- .../services/Xocfg_maint_parser__tst.java | 34 +- .../cfgs/upgrades/Xocfg_upgrade_mgr__tst.java | 42 +- .../scripts/apis/Xoscript_doc_head__tst.java | 38 +- .../apps/updates/js/Xojs_wkr__base.java | 51 +- .../specials/Xoa_update_itm__leaf.java | 34 +- .../bldrs/app_cfgs/Xob_wiki_cfg_bldr_tst.java | 36 +- .../wm_server_cfgs/Xowm_server_cfg_mgr.java | 58 ++- .../bldrs/centrals/cmds/Xobc_cmd__base.java | 42 +- .../packs/files/Pack_zip_name_bldr__tst.java | 34 +- .../files/cmds/Xobldr__image__create_tst.java | 40 +- .../cmds/Xobldr__lnki_temp__create__tst.java | 32 +- .../apis/Xowmf_imageinfo_item__tst.java | 36 +- .../files/utls/Xob_xfer_temp_itm_tst.java | 52 +-- .../makes/Xomp_make_merger__base.java | 32 +- .../htmls/tocs/Xoh_toc_htmlr__basic__tst.java | 44 +- .../tocs/Xoh_toc_wkr__lvl__basic__tst.java | 40 +- .../tocs/Xoh_toc_wkr__txt__basic__tst.java | 50 +- .../tocs/Xoh_toc_wkr__txt__dupe__tst.java | 38 +- .../tocs/Xoh_toc_wkr__txt__xnde__tst.java | 80 ++-- .../addons/htmls/tocs/Xowe_hdr_bldr__tst.java | 94 ++-- .../ctgs/bldrs/Xob_catlink_mgr__tst.java | 32 +- .../Xoctg_catpage_mgr__basic__tst.java | 52 +-- .../Xoctg_catpage_mgr__navlink__tst.java | 38 +- .../dbs/Xoctg_catlink_loader__tst.java | 34 +- .../catpages/fmts/Xoctg_fmt_itm_base.java | 32 +- .../langs/Xoctg_collation_wkr___tst.java | 46 +- .../catpages/urls/Xoctg_catpage_url__tst.java | 36 +- .../doubles/Xoctg_double_box__tst.java | 34 +- .../singles/Xoctg_single_box__tst.java | 32 +- .../dbs/Xowdir_wiki_props_mgr__tst.java | 40 +- .../core/Xofulltext_extractor__tst.java | 32 +- .../Xofulltext_finder_cbk__eval__tst.java | 50 +- .../htmls/css/mgrs/Xowd_css_core_mgr_tst.java | 34 +- .../core/loaders/Xosync_page_loader__tst.java | 36 +- .../parsers/Xosync_hdoc_parser__err__tst.java | 42 +- .../Xosync_hdoc_parser__file__tst.java | 46 +- .../Xosync_hdoc_parser__misc__tst.java | 26 +- .../core/parsers/Xosync_hdoc_parser__tst.java | 34 +- .../gui/htmlbars/Srch_rslt_cbk__js.java | 32 +- .../parsers/Srch_highlight_mgr_tst.java | 60 +-- .../searchs/parsers/Srch_text_parser_tst.java | 190 ++++---- .../searchers/Srch_search_phrase_tst.java | 62 +-- .../searchers/crts/Srch_crt_parser_tst.java | 94 ++-- .../searchers/crts/Srch_crt_scanner_tst.java | 84 ++-- .../searchers/crts/Srch_crt_sql_tst.java | 40 +- .../searchers/rslts/Srch_rslt_row_tst.java | 32 +- .../searchers/wkrs/Srch_link_wkr_sql_tst.java | 32 +- .../searchers/wkrs/Srch_page_tbl_wkr_tst.java | 52 +-- .../htmls/Srch_html_page_bldr_tst.java | 34 +- .../specials/htmls/Srch_rslt_cbk_tst.java | 32 +- .../src/gplx/xowa/apps/Xoa_app_eval_tst.java | 32 +- .../src/gplx/xowa/apps/Xoa_shell_tst.java | 26 +- .../addons/bldrs/Xopg_match_mgr__tst.java | 42 +- .../xowa/apps/cfgs/Xowc_xtn_pages_tst.java | 34 +- .../xowa/apps/fmtrs/Xoa_fmtr_itm_tst.java | 32 +- .../xowa/apps/fsys/Xoa_url_finder_tst.java | 32 +- .../gfs/Gfs_php_converter__to_gfs__tst.java | 36 +- .../gfs/Gfs_php_converter__to_php__tst.java | 26 +- .../src/gplx/xowa/apps/gfs/Xoa_gfs_mgr.java | 50 +- .../servers/http/Http_server_page__tst.java | 32 +- .../servers/http/Http_server_wkr__tst.java | 32 +- .../http/Http_server_wkr_fsys_hack__tst.java | 54 +-- .../servers/http/Http_url_parser_tst.java | 36 +- .../hdocs/Xoh_hdoc_wkr__http_server__tst.java | 52 +-- .../apps/servers/tcp/Xosrv_msg_rdr_tst.java | 38 +- .../apps/servers/tcp/Xosrv_server_tst.java | 34 +- .../xowa/apps/setups/Xoa_setup_mgr_tst.java | 32 +- .../apps/site_cfgs/Xoa_site_cfg_mgr_tst.java | 42 +- .../xowa/apps/urls/Xoa_url__basic__tst.java | 30 +- .../xowa/apps/urls/Xoa_url__to_str__tst.java | 50 +- .../xowa/apps/urls/Xoav_url_parser_tst.java | 34 +- .../apps/urls/Xow_url_parser__proto_tst.java | 42 +- .../apps/urls/Xow_url_parser__qarg__tst.java | 54 +-- .../apps/urls/Xow_url_parser__ttl_tst.java | 50 +- .../urls/Xow_url_parser__url_bar_tst.java | 50 +- .../apps/urls/Xow_url_parser__wiki_tst.java | 40 +- .../apps/urls/Xow_url_parser__xcmd_tst.java | 28 +- .../apps/urls/Xow_url_parser__xwiki_tst.java | 52 +-- .../xowa/apps/utls/Xoa_url_encoder__tst.java | 28 +- .../xowa/apps/versions/Xoa_version_tst.java | 32 +- .../wms/apis/origs/Xoapi_orig_base_tst.java | 36 +- .../src/gplx/xowa/bldrs/Xob_base_fxt.java | 52 ++- .../xowa/bldrs/cmds/texts/Xob_init_base.java | 36 +- .../cmds/texts/tdbs/Xob_init_base_tst.java | 32 +- .../texts/xmls/Xob_siteinfo_parser__tst.java | 34 +- .../css/Xoa_css_extractor_basic_tst.java | 46 +- .../bldrs/css/Xoa_css_extractor_wiki_tst.java | 36 +- .../bldrs/css/Xoa_css_img_downloader_tst.java | 72 +-- .../bldrs/css/Xob_css_parser__import_tst.java | 38 +- .../bldrs/css/Xob_css_parser__url_tst.java | 52 +-- .../xowa/bldrs/css/Xob_css_tkn__base.java | 32 +- .../xowa/bldrs/css/Xob_mirror_mgr_tst.java | 32 +- .../xowa/bldrs/css/Xob_url_fixer_tst.java | 50 +- .../core/Xob_ttl_filter_mgr_srl_tst.java | 42 +- .../filters/core/Xob_ttl_filter_mgr_tst.java | 32 +- .../dansguardians/Dg_match_mgr_tst.java | 32 +- .../filters/dansguardians/Dg_parser_tst.java | 58 +-- .../xowa/bldrs/installs/Xoi_cmd_base.java | 32 +- .../bldrs/installs/Xoi_cmd_dumpfile_tst.java | 40 +- .../bldrs/installs/Xoi_cmd_wiki_download.java | 32 +- .../installs/Xoi_cmd_wiki_goto_page.java | 26 +- .../bldrs/installs/Xoi_cmd_wiki_import.java | 32 +- .../xowa/bldrs/installs/Xoi_cmd_wiki_tst.java | 32 +- .../bldrs/installs/Xoi_mirror_parser_tst.java | 34 +- .../addons/Xoi_firefox_installer_tst.java | 32 +- .../maints/Wmf_dump_list_parser_tst.java | 34 +- .../setups/maints/Wmf_latest_parser_tst.java | 34 +- .../setups/upgrades/Xoa_upgrade_mgr_tst.java | 32 +- .../sql_dumps/Xosql_dump_parser__tst.java | 44 +- .../sql_dumps/Xosql_tbl_parser__tst.java | 38 +- .../wiki_cfgs/Xoi_wiki_props_api_tst.java | 34 +- .../gplx/xowa/bldrs/wkrs/Xob_cmd__base.java | 42 +- .../gplx/xowa/bldrs/wkrs/Xob_cmd_base.java | 22 +- .../gplx/xowa/bldrs/wkrs/Xob_idx_base.java | 32 +- .../gplx/xowa/bldrs/wkrs/Xob_io_utl__tst.java | 40 +- .../xowa/bldrs/wkrs/Xob_itm_basic_base.java | 36 +- .../xowa/bldrs/wkrs/Xob_itm_dump_base.java | 32 +- .../xowa/bldrs/wkrs/Xob_sql_dump_base.java | 32 +- .../Xowmf_wiki_dump_dirs_parser_tst.java | 34 +- .../bldrs/wms/dumps/Xowm_dump_file_tst.java | 36 +- .../bldrs/wms/dumps/Xowm_dump_type__tst.java | 24 +- .../wms/revs/Xowm_rev_wkr__meta__wm_tst.java | 32 +- .../bldrs/wms/sites/Site_json_parser_tst.java | 64 +-- .../xowa/bldrs/xmls/Xob_xml_dumper_tst.java | 32 +- .../xowa/bldrs/xmls/Xob_xml_parser_tst.java | 62 +-- 400_xowa/src/gplx/xowa/drds/Xod_app_tst.java | 34 +- .../src/gplx/xowa/files/Xof_img_size_tst.java | 104 ++--- .../src/gplx/xowa/files/Xof_xfer_itm_tst.java | 48 +- .../gplx/xowa/files/Xofv_file_mgr_tst.java | 44 +- .../bins/Xof_bin_wkr__http_wmf__tst.java | 36 +- .../xowa/files/caches/Xof_cache_mgr_tst.java | 32 +- .../xowa/files/caches/Xou_cache_mgr_tst.java | 40 +- .../xowa/files/caches/Xou_cache_tbl_tst.java | 34 +- .../files/fsdb/fs_roots/Fs_root_wkr_tst.java | 34 +- .../fsdb/tsts/Xof_file_ext__bmp_tst.java | 34 +- .../fsdb/tsts/Xof_file_ext__flac_tst.java | 34 +- .../fsdb/tsts/Xof_file_ext__oga_tst.java | 34 +- .../fsdb/tsts/Xof_file_ext__ogg_tst.java | 34 +- .../fsdb/tsts/Xof_file_ext__ogv_tst.java | 34 +- .../fsdb/tsts/Xof_file_ext__pdf_tst.java | 24 +- .../fsdb/tsts/Xof_file_ext__png_tst.java | 44 +- .../fsdb/tsts/Xof_file_ext__stl_tst.java | 74 +-- .../fsdb/tsts/Xof_file_ext__svg_tst.java | 36 +- .../fsdb/tsts/Xof_file_ext__unknown_tst.java | 34 +- .../fsdb/tsts/Xof_file_ext__wav_tst.java | 34 +- .../fsdb/tsts/Xof_file_ext__webp_tst.java | 74 +-- .../fsdb/tsts/Xof_file_ext__xcf_tst.java | 34 +- .../fsdb/tsts/Xof_file_redirect_tst.java | 40 +- .../xowa/files/origs/Xof_orig_tbl_tst.java | 32 +- .../files/xfers/Xof_xfer_queue_base_fxt.java | 32 +- .../xfers/Xof_xfer_queue_html_basic_tst.java | 52 +-- .../xfers/Xof_xfer_queue_html_cases_tst.java | 74 +-- .../files/xfers/Xof_xfer_queue_html_fxt.java | 32 +- .../Xof_xfer_queue_html_offline_tst.java | 26 +- .../Xof_xfer_queue_html_wmf_api_tst.java | 60 +-- .../src/gplx/xowa/guis/Xogv_tab_base.java | 32 +- .../src/gplx/xowa/guis/bnds/Xog_bnd_mgr.java | 63 ++- .../swts/Gfobj_wtr__json__browser__tst.java | 32 +- .../guis/history/Xog_history_stack_tst.java | 50 +- .../xowa/guis/menus/dom/Xog_mnu_base.java | 32 +- .../guis/urls/Xog_url_wkr__file__tst.java | 36 +- .../gplx/xowa/guis/urls/Xog_url_wkr__tst.java | 34 +- .../url_macros/Xog_url_macro_mgr_tst.java | 54 +-- .../gplx/xowa/guis/views/Xog_html_itm.java | 34 +- .../src/gplx/xowa/guis/views/Xog_tab_itm.java | 2 +- .../url_box_fmts/Xog_urlfmtr_mgr_tst.java | 34 +- .../gplx/xowa/htmls/Xoh_page_wtr_mgr_tst.java | 34 +- .../htmls/bridges/Bridge_msg_bldr_tst.java | 32 +- .../dbuis/fmtrs/Dbui_tbl_fmtr_tst.java | 32 +- .../htmls/core/htmls/Xoh_html_wtr_tst.java | 94 ++-- .../core/htmls/tidy/Xow_tidy_mgr_tst.java | 38 +- .../core/hzips/Gfo_decimal_parser_tst.java | 34 +- .../htmls/core/hzips/Xoh_hzip_int__tst.java | 34 +- .../htmls/core/hzips/Xoh_hzip_int_tst.java | 38 +- .../addons/gallerys/Xoh_gallery_hzip_tst.java | 24 +- .../addons/medias/Xoh_media_hzip_tst.java | 38 +- .../timelines/Xoh_timeline_hzip_tst.java | 18 +- .../wkrs/escapes/Xoh_escape_hzip_tst.java | 28 +- .../wkrs/glys/Xoh_gly_html__dump__tst.java | 36 +- .../wkrs/glys/Xoh_gly_hzip__basic__tst.java | 48 +- .../wkrs/glys/Xoh_gly_hzip__caption__tst.java | 40 +- .../wkrs/glys/Xoh_gly_hzip__style__tst.java | 46 +- .../core/wkrs/glys/Xoh_gly_itm_wtr_tst.java | 32 +- .../wkrs/glys/Xoh_gly_make__basic__tst.java | 32 +- .../core/wkrs/hdrs/Xoh_hdr_html_tst.java | 34 +- .../core/wkrs/hdrs/Xoh_hdr_hzip_tst.java | 48 +- .../core/wkrs/hdrs/Xoh_hdr_make_tst.java | 34 +- .../wkrs/imgs/Xoh_img_bare_hzip__tst.java | 36 +- .../wkrs/imgs/Xoh_img_html__dump__tst.java | 38 +- .../imgs/Xoh_img_hzip__dump__basic__tst.java | 60 +-- .../imgs/Xoh_img_hzip__dump__link__tst.java | 60 +-- .../imgs/Xoh_img_hzip__dump__orig__tst.java | 46 +- .../imgs/Xoh_img_hzip__dump__pgbnr__tst.java | 34 +- .../wkrs/imgs/Xoh_img_hzip__view__tst.java | 34 +- .../wkrs/imgs/Xoh_img_make__dump__tst.java | 42 +- .../core/wkrs/imgs/atrs/Xoh_img_cls__tst.java | 32 +- .../wkrs/imgs/atrs/Xoh_img_src_data_tst.java | 44 +- .../wkrs/lnkes/Xoh_lnke_html__basic__tst.java | 44 +- .../wkrs/lnkes/Xoh_lnke_html__hdump__tst.java | 26 +- .../core/wkrs/lnkes/Xoh_lnke_hzip_tst.java | 50 +- .../wkrs/lnkis/Xoh_lnki_html__basic__tst.java | 20 +- .../wkrs/lnkis/Xoh_lnki_html__hdump__tst.java | 42 +- .../core/wkrs/lnkis/Xoh_lnki_htxt__tst.java | 34 +- .../wkrs/lnkis/Xoh_lnki_hzip__anch__tst.java | 44 +- .../wkrs/lnkis/Xoh_lnki_hzip__diff__tst.java | 38 +- .../wkrs/lnkis/Xoh_lnki_hzip__ns__tst.java | 72 +-- .../wkrs/lnkis/Xoh_lnki_hzip__same__tst.java | 50 +- .../wkrs/lnkis/Xoh_lnki_hzip__site__tst.java | 70 +-- .../wkrs/lnkis/Xoh_lnki_make__basic__tst.java | 40 +- .../lnkis/anchs/Xoh_anch_capt_itm_tst.java | 48 +- .../lnkis/anchs/Xoh_anch_href_data_tst.java | 46 +- .../lnkis/htmls/Xoh_file_fmtr__basic.java | 36 +- .../lnkis/htmls/Xoh_file_wtr__audio__tst.java | 42 +- .../lnkis/htmls/Xoh_file_wtr__djvu__tst.java | 32 +- .../lnkis/htmls/Xoh_file_wtr__hdump__tst.java | 32 +- .../Xoh_file_wtr__image__basic__tst.java | 102 ++-- .../htmls/Xoh_file_wtr__image__link__tst.java | 38 +- .../lnkis/htmls/Xoh_file_wtr__media__tst.java | 40 +- .../lnkis/htmls/Xoh_file_wtr__video__tst.java | 42 +- .../lnkis/htmls/Xoh_lnki_title_bldr_tst.java | 34 +- .../core/wkrs/thms/Xoh_thm_html_tst.java | 36 +- .../wkrs/thms/Xoh_thm_hzip__avo__tst.java | 34 +- .../wkrs/thms/Xoh_thm_hzip__basic__tst.java | 42 +- .../wkrs/thms/Xoh_thm_hzip__pseudo__tst.java | 42 +- .../wkrs/thms/Xoh_thm_hzip__tidy__tst.java | 38 +- .../core/wkrs/tocs/Xoh_toc_hzip_tst.java | 16 +- .../wkrs/tocs/Xoh_toc_make__basic__tst.java | 4 +- .../wkrs/xndes/Xoh_xnde_hzip_nde__tst.java | 24 +- .../wkrs/xndes/dicts/Xoh_xnde_dict__tst.java | 32 +- .../src/gplx/xowa/htmls/doms/Xoh_dom_tst.java | 34 +- .../xowa/htmls/heads/Xoh_head_itm__base.java | 46 +- .../xowa/htmls/heads/Xoh_head_mgr_tst.java | 38 +- .../xowa/htmls/heads/Xoh_head_wtr_tst.java | 34 +- .../htmls/heads/Xow_fragment_mgr_tst.java | 32 +- .../htmls/hrefs/Xoh_href_gui_utl_tst.java | 156 +++---- .../hrefs/Xoh_href_parser__basic__tst.java | 62 +-- .../hrefs/Xoh_href_parser__qargs__tst.java | 36 +- .../hrefs/Xoh_href_parser__wiki__tst.java | 48 +- .../xowa/htmls/hrefs/Xoh_href_wtr_tst.java | 50 +- .../gplx/xowa/htmls/js/Xoh_js_cbk_tst.java | 32 +- .../htmls/js/Xoh_js_cbk_wdata_labels_tst.java | 36 +- .../xowa/htmls/js/Xoh_js_cleaner_tst.java | 40 +- .../Xow_popup_anchor_finder__hdr_tst.java | 42 +- .../Xow_popup_anchor_finder__id_tst.java | 36 +- .../modules/popups/Xow_popup_parser_tst.java | 120 ++--- .../keeplists/Xop_keeplist_wiki_tst.java | 34 +- .../ns_files/Xoh_ns_file_page_mgr_tst.java | 36 +- .../htmls/portal/Xoh_page_body_cls_tst.java | 34 +- .../xowa/htmls/portal/Xoh_rtl_utl_tst.java | 38 +- .../htmls/portal/Xoh_subpages_bldr_tst.java | 44 +- .../xowa/htmls/portal/Xow_portal_mgr_tst.java | 46 +- .../portal/vnts/Vnt_mnu_grp_fmtr_tst.java | 32 +- .../src/gplx/xowa/langs/Xol_lang_itm_tst.java | 32 +- .../xowa/langs/bldrs/Json_itm_wkr__base.java | 34 +- .../xowa/langs/bldrs/Xob_i18n_parser_tst.java | 34 +- .../langs/bldrs/Xobc_utl_make_lang_tst.java | 40 +- .../langs/bldrs/Xol_mw_lang_parser_tst.java | 74 +-- .../xowa/langs/cases/Xol_case_mgr_tst.java | 48 +- .../langs/kwds/Xol_kwd_parse_data_tst.java | 38 +- .../lnki_trails/Xol_lnki_trail_mgr_tst.java | 32 +- .../gplx/xowa/langs/msgs/Xol_msg_itm_tst.java | 40 +- .../gplx/xowa/langs/msgs/Xol_msg_mgr_tst.java | 38 +- .../langs/msgs/Xow_mainpage_finder_tst.java | 44 +- .../src/gplx/xowa/langs/names/Strcpn_tst.java | 38 +- .../xowa/langs/names/Xol_name_mgr_tst.java | 38 +- .../langs/numbers/Xol_num_fmtr_base_tst.java | 48 +- .../langs/numbers/Xol_num_grp_fmtr_tst.java | 38 +- .../gplx/xowa/langs/numbers/Xol_num_mgr.java | 32 +- .../langs/parsers/Xol_csv_parser_tst.java | 40 +- .../xowa/langs/parsers/Xol_lang_srl_tst.java | 50 +- .../xowa/langs/plurals/Xol_plural_ru_tst.java | 32 +- .../xowa/langs/vnts/Xol_vnt_regy_tst.java | 36 +- .../vnts/converts/Xol_convert_regy_tst.java | 38 +- .../langs/vnts/converts/Xol_mw_parse_tst.java | 36 +- .../gplx/xowa/mediawiki/XophpBool__tst.java | 32 +- .../gplx/xowa/mediawiki/XophpMath__tst.java | 30 +- .../gplx/xowa/mediawiki/XophpObject__tst.java | 32 +- .../gplx/xowa/mediawiki/XophpPreg__tst.java | 36 +- .../gplx/xowa/mediawiki/XophpRegex__tst.java | 40 +- .../mediawiki/XophpRegex_match_all_tst.java | 38 +- .../mediawiki/XophpRegex_replace_tst.java | 32 +- .../gplx/xowa/mediawiki/XophpString__tst.java | 64 +-- .../JsonConfig/includes/JCDataContent.java | 32 +- .../JsonConfig/includes/JCSingleton_tst.java | 32 +- ...XomwWikiTextPropertyOrderProvider_tst.java | 36 +- .../XomwHtml_expandAttributes_tst.java | 34 +- .../XomwLinker_NormalizeSubpageLink_tst.java | 14 +- .../includes/XomwLinker_SplitTrail_tst.java | 34 +- .../includes/XomwMagicWordArray_tst.java | 38 +- .../mediawiki/includes/XomwSanitizer_tst.java | 64 +-- .../mediawiki/includes/XomwTitle_tst.java | 4 +- .../includes/content/ContentHandler.java | 2 +- .../includes/content/XomwAbstractContent.java | 4 +- .../includes/filerepo/file/XomwFile.java | 6 +- .../includes/libs/XomwArrayObject.java | 32 +- .../includes/libs/XomwGenericArrayObject.java | 32 +- .../includes/libs/XomwStringUtils_tst.java | 36 +- .../includes/media/XomwImageHandler_tst.java | 2 +- .../includes/media/XomwMediaHandler.java | 32 +- .../parsers/XomwBlockLevelPass_tst.java | 32 +- .../parsers/XomwLinkHolderArray_tst.java | 2 +- .../parsers/XomwParser_internalParse_tst.java | 24 +- .../includes/parsers/XomwParser_tst.java | 2 +- .../parsers/XomwPreprocessor__tst.java | 104 ++--- .../includes/parsers/XomwStripState_tst.java | 34 +- .../parsers/Xomw_regex_parser__tst.java | 36 +- .../Xomw_doubleunder_wkr__tst.java | 42 +- .../headings/Xomw_heading_wkr__tst.java | 32 +- .../parsers/hrs/Xomw_hr_wkr__tst.java | 40 +- .../parsers/lnkes/Xomw_lnke_wkr__tst.java | 50 +- .../lnkis/Xomw_lnki_wkr__file__tst.java | 10 +- .../lnkis/Xomw_lnki_wkr__text__tst.java | 24 +- .../magiclinks/Xomw_magiclinks_wkr__tst.java | 16 +- .../parsers/nbsps/Xomw_nbsp_wkr__tst.java | 40 +- .../preprocessors/XomwPPDStackElement.java | 4 +- .../parsers/preprocessors/XomwPPFrame.java | 40 +- .../preprocessors_new/XomwPPFrame.java | 40 +- .../preprocessors_new/XomwPreprocessor.java | 40 +- .../XomwPreprocessor__tst.java | 104 ++--- .../parsers/quotes/Xomw_quote_wkr__tst.java | 58 +-- .../parsers/tables/Xomw_table_wkr__tst.java | 46 +- .../mediawiki/includes/site/XomwSite.java | 36 +- .../title/XomwMediaWikiTitleCodec_tst.java | 34 +- .../mediawiki/languages/XomwLanguage_tst.java | 40 +- .../src/XomwEvaluator_tst.java | 70 +-- .../src/gplx/xowa/parsers/Xop_ctx__tst.java | 32 +- .../gplx/xowa/parsers/Xop_parser__tst.java | 34 +- .../src/gplx/xowa/parsers/Xop_parser_tst.java | 32 +- .../gplx/xowa/parsers/Xop_tkn_chkr_base.java | 38 +- .../gplx/xowa/parsers/Xop_tkn_itm_base.java | 44 +- .../amps/Xop_amp_mgr__decode__tst.java | 62 +-- .../amps/Xop_amp_mgr__parse_tkn__tst.java | 20 +- .../xowa/parsers/amps/Xop_amp_wkr_tst.java | 40 +- .../xowa/parsers/apos/Xop_apos_wkr_tst.java | 66 +-- .../parsers/hdrs/Xop_hdr_wkr__basic_tst.java | 74 +-- .../parsers/hdrs/Xop_hdr_wkr__para_tst.java | 16 +- .../Xop_section_list__merge__tst.java | 44 +- .../Xop_section_list__slice__tst.java | 46 +- .../xowa/parsers/htmls/Mwh_atr_mgr_tst.java | 34 +- .../parsers/htmls/Mwh_atr_parser_tst.java | 110 ++--- .../parsers/htmls/Mwh_doc_parser_tst.java | 52 +-- .../parsers/lists/HierPosAryBldr_tst.java | 46 +- .../parsers/lists/Xop_list_wkr_basic_tst.java | 80 ++-- .../parsers/lists/Xop_list_wkr_para_tst.java | 38 +- .../lists/Xop_list_wkr_uncommon_tst.java | 68 +-- .../parsers/lnkes/Xop_lnke_wkr_brack_tst.java | 56 +-- .../lnkes/Xop_lnke_wkr_dangling_tst.java | 36 +- .../lnkes/Xop_lnke_wkr_relative_tst.java | 40 +- .../parsers/lnkes/Xop_lnke_wkr_text_tst.java | 56 +-- .../lnkes/Xop_lnke_wkr_uncommon_tst.java | 38 +- .../parsers/lnkes/Xop_lnke_wkr_xwiki_tst.java | 48 +- .../lnkis/Xop_lnki_wkr__basic_tst.java | 138 +++--- .../parsers/lnkis/Xop_lnki_wkr__ctg_tst.java | 50 +- .../lnkis/Xop_lnki_wkr__frame_tst.java | 16 +- .../lnkis/Xop_lnki_wkr__invalid_tst.java | 60 +-- .../lnkis/Xop_lnki_wkr__link__basic__tst.java | 50 +- .../lnkis/Xop_lnki_wkr__link__xwiki__tst.java | 50 +- .../parsers/lnkis/Xop_lnki_wkr__pre_tst.java | 38 +- .../parsers/lnkis/Xop_lnki_wkr__size_tst.java | 52 +-- .../lnkis/Xop_lnki_wkr__subpage_tst.java | 44 +- .../lnkis/Xop_lnki_wkr__uncommon_tst.java | 50 +- .../lnkis/Xop_lnki_wkr__video_tst.java | 28 +- .../lnkis/Xop_lnki_wkr__xwiki_tst.java | 50 +- .../xowa/parsers/miscs/Xop_comm_lxr_tst.java | 50 +- .../parsers/miscs/Xop_hr_lxr_basic_tst.java | 28 +- .../parsers/miscs/Xop_hr_lxr_para_tst.java | 34 +- .../xowa/parsers/miscs/Xop_space_lxr_tst.java | 30 +- .../xowa/parsers/miscs/Xop_under_lxr_tst.java | 68 +-- .../parsers/paras/Xop_nl_tab_lxr_tst.java | 36 +- .../parsers/paras/Xop_para_wkr_basic_tst.java | 136 +++--- .../parsers/paras/Xop_para_wkr_para_tst.java | 38 +- .../parsers/paras/Xop_para_wkr_pre_tst.java | 62 +-- .../parsers/tblws/Xop_tblw_wkr__atrs_tst.java | 52 +-- .../tblws/Xop_tblw_wkr__basic_tst.java | 122 ++--- .../tblws/Xop_tblw_wkr__dangling_tst.java | 32 +- .../tblws/Xop_tblw_wkr__double_pipe_tst.java | 40 +- .../parsers/tblws/Xop_tblw_wkr__errs_tst.java | 46 +- .../tblws/Xop_tblw_wkr__nested_tst.java | 42 +- .../parsers/tblws/Xop_tblw_wkr__para_tst.java | 46 +- .../parsers/tblws/Xop_tblw_wkr__tblx_tst.java | 40 +- .../tblws/Xop_tblw_wkr__uncommon_tst.java | 42 +- .../gplx/xowa/parsers/tmpls/Arg_nde_tkn.java | 32 +- .../xowa/parsers/tmpls/Xop_subst_tst.java | 72 +-- .../xowa/parsers/tmpls/Xop_tkn_print_tst.java | 48 +- .../tmpls/Xot_defn_trace_brief_tst.java | 36 +- .../parsers/tmpls/Xot_defn_trace_dbg_tst.java | 34 +- .../xowa/parsers/tmpls/Xot_examples_tst.java | 56 +-- .../parsers/tmpls/Xot_invk_sandbox_tst.java | 48 +- .../tmpls/Xot_invk_wkr__basic__tst.java | 164 +++---- .../tmpls/Xot_invk_wkr__missing__tst.java | 38 +- .../tmpls/Xot_invk_wkr__prepend_nl__tst.java | 50 +- .../tmpls/Xot_invk_wkr__raw_msg__tst.java | 42 +- .../tmpls/Xot_invk_wkr__transclude__tst.java | 46 +- .../xowa/parsers/tmpls/Xot_prm_tkn_tst.java | 94 ++-- .../uniqs/Xop_uniq_mgr__parse__tst.java | 22 +- .../xowa/parsers/uniqs/Xop_uniq_mgr__tst.java | 42 +- .../gplx/xowa/parsers/utils/TstObj_tst.java | 32 +- .../parsers/utils/Xop_redirect_mgr_tst.java | 60 +-- .../xowa/parsers/utils/Xop_sanitizer_tst.java | 48 +- .../vnts/Vnt_convert_lang__html__tst.java | 70 +-- .../vnts/Vnt_convert_lang__syntax__tst.java | 52 +-- .../parsers/vnts/Vnt_flag_parser_tst.java | 72 +-- .../vnts/Vnt_rule_parser__bidi_tst.java | 20 +- .../vnts/Vnt_rule_parser__undi_tst.java | 14 +- .../xndes/Xop_xatr_whitelist_mgr_tst.java | 6 +- .../xndes/Xop_xnde_wkr__basic_tst.java | 92 ++-- .../xndes/Xop_xnde_wkr__blockquote_tst.java | 36 +- .../xndes/Xop_xnde_wkr__err_dangling_tst.java | 66 +-- .../Xop_xnde_wkr__err_malformed_tst.java | 46 +- .../xndes/Xop_xnde_wkr__err_misc_tst.java | 56 +-- .../Xop_xnde_wkr__include_basic_tst.java | 54 +-- .../Xop_xnde_wkr__include_uncommon_tst.java | 76 +-- .../parsers/xndes/Xop_xnde_wkr__li_tst.java | 44 +- .../xndes/Xop_xnde_wkr__nowiki_tst.java | 58 +-- .../parsers/xndes/Xop_xnde_wkr__tblx_tst.java | 38 +- .../xndes/Xop_xnde_wkr__text_block_tst.java | 48 +- .../parsers/xndes/Xop_xnde_wkr__tidy_tst.java | 42 +- .../xndes/Xop_xnde_wkr__xatrs_tst.java | 48 +- .../xowa/specials/Xow_special_wtr__base.java | 34 +- .../allPages/Xows_page_allpages_tst.java | 40 +- .../xowa/specials/nearby/Nearby_mgr_tst.java | 38 +- .../statistics/Xop_statistics_page_tst.java | 32 +- .../src/gplx/xowa/users/Xou_user_tst.java | 32 +- .../xowa/users/data/Xoud_opt_scope_tst.java | 32 +- .../gplx/xowa/users/data/Xoud_regy_tbl.java | 40 +- .../users/history/Xou_history_mgr_tst.java | 38 +- .../users/wikis/Xofs_url_itm_parser_tst.java | 38 +- .../wikis/data/tbls/Xowd_page_itm_tst.java | 32 +- .../wikis/data/tbls/Xowd_page_tbl_tst.java | 32 +- .../xowa/wikis/domains/Xow_abrv_wm_tst.java | 46 +- .../xowa/wikis/domains/Xow_abrv_xo__tst.java | 32 +- .../wikis/domains/Xow_domain_itm_tst.java | 60 +-- .../wikis/domains/Xow_domain_uid__tst.java | 32 +- .../xowa/wikis/modules/Xow_module_base.java | 26 +- .../gplx/xowa/wikis/nss/Xow_ns_mgr_tst.java | 46 +- .../src/gplx/xowa/wikis/nss/Xow_ns_tst.java | 38 +- .../redirects/Xopg_redirect_mgr__tst.java | 34 +- .../xowa/wikis/tdbs/Xotdb_fsys_mgr_tst.java | 32 +- .../wikis/tdbs/hives/Xob_hive_mgr_tst.java | 24 +- .../wikis/tdbs/hives/Xowd_hive_mgr_tst.java | 40 +- .../wikis/tdbs/hives/Xowd_regy_mgr__tst.java | 34 +- .../wikis/tdbs/hives/Xowd_regy_mgr_tst.java | 56 +-- .../wikis/tdbs/metas/Xof_meta_fil_tst.java | 24 +- .../wikis/tdbs/metas/Xof_meta_mgr_tst.java | 38 +- .../tdbs/metas/Xof_meta_thumb_parser_tst.java | 38 +- .../wikis/tdbs/utils/Xos_url_gen_tst.java | 30 +- .../wikis/tdbs/xdats/Xob_xdat_file_tst.java | 40 +- .../tdbs/xdats/Xob_xdat_file_wtr_tst.java | 32 +- .../xowa/wikis/ttls/Xoa_ttl__err_tst.java | 42 +- .../xowa/wikis/ttls/Xow_ttl__anchor_tst.java | 46 +- .../xowa/wikis/ttls/Xow_ttl__basic_tst.java | 102 ++-- .../wikis/ttls/Xow_ttl__html_entity_tst.java | 28 +- .../xowa/wikis/ttls/Xow_ttl__i18n_tst.java | 42 +- .../xowa/wikis/ttls/Xow_ttl__qarg_tst.java | 28 +- .../gplx/xowa/wikis/ttls/Xow_ttl__ws_tst.java | 24 +- .../xowa/wikis/ttls/Xow_ttl__xwik_tst.java | 46 +- .../xowa/wikis/xwikis/Xow_xwiki_itm_tst.java | 42 +- .../xwikis/bldrs/Xow_xwiki_itm_bldr_tst.java | 36 +- .../parsers/Xow_xwiki_itm_parser_tst.java | 42 +- .../xwikis/parsers/Xow_xwiki_mgr_tst.java | 42 +- .../Xoa_sitelink_mgr_parser_tst.java | 34 +- .../htmls/Xoa_sitelink_div_wtr_tst.java | 38 +- 400_xowa/src/gplx/xowa/xtns/Xox_mgr_base.java | 44 +- .../assessments/Assessment_func__tst.java | 16 +- .../Xtn_categoryList_nde_tst.java | 14 +- .../categorytrees/Categorytree_func_tst.java | 16 +- .../gplx/xowa/xtns/cites/Cite_mgr_tst.java | 38 +- .../xowa/xtns/cites/Ref_itm_mgr_cfg_tst.java | 32 +- .../gplx/xowa/xtns/cites/Ref_itm_mgr_tst.java | 38 +- .../xtns/cites/References_nde_basic_tst.java | 58 +-- .../xtns/cites/References_nde_group_tst.java | 42 +- .../xtns/cites/References_nde_pre_tst.java | 36 +- .../xtns/cites/References_nde_rare_tst.java | 44 +- .../xtns/cldrs/Cldr_name_converter_tst.java | 36 +- .../xowa/xtns/cldrs/Cldr_name_loader_tst.java | 34 +- .../cldrs/Language_names_converter_tst.java | 34 +- .../xtns/dynamicPageList/Dpl_xnde_tst.java | 78 ++-- .../Pages_using_pending_changes_func_tst.java | 16 +- .../Pending_change_level_func_tst.java | 16 +- .../scribunto/Flagged_revs_lib_tst.java | 32 +- .../xowa/xtns/gallery/Gallery_mgr_base.java | 54 +-- .../gallery/Gallery_mgr_base__basic__tst.java | 74 +-- .../gallery/Gallery_mgr_base__xatrs__tst.java | 44 +- .../gallery/Gallery_mgr_packed_base__tst.java | 34 +- .../xowa/xtns/gallery/Gallery_parser_tst.java | 90 ++-- .../xowa/xtns/gallery/Gallery_xnde_tst.java | 56 +-- .../xtns/geoCrumbs/Geoc_isin_func_tst.java | 32 +- .../geodata/Geo_coordinates_func_tst.java | 14 +- .../gplx/xowa/xtns/graphs/Graph_html_tst.java | 40 +- .../xtns/graphs/Graph_json_save_mgr__tst.java | 40 +- .../gplx/xowa/xtns/graphs/Json_fmtr_tst.java | 34 +- .../xowa/xtns/hieros/Hiero_html_mgr_tst.java | 62 +-- .../hieros/Hiero_mw_tables_parser_tst.java | 32 +- .../xowa/xtns/hieros/Hiero_parser_tst.java | 32 +- .../gplx/xowa/xtns/imaps/Imap_base_fxt.java | 32 +- .../gplx/xowa/xtns/imaps/Imap_parser_tst.java | 62 +-- .../imaps/htmls/Imap_html__hview__tst.java | 52 +-- .../xtns/imaps/htmls/Imap_shapes_arg_tst.java | 36 +- .../indicators/Indicator_html_bldr_tst.java | 34 +- .../xtns/indicators/Indicator_xnde_tst.java | 16 +- .../xtns/inputBox/Xtn_inputbox_nde_tst.java | 16 +- .../xowa/xtns/insiders/Insider_func_tst.java | 32 +- .../xtns/insiders/Insider_html_bldr_tst.java | 32 +- .../kartographers/Mapframe_xnde__tst.java | 28 +- .../xtns/kartographers/Maplink_xnde__tst.java | 28 +- .../xtns/listings/Listing_xnde_basic_tst.java | 50 +- .../listings/Listing_xnde_template_tst.java | 56 +-- .../xowa/xtns/lst/Lst_pfunc_lsth_tst.java | 50 +- .../xowa/xtns/lst/Lst_pfunc_lstx_tst.java | 38 +- .../xowa/xtns/lst/Lst_section_nde_tst.java | 28 +- .../xtns/mapSources/Map_dd2dms_func_tst.java | 56 +-- .../xtns/mapSources/Map_deg2dd_func_tst.java | 20 +- .../xtns/mapSources/Map_geolink_func_tst.java | 34 +- .../massMessage/Message_target_func_tst.java | 16 +- .../gplx/xowa/xtns/math/Xomath_core__tst.java | 44 +- .../xowa/xtns/math/Xomath_subst_mgr__tst.java | 20 +- .../xtns/math/texvcs/Texvc_checker_tst.java | 34 +- .../xtns/math/texvcs/Texvc_parser_tst.java | 44 +- .../math/texvcs/tkns/Texvc_tkn__leaf_raw.java | 32 +- .../New_window_link_func_tst.java | 18 +- .../xowa/xtns/pagebanners/Pgbnr_func_tst.java | 208 ++++----- .../gplx/xowa/xtns/pfuncs/Pf_func_base.java | 32 +- .../xowa/xtns/pfuncs/exprs/Func_tkn_base.java | 34 +- .../xtns/pfuncs/exprs/Pfunc_expr_tst.java | 194 ++++---- .../xowa/xtns/pfuncs/ifs/Pfunc_if_tst.java | 58 +-- .../xowa/xtns/pfuncs/ifs/Pfunc_ifeq_tst.java | 68 +-- .../xtns/pfuncs/ifs/Pfunc_iferror_tst.java | 26 +- .../xtns/pfuncs/ifs/Pfunc_ifexist_tst.java | 44 +- .../xtns/pfuncs/ifs/Pfunc_ifexpr_tst.java | 26 +- .../xtns/pfuncs/ifs/Pfunc_switch_tst.java | 80 ++-- .../xtns/pfuncs/langs/Pfunc_gender_tst.java | 28 +- .../xtns/pfuncs/langs/Pfunc_grammar_tst.java | 38 +- .../xtns/pfuncs/langs/Pfunc_i18n_tst.java | 34 +- .../xtns/pfuncs/langs/Pfunc_language_tst.java | 26 +- .../xtns/pfuncs/langs/Pfunc_plural_tst.java | 40 +- .../pfuncs/numbers/Pf_formatnum_de_tst.java | 46 +- .../pfuncs/numbers/Pf_formatnum_en_tst.java | 58 +-- .../pfuncs/numbers/Pf_formatnum_es_tst.java | 32 +- .../pfuncs/numbers/Pf_formatnum_fa_tst.java | 34 +- .../pfuncs/pages/Pfunc_displaytitle_tst.java | 46 +- .../xtns/pfuncs/pages/Pfunc_misc_tst.java | 14 +- .../pfuncs/pages/Pfunc_pagelanguage__tst.java | 16 +- .../pfuncs/pages/Pfunc_rev_props_tst.java | 28 +- .../pfuncs/scribunto/Pfunc_scrib_lib_tst.java | 36 +- .../xtns/pfuncs/strings/Pfunc_case_tst.java | 44 +- .../xtns/pfuncs/strings/Pfunc_pad_tst.java | 52 +-- .../pfuncs/stringutils/Pfunc_count_tst.java | 16 +- .../pfuncs/stringutils/Pfunc_explode_tst.java | 22 +- .../pfuncs/stringutils/Pfunc_len_tst.java | 18 +- .../pfuncs/stringutils/Pfunc_pos_tst.java | 18 +- .../pfuncs/stringutils/Pfunc_replace_tst.java | 20 +- .../pfuncs/stringutils/Pfunc_rpos_tst.java | 18 +- .../pfuncs/stringutils/Pfunc_sub_tst.java | 24 +- .../stringutils/Pfunc_urldecode_tst.java | 12 +- .../xowa/xtns/pfuncs/tags/Pfunc_tag_tst.java | 64 +-- .../pfuncs/times/Pft_func_date_lcl_tst.java | 56 +-- .../pfuncs/times/Pft_func_date_rev_tst.java | 26 +- .../pfuncs/times/Pft_func_date_utc_tst.java | 58 +-- .../pfuncs/times/Pft_func_formatdate_tst.java | 46 +- .../times/Pft_func_time__basic__tst.java | 208 ++++----- .../times/Pft_func_time__hebrew__tst.java | 48 +- .../pfuncs/times/Pft_func_time__int__tst.java | 14 +- .../times/Pft_func_time__other__tst.java | 24 +- .../times/Pft_func_time__uncommon__tst.java | 38 +- .../gplx/xowa/xtns/pfuncs/times/Pxd_itm_.java | 34 +- .../xtns/pfuncs/times/Pxd_parser_tst.java | 114 ++--- .../pfuncs/ttls/Pfunc_anchorencode_tst.java | 60 +-- .../xtns/pfuncs/ttls/Pfunc_filepath_tst.java | 38 +- .../xowa/xtns/pfuncs/ttls/Pfunc_ns_tst.java | 54 +-- .../xtns/pfuncs/ttls/Pfunc_rel2abs_tst.java | 74 +-- .../pfuncs/ttls/Pfunc_titleparts_tst.java | 72 +-- .../xowa/xtns/pfuncs/ttls/Pfunc_ttl_tst.java | 86 ++-- .../xtns/pfuncs/ttls/Pfunc_urlencode_tst.java | 26 +- .../xtns/pfuncs/ttls/Pfunc_urlfunc_tst.java | 54 +-- .../wikis/Pfunc_pagesincategory_tst.java | 54 +-- .../pfuncs/wikis/Pfunc_wiki_props_tst.java | 52 +-- .../pfuncs/wikis/Pfunc_wiki_stats_tst.java | 30 +- .../gplx/xowa/xtns/poems/Poem_nde_tst.java | 64 +-- .../proofreadPage/Pp_pagelist_nde_tst.java | 16 +- .../proofreadPage/Pp_pagequality_nde_tst.java | 16 +- .../proofreadPage/Pp_pages_nde_basic_tst.java | 64 +-- .../proofreadPage/Pp_pages_nde_hdr_tst.java | 44 +- .../proofreadPage/Pp_pages_nde_index_tst.java | 56 +-- .../Pp_pages_nde_recursion_tst.java | 36 +- .../gplx/xowa/xtns/quiz/Quiz_xnde_tst.java | 16 +- .../relatedArticles/Articles_func_tst.java | 32 +- .../relatedSites/Sites_html_bldr_tst.java | 32 +- .../src/gplx/xowa/xtns/rss/Rss_xnde_tst.java | 20 +- .../gplx/xowa/xtns/scores/Score_html_tst.java | 28 +- .../gplx/xowa/xtns/scores/Score_xnde_tst.java | 16 +- .../xowa/xtns/scribunto/Scrib_core_tst.java | 52 +-- .../scribunto/Scrib_err_filter_mgr_tst.java | 32 +- .../xtns/scribunto/Scrib_fsys_mgr_tst.java | 32 +- .../engines/luaj/Luaj_value__tst.java | 32 +- .../engines/process/Process_send_wtr_tst.java | 48 +- .../process/Process_stream_rdr_tst.java | 32 +- .../scribunto/libs/Scrib_lib_hash_tst.java | 136 +++--- .../libs/Scrib_lib_language_tst.java | 50 +- .../scribunto/libs/Scrib_lib_message_tst.java | 42 +- .../libs/Scrib_lib_mw__frame_tst.java | 38 +- .../libs/Scrib_lib_mw__invoke_tst.java | 264 +++++------ .../scribunto/libs/Scrib_lib_mw__lib_tst.java | 74 +-- .../scribunto/libs/Scrib_lib_site_tst.java | 50 +- .../libs/Scrib_lib_text__nowiki_util_tst.java | 32 +- .../libs/Scrib_lib_text_json_tst.java | 58 +-- .../scribunto/libs/Scrib_lib_text_tst.java | 36 +- .../scribunto/libs/Scrib_lib_title_tst.java | 70 +-- .../scribunto/libs/Scrib_lib_uri_tst.java | 40 +- .../libs/Scrib_lib_ustring__find__tst.java | 52 +-- .../libs/Scrib_lib_ustring__gmatch__tst.java | 42 +- .../libs/Scrib_lib_ustring__match__tst.java | 2 +- .../Scrib_lib_ustring__shell_cmd__tst.java | 38 +- .../libs/Scrib_regx_converter_tst.java | 86 ++-- .../xtns/scribunto/libs/Xow_wiki_tst.java | 32 +- .../scribunto/libs/wikibases/Entity__tst.java | 38 +- .../wikibases/GetEntityStatements__tst.java | 36 +- .../wikibases/ResolvePropertyId__tst.java | 32 +- .../scribunto/libs/wikibases/Srl__tst.java | 72 +-- .../scribunto/procs/Scrib_proc_args__tst.java | 38 +- .../syntax_highlights/Int_rng_mgr_tst.java | 36 +- .../syntax_highlights/Synh_xtn_nde_tst.java | 28 +- .../Xtn_templateData_nde_tst.java | 16 +- .../Template_styles_nde_tst.java | 4 +- .../Blacklist_scrib_lib_tst.java | 24 +- .../xtns/translates/Translation_func_tst.java | 14 +- .../translates/Xop_languages_xnde_tst.java | 38 +- .../translates/Xop_mylanguage_page_tst.java | 36 +- .../translates/Xop_translate_xnde_tst.java | 22 +- .../xtns/translates/Xop_tvar_lxr_tst.java | 30 +- .../xowa/xtns/wbases/Wdata_wiki_mgr_tst.java | 232 ++++----- .../xtns/wbases/Wdata_xwiki_link_wtr_tst.java | 44 +- .../wbases/claims/Wbase_claim_grp_tst.java | 36 +- .../claims/itms/times/Wbase_date_tst.java | 42 +- .../xtns/wbases/dbs/Wbase_qid_tbl_tst.java | 32 +- .../xtns/wbases/hwtrs/Wdata_hwtr_mgr_tst.java | 46 +- .../hwtrs/Wdata_visitor__html_wtr_tst.java | 210 ++++----- .../xtns/wbases/imports/Xob_wdata_db_cmd.java | 2 +- .../wbases/imports/Xob_wdata_pid_tst.java | 32 +- .../wbases/imports/Xob_wdata_qid_tst.java | 38 +- .../parsers/Wdata_doc_parser_v1_tst.java | 50 +- .../Wdata_doc_parser_v2__basic__tst.java | 48 +- .../Wdata_doc_parser_v2__claims__tst.java | 26 +- .../Wdata_pf_noExternalLangLinks_tst.java | 36 +- .../pfuncs/Wdata_pf_property__parse__tst.java | 36 +- .../Wdata_pf_statements__basic__tst.java | 34 +- .../pfuncs/Wdata_pf_wbreponame_tst.java | 32 +- .../specials/Wdata_itemByTitle_page_tst.java | 40 +- .../wbases/stores/Wbase_doc_mgr__tst.java | 32 +- .../wikias/Random_selection_xnde_tst.java | 34 +- .../xowa/xtns/wikias/Tabber_xnde_tst.java | 36 +- .../xowa/xtns/wikias/Tabview_xnde_tst.java | 32 +- .../xowa/xtns/xowa_cmds/Xop_xowa_cmd_tst.java | 38 +- .../xtns/xowa_cmds/Xop_xowa_func_tst.java | 28 +- .../xtns/xowa_cmds/Xox_xowa_html_cmd_tst.java | 36 +- .../mediawiki/XophpArrayInstanceTest.java | 370 +++++++-------- .../mediawiki/includes/XomwHooksTest.java | 158 +++---- .../scribunto/cfgs/ScribCfgResolverTest.java | 333 +++++++------ 401_xowa_updater/.classpath | 7 - baselib/src/gplx/objects/GfoKeyVal.java | 10 + baselib/src/gplx/objects/errs/Err_.java | 41 +- baselib/src/gplx/objects/events/GfoEvent.java | 23 + .../gplx/objects/events/GfoEventOwner.java | 5 + .../src/gplx/objects/events/GfoHandler.java | 5 + .../src/gplx/objects/lists/GfoComparator.java | 4 + .../src/gplx/objects/lists/GfoHashBase.java | 49 ++ .../gplx/objects/lists/GfoHashKeyFunc.java | 5 + .../gplx/objects/lists/GfoIndexedList.java | 127 +++++ .../src/gplx/objects/lists/GfoListBase.java | 157 +++++++ .../src/gplx/objects/lists/GfoSetBase.java | 39 ++ .../gplx/objects/lists/ItemsChangedArg.java | 11 + .../gplx/objects/lists/ItemsChangedType.java | 8 + baselib/src/gplx/objects/lists/ListUtil.java | 14 + .../src/gplx/objects/primitives/Int__tst.java | 38 +- .../src/gplx/objects/strings/String__tst.java | 34 +- .../strings/bfrs/GfoStringBuilder.java | 35 ++ .../objects/strings/unicodes/Ustring_tst.java | 42 +- .../lists/GfoIndexedListEntryTest.java | 70 +++ gplx.gflucene/.classpath | 13 - lib/JUnitParams-1.1.0.jar | Bin 0 -> 67132 bytes lib/jcommander-1.81.jar | Bin 0 -> 85816 bytes ...t-platform-console-standalone-1.8.0-M1.jar | Bin 0 -> 4130502 bytes lib/testng-7.5.0-20210517.112015-26.jar | Bin 0 -> 929233 bytes luaj_xowa | 1 + 1059 files changed, 23816 insertions(+), 21909 deletions(-) delete mode 100644 100_core/.classpath rename {400_xowa => 100_core}/src/gplx/core/primitives/Gfo_number_parser.java (95%) create mode 100644 100_core/src/gplx/core/primitives/Int_ary.java create mode 100644 100_core/src/gplx/core/security/algos/gplx_crypto/Crc32.java create mode 100644 100_core/src/gplx/core/security/algos/gplx_crypto/Crc32_tst.java delete mode 100644 100_core/src/gplx/langs/gfs/GfsCoreHelp.java delete mode 100644 110_gfml/.classpath delete mode 100644 140_dbs/.classpath create mode 100644 140_dbs/src/gplx/gfdbs/cores/GfdbCloseAble.java create mode 100644 140_dbs/src/gplx/gfdbs/cores/GfdbConnInfo.java create mode 100644 140_dbs/src/gplx/gfdbs/cores/GfdbConnInfoSqlite.java create mode 100644 140_dbs/src/gplx/gfdbs/cores/GfdbItm.java create mode 100644 140_dbs/src/gplx/gfdbs/cores/GfdbItmFactory.java create mode 100644 140_dbs/src/gplx/gfdbs/cores/GfdbMeta.java create mode 100644 140_dbs/src/gplx/gfdbs/cores/GfdbMetaBase.java create mode 100644 140_dbs/src/gplx/gfdbs/cores/GfdbState.java create mode 100644 140_dbs/src/gplx/gfdbs/cores/GfdbTbl.java create mode 100644 140_dbs/src/gplx/gfdbs/cores/cfgs/GfdbCfgItm.java create mode 100644 140_dbs/src/gplx/gfdbs/cores/cfgs/GfdbCfgMeta.java create mode 100644 140_dbs/src/gplx/gfdbs/cores/cfgs/GfdbCfgSelectWildcardWkr.java create mode 100644 140_dbs/src/gplx/gfdbs/cores/cfgs/GfdbCfgTbl.java create mode 100644 140_dbs/src/gplx/gfdbs/cores/cfgs/GfdbIdMgr.java create mode 100644 140_dbs/src/gplx/gfdbs/cores/cmds/GfdbModifyCmd.java create mode 100644 140_dbs/src/gplx/gfdbs/cores/cmds/GfdbSelectCmd.java create mode 100644 140_dbs/src/gplx/gfdbs/cores/cmds/GfdbSelectList.java create mode 100644 140_dbs/src/gplx/gfdbs/cores/cmds/GfoDbModifyCmdHash.java create mode 100644 140_dbs/src/gplx/gfdbs/cores/cmds/GfoDbSelectWkr.java create mode 100644 140_dbs/src/gplx/gfdbs/cores/cmds/GfoDbSelectWkrAll.java create mode 100644 140_dbs/src/gplx/gfdbs/cores/cmds/GfoDbSelectWkrOne.java create mode 100644 140_dbs/src/gplx/gfdbs/cores/txns/GfdbTxnMgr.java create mode 100644 140_dbs/src/gplx/gfdbs/cores/txns/GfdbTxnSub.java create mode 100644 140_dbs/src/gplx/gfdbs/cores/wkrs/GfdbListWkr.java create mode 100644 140_dbs/src/gplx/gfdbs/cores/wkrs/GfdbListWkrUtl.java create mode 100644 140_dbs/tst/gplx/dbs/qrys/Db_val_typeTest.java delete mode 100644 150_gfui/.classpath delete mode 100644 400_xowa/.classpath delete mode 100644 401_xowa_updater/.classpath create mode 100644 baselib/src/gplx/objects/GfoKeyVal.java create mode 100644 baselib/src/gplx/objects/events/GfoEvent.java create mode 100644 baselib/src/gplx/objects/events/GfoEventOwner.java create mode 100644 baselib/src/gplx/objects/events/GfoHandler.java create mode 100644 baselib/src/gplx/objects/lists/GfoComparator.java create mode 100644 baselib/src/gplx/objects/lists/GfoHashBase.java create mode 100644 baselib/src/gplx/objects/lists/GfoHashKeyFunc.java create mode 100644 baselib/src/gplx/objects/lists/GfoIndexedList.java create mode 100644 baselib/src/gplx/objects/lists/GfoListBase.java create mode 100644 baselib/src/gplx/objects/lists/GfoSetBase.java create mode 100644 baselib/src/gplx/objects/lists/ItemsChangedArg.java create mode 100644 baselib/src/gplx/objects/lists/ItemsChangedType.java create mode 100644 baselib/src/gplx/objects/lists/ListUtil.java create mode 100644 baselib/src/gplx/objects/strings/bfrs/GfoStringBuilder.java create mode 100644 baselib/tst/gplx/objects/lists/GfoIndexedListEntryTest.java delete mode 100644 gplx.gflucene/.classpath create mode 100644 lib/JUnitParams-1.1.0.jar create mode 100644 lib/jcommander-1.81.jar create mode 100644 lib/junit-platform-console-standalone-1.8.0-M1.jar create mode 100644 lib/testng-7.5.0-20210517.112015-26.jar create mode 160000 luaj_xowa diff --git a/100_core/.classpath b/100_core/.classpath deleted file mode 100644 index 51b709cbc..000000000 --- a/100_core/.classpath +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - diff --git a/100_core/src/gplx/Array__tst.java b/100_core/src/gplx/Array__tst.java index f00e89500..270090cec 100644 --- a/100_core/src/gplx/Array__tst.java +++ b/100_core/src/gplx/Array__tst.java @@ -1,34 +1,34 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx; import org.junit.*; public class Array__tst { - @Test public void Resize_add() { + @Test public void Resize_add() { tst_Resize_add(ary_(), ary_(1), ary_(1)); // 0 + 1 = 1 tst_Resize_add(ary_(0), ary_(), ary_(0)); // 1 + 0 = 1 tst_Resize_add(ary_(0), ary_(1), ary_(0, 1)); // 1 + 1 = 2 } void tst_Resize_add(int[] source, int[] added, int[] expd) {Tfds.Eq_ary(expd, (int[])Array_.Resize_add(source, added));} - @Test public void Resize() { + @Test public void Resize() { tst_Resize(ary_(0), 0, ary_()); // 1 -> 0 tst_Resize(ary_(0, 1), 1, ary_(0)); // 2 -> 1 } void tst_Resize(int[] source, int length, int[] expd) {Tfds.Eq_ary(expd, (int[])Array_.Resize(source, length));} - @Test public void Insert() { + @Test public void Insert() { tst_Insert(ary_obj(0, 1, 4, 5), ary_obj(2, 3), 2, ary_obj(0, 1, 2, 3, 4, 5)); } void tst_Insert(Object[] cur, Object[] add, int addPos, Object[] expd) {Tfds.Eq_ary(expd, Array_.Insert(cur, add, addPos));} - @Test public void ReplaceInsert() { + @Test public void ReplaceInsert() { tst_ReplaceInsert(ary_obj(0, 1, 4, 5) , ary_obj(1, 2, 3), 1, 1, ary_obj(0, 1, 2, 3, 4, 5)); tst_ReplaceInsert(ary_obj(0, 1, 2, 4, 5) , ary_obj(1, 2, 3), 1, 2, ary_obj(0, 1, 2, 3, 4, 5)); tst_ReplaceInsert(ary_obj(0, 1, 2, 3, 4, 5) , ary_obj(1, 2, 3), 1, 3, ary_obj(0, 1, 2, 3, 4, 5)); diff --git a/100_core/src/gplx/Bool__tst.java b/100_core/src/gplx/Bool__tst.java index f95218094..29d4b51b4 100644 --- a/100_core/src/gplx/Bool__tst.java +++ b/100_core/src/gplx/Bool__tst.java @@ -13,17 +13,17 @@ The terms of each license can be found in the source code repository: GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt */ -package gplx; -import org.junit.*; -public class Bool__tst { - private final Bool__fxt fxt = new Bool__fxt(); - @Test public void Compare() { - fxt.Test__compare(Bool_.Y, Bool_.Y, CompareAble_.Same); - fxt.Test__compare(Bool_.N, Bool_.N, CompareAble_.Same); - fxt.Test__compare(Bool_.N, Bool_.Y, CompareAble_.Less); - fxt.Test__compare(Bool_.Y, Bool_.N, CompareAble_.More); - } -} -class Bool__fxt { - public void Test__compare(boolean lhs, boolean rhs, int expd) {Tfds.Eq(expd, Bool_.Compare(lhs, rhs));} -} +package gplx; +import org.junit.*; +public class Bool__tst { + private final Bool__fxt fxt = new Bool__fxt(); + @Test public void Compare() { + fxt.Test__compare(Bool_.Y, Bool_.Y, CompareAble_.Same); + fxt.Test__compare(Bool_.N, Bool_.N, CompareAble_.Same); + fxt.Test__compare(Bool_.N, Bool_.Y, CompareAble_.Less); + fxt.Test__compare(Bool_.Y, Bool_.N, CompareAble_.More); + } +} +class Bool__fxt { + public void Test__compare(boolean lhs, boolean rhs, int expd) {Tfds.Eq(expd, Bool_.Compare(lhs, rhs));} +} diff --git a/100_core/src/gplx/Bry_bfr_tst.java b/100_core/src/gplx/Bry_bfr_tst.java index 4c80110da..fe8c41d02 100644 --- a/100_core/src/gplx/Bry_bfr_tst.java +++ b/100_core/src/gplx/Bry_bfr_tst.java @@ -1,34 +1,34 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx; import org.junit.*; import gplx.core.tests.*; -public class Bry_bfr_tst { +public class Bry_bfr_tst { private Bry_bfr bb = Bry_bfr_.New(); @Before public void setup() {bb.Clear();} private ByteAryBfr_fxt fxt = new ByteAryBfr_fxt(); - @Test public void AddByte() { + @Test public void AddByte() { bb = Bry_bfr_.New_w_size(2); // NOTE: make sure auto-expands tst_AddByte("a", "a", 2); tst_AddByte("b", "ab", 2); tst_AddByte("c", "abc", 4); } - @Test public void AddAry() { // NOTE: make sure auto-expands + @Test public void AddAry() { // NOTE: make sure auto-expands bb = Bry_bfr_.New_w_size(2); tst_AddByte("abcd", "abcd", 12); } - @Test public void Add_byte_repeat() { // NOTE: make sure auto-expands + @Test public void Add_byte_repeat() { // NOTE: make sure auto-expands bb = Bry_bfr_.New_w_size(2); tst_Add_byte_repeat(Byte_ascii.Space, 12, String_.Repeat(" ", 12)); } void tst_Add_byte_repeat(byte b, int len, String expd) {Tfds.Eq(expd, bb.Add_byte_repeat(b, len).To_str_and_clear());} @@ -40,14 +40,14 @@ public class Bry_bfr_tst { Tfds.Eq(expdStr, String_.new_u8(bb.To_bry())); Tfds.Eq(expdLen, bb.Bfr_max()); } - @Test public void Add_dte() { + @Test public void Add_dte() { tst_AddDte("20110801 221435.987"); } void tst_AddDte(String raw) { bb.Add_dte(DateAdp_.parse_fmt(raw, Bry_.Fmt_csvDte)); Tfds.Eq(raw, String_.new_u8(bb.To_bry())); } - @Test public void Add_int_variable() { + @Test public void Add_int_variable() { Add_int_variable(-1); Add_int_variable(-12); Add_int_variable(-1234); @@ -56,7 +56,7 @@ public class Bry_bfr_tst { Add_int_variable(1234); Add_int_variable(123456789); } - @Test public void Add_float() { + @Test public void Add_float() { tst_Add_float(1 / 3); tst_Add_float(-1 / 3); } @@ -69,26 +69,26 @@ public class Bry_bfr_tst { bb.Add_int_variable(val); Tfds.Eq(val, Int_.Parse(String_.new_u8(bb.To_bry()))); } - @Test public void Add_int_fixed_len3() {tst_Add_int_fixed(123, 3, "123");} - @Test public void Add_int_fixed_pad_1() {tst_Add_int_fixed(2, 1, "2");} - @Test public void Add_int_fixed_pad_2() {tst_Add_int_fixed(2, 2, "02");} - @Test public void Add_int_fixed_pad_16() {tst_Add_int_fixed(2, 16, "0000000000000002");} // test overflows int - @Test public void Add_int_fixed_neg() {tst_Add_int_fixed(-2, 2, "-2");} - @Test public void Add_int_fixed_neg_pad1() {tst_Add_int_fixed(-2, 1, "-");} - @Test public void Add_int_fixed_chop_1() {tst_Add_int_fixed(123, 1, "3");} - @Test public void Add_int_fixed_chop_neg() {tst_Add_int_fixed(-21, 2, "-1");} + @Test public void Add_int_fixed_len3() {tst_Add_int_fixed(123, 3, "123");} + @Test public void Add_int_fixed_pad_1() {tst_Add_int_fixed(2, 1, "2");} + @Test public void Add_int_fixed_pad_2() {tst_Add_int_fixed(2, 2, "02");} + @Test public void Add_int_fixed_pad_16() {tst_Add_int_fixed(2, 16, "0000000000000002");} // test overflows int + @Test public void Add_int_fixed_neg() {tst_Add_int_fixed(-2, 2, "-2");} + @Test public void Add_int_fixed_neg_pad1() {tst_Add_int_fixed(-2, 1, "-");} + @Test public void Add_int_fixed_chop_1() {tst_Add_int_fixed(123, 1, "3");} + @Test public void Add_int_fixed_chop_neg() {tst_Add_int_fixed(-21, 2, "-1");} void tst_Add_int_fixed(int val, int digits, String expd) {Tfds.Eq(expd, String_.new_u8(bb.Add_int_fixed(val, digits).To_bry()));} - @Test public void Add_long_fixed_len3() {tst_Add_long_fixed(123, 3, "123");} - @Test public void Add_long_fixed_pad_1() {tst_Add_long_fixed(2, 1, "2");} - @Test public void Add_long_fixed_pad_2() {tst_Add_long_fixed(2, 2, "02");} - @Test public void Add_long_fixed_pad_16() {tst_Add_long_fixed(2, 16, "0000000000000002");} // test overflows long - @Test public void Add_long_fixed_neg() {tst_Add_long_fixed(-2, 2, "-2");} - @Test public void Add_long_fixed_neg_pad1() {tst_Add_long_fixed(-2, 1, "-");} - @Test public void Add_long_fixed_chop_1() {tst_Add_long_fixed(123, 1, "3");} - @Test public void Add_long_fixed_chop_neg() {tst_Add_long_fixed(-21, 2, "-1");} - @Test public void Add_long_fixed_large() {tst_Add_long_fixed(123456789012345L, 15, "123456789012345");} + @Test public void Add_long_fixed_len3() {tst_Add_long_fixed(123, 3, "123");} + @Test public void Add_long_fixed_pad_1() {tst_Add_long_fixed(2, 1, "2");} + @Test public void Add_long_fixed_pad_2() {tst_Add_long_fixed(2, 2, "02");} + @Test public void Add_long_fixed_pad_16() {tst_Add_long_fixed(2, 16, "0000000000000002");} // test overflows long + @Test public void Add_long_fixed_neg() {tst_Add_long_fixed(-2, 2, "-2");} + @Test public void Add_long_fixed_neg_pad1() {tst_Add_long_fixed(-2, 1, "-");} + @Test public void Add_long_fixed_chop_1() {tst_Add_long_fixed(123, 1, "3");} + @Test public void Add_long_fixed_chop_neg() {tst_Add_long_fixed(-21, 2, "-1");} + @Test public void Add_long_fixed_large() {tst_Add_long_fixed(123456789012345L, 15, "123456789012345");} void tst_Add_long_fixed(long val, int digits, String expd) {Tfds.Eq(expd, String_.new_u8(bb.Add_long_fixed(val, digits).To_bry()));} - @Test public void AddDte_short() { + @Test public void AddDte_short() { tst_AddDte_short("2010-08-26T22:38:36Z"); } void tst_AddDte_short(String raw) { @@ -111,7 +111,7 @@ public class Bry_bfr_tst { //// Base85_.Set_bry(l, bb. // bb.Add_int(l); } -// @Test public void InsertAt_str() { +// @Test public void InsertAt_str() { // tst_InsertAt_str("", 0, "c", "c"); // tst_InsertAt_str("ab", 0, "c", "cab"); // tst_InsertAt_str("ab", 0, "cdefghij", "cdefghijab"); @@ -123,7 +123,7 @@ public class Bry_bfr_tst { // String actl = bb.To_str_and_clear(); // Tfds.Eq(expd, actl); // } - @Test public void To_bry_and_clear_and_trim() { + @Test public void To_bry_and_clear_and_trim() { tst_XtoAryAndClearAndTrim("a" , "a"); tst_XtoAryAndClearAndTrim(" a " , "a"); tst_XtoAryAndClearAndTrim(" a b " , "a b"); @@ -133,7 +133,7 @@ public class Bry_bfr_tst { bb.Add_str_u8(raw); Tfds.Eq(expd, String_.new_u8(bb.To_bry_and_clear_and_trim())); } - @Test public void XtoInt() { + @Test public void XtoInt() { tst_XtoInt("123", 123); tst_XtoInt("a", Int_.Min_value); tst_XtoInt("9999999999", Int_.Min_value); @@ -160,14 +160,14 @@ public class Bry_bfr_tst { int second = (int)((v ) & 0x3f); return DateAdp_.new_(year, month, day, hour, minute, second, 0); } - @Test public void Add_bfr_trimEnd_and_clear() { + @Test public void Add_bfr_trimEnd_and_clear() { tst_Add_bfr_trimEnd_and_clear("a ", "a"); } void tst_Add_bfr_trimEnd_and_clear(String raw, String expd) { Bry_bfr tmp = Bry_bfr_.New().Add_str_u8(raw); Tfds.Eq(expd, bb.Add_bfr_trim_and_clear(tmp, false, true).To_str_and_clear()); } - @Test public void Add_bfr_trimAll_and_clear() { + @Test public void Add_bfr_trimAll_and_clear() { tst_Add_bfr_trimAll_and_clear(" a ", "a"); tst_Add_bfr_trimAll_and_clear(" a b ", "a b"); tst_Add_bfr_trimAll_and_clear("a", "a"); @@ -177,49 +177,49 @@ public class Bry_bfr_tst { Bry_bfr tmp = Bry_bfr_.New().Add_str_u8(raw); Tfds.Eq(expd, bb.Add_bfr_trim_and_clear(tmp, true, true).To_str_and_clear()); } - @Test public void Add_int_pad_bgn() { + @Test public void Add_int_pad_bgn() { fxt.Test_Add_int_pad_bgn(Byte_ascii.Num_0, 3, 0, "000"); fxt.Test_Add_int_pad_bgn(Byte_ascii.Num_0, 3, 1, "001"); fxt.Test_Add_int_pad_bgn(Byte_ascii.Num_0, 3, 10, "010"); fxt.Test_Add_int_pad_bgn(Byte_ascii.Num_0, 3, 100, "100"); fxt.Test_Add_int_pad_bgn(Byte_ascii.Num_0, 3, 1000, "1000"); } - @Test public void Add_bry_escape() { + @Test public void Add_bry_escape() { fxt.Test__add_bry_escape("abc" , "abc"); // nothing to escape fxt.Test__add_bry_escape("a'bc" , "a''bc"); // single escape (code handles first quote differently) fxt.Test__add_bry_escape("a'b'c" , "a''b''c"); // double escape (code handles subsequent quotes different than first) fxt.Test__add_bry_escape("abc", 1, 2 , "b"); // nothing to escape } - @Test public void Add_bry_escape_html() { + @Test public void Add_bry_escape_html() { fxt.Test__add_bry_escape_html("abc" , "abc"); // escape=none fxt.Test__add_bry_escape_html("a&\"'<>b" , "a&"'<>b"); // escape=all; code handles first escape differently fxt.Test__add_bry_escape_html("a&b&c" , "a&b&c"); // staggered; code handles subsequent escapes differently fxt.Test__add_bry_escape_html("abc", 1, 2 , "b"); // by index; fixes bug in initial implementation } - @Test public void Insert_at() { + @Test public void Insert_at() { fxt.Test_Insert_at("abcd", 0, "xyz" , "xyzabcd"); // bgn fxt.Test_Insert_at("abcd", 4, "xyz" , "abcdxyz"); // end fxt.Test_Insert_at("abcd", 2, "xyz" , "abxyzcd"); // mid fxt.Test_Insert_at("abcd", 2, "xyz", 1, 2 , "abycd"); // mid } - @Test public void Delete_rng() { + @Test public void Delete_rng() { fxt.Test_Delete_rng("abcd", 0, 2 , "cd"); // bgn fxt.Test_Delete_rng("abcd", 2, 4 , "ab"); // end fxt.Test_Delete_rng("abcd", 1, 3 , "ad"); // mid } - @Test public void Delete_rng_to_bgn() { + @Test public void Delete_rng_to_bgn() { fxt.Test_Delete_rng_to_bgn("abcd", 2 , "cd"); } - @Test public void Delete_rng_to_end() { + @Test public void Delete_rng_to_end() { fxt.Test_Delete_rng_to_end("abcd", 2 , "ab"); } - @Test public void To_bry_ary_and_clear() { + @Test public void To_bry_ary_and_clear() { fxt.Test__to_bry_ary_and_clear("" ); // empty fxt.Test__to_bry_ary_and_clear("a" , "a"); // lines=1 fxt.Test__to_bry_ary_and_clear("a\nb\nc" , "a", "b", "c"); // lines=n fxt.Test__to_bry_ary_and_clear("a\n" , "a"); // nl at end } - @Test public void To_bry_ary_and_clear_and_trim__memory_reference_bug() {// PURPOSE:test that bry isn't reused; ISSUE#:562; DATE:2019-09-02 + @Test public void To_bry_ary_and_clear_and_trim__memory_reference_bug() {// PURPOSE:test that bry isn't reused; ISSUE#:562; DATE:2019-09-02 String str_a = "aaaaaaaaaaaaaaaa" // NOTE: length is 16 b/c bry_bfr init's to 16 len , str_b = "bbbbbbbbbbbbbbbb"; Bry_bfr bfr = Bry_bfr_.New(); diff --git a/100_core/src/gplx/Bry_find_.java b/100_core/src/gplx/Bry_find_.java index 896bea26e..42e9fee99 100644 --- a/100_core/src/gplx/Bry_find_.java +++ b/100_core/src/gplx/Bry_find_.java @@ -1,18 +1,18 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx; public class Bry_find_ { public static final int Not_found = -1; @@ -230,6 +230,12 @@ public class Bry_find_ { --cur; } } + public static int Find_bwd_while_in(byte[] src, int cur, int end, boolean[] while_ary) { + while (true) { + if (cur <= end || !while_ary[src[cur]]) return cur; + cur--; + } + } public static int Find_bwd_while_v2(byte[] src, int cur, int end, byte while_byte) { --cur; while (true) { diff --git a/100_core/src/gplx/Bry_find__tst.java b/100_core/src/gplx/Bry_find__tst.java index 38fa5893b..ea793748d 100644 --- a/100_core/src/gplx/Bry_find__tst.java +++ b/100_core/src/gplx/Bry_find__tst.java @@ -1,23 +1,23 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx; import org.junit.*; import gplx.core.tests.*; public class Bry_find__tst { private Bry_find__fxt fxt = new Bry_find__fxt(); - @Test public void Find_fwd() { + @Test public void Find_fwd() { fxt.Test_Find_fwd("abcba", "b", 0, 1); fxt.Test_Find_fwd("abcba", "z", 0, -1); fxt.Test_Find_fwd("abcba", "b", 1, 1); @@ -26,7 +26,7 @@ public class Bry_find__tst { fxt.Test_Find_fwd("abcba", "zb", 4, -1); fxt.Test_Find_fwd("abcba", "a", 6, -1); } - @Test public void Find_bwd() { + @Test public void Find_bwd() { fxt.Test_Find_bwd("abcba", "b", 4, 3); fxt.Test_Find_bwd("abcba", "z", 4, -1); fxt.Test_Find_bwd("abcba", "b", 3, 1); @@ -36,12 +36,12 @@ public class Bry_find__tst { fxt.Test_Find_fwd("abcba", "a", -1, -1); fxt.Test_Find_bwd("abcba", "ab", 4, 0); } - @Test public void Find_bwd_last_ws() { + @Test public void Find_bwd_last_ws() { fxt.Test_Find_bwd_1st_ws_tst("a b" , 2, 1); // basic fxt.Test_Find_bwd_1st_ws_tst("a b" , 3, 1); // multiple fxt.Test_Find_bwd_1st_ws_tst("ab" , 1, Bry_find_.Not_found); // none } - @Test public void Trim_fwd_space_tab() { + @Test public void Trim_fwd_space_tab() { fxt.Test_Trim_fwd_space_tab(" a b" , 1); fxt.Test_Trim_fwd_space_tab("\ta b" , 1); fxt.Test_Trim_fwd_space_tab(" \ta b" , 2); @@ -49,7 +49,7 @@ public class Bry_find__tst { fxt.Test_Trim_fwd_space_tab("" , 0); fxt.Test_Trim_fwd_space_tab(" \t" , 2); } - @Test public void Trim_bwd_space_tab() { + @Test public void Trim_bwd_space_tab() { fxt.Test_Trim_bwd_space_tab("a b " , 3); fxt.Test_Trim_bwd_space_tab("a b\t" , 3); fxt.Test_Trim_bwd_space_tab("a b\t " , 3); @@ -57,7 +57,7 @@ public class Bry_find__tst { fxt.Test_Trim_bwd_space_tab("" , 0); fxt.Test_Trim_bwd_space_tab(" \t" , 0); } - @Test public void Find_fwd_while_in() { + @Test public void Find_fwd_while_in() { boolean[] while_ary = fxt.Init__find_fwd_while_in(Byte_ascii.Space, Byte_ascii.Tab, Byte_ascii.Nl); fxt.Test__find_fwd_while_in(" \t\na", while_ary, 3); } diff --git a/100_core/src/gplx/Bry_split__tst.java b/100_core/src/gplx/Bry_split__tst.java index 70cd286f2..214532dec 100644 --- a/100_core/src/gplx/Bry_split__tst.java +++ b/100_core/src/gplx/Bry_split__tst.java @@ -1,23 +1,23 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx; import org.junit.*; import gplx.core.tests.*; public class Bry_split__tst { private final Bry_split__fxt fxt = new Bry_split__fxt(); - @Test public void Split() { + @Test public void Split() { fxt.Test_split("a" , Byte_ascii.Pipe, Bool_.N, "a"); // no trim fxt.Test_split("a|" , Byte_ascii.Pipe, Bool_.N, "a"); fxt.Test_split("|a" , Byte_ascii.Pipe, Bool_.N, "", "a"); @@ -37,19 +37,19 @@ public class Bry_split__tst { fxt.Test_split("extend|a" , Byte_ascii.Pipe, Bool_.Y, "extend|a"); // extend fxt.Test_split("a|cancel|b" , Byte_ascii.Pipe, Bool_.Y, "a"); // cancel } - @Test public void Split__bry() { + @Test public void Split__bry() { fxt.Test_split("a|b|c|d" , 2, 6, "|", "b", "c"); fxt.Test_split("a|b|c|d" , 2, 4, "|", "b"); } - @Test public void Empty() { + @Test public void Empty() { fxt.Test_split("a\n\nb" , Byte_ascii.Nl, Bool_.N, "a", "", "b"); } - @Test public void Split_w_max() { + @Test public void Split_w_max() { fxt.Test__split_w_max("a|b|c|d" , Byte_ascii.Pipe, 2, "a", "b"); // max is less fxt.Test__split_w_max("a" , Byte_ascii.Pipe, 2, "a", null); // max is more fxt.Test__split_w_max("|" , Byte_ascii.Pipe, 2, "", ""); // empty itms } - @Test public void Split_ws() { + @Test public void Split_ws() { fxt.Test__split_ws("a b", "a", "b"); fxt.Test__split_ws(" a ", "a"); fxt.Test__split_ws(" abc def ", "abc", "def"); diff --git a/100_core/src/gplx/Byte__tst.java b/100_core/src/gplx/Byte__tst.java index e6d1194ae..0183671f6 100644 --- a/100_core/src/gplx/Byte__tst.java +++ b/100_core/src/gplx/Byte__tst.java @@ -1,29 +1,29 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx; import org.junit.*; public class Byte__tst { - @Test public void int_() { + @Test public void int_() { tst_int_( 0, 0); tst_int_( 127, 127); tst_int_( 128, 128); // NOTE: JAVA defines byte as -128 -> 127 tst_int_( 255, 255); tst_int_( 256, 0); // NOTE: 256 will cast to 1; (byte)256 works same in both JAVA/.NET } void tst_int_(int v, int expd) {Tfds.Eq((byte)expd, Byte_.By_int(v));} // WORKAROUND/JAVA: expd is of type int b/c java promotes numbers to ints - @Test public void To_int() { + @Test public void To_int() { tst_XtoInt( 0, 0); tst_XtoInt( 127, 127); tst_XtoInt( 128, 128); diff --git a/100_core/src/gplx/DateAdp_.java b/100_core/src/gplx/DateAdp_.java index cad7aa65f..121422ea5 100644 --- a/100_core/src/gplx/DateAdp_.java +++ b/100_core/src/gplx/DateAdp_.java @@ -1,19 +1,20 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx; +import gplx.core.times.DateAdp_parser; import java.sql.Timestamp; import java.text.ParseException; import java.text.SimpleDateFormat; @@ -22,7 +23,6 @@ import java.util.Date; import java.util.GregorianCalendar; import java.util.Locale; import java.util.TimeZone; -import gplx.core.times.*; public class DateAdp_ implements Gfo_invk { public static final String Cls_ref_name = "Date"; public static final Class Cls_ref_type = DateAdp.class; @@ -84,8 +84,11 @@ public class DateAdp_ implements Gfo_invk { try {return parse_fmt(raw, fmt);} catch (Exception e) {Err_.Noop(e); return or;} } - public static DateAdp db_(Object v) { - Timestamp ts = (Timestamp)v; + public static DateAdp db_(Object v) { + if (v instanceof String) { + return DateAdp_.parse_iso8561((String)v); + } + Timestamp ts = (Timestamp)v; Calendar gc = Calendar.getInstance(); gc.setTimeInMillis(ts.getTime()); return new DateAdp(gc); diff --git a/100_core/src/gplx/DateAdp__tst.java b/100_core/src/gplx/DateAdp__tst.java index 0bc081a95..687046a57 100644 --- a/100_core/src/gplx/DateAdp__tst.java +++ b/100_core/src/gplx/DateAdp__tst.java @@ -1,40 +1,40 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx; import org.junit.*; import gplx.core.tests.*; public class DateAdp__tst { private final DateAdp__fxt fxt = new DateAdp__fxt(); - @Test public void Parse_gplx() { + @Test public void Parse_gplx() { fxt.Test__parse_gplx("99991231_235959.999" , "99991231_235959.999"); fxt.Test__parse_gplx("20090430_213200.123" , "20090430_213200.123"); fxt.Test__parse_gplx("20090430_213200" , "20090430_213200.000"); fxt.Test__parse_gplx("20090430" , "20090430_000000.000"); } - @Test public void Parse_separators() { + @Test public void Parse_separators() { fxt.Test__parse_gplx("2009-04-30 21:32:00.123" , "20090430_213200.123"); fxt.Test__parse_gplx("2009-04-30 21:32:00" , "20090430_213200.000"); fxt.Test__parse_gplx("2009-04-30" , "20090430_000000.000"); } - @Test public void Parse_utc() { + @Test public void Parse_utc() { fxt.Test__parse_gplx("2015-12-26T10:03:53Z" , "20151226_100353.000"); } - @Test public void DayOfWeek() { + @Test public void DayOfWeek() { fxt.Test__day_of_week("2012-01-18", 3); //3=Wed } - @Test public void WeekOfYear() { + @Test public void WeekOfYear() { fxt.Test__week_of_year("2006-02-01", 5); // 1-1:Sun;2-1:Wed fxt.Test__week_of_year("2007-02-01", 5); // 1-1:Mon;2-1:Thu fxt.Test__week_of_year("2008-02-01", 5); // 1-1:Tue;2-1:Fri @@ -42,25 +42,25 @@ public class DateAdp__tst { fxt.Test__week_of_year("2010-02-01", 6); // 1-1:Fri;2-1:Mon fxt.Test__week_of_year("2011-02-01", 6); // 1-1:Sat;2-1:Tue } - @Test public void DayOfYear() { + @Test public void DayOfYear() { fxt.Test__day_of_year("2012-01-01", 1); fxt.Test__day_of_year("2012-02-29", 60); fxt.Test__day_of_year("2012-12-31", 366); } - @Test public void Timestamp_unix() { + @Test public void Timestamp_unix() { fxt.Test__timestamp_unix("1970-01-01 00:00:00", 0); fxt.Test__timestamp_unix("2012-01-01 00:00:00", 1325376000); } - @Test public void DaysInMonth() { + @Test public void DaysInMonth() { fxt.Test__days_in_month("2012-01-01", 31); fxt.Test__days_in_month("2012-02-01", 29); fxt.Test__days_in_month("2012-04-01", 30); fxt.Test__days_in_month("2011-02-01", 28); } - @Test public void XtoUtc() { + @Test public void XtoUtc() { fxt.Test__to_utc("2012-01-01 00:00", "2012-01-01 05:00"); //4=Wed } - @Test public void Timezone_id() { + @Test public void Timezone_id() { fxt.Test__timezone_id("2015-12-26T10:03:53Z", "UTC"); } } diff --git a/100_core/src/gplx/Double__tst.java b/100_core/src/gplx/Double__tst.java index 72c7ece9e..aaa01bbfa 100644 --- a/100_core/src/gplx/Double__tst.java +++ b/100_core/src/gplx/Double__tst.java @@ -13,15 +13,15 @@ The terms of each license can be found in the source code repository: GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt */ -package gplx; -import org.junit.*; -public class Double__tst { - private Double__fxt fxt = new Double__fxt(); - @Test public void Xto_str_loose() { - fxt.Test_Xto_str_loose(2449.6000000d , "2449.6"); - fxt.Test_Xto_str_loose(623.700d , "623.7"); - } -} -class Double__fxt { - public void Test_Xto_str_loose(double v, String expd) {Tfds.Eq(expd, Double_.To_str_loose(v));} -} +package gplx; +import org.junit.*; +public class Double__tst { + private Double__fxt fxt = new Double__fxt(); + @Test public void Xto_str_loose() { + fxt.Test_Xto_str_loose(2449.6000000d , "2449.6"); + fxt.Test_Xto_str_loose(623.700d , "623.7"); + } +} +class Double__fxt { + public void Test_Xto_str_loose(double v, String expd) {Tfds.Eq(expd, Double_.To_str_loose(v));} +} diff --git a/100_core/src/gplx/Err_tst.java b/100_core/src/gplx/Err_tst.java index fcc162028..2425795f4 100644 --- a/100_core/src/gplx/Err_tst.java +++ b/100_core/src/gplx/Err_tst.java @@ -1,23 +1,23 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx; import org.junit.*; public class Err_tst { private final Err_fxt fxt = new Err_fxt(); - @Test public void Trace_to_str__gplx() { + @Test public void Trace_to_str__gplx() { fxt.Test_Trace_to_str(Bool_.Y, Bool_.N, 0, String_.Concat_lines_nl_skip_last ( "gplx.Err_.new_wo_type(Err_.java:1)" // ignore this line , "gplx.String_.Len(String_.java:2)" @@ -26,7 +26,7 @@ public class Err_tst { , " gplx.String_.Len(String_.java:2)" )); } - @Test public void Trace_to_str__gplx_ignore() { + @Test public void Trace_to_str__gplx_ignore() { fxt.Test_Trace_to_str(Bool_.Y, Bool_.N, 1, String_.Concat_lines_nl_skip_last ( "gplx.Err_.new_wo_type(Err_.java:1)" // ignore this line , "gplx.String_.Fail(String_.java:2)" // ignore this line also diff --git a/100_core/src/gplx/GfoMsg_tst.java b/100_core/src/gplx/GfoMsg_tst.java index 0610da5ff..2f8d45a9d 100644 --- a/100_core/src/gplx/GfoMsg_tst.java +++ b/100_core/src/gplx/GfoMsg_tst.java @@ -1,29 +1,29 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx; import org.junit.*; import gplx.langs.gfs.*; public class GfoMsg_tst { @Before public void setup() { GfsCore.Instance.AddObj(new Mok(), "Mok"); } - @Test public void Write1() { + @Test public void Write1() { GfoMsg m = GfoMsg_.root_leafArgs_(String_.Ary("a", "b"), Keyval_.new_("int0", 1)); tst_Msg(m, "a.b:int0='1';"); } - @Test public void Write() { + @Test public void Write() { Mok mok = new Mok(); tst_Msg(Gfo_invk_to_str.WriteMsg(mok, Mok.Invk_Cmd0, true, 1, "a"), "Mok.Cmd0:bool0='y' int0='1' str0='a';"); mok.Int0 = 2; diff --git a/100_core/src/gplx/Gfo_evt_mgr.java b/100_core/src/gplx/Gfo_evt_mgr.java index 4118d9177..eac991dc5 100644 --- a/100_core/src/gplx/Gfo_evt_mgr.java +++ b/100_core/src/gplx/Gfo_evt_mgr.java @@ -1,18 +1,18 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx; import gplx.core.lists.*; public class Gfo_evt_mgr { diff --git a/100_core/src/gplx/Gfo_evt_mgr_.java b/100_core/src/gplx/Gfo_evt_mgr_.java index dc842da09..eef000e03 100644 --- a/100_core/src/gplx/Gfo_evt_mgr_.java +++ b/100_core/src/gplx/Gfo_evt_mgr_.java @@ -1,18 +1,18 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx; public class Gfo_evt_mgr_ { public static void Sub(Gfo_evt_mgr_owner pub, String pubEvt, Gfo_evt_itm sub, String subEvt) {pub.Evt_mgr().AddSub(pub, pubEvt, sub, subEvt);} diff --git a/100_core/src/gplx/Gfo_evt_mgr_tst.java b/100_core/src/gplx/Gfo_evt_mgr_tst.java index 28c91d2cc..c2cee2f05 100644 --- a/100_core/src/gplx/Gfo_evt_mgr_tst.java +++ b/100_core/src/gplx/Gfo_evt_mgr_tst.java @@ -1,49 +1,49 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx; import org.junit.*; public class Gfo_evt_mgr_tst { @Before public void setup() { pub = make_(); sub = make_(); } MockEvObj pub, sub; - @Test public void Basic() { + @Test public void Basic() { Gfo_evt_mgr_.Sub_same(pub, "ev1", sub); Gfo_evt_mgr_.Pub_val(pub, "ev1", "val1"); sub.tst_Handled("val1"); } - @Test public void None() {// make sure no subscribers does not cause exception + @Test public void None() {// make sure no subscribers does not cause exception Gfo_evt_mgr_.Sub_same(pub, "ev1", sub); Gfo_evt_mgr_.Pub_val(pub, "ev2", "val1"); //ev2 does not exist sub.tst_Handled(); } - @Test public void Lnk() { + @Test public void Lnk() { MockEvObj mid = make_(); mid.Evt_mgr().Lnk(pub); Gfo_evt_mgr_.Sub_same(mid, "ev1", sub); Gfo_evt_mgr_.Pub_val(pub, "ev1", "val1"); sub.tst_Handled("val1"); } - @Test public void RlsSub() { + @Test public void RlsSub() { this.Basic(); Gfo_evt_mgr_.Rls_sub(sub); Gfo_evt_mgr_.Pub_val(pub, "ev1", "val1"); sub.tst_Handled(); } - @Test public void RlsPub() { + @Test public void RlsPub() { this.Basic(); Gfo_evt_mgr_.Rls_sub(pub); diff --git a/100_core/src/gplx/Gfo_invk_.java b/100_core/src/gplx/Gfo_invk_.java index b6bc37202..0781ee2fd 100644 --- a/100_core/src/gplx/Gfo_invk_.java +++ b/100_core/src/gplx/Gfo_invk_.java @@ -1,18 +1,18 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx; import gplx.core.primitives.*; public class Gfo_invk_ { @@ -23,7 +23,9 @@ public class Gfo_invk_ { , Rv_handled = String_obj_val.new_("Handled") , Rv_host = String_obj_val.new_("Host") , Rv_cancel = String_obj_val.new_("Cancel") - , Rv_error = String_obj_val.new_("Error"); + , Rv_error = String_obj_val.new_("Error") + , ArgNone = String_obj_val.new_("") + ; public static Gfo_invk as_(Object obj) {return obj instanceof Gfo_invk ? (Gfo_invk)obj : null;} diff --git a/100_core/src/gplx/Gfo_invk_to_str.java b/100_core/src/gplx/Gfo_invk_to_str.java index 72c340b77..24e521bc2 100644 --- a/100_core/src/gplx/Gfo_invk_to_str.java +++ b/100_core/src/gplx/Gfo_invk_to_str.java @@ -1,23 +1,23 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx; import gplx.langs.gfs.*; public class Gfo_invk_to_str { public static GfoMsg ReadMsg(Gfo_invk invk, String k) { - GfsCtx ctx = GfsCtx.wtr_(); + GfsCtx ctx = GfsCtx.NewDeny(); GfoMsg m = GfoMsg_.rdr_(k); invk.Invk(ctx, 0, k, m); String invkKey = GfsCore.Instance.FetchKey(invk); @@ -27,7 +27,7 @@ public class Gfo_invk_to_str { } public static GfoMsg WriteMsg(Gfo_invk invk, String k, Object... ary) {return WriteMsg(GfsCore.Instance.FetchKey(invk), invk, k, ary);} public static GfoMsg WriteMsg(String invkKey, Gfo_invk invk, String k, Object... ary) { - GfsCtx ctx = GfsCtx.wtr_(); + GfsCtx ctx = GfsCtx.NewDeny(); GfoMsg m = GfoMsg_.wtr_(); invk.Invk(ctx, 0, k, m); GfoMsg rv = GfoMsg_.new_cast_(k); diff --git a/100_core/src/gplx/GfsCtx.java b/100_core/src/gplx/GfsCtx.java index ea98afa8b..1b7aa0d45 100644 --- a/100_core/src/gplx/GfsCtx.java +++ b/100_core/src/gplx/GfsCtx.java @@ -1,6 +1,6 @@ /* XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com +Copyright (C) 2012-2021 gnosygnu@gmail.com XOWA is licensed under the terms of the General Public License (GPL) Version 3, or alternatively under the terms of the Apache License Version 2.0. @@ -13,51 +13,19 @@ The terms of each license can be found in the source code repository: GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt */ -package gplx; -public class GfsCtx { - public Ordered_hash Vars() {return vars;} Ordered_hash vars = Ordered_hash_.New(); - public boolean Fail_if_unhandled() {return fail_if_unhandled;} public GfsCtx Fail_if_unhandled_(boolean v) {fail_if_unhandled = v; return this;} private boolean fail_if_unhandled; - public Gfo_usr_dlg Usr_dlg() {return usr_dlg;} public GfsCtx Usr_dlg_(Gfo_usr_dlg v) {usr_dlg = v; return this;} Gfo_usr_dlg usr_dlg; - public boolean Help_browseMode() {return help_browseMode;} public GfsCtx Help_browseMode_(boolean v) {help_browseMode = v; return this;} private boolean help_browseMode; - public List_adp Help_browseList() {return help_browseList;} List_adp help_browseList = List_adp_.New(); - public Object MsgSrc() {return msgSrc;} public GfsCtx MsgSrc_(Object v) {msgSrc = v; return this;} Object msgSrc; - public boolean Match(String k, String match) { - if (help_browseMode) { - help_browseList.Add(match); - return false; - } - else - return String_.Eq(k, match); - } - public boolean MatchPriv(String k, String match) {return help_browseMode ? false : String_.Eq(k, match);} - public boolean MatchIn(String k, String... match) { - if (help_browseMode) { - for (String i : match) - help_browseList.Add(i); - return false; - } - return String_.In(k, match); - } - public boolean Write_note(String fmt, Object... ary) {UsrDlg_.Instance.Note(fmt, ary); return false;} - public boolean Write_warn(String fmt, Object... ary) {UsrDlg_.Instance.Note("! " + fmt, ary); return false;} - public boolean Write_stop(UsrMsg umsg) {UsrDlg_.Instance.Note("* " + umsg.To_str()); return false;} - public boolean Write_stop(String fmt, Object... ary) {UsrDlg_.Instance.Note("* " + fmt, ary); return false;} - public boolean Deny() {return deny;} private boolean deny; - public static final GfsCtx Instance = new GfsCtx(); - public static GfsCtx new_() {return new GfsCtx();} GfsCtx() {} - public static GfsCtx rdr_() { - GfsCtx rv = new GfsCtx(); - rv.deny = true; - rv.mode = "read"; - return rv; - } - public static GfsCtx wtr_() { - GfsCtx rv = new GfsCtx(); - rv.deny = true; - rv.mode = Mode_write; - return rv; - } - public String Mode() {return mode;} public GfsCtx Mode_(String v) {mode = v; return this;} private String mode = "regular"; - public static final String Mode_write = "write"; - public static final int Ikey_null = -1; -} +package gplx; +public class GfsCtx { + private GfsCtx(boolean deny) { + this.deny = deny; + } + public Object MsgSrc() {return msgSrc;} public GfsCtx MsgSrc_(Object v) {msgSrc = v; return this;} private Object msgSrc; + public boolean Fail_if_unhandled() {return fail_if_unhandled;} public GfsCtx Fail_if_unhandled_(boolean v) {fail_if_unhandled = v; return this;} private boolean fail_if_unhandled; + public boolean Deny() {return deny;} private final boolean deny; + public boolean Match(String k, String match) {return String_.Eq(k, match);} + public boolean MatchPriv(String k, String match) {return String_.Eq(k, match);} + public boolean MatchIn(String k, String... match) {return String_.In(k, match);} + + public static final GfsCtx Instance = new_(); + public static GfsCtx new_() {return new GfsCtx(false);} + public static GfsCtx NewDeny() {return new GfsCtx(true);} +} diff --git a/100_core/src/gplx/Guid_adp__tst.java b/100_core/src/gplx/Guid_adp__tst.java index 4eac0e7dd..2fabe3aeb 100644 --- a/100_core/src/gplx/Guid_adp__tst.java +++ b/100_core/src/gplx/Guid_adp__tst.java @@ -13,14 +13,14 @@ The terms of each license can be found in the source code repository: GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt */ -package gplx; -import org.junit.*; -public class Guid_adp__tst { - @Test public void parse() { - tst_parse_("467ffb41-cdfe-402f-b22b-be855425784b"); - } - void tst_parse_(String s) { - Guid_adp uuid = Guid_adp_.Parse(s); - Tfds.Eq(uuid.To_str(), s); - } -} +package gplx; +import org.junit.*; +public class Guid_adp__tst { + @Test public void parse() { + tst_parse_("467ffb41-cdfe-402f-b22b-be855425784b"); + } + void tst_parse_(String s) { + Guid_adp uuid = Guid_adp_.Parse(s); + Tfds.Eq(uuid.To_str(), s); + } +} diff --git a/100_core/src/gplx/Hash_adp_bry_tst.java b/100_core/src/gplx/Hash_adp_bry_tst.java index e33f2be9d..6452e9a7e 100644 --- a/100_core/src/gplx/Hash_adp_bry_tst.java +++ b/100_core/src/gplx/Hash_adp_bry_tst.java @@ -1,36 +1,36 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx; import org.junit.*; public class Hash_adp_bry_tst { @Before public void setup() {fxt.Clear();} private Hash_adp_bry_fxt fxt = new Hash_adp_bry_fxt(); - @Test public void Add_bry() { + @Test public void Add_bry() { fxt .New_cs() .Add("a0").Add("b0").Add("c0") .Get_bry_tst("a0").Get_bry_tst("b0").Get_bry_tst("c0").Get_bry_tst("A0", null) ; } - @Test public void Get_mid() { + @Test public void Get_mid() { fxt .New_cs() .Add("a0").Add("b0").Add("c0") .Get_mid_tst("xyza0xyz", 3, 5, "a0") .Get_mid_tst("xyza0xyz", 3, 4, null) ; } - @Test public void Case_insensitive() { + @Test public void Case_insensitive() { fxt .New_ci() .Add("a0").Add("B0").Add("c0") .Get_bry_tst("a0", "a0") diff --git a/100_core/src/gplx/Int__tst.java b/100_core/src/gplx/Int__tst.java index f060fa78d..ea68164fe 100644 --- a/100_core/src/gplx/Int__tst.java +++ b/100_core/src/gplx/Int__tst.java @@ -1,22 +1,22 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx; import org.junit.*; public class Int__tst { - @Test public void XtoStr_PadBgn() { + @Test public void XtoStr_PadBgn() { tst_XtoStr_PadLeft_Zeroes(1 , 3, "001"); // pad tst_XtoStr_PadLeft_Zeroes(123 , 3, "123"); // no pad tst_XtoStr_PadLeft_Zeroes(1234 , 3, "1234"); // val exceeds pad; confirm noop @@ -25,11 +25,11 @@ public class Int__tst { tst_XtoStr_PadLeft_Zeroes(-123 , 3, "-123"); // negative tst_XtoStr_PadLeft_Zeroes(-1234 , 3, "-1234"); // negative } void tst_XtoStr_PadLeft_Zeroes(int val, int zeros, String expd) {Tfds.Eq(expd, Int_.To_str_pad_bgn_zero(val, zeros));} - @Test public void Xto_fmt() { + @Test public void Xto_fmt() { tst_XtoStr_fmt(1, "1"); tst_XtoStr_fmt(1000, "1,000"); } void tst_XtoStr_fmt(int v, String expd) {Tfds.Eq(expd, Int_.To_str_fmt(v, "#,###"));} - @Test public void Xto_int_hex_tst() { + @Test public void Xto_int_hex_tst() { Xto_int_hex("007C", 124); } void Xto_int_hex(String raw, int expd) {Tfds.Eq(expd, Int_.By_hex_bry(Bry_.new_a7(raw)));} } diff --git a/100_core/src/gplx/Int_ary__tst.java b/100_core/src/gplx/Int_ary__tst.java index e2486b2f1..1018c0130 100644 --- a/100_core/src/gplx/Int_ary__tst.java +++ b/100_core/src/gplx/Int_ary__tst.java @@ -1,24 +1,24 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx; import org.junit.*; import gplx.core.tests.*; public class Int_ary__tst { private Int_ary__fxt fxt = new Int_ary__fxt(); - @Test public void Parse() { + @Test public void Parse() { fxt.Test__Parse("1,2,3" , 3, Int_ary_.Empty, 1, 2, 3); fxt.Test__Parse("123,321,213" , 3, Int_ary_.Empty, 123, 321, 213); fxt.Test__Parse(" 1, 2,3" , 3, Int_ary_.Empty, 1, 2, 3); @@ -31,7 +31,7 @@ public class Int_ary__tst { fxt.Test__Parse("1-2," , 1, Int_ary_.Empty); } - @Test public void Parse_list_or_() { + @Test public void Parse_list_or_() { fxt.Test__Parse_or("1", 1); fxt.Test__Parse_or("123", 123); fxt.Test__Parse_or("1,2,123", 1, 2, 123); diff --git a/100_core/src/gplx/Io_mgr__tst.java b/100_core/src/gplx/Io_mgr__tst.java index 5f5a6b912..852fd108f 100644 --- a/100_core/src/gplx/Io_mgr__tst.java +++ b/100_core/src/gplx/Io_mgr__tst.java @@ -1,28 +1,28 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx; import org.junit.*; public class Io_mgr__tst { @Before public void init() {fxt.Clear();} private final Io_mgr__fxt fxt = new Io_mgr__fxt(); - @Test public void Dir_delete_empty__basic() { + @Test public void Dir_delete_empty__basic() { fxt.Exec_itm_create("mem/dir/"); fxt.Exec_dir_delete_empty("mem/dir/"); fxt.Test_itm_exists_n("mem/dir/"); } - @Test public void Dir_delete_empty__no_delete() { + @Test public void Dir_delete_empty__no_delete() { fxt.Exec_itm_create ( "mem/dir/" , "mem/dir/fil.txt" @@ -30,7 +30,7 @@ public class Io_mgr__tst { fxt.Exec_dir_delete_empty("mem/dir/"); fxt.Test_itm_exists_y("mem/dir/"); } - @Test public void Dir_delete_empty__nested_simple() { + @Test public void Dir_delete_empty__nested_simple() { fxt.Exec_itm_create ( "mem/dir/" , "mem/dir/1/" @@ -39,7 +39,7 @@ public class Io_mgr__tst { fxt.Exec_dir_delete_empty("mem/dir/"); fxt.Test_itm_exists_n("mem/dir/"); } - @Test public void Dir_delete_empty__nested_many() { + @Test public void Dir_delete_empty__nested_many() { fxt.Exec_itm_create ( "mem/dir/" , "mem/dir/1/" @@ -51,7 +51,7 @@ public class Io_mgr__tst { fxt.Exec_dir_delete_empty("mem/dir/"); fxt.Test_itm_exists_n("mem/dir/"); } - @Test public void Dir_delete_empty__nested_some() { + @Test public void Dir_delete_empty__nested_some() { fxt.Exec_itm_create ( "mem/dir/" , "mem/dir/1/" diff --git a/100_core/src/gplx/Io_url__tst.java b/100_core/src/gplx/Io_url__tst.java index 9e6758361..6ce37039b 100644 --- a/100_core/src/gplx/Io_url__tst.java +++ b/100_core/src/gplx/Io_url__tst.java @@ -1,32 +1,32 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ -package gplx; -import org.junit.*; import gplx.core.tests.*; import gplx.core.envs.*; -public class Io_url__tst { - @Before public void init() {fxt.Clear();} private final Io_url__fxt fxt = new Io_url__fxt(); - @Test public void Basic__lnx() {fxt.Test__New__http_or_null(Bool_.N, "file:///C:/a.txt", "C:/a.txt");} - @Test public void Basic__wnt() {fxt.Test__New__http_or_null(Bool_.Y, "file:///C:/a.txt", "C:\\a.txt");} - @Test public void Null() {fxt.Test__New__http_or_null(Bool_.N, "C:/a.txt", null);} -} -class Io_url__fxt { - public void Clear() {Io_mgr.Instance.InitEngine_mem();} - public void Test__New__http_or_null(boolean os_is_wnt, String raw, String expd) { - int curTid = Op_sys.Cur().Tid(); - Op_sys.Cur_(os_is_wnt ? Op_sys.Tid_wnt : Op_sys.Tid_lnx); - Gftest.Eq__obj_or_null(expd, Io_url_.New__http_or_null(raw)); - Op_sys.Cur_(curTid); - } -} +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ +package gplx; +import org.junit.*; import gplx.core.tests.*; import gplx.core.envs.*; +public class Io_url__tst { + @Before public void init() {fxt.Clear();} private final Io_url__fxt fxt = new Io_url__fxt(); + @Test public void Basic__lnx() {fxt.Test__New__http_or_null(Bool_.N, "file:///C:/a.txt", "C:/a.txt");} + @Test public void Basic__wnt() {fxt.Test__New__http_or_null(Bool_.Y, "file:///C:/a.txt", "C:\\a.txt");} + @Test public void Null() {fxt.Test__New__http_or_null(Bool_.N, "C:/a.txt", null);} +} +class Io_url__fxt { + public void Clear() {Io_mgr.Instance.InitEngine_mem();} + public void Test__New__http_or_null(boolean os_is_wnt, String raw, String expd) { + int curTid = Op_sys.Cur().Tid(); + Op_sys.Cur_(os_is_wnt ? Op_sys.Tid_wnt : Op_sys.Tid_lnx); + Gftest.Eq__obj_or_null(expd, Io_url_.New__http_or_null(raw)); + Op_sys.Cur_(curTid); + } +} diff --git a/100_core/src/gplx/List_adp_tst.java b/100_core/src/gplx/List_adp_tst.java index 48cb8f3be..25783cf72 100644 --- a/100_core/src/gplx/List_adp_tst.java +++ b/100_core/src/gplx/List_adp_tst.java @@ -1,18 +1,18 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx; import org.junit.*; public class List_adp_tst { @@ -20,13 +20,13 @@ public class List_adp_tst { list = List_adp_.New(); listBase = (List_adp_base)list; } List_adp list; List_adp_base listBase; - @Test public void Add() { + @Test public void Add() { Tfds.Eq(0, list.Count()); list.Add("0"); Tfds.Eq(1, list.Count()); } - @Test public void Add_changeCapacity() { + @Test public void Add_changeCapacity() { int capacity = 8; for (int i = 0; i < capacity; i++) list.Add("0"); @@ -37,30 +37,30 @@ public class List_adp_tst { Tfds.Eq(capacity + 1, list.Count()); Tfds.Eq(capacity * 2, listBase.Capacity()); } - @Test public void Get_at() { + @Test public void Get_at() { list.Add("0"); Tfds.Eq("0", list.Get_at(0)); } - @Test public void Fetch_many() { + @Test public void Fetch_many() { list_AddMany("0", "1"); Tfds.Eq("0", list.Get_at(0)); Tfds.Eq("1", list.Get_at(1)); } - @Test public void FetchAt_fail() { + @Test public void FetchAt_fail() { try {list.Get_at(0);} catch (Exception exc) {Err_.Noop(exc); return;} Tfds.Fail("Get_at should fail for out of bound index"); } - @Test public void Del_at() { + @Test public void Del_at() { list.Add("0"); Tfds.Eq(1, list.Count()); list.Del_at(0); Tfds.Eq(0, list.Count()); } - @Test public void DelAt_shiftDown() { + @Test public void DelAt_shiftDown() { list_AddMany("0", "1"); Tfds.Eq(list.Count(), 2); @@ -68,19 +68,19 @@ public class List_adp_tst { Tfds.Eq(1, list.Count()); Tfds.Eq("1", list.Get_at(0)); } - @Test public void DelAt_fail() { + @Test public void DelAt_fail() { try {list.Del_at(0);} catch (Exception exc) {Err_.Noop(exc); return;} Tfds.Fail("Del_at should fail for out of bound index"); } - @Test public void Del() { + @Test public void Del() { list.Add("0"); Tfds.Eq(1, list.Count()); list.Del("0"); Tfds.Eq(0, list.Count()); } - @Test public void Del_matchMember() { + @Test public void Del_matchMember() { list_AddMany("0", "1"); Tfds.Eq(2, list.Count()); @@ -88,23 +88,23 @@ public class List_adp_tst { Tfds.Eq(1, list.Count()); Tfds.Eq("0", list.Get_at(0)); } - @Test public void Del_matchFirst() { + @Test public void Del_matchFirst() { list_AddMany("0", "1", "0"); Tfds.Eq(3, list.Count()); list.Del("0"); tst_Enumerator("1", "0"); } - @Test public void Enumerator() { + @Test public void Enumerator() { list_AddMany("0", "1", "2"); tst_Enumerator("0", "1", "2"); } - @Test public void Enumerator_stateLess() { // run 2x, to confirm no state is being cached + @Test public void Enumerator_stateLess() { // run 2x, to confirm no state is being cached list_AddMany("0", "1", "2"); tst_Enumerator("0", "1", "2"); tst_Enumerator("0", "1", "2"); } - @Test public void Enumerator_recursive() { // confirm separate enumerator objects are used + @Test public void Enumerator_recursive() { // confirm separate enumerator objects are used int pos = 0; list_AddMany("0", "1", "2"); for (Object valObj : list) { @@ -113,7 +113,7 @@ public class List_adp_tst { tst_Enumerator("0", "1", "2"); } } - @Test public void Clear() { + @Test public void Clear() { int capacity = 8; for (int i = 0; i < capacity + 1; i++) list.Add("0"); @@ -123,36 +123,36 @@ public class List_adp_tst { Tfds.Eq(0, list.Count()); Tfds.Eq(16, listBase.Capacity()); // check that capacity has increased } - @Test public void Clear_empty() { // confirm no failure + @Test public void Clear_empty() { // confirm no failure list.Clear(); Tfds.Eq(0, list.Count()); } - @Test public void Reverse() { + @Test public void Reverse() { list_AddMany("0", "1", "2"); list.Reverse(); tst_Enumerator("2", "1", "0"); } - @Test public void Reverse_empty() {list.Reverse();} - @Test public void Sort() { + @Test public void Reverse_empty() {list.Reverse();} + @Test public void Sort() { list_AddMany("2", "0", "1"); list.Sort(); tst_Enumerator("0", "1", "2"); } - @Test public void Sort_empty() {list.Sort();} - @Test public void Xto_bry() { + @Test public void Sort_empty() {list.Sort();} + @Test public void Xto_bry() { list_AddMany("0", "1"); String[] ary = (String[])list.To_ary(String.class); Tfds.Eq_nullNot(ary); Tfds.Eq(2, Array_.Len(ary)); } - @Test public void XtoAry_empty() { + @Test public void XtoAry_empty() { String[] ary = (String[])list.To_ary(String.class); Tfds.Eq_nullNot(ary); Tfds.Eq(0, Array_.Len(ary)); } - @Test public void Shuffle() { + @Test public void Shuffle() { for (int i = 0; i < 25; i++) list.Add(i); @@ -169,14 +169,14 @@ public class List_adp_tst { list.Del(i); Tfds.Eq(0, list.Count(), "shuffled list does not have the same contents as original list"); } - @Test public void Shuffle_empty() {list.Shuffle();} - @Test public void Move_to() { + @Test public void Shuffle_empty() {list.Shuffle();} + @Test public void Move_to() { run_ClearAndAdd("0", "1", "2").run_MoveTo(0, 1).tst_Order("1", "0", "2"); run_ClearAndAdd("0", "1", "2").run_MoveTo(0, 2).tst_Order("1", "2", "0"); run_ClearAndAdd("0", "1", "2").run_MoveTo(2, 1).tst_Order("0", "2", "1"); run_ClearAndAdd("0", "1", "2").run_MoveTo(2, 0).tst_Order("2", "0", "1"); } - @Test public void Del_range() { + @Test public void Del_range() { run_ClearAndAdd("0", "1", "2", "3").tst_DelRange(0, 2, "3"); run_ClearAndAdd("0", "1", "2", "3").tst_DelRange(0, 3); run_ClearAndAdd("0", "1", "2", "3").tst_DelRange(1, 2, "0", "3"); diff --git a/100_core/src/gplx/Long__tst.java b/100_core/src/gplx/Long__tst.java index 1fa27a77e..4f97a52a3 100644 --- a/100_core/src/gplx/Long__tst.java +++ b/100_core/src/gplx/Long__tst.java @@ -1,22 +1,22 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx; import org.junit.*; public class Long__tst { - @Test public void DigitCount() { + @Test public void DigitCount() { tst_DigitCount(0, 1); tst_DigitCount(1, 1); tst_DigitCount(9, 1); @@ -31,7 +31,7 @@ public class Long__tst { tst_DigitCount(10000000000000000L, 17); tst_DigitCount(-1, 2); } void tst_DigitCount(long val, int expd) {Tfds.Eq(expd, Long_.DigitCount(val));} - @Test public void Int_merge() { + @Test public void Int_merge() { tst_Int_merge(123, 456, 528280977864L); tst_Int_merge(123, 457, 528280977865L); } @@ -40,7 +40,7 @@ public class Long__tst { Tfds.Eq(hi, Long_.Int_split_hi(expd)); Tfds.Eq(lo, Long_.Int_split_lo(expd)); } - @Test public void parse_or() { + @Test public void parse_or() { parse_or_tst("10000000000", 10000000000L); } void parse_or_tst(String raw, long expd) {Tfds.Eq(expd, Long_.parse_or(raw, -1));} diff --git a/100_core/src/gplx/Math__tst.java b/100_core/src/gplx/Math__tst.java index 75ba24d8d..9c3ae4bb0 100644 --- a/100_core/src/gplx/Math__tst.java +++ b/100_core/src/gplx/Math__tst.java @@ -1,47 +1,47 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx; import org.junit.*; public class Math__tst { - @Test public void Abs() { + @Test public void Abs() { tst_Abs(1, 1); tst_Abs(-1, 1); tst_Abs(0, 0); } void tst_Abs(int val, int expd) {Tfds.Eq(expd, Math_.Abs(val));} - @Test public void Log10() { + @Test public void Log10() { tst_Log10(0, Int_.Min_value); tst_Log10(9, 0); tst_Log10(10, 1); tst_Log10(99, 1); tst_Log10(100, 2); } void tst_Log10(int val, int expd) {Tfds.Eq(expd, Math_.Log10(val));} - @Test public void Min() { + @Test public void Min() { tst_Min(0, 1, 0); tst_Min(1, 0, 0); tst_Min(0, 0, 0); } void tst_Min(int val0, int val1, int expd) {Tfds.Eq(expd, Math_.Min(val0, val1));} - @Test public void Pow() { + @Test public void Pow() { tst_Pow(2, 0, 1); tst_Pow(2, 1, 2); tst_Pow(2, 2, 4); } void tst_Pow(int val, int exponent, double expd) {Tfds.Eq(expd, Math_.Pow(val, exponent));} - @Test public void Mult() { + @Test public void Mult() { tst_Mult(100, .01f, 1); } void tst_Mult(int val, float multiplier, int expd) {Tfds.Eq(expd, Int_.Mult(val, multiplier));} - @Test public void Base2Ary() { + @Test public void Base2Ary() { tst_Base2Ary( 1, 256, 1); tst_Base2Ary( 2, 256, 2); tst_Base2Ary( 3, 256, 1, 2); @@ -50,7 +50,7 @@ public class Math__tst { tst_Base2Ary( 6, 256, 2, 4); tst_Base2Ary(511, 256, 1, 2, 4, 8, 16, 32, 64, 128, 256); } void tst_Base2Ary(int v, int max, int... expd) {Tfds.Eq_ary(expd, Math_.Base2Ary(v, max));} - @Test public void Round() { + @Test public void Round() { tst_Round(1.5 , 0, 2); tst_Round(2.5 , 0, 3); tst_Round(2.123 , 2, 2.12); diff --git a/100_core/src/gplx/Object__tst.java b/100_core/src/gplx/Object__tst.java index 22b51f1c7..812f16c70 100644 --- a/100_core/src/gplx/Object__tst.java +++ b/100_core/src/gplx/Object__tst.java @@ -1,29 +1,29 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx; import org.junit.*; public class Object__tst { @Before public void init() {} private Object__fxt fxt = new Object__fxt(); - @Test public void Eq() { + @Test public void Eq() { fxt.Test_eq(null, null, true); // both null fxt.Test_eq(5, 5, true); // both non-null fxt.Test_eq(5, null, false); // rhs non-null fxt.Test_eq(null, 5, false); // lhs non-null } - @Test public void Xto_str_loose_or_null() { + @Test public void Xto_str_loose_or_null() { fxt.Test_xto_str_loose_or_null(null, null); fxt.Test_xto_str_loose_or_null(2449.6000000000004d, "2449.6"); } diff --git a/100_core/src/gplx/Ordered_hash_tst.java b/100_core/src/gplx/Ordered_hash_tst.java index 9865b8b9c..a4df5f6ab 100644 --- a/100_core/src/gplx/Ordered_hash_tst.java +++ b/100_core/src/gplx/Ordered_hash_tst.java @@ -1,29 +1,29 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx; import org.junit.*; public class Ordered_hash_tst { @Before public void setup() { hash = Ordered_hash_.New(); } - @Test public void Get_at() { + @Test public void Get_at() { hash.Add("key1", "val1"); Tfds.Eq("val1", hash.Get_at(0)); } - @Test public void iterator() { + @Test public void iterator() { hash.Add("key2", "val2"); hash.Add("key1", "val1"); @@ -33,5 +33,16 @@ public class Ordered_hash_tst { Tfds.Eq("val2", list.Get_at(0)); Tfds.Eq("val1", list.Get_at(1)); } + +// NOTE: this test shows that Del breaks iterator when vals are the same +// @Test +// public void Del() { +// hash.Add("a", "v1"); +// hash.Add("b", "v2"); +// hash.Add("c", "v1"); +// hash.Del("c"); +// Tfds.Eq("v1", hash.Get_at(0)); // should be "v1" b/c "a" was not deleted, but Del deletes "c" and first instance of "v1" +// } + Ordered_hash hash; } diff --git a/100_core/src/gplx/String_.java b/100_core/src/gplx/String_.java index 1ec8d3c37..f83b25fcd 100644 --- a/100_core/src/gplx/String_.java +++ b/100_core/src/gplx/String_.java @@ -1,21 +1,22 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx; -import java.lang.*; -import gplx.core.strings.*; import gplx.langs.gfs.*; import gplx.core.envs.*; +import gplx.core.envs.Op_sys; +import gplx.core.strings.String_bldr; +import gplx.core.strings.String_bldr_; public class String_ { // -------- BASELIB_COPY -------- public static final Class Cls_ref_type = String.class; @@ -145,11 +146,10 @@ public class String_ { public static int FindFwd(String s, String find, int bgn, int end) { int rv = FindFwd(s, find, bgn); return rv > end ? String_.Find_none : rv; - } - public static int FindBwd(String s, String find) {return s.lastIndexOf(find);} - public static int FindBwd(String s, String find, int pos) { - return s.lastIndexOf(find, pos); - } + } + public static int FindBwdOr(String s, String find, int or) {int pos = FindBwd(s, find); return pos == Pos_neg1 ? or : pos;} + public static int FindBwd(String s, String find) {return s.lastIndexOf(find);} + public static int FindBwd(String s, String find, int pos) {return s.lastIndexOf(find, pos);} public static int FindBetween(String s, String find, int bgn, int end) { int rv = FindFwd(s, find, bgn); return (rv > end) ? String_.Find_none : rv; diff --git a/100_core/src/gplx/String__tst.java b/100_core/src/gplx/String__tst.java index 93a865b48..c5c8b4a24 100644 --- a/100_core/src/gplx/String__tst.java +++ b/100_core/src/gplx/String__tst.java @@ -1,22 +1,22 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx; import org.junit.*; public class String__tst { - @Test public void LimitToFirst() { + @Test public void LimitToFirst() { tst_LimitToFirst("abc", 0, ""); tst_LimitToFirst("abc", 1, "a"); tst_LimitToFirst("abc", 2, "ab"); @@ -26,7 +26,7 @@ public class String__tst { } void tst_LimitToFirst(String s, int v, String expd) {Tfds.Eq(expd, String_.LimitToFirst(s, v));} void err_LimitToFirst(String s, int v) {try {String_.LimitToFirst(s, v);} catch (Exception exc) {Tfds.Err_classMatch(exc, Err.class); return;} Tfds.Fail_expdError();} - @Test public void LimitToLast() { + @Test public void LimitToLast() { tst_LimitToLast("abc", 0, ""); tst_LimitToLast("abc", 1, "c"); tst_LimitToLast("abc", 2, "bc"); @@ -36,7 +36,7 @@ public class String__tst { } void tst_LimitToLast(String s, int v, String expd) {Tfds.Eq(expd, String_.LimitToLast(s, v));} void err_LimitToLast(String s, int v) {try {String_.LimitToLast(s, v);} catch (Exception exc) {Tfds.Err_classMatch(exc, Err.class); return;} Tfds.Fail_expdError();} - @Test public void DelBgn() { + @Test public void DelBgn() { tst_DelBgn("abc", 0, "abc"); tst_DelBgn("abc", 1, "bc"); tst_DelBgn("abc", 2, "c"); @@ -46,7 +46,7 @@ public class String__tst { } void tst_DelBgn(String s, int v, String expd) {Tfds.Eq(expd, String_.DelBgn(s, v));} void err_DelBgn(String s, int v) {try {String_.DelBgn(s, v);} catch (Exception exc) {Tfds.Err_classMatch(exc, Err.class); return;} Tfds.Fail_expdError();} - @Test public void DelBgnIf() { + @Test public void DelBgnIf() { tst_DelBgnIf("abc", "", "abc"); tst_DelBgnIf("abc", "a", "bc"); tst_DelBgnIf("abc", "ab", "c"); @@ -58,7 +58,7 @@ public class String__tst { } void tst_DelBgnIf(String s, String v, String expd) {Tfds.Eq(expd, String_.DelBgnIf(s, v));} void err_DelBgnIf(String s, String v) {try {String_.DelBgnIf(s, v);} catch (Exception exc) {Tfds.Err_classMatch(exc, Err.class); return;} Tfds.Fail_expdError();} - @Test public void DelEnd() { + @Test public void DelEnd() { tst_DelEnd("abc", 0, "abc"); tst_DelEnd("abc", 1, "ab"); tst_DelEnd("abc", 2, "a"); @@ -68,7 +68,7 @@ public class String__tst { } void tst_DelEnd(String s, int v, String expd) {Tfds.Eq(expd, String_.DelEnd(s, v));} void err_DelEnd(String s, int v) {try {String_.DelEnd(s, v);} catch (Exception exc) {Tfds.Err_classMatch(exc, Err.class); return;} Tfds.Fail_expdError();} - @Test public void DelEndIf() { + @Test public void DelEndIf() { tst_DelEndIf("abc", "", "abc"); tst_DelEndIf("abc", "c", "ab"); tst_DelEndIf("abc", "bc", "a"); @@ -80,7 +80,7 @@ public class String__tst { } void tst_DelEndIf(String s, String v, String expd) {Tfds.Eq(expd, String_.DelEndIf(s, v));} void err_DelEndIf(String s, String v) {try {String_.DelEndIf(s, v);} catch (Exception exc) {Tfds.Err_classMatch(exc, Err.class); return;} Tfds.Fail_expdError();} - @Test public void MidByPos() { + @Test public void MidByPos() { tst_MidByPos("abc", 0, 0, ""); tst_MidByPos("abc", 0, 1, "a"); tst_MidByPos("abc", 0, 2, "ab"); @@ -91,7 +91,7 @@ public class String__tst { } void tst_MidByPos(String s, int bgn, int end, String expd) {Tfds.Eq(expd, String_.Mid(s, bgn, end));} void err_MidByPos(String s, int bgn, int end) {try {String_.Mid(s, bgn, end);} catch (Exception e) {Tfds.Err_classMatch(e, Err.class); return;} Tfds.Fail_expdError();} - @Test public void TrimEnd() { + @Test public void TrimEnd() { tst_TrimEnd("a", "a"); tst_TrimEnd("a ", "a"); tst_TrimEnd("a\t", "a"); @@ -103,19 +103,19 @@ public class String__tst { } void tst_TrimEnd(String s, String expd) {Tfds.Eq(expd, String_.TrimEnd(s));} - @Test public void Count() { + @Test public void Count() { String text = "0 0 0"; Tfds.Eq(3, String_.Count(text, "0")); } - @Test public void Has() { + @Test public void Has() { String text = "find word"; Tfds.Eq_true(String_.Has(text, "word")); Tfds.Eq_false(String_.Has(text, "nothing")); } - @Test public void Repeat() { + @Test public void Repeat() { Tfds.Eq("333", String_.Repeat("3", 3)); } - @Test public void Split() { + @Test public void Split() { tst_Split("ab", " ", "ab"); // no match -> return array with original input tst_Split("ab cd", " ", "ab", "cd"); // separator.length = 1 tst_Split("ab+!cd", "+!", "ab", "cd"); // separator.length = 2 @@ -132,12 +132,12 @@ public class String__tst { // acceptance tst_Split("this\r\nis\na\rtest\r\n.", "\r\n", "this", "is\na\rtest", "."); } void tst_Split(String text, String separator, String... expd) {Tfds.Eq_ary(expd, String_.Split(text, separator));} - @Test public void Concat_with_obj() { + @Test public void Concat_with_obj() { tst_ConcatWith_any("a|b", "|", "a", "b"); // do not append final delimiter tst_ConcatWith_any("a||c", "|", "a", null, "c"); // null tst_ConcatWith_any("a|b", "|", Object_.Ary("a", "b")); // pass array as arg } void tst_ConcatWith_any(String expd, String delimiter, Object... array) {Tfds.Eq(expd, String_.Concat_with_obj(delimiter, array));} - @Test public void Compare_byteAry() { + @Test public void Compare_byteAry() { tst_Compare_byteAry("a", "a", CompareAble_.Same); tst_Compare_byteAry("a", "b", CompareAble_.Less); tst_Compare_byteAry("b", "a", CompareAble_.More); @@ -148,14 +148,14 @@ public class String__tst { tst_Compare_byteAry("101", "1-0-1", CompareAble_.More); // NOTE: regular String_.Compare_as_ordinals returns Less in .NET, More in Java tst_Compare_byteAry("1-0-1", "101 (album)", CompareAble_.Less); } void tst_Compare_byteAry(String lhs, String rhs, int expd) {Tfds.Eq(expd, String_.Compare_byteAry(lhs, rhs));} - @Test public void FindBwd() { // WORKAROUND.CS:String.LastIndexOf returns -1 for multi-chars; + @Test public void FindBwd() { // WORKAROUND.CS:String.LastIndexOf returns -1 for multi-chars; tst_FindRev("abc", "a", 0, 0); tst_FindRev("abc", "ab", 0, 0); // 2 chars tst_FindRev("abc", "abc", 0, 0); // 3 chars tst_FindRev("ab", "abc", 0, -1); // out of index error tst_FindRev("ababab", "ab", 2, 2); // make sure cs implementation doesn't pick up next } void tst_FindRev(String s, String find, int pos, int expd) {Tfds.Eq(expd, String_.FindBwd(s, find, pos));} - @Test public void Extract_after_bwd() { + @Test public void Extract_after_bwd() { Extract_after_bwd_tst("a/b", "/", "b"); Extract_after_bwd_tst("a/", "/", ""); Extract_after_bwd_tst("a", "/", ""); diff --git a/100_core/src/gplx/core/brys/Bry_bfr_mkr_tst.java b/100_core/src/gplx/core/brys/Bry_bfr_mkr_tst.java index fd801cba5..7990e1fbd 100644 --- a/100_core/src/gplx/core/brys/Bry_bfr_mkr_tst.java +++ b/100_core/src/gplx/core/brys/Bry_bfr_mkr_tst.java @@ -1,38 +1,38 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.core.brys; import gplx.*; import gplx.core.*; import org.junit.*; public class Bry_bfr_mkr_tst { private final Bry_bfr_mkr_fxt fxt = new Bry_bfr_mkr_fxt(); @Before public void setup() {fxt.Clear();} - @Test public void Get_1() {fxt.Clear().Get().Test__used(0);} - @Test public void Get_2() {fxt.Clear().Get().Get().Test__used(0, 1);} - @Test public void Get_3() {fxt.Clear().Get().Get().Get().Test__used(0, 1, 2);} - @Test public void Rls() {fxt.Clear().Get().Rls(0).Test__used();} - @Test public void Rls_skip_1() { + @Test public void Get_1() {fxt.Clear().Get().Test__used(0);} + @Test public void Get_2() {fxt.Clear().Get().Get().Test__used(0, 1);} + @Test public void Get_3() {fxt.Clear().Get().Get().Get().Test__used(0, 1, 2);} + @Test public void Rls() {fxt.Clear().Get().Rls(0).Test__used();} + @Test public void Rls_skip_1() { fxt.Clear().Get().Get().Rls(0).Test__used(-1, 1); fxt.Get().Test__used(0, 1); } - @Test public void Rls_skip_2_1() { + @Test public void Rls_skip_2_1() { fxt.Clear().Get().Get().Get().Rls(1).Rls(0).Test__used(-1, -1, 2); fxt.Get().Test__used(0, -1, 2); fxt.Get().Test__used(0, 1, 2); fxt.Get().Test__used(0, 1, 2, 3); } - @Test public void Get_rls_get() { // PURPOSE: defect in which last rls failed b/c was not doing ++ if rv existed + @Test public void Get_rls_get() { // PURPOSE: defect in which last rls failed b/c was not doing ++ if rv existed fxt.Clear().Get().Rls(0).Get().Get().Rls(1).Rls(0).Test__used(); } } diff --git a/100_core/src/gplx/core/brys/Bry_rdr.java b/100_core/src/gplx/core/brys/Bry_rdr.java index e45741aa1..f9c56d322 100644 --- a/100_core/src/gplx/core/brys/Bry_rdr.java +++ b/100_core/src/gplx/core/brys/Bry_rdr.java @@ -1,20 +1,28 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ -package gplx.core.brys; import gplx.*; import gplx.core.*; -import gplx.core.errs.*; import gplx.core.btries.*; +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ +package gplx.core.brys; import gplx.Bool_; +import gplx.Bry_; +import gplx.Bry_find_; +import gplx.Byte_; +import gplx.Byte_ascii; +import gplx.Double_; +import gplx.Int_; +import gplx.String_; +import gplx.core.btries.Btrie_rv; +import gplx.core.btries.Btrie_slim_mgr; public class Bry_rdr { private final gplx.core.primitives.Int_obj_ref pos_ref = gplx.core.primitives.Int_obj_ref.New_neg1(); private final Btrie_rv trv = new Btrie_rv(); @@ -22,6 +30,9 @@ public class Bry_rdr { public int Src_end() {return src_end;} protected int src_end; public int Pos() {return pos;} protected int pos; public boolean Pos_is_eos() {return pos == src_end;} + public boolean Pos_is_reading() {return pos > -1 && pos < src_end;} + public byte Cur() {return src[pos];} + public byte Nxt() {return pos + 1 >= src_end ? Not_found : src[pos + 1];} public Bry_rdr Dflt_dlm_(byte b) {this.dflt_dlm = b; return this;} private byte dflt_dlm; public Bry_rdr Fail_throws_err_(boolean v) {err_wkr.Fail_throws_err_(v); return this;} public Bry_rdr Init_by_src(byte[] src) {err_wkr.Init_by_page("", src); this.pos = 0; this.src = src; this.src_end = src.length; return this;} @@ -35,13 +46,19 @@ public class Bry_rdr { } public Bry_err_wkr Err_wkr() {return err_wkr;} private Bry_err_wkr err_wkr = new Bry_err_wkr(); public int Move_to(int v) {this.pos = v; return pos;} + public int Move_to_last() {this.pos = src_end - 1; return pos;} + public int Move_to_end() {this.pos = src_end; return pos;} public int Move_by_one() {return Move_by(1);} public int Move_by(int v) {this.pos += v; return pos;} public int Find_fwd_lr() {return Find_fwd(dflt_dlm , Bool_.Y, Bool_.N, Fail_if_missing);} public int Find_fwd_lr(byte find) {return Find_fwd(find , Bool_.Y, Bool_.N, Fail_if_missing);} public int Find_fwd_lr_or(byte find, int or) {return Find_fwd(find , Bool_.Y, Bool_.N, or);} + public int Find_fwd_lr(String find) {return Find_fwd(Bry_.new_u8(find), Bool_.Y, Bool_.N, Fail_if_missing);} public int Find_fwd_lr(byte[] find) {return Find_fwd(find , Bool_.Y, Bool_.N, Fail_if_missing);} + public int Find_fwd_lr_or(String find, int or) {return Find_fwd(Bry_.new_u8(find), Bool_.Y, Bool_.N, or);} + public int Find_fwd_lr_or(byte[] find, int or) + {return Find_fwd(find , Bool_.Y, Bool_.N, or);} public int Find_fwd_rr() {return Find_fwd(dflt_dlm , Bool_.N, Bool_.N, Fail_if_missing);} public int Find_fwd_rr(byte find) {return Find_fwd(find , Bool_.N, Bool_.N, Fail_if_missing);} public int Find_fwd_rr(byte[] find) {return Find_fwd(find , Bool_.N, Bool_.N, Fail_if_missing);} @@ -141,6 +158,29 @@ public class Bry_rdr { int bgn = pos; return Bry_.Mid(src, bgn, Find_fwd_lr(b)); } + public int Move_fwd_while(byte b) { + while (pos < src_end) { + if (src[pos] != b) { + break; + } + pos++; + } + return pos; + } + public int Move_bwd_while(byte b) { + while (pos > -1) { + if (src[pos] != b) { + return pos + 1; // return position which is start of b sequence + } + pos--; + } + return -1; + } + public boolean Match(byte[] find) { // same as Is but no auto-move + int find_len = find.length; + int find_end = pos + find_len; + return Bry_.Match(src, pos, find_end, find, 0, find_len); + } public boolean Is(byte find) { boolean rv = src[pos] == find; if (rv) ++pos; // only advance if match; @@ -189,7 +229,7 @@ public class Bry_rdr { pos = trv.Pos(); return ((gplx.core.primitives.Byte_obj_val)rv_obj).Val(); } - @gplx.Virtual public Bry_rdr Skip_ws() { + public Bry_rdr Skip_ws() { while (pos < src_end) { switch (src[pos]) { case Byte_ascii.Tab: case Byte_ascii.Nl: case Byte_ascii.Cr: case Byte_ascii.Space: @@ -226,4 +266,5 @@ public class Bry_rdr { return this; } private static final int Fail_if_missing = Int_.Min_value; + public static final int Not_found = Bry_find_.Not_found; } diff --git a/100_core/src/gplx/core/brys/Bry_rdr_tst.java b/100_core/src/gplx/core/brys/Bry_rdr_tst.java index fc38b774e..8247ba514 100644 --- a/100_core/src/gplx/core/brys/Bry_rdr_tst.java +++ b/100_core/src/gplx/core/brys/Bry_rdr_tst.java @@ -1,35 +1,35 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.core.brys; import gplx.*; import gplx.core.*; import org.junit.*; public class Bry_rdr_tst { @Before public void init() {fxt.Clear();} private Bry_rdr_fxt fxt = new Bry_rdr_fxt(); - @Test public void Int() { + @Test public void Int() { fxt.Init_src("12|3456|789"); fxt.Test_read_int(12); fxt.Test_read_int(3456); fxt.Test_read_int(789); fxt.Test_read_int(Int_.Min_value); } - @Test public void Int_negative() { + @Test public void Int_negative() { fxt.Init_src("-1|-2"); fxt.Test_read_int(-1); fxt.Test_read_int(-2); } - @Test public void Bry() { + @Test public void Bry() { fxt.Init_src("abc|d||ef"); fxt.Test_read_bry("abc"); fxt.Test_read_bry("d"); diff --git a/100_core/src/gplx/core/brys/args/Bfr_arg__time_tst.java b/100_core/src/gplx/core/brys/args/Bfr_arg__time_tst.java index 8c1faccb9..2419256c5 100644 --- a/100_core/src/gplx/core/brys/args/Bfr_arg__time_tst.java +++ b/100_core/src/gplx/core/brys/args/Bfr_arg__time_tst.java @@ -1,22 +1,22 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.core.brys.args; import gplx.*; import gplx.core.*; import gplx.core.brys.*; import org.junit.*; public class Bfr_arg__time_tst { - @Test public void Basic() { + @Test public void Basic() { Time_fmtr_arg_fxt fxt = new Time_fmtr_arg_fxt().Clear(); fxt.XferAry( 1, "01s"); // seconds fxt.XferAry( 62, "01m 02s"); // minutes diff --git a/100_core/src/gplx/core/brys/fmtrs/Bry_fmtr_tst.java b/100_core/src/gplx/core/brys/fmtrs/Bry_fmtr_tst.java index c03461a6c..6ffaad8c8 100644 --- a/100_core/src/gplx/core/brys/fmtrs/Bry_fmtr_tst.java +++ b/100_core/src/gplx/core/brys/fmtrs/Bry_fmtr_tst.java @@ -1,48 +1,48 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.core.brys.fmtrs; import gplx.*; import gplx.core.*; import gplx.core.brys.*; import org.junit.*; public class Bry_fmtr_tst { private final Bry_fmtr_fxt fxt = new Bry_fmtr_fxt(); - @Test public void Text() {fxt.Clear().Fmt("a").Test("a");} - @Test public void Idx__1() {fxt.Clear().Fmt("~{0}").Args("a").Test("a");} - @Test public void Idx__3() {fxt.Clear().Fmt("~{0}~{1}~{2}").Args("a", "b", "c").Test("abc");} - @Test public void Idx__mix() {fxt.Clear().Fmt("a~{0}c~{1}e").Args("b", "d").Test("abcde");} - @Test public void Idx__missing() {fxt.Clear().Fmt("~{0}").Test("~{0}");} + @Test public void Text() {fxt.Clear().Fmt("a").Test("a");} + @Test public void Idx__1() {fxt.Clear().Fmt("~{0}").Args("a").Test("a");} + @Test public void Idx__3() {fxt.Clear().Fmt("~{0}~{1}~{2}").Args("a", "b", "c").Test("abc");} + @Test public void Idx__mix() {fxt.Clear().Fmt("a~{0}c~{1}e").Args("b", "d").Test("abcde");} + @Test public void Idx__missing() {fxt.Clear().Fmt("~{0}").Test("~{0}");} - @Test public void Key__basic() {fxt.Clear().Fmt("~{key}").Keys("key").Args("a").Test("a");} - @Test public void Key__mult() {fxt.Clear().Fmt("~{key1}~{key2}").Keys("key1", "key2").Args("a", "b").Test("ab");} - @Test public void Key__repeat() {fxt.Clear().Fmt("~{key1}~{key1}").Keys("key1").Args("a").Test("aa");} + @Test public void Key__basic() {fxt.Clear().Fmt("~{key}").Keys("key").Args("a").Test("a");} + @Test public void Key__mult() {fxt.Clear().Fmt("~{key1}~{key2}").Keys("key1", "key2").Args("a", "b").Test("ab");} + @Test public void Key__repeat() {fxt.Clear().Fmt("~{key1}~{key1}").Keys("key1").Args("a").Test("aa");} - @Test public void Mix() {fxt.Clear().Fmt("~{key1}~{1}").Keys("key1", "key2").Args("a", "b").Test("ab");} + @Test public void Mix() {fxt.Clear().Fmt("~{key1}~{1}").Keys("key1", "key2").Args("a", "b").Test("ab");} - @Test public void Simple() { + @Test public void Simple() { fxt.Clear().Fmt("0~{key1}1~{key2}2").Keys("key1", "key2").Args(".", ",").Test("0.1,2"); } - @Test public void Cmd() { + @Test public void Cmd() { Bry_fmtr_tst_mok mok = new Bry_fmtr_tst_mok(); Bry_fmtr fmtr = Bry_fmtr.new_("0~{key1}2~{<>3<>}4", "key1").Eval_mgr_(mok); Tfds.Eq("012~{<>3<>}4", fmtr.Bld_str_many("1")); mok.Enabled_(true); Tfds.Eq("01234", fmtr.Bld_str_many("1")); } - @Test public void Bld_bfr_many_and_set_fmt() { + @Test public void Bld_bfr_many_and_set_fmt() { fxt.Bld_bfr_many_and_set_fmt("a~{0}c", Object_.Ary("b"), "abc"); } - @Test public void Escape_tilde() { + @Test public void Escape_tilde() { Tfds.Eq("~~~~~~", Bry_fmtr.Escape_tilde("~~~")); } } diff --git a/100_core/src/gplx/core/brys/fmts/Bry_fmt_tst.java b/100_core/src/gplx/core/brys/fmts/Bry_fmt_tst.java index 119b8b5f6..879d5d109 100644 --- a/100_core/src/gplx/core/brys/fmts/Bry_fmt_tst.java +++ b/100_core/src/gplx/core/brys/fmts/Bry_fmt_tst.java @@ -1,31 +1,31 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.core.brys.fmts; import gplx.*; import gplx.core.*; import gplx.core.brys.*; import org.junit.*; public class Bry_fmt_tst { private final Bry_fmt_fxt fxt = new Bry_fmt_fxt(); - @Test public void Text() {fxt.Clear().Fmt("a").Test("a");} - @Test public void Key__basic() {fxt.Clear().Fmt("~{key}").Vals("a").Test("a");} - @Test public void Key__mult() {fxt.Clear().Fmt("~{key1}~{key2}").Vals("a", "b").Test("ab");} - @Test public void Key__repeat() {fxt.Clear().Fmt("~{key1}~{key1}").Vals("a").Test("aa");} - @Test public void Key__missing() {fxt.Clear().Fmt("~{key}").Test("~{key}");} - @Test public void Tilde() {fxt.Clear().Fmt("~~~~").Test("~~");} - @Test public void Simple() {fxt.Clear().Fmt("0~{key1}1~{key2}2").Vals(".", ",").Test("0.1,2");} - @Test public void Arg() {fxt.Clear().Fmt("~{custom}").Args("custom", new Bfr_fmt_arg_mok(123)).Test("123");} - @Test public void Keys() {fxt.Clear().Fmt("~{b}~{c}~{a}").Keys("a", "b", "c").Vals("a", "b", "c").Test("bca");} + @Test public void Text() {fxt.Clear().Fmt("a").Test("a");} + @Test public void Key__basic() {fxt.Clear().Fmt("~{key}").Vals("a").Test("a");} + @Test public void Key__mult() {fxt.Clear().Fmt("~{key1}~{key2}").Vals("a", "b").Test("ab");} + @Test public void Key__repeat() {fxt.Clear().Fmt("~{key1}~{key1}").Vals("a").Test("aa");} + @Test public void Key__missing() {fxt.Clear().Fmt("~{key}").Test("~{key}");} + @Test public void Tilde() {fxt.Clear().Fmt("~~~~").Test("~~");} + @Test public void Simple() {fxt.Clear().Fmt("0~{key1}1~{key2}2").Vals(".", ",").Test("0.1,2");} + @Test public void Arg() {fxt.Clear().Fmt("~{custom}").Args("custom", new Bfr_fmt_arg_mok(123)).Test("123");} + @Test public void Keys() {fxt.Clear().Fmt("~{b}~{c}~{a}").Keys("a", "b", "c").Vals("a", "b", "c").Test("bca");} } class Bfr_fmt_arg_mok implements Bfr_arg { private int num; diff --git a/100_core/src/gplx/core/brys/fmts/Bry_keys_parser_tst.java b/100_core/src/gplx/core/brys/fmts/Bry_keys_parser_tst.java index 862f31f8f..4aa8a14d8 100644 --- a/100_core/src/gplx/core/brys/fmts/Bry_keys_parser_tst.java +++ b/100_core/src/gplx/core/brys/fmts/Bry_keys_parser_tst.java @@ -13,18 +13,18 @@ The terms of each license can be found in the source code repository: GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt */ -package gplx.core.brys.fmts; import gplx.*; import gplx.core.*; import gplx.core.brys.*; -import org.junit.*; -public class Bry_keys_parser_tst { - private final Bry_keys_parser_fxt fxt = new Bry_keys_parser_fxt(); - @Test public void None() {fxt.Test("a");} - @Test public void One() {fxt.Test("~{a}" , "a");} - @Test public void Many() {fxt.Test("~{a}b~{c}d~{e}" , "a", "c", "e");} - @Test public void Dupe() {fxt.Test("~{a}b~{a}" , "a");} - @Test public void Bug__space() {fxt.Test("~{a}~{b} ~{c}" , "a", "b", "c");} // DATE:2016-08-02 -} -class Bry_keys_parser_fxt { - public void Test(String fmt, String... expd) { - Tfds.Eq_ary(expd, String_.Ary(Bry_fmt_parser_.Parse_keys(Bry_.new_u8(fmt)))); - } -} +package gplx.core.brys.fmts; import gplx.*; import gplx.core.*; import gplx.core.brys.*; +import org.junit.*; +public class Bry_keys_parser_tst { + private final Bry_keys_parser_fxt fxt = new Bry_keys_parser_fxt(); + @Test public void None() {fxt.Test("a");} + @Test public void One() {fxt.Test("~{a}" , "a");} + @Test public void Many() {fxt.Test("~{a}b~{c}d~{e}" , "a", "c", "e");} + @Test public void Dupe() {fxt.Test("~{a}b~{a}" , "a");} + @Test public void Bug__space() {fxt.Test("~{a}~{b} ~{c}" , "a", "b", "c");} // DATE:2016-08-02 +} +class Bry_keys_parser_fxt { + public void Test(String fmt, String... expd) { + Tfds.Eq_ary(expd, String_.Ary(Bry_fmt_parser_.Parse_keys(Bry_.new_u8(fmt)))); + } +} diff --git a/100_core/src/gplx/core/btries/Btrie_bwd_mgr_tst.java b/100_core/src/gplx/core/btries/Btrie_bwd_mgr_tst.java index 11d4e4e03..87ab660d2 100644 --- a/100_core/src/gplx/core/btries/Btrie_bwd_mgr_tst.java +++ b/100_core/src/gplx/core/btries/Btrie_bwd_mgr_tst.java @@ -1,18 +1,18 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.core.btries; import gplx.*; import gplx.core.*; import org.junit.*; public class Btrie_bwd_mgr_tst { @@ -22,7 +22,7 @@ public class Btrie_bwd_mgr_tst { run_Add("c" , 1); run_Add("abc" , 123); } - @Test public void Get_by() { + @Test public void Get_by() { ini_setup1(); tst_MatchAtCur("c" , 1); tst_MatchAtCur("abc" , 123); @@ -30,17 +30,17 @@ public class Btrie_bwd_mgr_tst { tst_MatchAtCur("yzabc" , 123); tst_MatchAtCur("ab" , null); } - @Test public void Fetch_intl() { + @Test public void Fetch_intl() { trie = new Btrie_bwd_mgr(false); run_Add("a�", 1); tst_MatchAtCur("a�" , 1); tst_MatchAtCur("�" , null); } - @Test public void Eos() { + @Test public void Eos() { ini_setup1(); tst_Match("ab", Byte_ascii.Ltr_c, 2, 123); } - @Test public void Match_exact() { + @Test public void Match_exact() { ini_setup1(); tst_MatchAtCurExact("c", 1); tst_MatchAtCurExact("bc", null); @@ -51,7 +51,7 @@ public class Btrie_bwd_mgr_tst { run_Add("a" , 1); run_Add("b" , 2); } - @Test public void Match_2() { + @Test public void Match_2() { ini_setup2(); tst_MatchAtCur("a", 1); tst_MatchAtCur("b", 2); @@ -61,7 +61,7 @@ public class Btrie_bwd_mgr_tst { run_Add("a" , 1); run_Add("b" , 2); } - @Test public void CaseAny() { + @Test public void CaseAny() { ini_setup_caseAny(); tst_MatchAtCur("a", 1); tst_MatchAtCur("A", 1); diff --git a/100_core/src/gplx/core/btries/Btrie_fast_mgr_tst.java b/100_core/src/gplx/core/btries/Btrie_fast_mgr_tst.java index eeaebc16a..bbb9c05e4 100644 --- a/100_core/src/gplx/core/btries/Btrie_fast_mgr_tst.java +++ b/100_core/src/gplx/core/btries/Btrie_fast_mgr_tst.java @@ -1,54 +1,54 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.core.btries; import gplx.*; import gplx.core.*; import org.junit.*; public class Btrie_fast_mgr_tst { private Btrie_fast_mgr_fxt fxt = new Btrie_fast_mgr_fxt(); @Before public void init() {fxt.Clear();} - @Test public void Get_by() { + @Test public void Get_by() { fxt.Test_matchAtCur("a" , 1); fxt.Test_matchAtCur("abc" , 123); fxt.Test_matchAtCur("ab" , 1); fxt.Test_matchAtCur("abcde" , 123); fxt.Test_matchAtCur(" a" , null); } - @Test public void Bos() { + @Test public void Bos() { fxt.Test_match("bc", Byte_ascii.Ltr_a, -1, 123); } - @Test public void Match_exact() { + @Test public void Match_exact() { fxt.Test_matchAtCurExact("a", 1); fxt.Test_matchAtCurExact("ab", null); fxt.Test_matchAtCurExact("abc", 123); } - @Test public void Del_noop__no_match() { + @Test public void Del_noop__no_match() { fxt.Exec_del("d"); fxt.Test_matchAtCurExact("a" , 1); fxt.Test_matchAtCurExact("abc" , 123); } - @Test public void Del_noop__partial_match() { + @Test public void Del_noop__partial_match() { fxt.Exec_del("ab"); fxt.Test_matchAtCurExact("a" , 1); fxt.Test_matchAtCurExact("abc" , 123); } - @Test public void Del_match__long() { + @Test public void Del_match__long() { fxt.Exec_del("abc"); fxt.Test_matchAtCurExact("a" , 1); fxt.Test_matchAtCurExact("abc" , null); } - @Test public void Del_match__short() { + @Test public void Del_match__short() { fxt.Exec_del("a"); fxt.Test_matchAtCurExact("a" , null); fxt.Test_matchAtCurExact("abc" , 123); diff --git a/100_core/src/gplx/core/btries/Btrie_slim_itm_tst.java b/100_core/src/gplx/core/btries/Btrie_slim_itm_tst.java index 3c0b99d33..93dd11bf1 100644 --- a/100_core/src/gplx/core/btries/Btrie_slim_itm_tst.java +++ b/100_core/src/gplx/core/btries/Btrie_slim_itm_tst.java @@ -1,35 +1,35 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.core.btries; import gplx.*; import gplx.core.*; import org.junit.*; public class Btrie_slim_itm_tst { private Btrie_slim_itm itm = new Btrie_slim_itm(Byte_.Zero, null, false); @Before public void init() {itm.Clear();} - @Test public void Find_nil() { + @Test public void Find_nil() { tst_Find(Byte_ascii.Ltr_a, null); } - @Test public void Add_one() { + @Test public void Add_one() { run_Add(Byte_ascii.Ltr_a); tst_Find(Byte_ascii.Ltr_a, "a"); } - @Test public void Add_many() { + @Test public void Add_many() { run_Add(Byte_ascii.Bang, Byte_ascii.Num_0, Byte_ascii.Ltr_a, Byte_ascii.Ltr_B); tst_Find(Byte_ascii.Ltr_a, "a"); } - @Test public void Del() { + @Test public void Del() { run_Add(Byte_ascii.Bang, Byte_ascii.Num_0, Byte_ascii.Ltr_a, Byte_ascii.Ltr_B); tst_Find(Byte_ascii.Ltr_a, "a"); run_Del(Byte_ascii.Ltr_a); diff --git a/100_core/src/gplx/core/btries/Btrie_slim_mgr_tst.java b/100_core/src/gplx/core/btries/Btrie_slim_mgr_tst.java index 1e4e2dfa8..2d7cf5c64 100644 --- a/100_core/src/gplx/core/btries/Btrie_slim_mgr_tst.java +++ b/100_core/src/gplx/core/btries/Btrie_slim_mgr_tst.java @@ -1,18 +1,18 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.core.btries; import gplx.*; import gplx.core.*; import org.junit.*; import gplx.core.tests.*; public class Btrie_slim_mgr_tst { @@ -23,7 +23,7 @@ public class Btrie_slim_mgr_tst { run_Add("a" , 1); run_Add("abc" , 123); } - @Test public void Get_by() { + @Test public void Get_by() { ini_setup1(); tst_MatchAtCur("a" , 1); tst_MatchAtCur("abc" , 123); @@ -31,11 +31,11 @@ public class Btrie_slim_mgr_tst { tst_MatchAtCur("abcde" , 123); tst_MatchAtCur(" a" , null); } - @Test public void Bos() { + @Test public void Bos() { ini_setup1(); tst_Match("bc", Byte_ascii.Ltr_a, -1, 123); } - @Test public void Match_exact() { + @Test public void Match_exact() { ini_setup1(); tst_MatchAtCurExact("a", 1); tst_MatchAtCurExact("ab", null); @@ -46,7 +46,7 @@ public class Btrie_slim_mgr_tst { run_Add("a" , 1); run_Add("b" , 2); } - @Test public void Match_2() { + @Test public void Match_2() { ini_setup2(); tst_MatchAtCur("a", 1); tst_MatchAtCur("b", 2); @@ -56,12 +56,12 @@ public class Btrie_slim_mgr_tst { run_Add("a" , 1); run_Add("b" , 2); } - @Test public void CaseAny() { + @Test public void CaseAny() { ini_setup_caseAny(); tst_MatchAtCur("a", 1); tst_MatchAtCur("A", 1); } - @Test public void Del() { + @Test public void Del() { ini_setup1(); trie.Del(Bry_.new_a7("a")); // delete "a"; "abc" still remains; tst_MatchAtCur("a" , null); @@ -70,7 +70,7 @@ public class Btrie_slim_mgr_tst { trie.Del(Bry_.new_a7("abc")); tst_MatchAtCur("abc" , null); } - @Test public void Match_none() { + @Test public void Match_none() { Btrie_slim_mgr_fxt fxt = new Btrie_slim_mgr_fxt(); fxt.Init__add("k1", "v1"); fxt.Exec__match("ak1", 1, 3, "v1", 3); // 3 to position after match diff --git a/100_core/src/gplx/core/caches/Lru_cache_tst.java b/100_core/src/gplx/core/caches/Lru_cache_tst.java index 923d9cac1..7607f3736 100644 --- a/100_core/src/gplx/core/caches/Lru_cache_tst.java +++ b/100_core/src/gplx/core/caches/Lru_cache_tst.java @@ -1,40 +1,40 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.core.caches; import gplx.*; import gplx.core.*; import org.junit.*; import gplx.core.tests.*; public class Lru_cache_tst { private final Lru_cache_fxt fxt = new Lru_cache_fxt(); - @Test public void Get_one() { + @Test public void Get_one() { fxt.Exec__set("a", 5); fxt.Test__get_y("a"); } - @Test public void Pop_one() { + @Test public void Pop_one() { fxt.Exec__set("a", 10); fxt.Exec__set("b", 10); fxt.Test__get_n("a"); fxt.Test__get_y("b"); } - @Test public void Add_many() { + @Test public void Add_many() { fxt.Exec__set("a", 4); fxt.Exec__set("b", 3); fxt.Exec__set("c", 2); fxt.Exec__set("d", 1); fxt.Test__get_y("a", "b", "c", "d"); } - @Test public void Pop_many() { + @Test public void Pop_many() { fxt.Exec__set("a", 4); fxt.Exec__set("b", 3); fxt.Exec__set("c", 2); @@ -43,13 +43,13 @@ public class Lru_cache_tst { fxt.Test__get_y("c", "d", "e"); fxt.Test__get_n("a", "b"); } - @Test public void Set_repeatedly() { + @Test public void Set_repeatedly() { fxt.Exec__set("a", "a1", 10); fxt.Exec__set("a", "a2", 10); fxt.Exec__set("a", "a3", 10); fxt.Test__get_val("a", "a3"); } - @Test public void Set_bumps_priority() { + @Test public void Set_bumps_priority() { fxt.Exec__set("a", 2); fxt.Exec__set("b", 3); fxt.Exec__set("c", 2); @@ -58,14 +58,14 @@ public class Lru_cache_tst { fxt.Test__get_y("a", "d"); fxt.Test__get_n("b", "c"); } - @Test public void Del() { + @Test public void Del() { fxt.Exec__set("a", 2); fxt.Exec__set("b", 2); fxt.Exec__del("b"); fxt.Test__get_y("a"); fxt.Test__get_n("b"); } - @Test public void Clear() { + @Test public void Clear() { fxt.Exec__set("a", 2); fxt.Exec__set("b", 2); fxt.Exec__clear(); diff --git a/100_core/src/gplx/core/criterias/Criteria_ioItm_tst.java b/100_core/src/gplx/core/criterias/Criteria_ioItm_tst.java index c1bd2ec6b..0b56f7e62 100644 --- a/100_core/src/gplx/core/criterias/Criteria_ioItm_tst.java +++ b/100_core/src/gplx/core/criterias/Criteria_ioItm_tst.java @@ -1,40 +1,40 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.core.criterias; import gplx.*; import gplx.core.*; import org.junit.*; import gplx.core.ios.*; public class Criteria_ioItm_tst { IoItmFil fil; Criteria crt; IoItm_fxt fx = IoItm_fxt.new_(); - @Test public void IoType() { + @Test public void IoType() { crt = crt_(IoItm_base_.Prop_Type, Criteria_.eq_(IoItmFil.Type_Fil)); tst_Match(true, crt, fx.fil_wnt_("C:\\fil.txt")); tst_Match(false, crt, fx.dir_wnt_("C:\\dir")); } - @Test public void Ext() { + @Test public void Ext() { crt = crt_(IoItm_base_.Prop_Ext, Criteria_.eq_(".txt")); tst_Match(true, crt, fx.fil_wnt_("C:\\fil.txt")); tst_Match(false, crt, fx.fil_wnt_("C:\\fil.xml"), fx.fil_wnt_("C:\\fil.txt1"), fx.fil_wnt_("C:\\fil1.txt.xml"), fx.dir_wnt_("C:\\.txt")); } - @Test public void Modified() { + @Test public void Modified() { fil = fx.fil_wnt_("C:\\fil.txt"); crt = crt_(IoItmFil_.Prop_Modified, Criteria_.mte_(DateAdp_.parse_gplx("2001-01-01"))); tst_Match(true, crt, fil.ModifiedTime_(DateAdp_.parse_gplx("2001-01-02")), fil.ModifiedTime_(DateAdp_.parse_gplx("2001-01-01"))); tst_Match(false, crt, fil.ModifiedTime_(DateAdp_.parse_gplx("2000-12-31"))); } - @Test public void IoMatch() { + @Test public void IoMatch() { Criteria crt = Criteria_ioMatch.parse(true, "*.txt", false); CriteriaFxt fx_crt = new CriteriaFxt(); fx_crt.tst_Matches(crt, Io_url_.new_any_("file.txt")); diff --git a/100_core/src/gplx/core/criterias/Criteria_tst.java b/100_core/src/gplx/core/criterias/Criteria_tst.java index 5d6a4c7c0..fbd328ea4 100644 --- a/100_core/src/gplx/core/criterias/Criteria_tst.java +++ b/100_core/src/gplx/core/criterias/Criteria_tst.java @@ -1,22 +1,22 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.core.criterias; import gplx.*; import gplx.core.*; import org.junit.*; public class Criteria_tst { - @Test public void Equal() { + @Test public void Equal() { Criteria crt = Criteria_.eq_(true); fx.tst_Matches(crt, true); fx.tst_MatchesNot(crt, false); @@ -26,7 +26,7 @@ public class Criteria_tst { fx.tst_Matches(Criteria_.eq_("equal"), "equal"); fx.tst_Matches(Criteria_.eq_(date), date); } - @Test public void Not() { + @Test public void Not() { Criteria crt = Criteria_.eqn_(true); fx.tst_Matches(crt, false); fx.tst_MatchesNot(crt, true); @@ -36,7 +36,7 @@ public class Criteria_tst { fx.tst_Matches(Criteria_.eqn_("equal"), "not equal"); fx.tst_Matches(Criteria_.eqn_(date), date.Add_minute(1)); } - @Test public void MoreThan() { + @Test public void MoreThan() { Criteria crt = Criteria_.mt_(0); fx.tst_Matches(crt, 1, 2); fx.tst_MatchesNot(crt, 0, -1); @@ -47,21 +47,21 @@ public class Criteria_tst { fx.tst_Matches(Criteria_.mt_(date), date.Add_minute(1)); fx.tst_Matches(Criteria_.mt_(false), true); // MISC: thus truth is greater than falsehood } - @Test public void MoreThanEq() { + @Test public void MoreThanEq() { Criteria crt = Criteria_.mte_(0); fx.tst_Matches(crt, 0); } - @Test public void Less() { + @Test public void Less() { Criteria crt = Criteria_.lt_(0); fx.tst_Matches(crt, -1, -2); fx.tst_MatchesNot(crt, 0, 1); fx.tst_MatchesFail(crt, "-1"); } - @Test public void LessEq() { + @Test public void LessEq() { Criteria crt = Criteria_.lte_(0); fx.tst_Matches(crt, 0); } - @Test public void Between() { + @Test public void Between() { Criteria crt = Criteria_.between_(-1, 1); fx.tst_Matches(crt, 0, 1, -1); fx.tst_MatchesNot(crt, -2, 2); @@ -70,7 +70,7 @@ public class Criteria_tst { fx.tst_Matches(Criteria_.between_(1, -1), 0); // reverse range fx.tst_Matches(Criteria_.between_("a", "c"), "b"); } - @Test public void In() { + @Test public void In() { Criteria crt = Criteria_.in_(0, 1, 2); fx.tst_Matches(crt, 0, 1, 2); fx.tst_MatchesNot(crt, 3, -1); diff --git a/100_core/src/gplx/core/encoders/B85_fp__tst.java b/100_core/src/gplx/core/encoders/B85_fp__tst.java index f837e9584..251348ecb 100644 --- a/100_core/src/gplx/core/encoders/B85_fp__tst.java +++ b/100_core/src/gplx/core/encoders/B85_fp__tst.java @@ -13,17 +13,17 @@ The terms of each license can be found in the source code repository: GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt */ -package gplx.core.encoders; import gplx.*; import gplx.core.*; -import org.junit.*; -public class B85_fp__tst { - private final B85_fp__fxt fxt = new B85_fp__fxt(); - @Test public void Double_to_str() { - fxt.Test__to_str(.1d, "/\""); - } -} -class B85_fp__fxt { - public void Test__to_str(double val, String expd) { - byte[] actl = B85_fp_.To_bry(val); - Tfds.Eq_str(expd, String_.new_a7(actl)); - } -} +package gplx.core.encoders; import gplx.*; import gplx.core.*; +import org.junit.*; +public class B85_fp__tst { + private final B85_fp__fxt fxt = new B85_fp__fxt(); + @Test public void Double_to_str() { + fxt.Test__to_str(.1d, "/\""); + } +} +class B85_fp__fxt { + public void Test__to_str(double val, String expd) { + byte[] actl = B85_fp_.To_bry(val); + Tfds.Eq_str(expd, String_.new_a7(actl)); + } +} diff --git a/100_core/src/gplx/core/encoders/Base85__tst.java b/100_core/src/gplx/core/encoders/Base85__tst.java index b5f2e238c..e572fc1ca 100644 --- a/100_core/src/gplx/core/encoders/Base85__tst.java +++ b/100_core/src/gplx/core/encoders/Base85__tst.java @@ -1,23 +1,23 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.core.encoders; import gplx.*; import gplx.core.*; import org.junit.*; public class Base85__tst { private final Base85__fxt fxt = new Base85__fxt(); - @Test public void Log() { + @Test public void Log() { fxt.Test_log( 0, 1); fxt.Test_log( 84, 1); fxt.Test_log( 85, 2); @@ -29,7 +29,7 @@ public class Base85__tst { fxt.Test_log( 52200625, 5); fxt.Test_log(Int_.Max_value, 5); } - @Test public void To_str() { + @Test public void To_str() { fxt.Test_to_str( 0, "!"); fxt.Test_to_str( 84, "u"); fxt.Test_to_str( 85, "\"!"); @@ -40,7 +40,7 @@ public class Base85__tst { fxt.Test_to_str( 52200624, "uuuu"); fxt.Test_to_str( 52200625, "\"!!!!"); } - @Test public void XtoStrAry() { + @Test public void XtoStrAry() { byte[] ary = new byte[9]; fxt.Exec_to_str(ary, 0, 2); // !!# fxt.Exec_to_str(ary, 3, 173); // !#$ diff --git a/100_core/src/gplx/core/encoders/Hex_utl__tst.java b/100_core/src/gplx/core/encoders/Hex_utl__tst.java index ca414e615..ad5fbb0b2 100644 --- a/100_core/src/gplx/core/encoders/Hex_utl__tst.java +++ b/100_core/src/gplx/core/encoders/Hex_utl__tst.java @@ -1,23 +1,23 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.core.encoders; import gplx.*; import gplx.core.*; import org.junit.*; import gplx.core.tests.*; public class Hex_utl__tst { private final Hex_utl__fxt fxt = new Hex_utl__fxt(); - @Test public void To_int() { + @Test public void To_int() { fxt.Test__to_int("0" , 0); fxt.Test__to_int("F" , 15); fxt.Test__to_int("0F" , 15); @@ -29,7 +29,7 @@ public class Hex_utl__tst { fxt.Test__to_int("7FFFFFFF" , Int_.Max_value); fxt.Test__to_int_bry("100" , 256); } - @Test public void To_str() { + @Test public void To_str() { fxt.Test__to_str(0 , "0"); fxt.Test__to_str(15 , "F"); fxt.Test__to_str(16 , "10"); @@ -40,11 +40,11 @@ public class Hex_utl__tst { fxt.Test__to_str(15, 2 , "0F"); fxt.Test__to_str(15, 3 , "00F"); } - @Test public void Write() { + @Test public void Write() { fxt.Test__write("[00000000]", 1, 9, 15, "[0000000F]"); fxt.Test__write("[00000000]", 1, 9, 255, "[000000FF]"); } - @Test public void Write_bfr() { + @Test public void Write_bfr() { fxt.Test__write_bfr(Bool_.Y, 0, "0"); fxt.Test__write_bfr(Bool_.Y, 15, "f"); fxt.Test__write_bfr(Bool_.Y, 16, "10"); @@ -53,7 +53,7 @@ public class Hex_utl__tst { fxt.Test__write_bfr(Bool_.Y, 256, "100"); fxt.Test__write_bfr(Bool_.Y, Int_.Max_value, "7fffffff"); } - @Test public void Encode() { + @Test public void Encode() { fxt.Test__parse_hex_to_bry("E2A7BC", 226, 167, 188); } } diff --git a/100_core/src/gplx/core/envs/Env_.java b/100_core/src/gplx/core/envs/Env_.java index 536d8c8f0..a2ed07285 100644 --- a/100_core/src/gplx/core/envs/Env_.java +++ b/100_core/src/gplx/core/envs/Env_.java @@ -1,6 +1,6 @@ /* XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com +Copyright (C) 2012-2021 gnosygnu@gmail.com XOWA is licensed under the terms of the General Public License (GPL) Version 3, or alternatively under the terms of the Apache License Version 2.0. @@ -13,34 +13,44 @@ The terms of each license can be found in the source code repository: GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt */ -package gplx.core.envs; import gplx.*; import gplx.core.*; -public class Env_ { - public static void Init(String[] args, String appNameAndExt, Class type) { - mode_testing = false; - mode_debug = String_.In("GPLX_DEBUG_MODE_ENABLED", args); - appArgs = args; - appUrl = Jar_adp_.Url_type(type).OwnerDir().GenSubFil(appNameAndExt); - } - public static void Init_swt(String[] args, Class type) { // DATE:2014-06-23 - mode_testing = false; - mode_debug = String_.In("GPLX_DEBUG_MODE_ENABLED", args); - appArgs = args; - appUrl = Jar_adp_.Url_type(type); - } - public static void Init_drd() { - mode_testing = mode_debug = false; - } - public static void Init_testing() {mode_testing = true;} - public static void Init_testing_n_() {mode_testing = false;} - public static boolean Mode_testing() {return mode_testing;} private static boolean mode_testing = true; - public static boolean Mode_debug() {return mode_debug;} private static boolean mode_debug = false; - public static String[] AppArgs() {return appArgs;} static String[] appArgs; - public static Io_url AppUrl() { - if (mode_testing) return Io_url_.mem_fil_("mem/testing.jar"); - if (appUrl == Io_url_.Empty) throw Err_.new_wo_type("Env_.Init was not called"); - return appUrl; - } static Io_url appUrl = Io_url_.Empty; - - public static final String LocalHost = "127.0.0.1"; - public static String NewLine_lang() {return mode_testing ? "\n" : "\n";} -} +package gplx.core.envs; +import gplx.Err_; +import gplx.Io_url; +import gplx.Io_url_; +import gplx.String_; +public class Env_ { + public static void Init(String[] args, String appNameAndExt, Class type) { + mode_testing = false; + mode_debug = String_.In("GPLX_DEBUG_MODE_ENABLED", args); + appArgs = args; + appUrl = Jar_adp_.Url_type(type).OwnerDir().GenSubFil(appNameAndExt); + } + public static void Init_swt(String[] args, Class type) { // DATE:2014-06-23 + mode_testing = false; + mode_debug = String_.In("GPLX_DEBUG_MODE_ENABLED", args); + appArgs = args; + appUrl = Jar_adp_.Url_type(type); + } + public static void Init_cmd(String[] args, Io_url url) { + mode_testing = false; + mode_debug = String_.In("GPLX_DEBUG_MODE_ENABLED", args); + appArgs = args; + appUrl = url; + } + public static void Init_drd() { + mode_testing = mode_debug = false; + } + public static void Init_testing() {mode_testing = true;} + public static void Init_testing_n_() {mode_testing = false;} + public static boolean Mode_testing() {return mode_testing;} private static boolean mode_testing = true; + public static boolean Mode_debug() {return mode_debug;} private static boolean mode_debug = false; + public static String[] AppArgs() {return appArgs;} static String[] appArgs; + public static Io_url AppUrl() { + if (mode_testing) return Io_url_.mem_fil_("mem/testing.jar"); + if (appUrl == Io_url_.Empty) throw Err_.new_wo_type("Env_.Init was not called"); + return appUrl; + } static Io_url appUrl = Io_url_.Empty; + + public static final String LocalHost = "127.0.0.1"; + public static String NewLine_lang() {return mode_testing ? "\n" : "\n";} +} diff --git a/100_core/src/gplx/core/envs/Process_adp_tst.java b/100_core/src/gplx/core/envs/Process_adp_tst.java index d0aad74b6..b757811e7 100644 --- a/100_core/src/gplx/core/envs/Process_adp_tst.java +++ b/100_core/src/gplx/core/envs/Process_adp_tst.java @@ -13,18 +13,18 @@ The terms of each license can be found in the source code repository: GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt */ -package gplx.core.envs; import gplx.*; import gplx.core.*; -import org.junit.*; -public class Process_adp_tst { - private Process_adp_fxt fxt = new Process_adp_fxt(); - @Test public void Escape_ampersands_if_process_is_cmd() { - fxt.Test_Escape_ampersands_if_process_is_cmd(Bool_.Y, "cmd" , "/c \"http://a.org?b=c&d=e\"", "/c \"http://a.org?b=c^&d=e\""); - fxt.Test_Escape_ampersands_if_process_is_cmd(Bool_.Y, "cmd1", "/c \"http://a.org?b=c&d=e\"", "/c \"http://a.org?b=c&d=e\""); - fxt.Test_Escape_ampersands_if_process_is_cmd(Bool_.N, "cmd" , "/c \"http://a.org?b=c&d=e\"", "/c \"http://a.org?b=c&d=e\""); - } -} -class Process_adp_fxt { - public void Test_Escape_ampersands_if_process_is_cmd(boolean os_is_wnt, String exe_url, String exe_args, String expd) { - Tfds.Eq(expd, Process_adp.Escape_ampersands_if_process_is_cmd(os_is_wnt, exe_url, exe_args)); - } -} +package gplx.core.envs; import gplx.*; import gplx.core.*; +import org.junit.*; +public class Process_adp_tst { + private Process_adp_fxt fxt = new Process_adp_fxt(); + @Test public void Escape_ampersands_if_process_is_cmd() { + fxt.Test_Escape_ampersands_if_process_is_cmd(Bool_.Y, "cmd" , "/c \"http://a.org?b=c&d=e\"", "/c \"http://a.org?b=c^&d=e\""); + fxt.Test_Escape_ampersands_if_process_is_cmd(Bool_.Y, "cmd1", "/c \"http://a.org?b=c&d=e\"", "/c \"http://a.org?b=c&d=e\""); + fxt.Test_Escape_ampersands_if_process_is_cmd(Bool_.N, "cmd" , "/c \"http://a.org?b=c&d=e\"", "/c \"http://a.org?b=c&d=e\""); + } +} +class Process_adp_fxt { + public void Test_Escape_ampersands_if_process_is_cmd(boolean os_is_wnt, String exe_url, String exe_args, String expd) { + Tfds.Eq(expd, Process_adp.Escape_ampersands_if_process_is_cmd(os_is_wnt, exe_url, exe_args)); + } +} diff --git a/100_core/src/gplx/core/gfo_regys/GfoRegy_RegDir_tst.java b/100_core/src/gplx/core/gfo_regys/GfoRegy_RegDir_tst.java index 81cfeff7f..f0d5c9137 100644 --- a/100_core/src/gplx/core/gfo_regys/GfoRegy_RegDir_tst.java +++ b/100_core/src/gplx/core/gfo_regys/GfoRegy_RegDir_tst.java @@ -1,18 +1,18 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.core.gfo_regys; import gplx.*; import gplx.core.*; import org.junit.*; public class GfoRegy_RegDir_tst { @@ -21,7 +21,7 @@ public class GfoRegy_RegDir_tst { Io_mgr.Instance.InitEngine_mem(); root = Io_url_.mem_dir_("mem/root"); } GfoRegy regy; Io_url root; - @Test public void Basic() { + @Test public void Basic() { ini_fil("101_tsta.txt"); ini_fil("102_tstb.txt"); ini_fil("103_tstc.png"); @@ -31,20 +31,20 @@ public class GfoRegy_RegDir_tst { tst_Exists("tsta"); tst_Exists("tstb"); } - @Test public void Err_dupe() { + @Test public void Err_dupe() { ini_fil("101_tsta.txt"); ini_fil("102_tsta.txt"); try {regy.RegDir(root, "*.txt", false, "_", ".");} catch (Exception e) {Tfds.Err_has(e, GfoRegy.Err_Dupe); return;} Tfds.Fail_expdError(); } - @Test public void Err_chopBgn() { + @Test public void Err_chopBgn() { ini_fil("123_"); try {regy.RegDir(root, "*", false, "_", ".");} catch (Exception e) {Tfds.Err_has(e, GfoRegy.Err_ChopBgn); return;} Tfds.Fail_expdError(); } - @Test public void Err_chopEnd() { + @Test public void Err_chopEnd() { ini_fil(".txt"); try {regy.RegDir(root, "*.txt", false, "_", ".");} catch (Exception e) {Tfds.Err_has(e, GfoRegy.Err_ChopEnd); return;} diff --git a/100_core/src/gplx/core/gfo_regys/GfoRegy_basic_tst.java b/100_core/src/gplx/core/gfo_regys/GfoRegy_basic_tst.java index 5ffb383f3..167aceb31 100644 --- a/100_core/src/gplx/core/gfo_regys/GfoRegy_basic_tst.java +++ b/100_core/src/gplx/core/gfo_regys/GfoRegy_basic_tst.java @@ -13,17 +13,17 @@ The terms of each license can be found in the source code repository: GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt */ -package gplx.core.gfo_regys; import gplx.*; import gplx.core.*; -import org.junit.*; -public class GfoRegy_basic_tst { - @Before public void setup() { - regy = GfoRegy.new_(); - } GfoRegy regy; - @Test public void RegObjByType() { - regy.Parsers().Add("Io_url", Io_url_.Parser); - Io_url expd = Io_url_.new_any_("C:\\fil.txt"); - regy.RegObjByType("test", expd.Xto_api(), "Io_url"); - Io_url actl = (Io_url)regy.FetchValOr("test", Io_url_.Empty); - Tfds.Eq(expd.Xto_api(), actl.Xto_api()); - } -} +package gplx.core.gfo_regys; import gplx.*; import gplx.core.*; +import org.junit.*; +public class GfoRegy_basic_tst { + @Before public void setup() { + regy = GfoRegy.new_(); + } GfoRegy regy; + @Test public void RegObjByType() { + regy.Parsers().Add("Io_url", Io_url_.Parser); + Io_url expd = Io_url_.new_any_("C:\\fil.txt"); + regy.RegObjByType("test", expd.Xto_api(), "Io_url"); + Io_url actl = (Io_url)regy.FetchValOr("test", Io_url_.Empty); + Tfds.Eq(expd.Xto_api(), actl.Xto_api()); + } +} diff --git a/100_core/src/gplx/core/interfaces/SrlAble__tst.java b/100_core/src/gplx/core/interfaces/SrlAble__tst.java index 118756e9e..ec744d284 100644 --- a/100_core/src/gplx/core/interfaces/SrlAble__tst.java +++ b/100_core/src/gplx/core/interfaces/SrlAble__tst.java @@ -1,29 +1,29 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.core.interfaces; import gplx.*; import gplx.core.*; import org.junit.*; public class SrlAble__tst { - @Test public void Basic() { + @Test public void Basic() { tst_Srl_ ( GfoMsg_.new_cast_("itm").Add("key", "a").Add("val", 1) , "itm:key='a' val='1';" ); } - @Test public void Depth1_1() { + @Test public void Depth1_1() { tst_Srl_ ( GfoMsg_.new_cast_("itm").Add("key", "a").Add("val", 1).Subs_ ( GfoMsg_.new_cast_("itm").Add("key", "aa").Add("val", 11) @@ -33,7 +33,7 @@ public class SrlAble__tst { ) ); } - @Test public void Depth1_2() { + @Test public void Depth1_2() { tst_Srl_ ( GfoMsg_.new_cast_("itm").Add("key", "a").Add("val", 1).Subs_ ( GfoMsg_.new_cast_("itm").Add("key", "aa").Add("val", 11) @@ -47,7 +47,7 @@ public class SrlAble__tst { ) ); } - @Test public void Depth1_1_2() { + @Test public void Depth1_1_2() { tst_Srl_ ( GfoMsg_.new_cast_("itm").Add("key", "a").Add("val", 1).Subs_ ( GfoMsg_.new_cast_("itm").Add("key", "aa").Add("val", 11).Subs_( diff --git a/100_core/src/gplx/core/intls/Utf16__tst.java b/100_core/src/gplx/core/intls/Utf16__tst.java index 15a8fe573..f20cfe68a 100644 --- a/100_core/src/gplx/core/intls/Utf16__tst.java +++ b/100_core/src/gplx/core/intls/Utf16__tst.java @@ -1,35 +1,35 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.core.intls; import gplx.*; import gplx.core.*; import org.junit.*; import gplx.core.primitives.*; public class Utf16__tst { private Utf16__fxt fxt = new Utf16__fxt(); - @Test public void Encode_decode() { + @Test public void Encode_decode() { fxt.Test_encode_decode(162, 194, 162); // cent; ¢ fxt.Test_encode_decode(8364, 226, 130, 172); // euro; € fxt.Test_encode_decode(150370, 240, 164, 173, 162); // example from [[UTF-8]]; should be encoded as two bytes; 𤭢 fxt.Test_encode_decode(143489, 240, 163, 130, 129); // EX: 駣𣂁脁 DATE:2017-04-22; 𣂁 } - @Test public void Encode_as_bry_by_hex() { + @Test public void Encode_as_bry_by_hex() { fxt.Test_Encode_hex_to_bry("00", 0); fxt.Test_Encode_hex_to_bry("41", 65); fxt.Test_Encode_hex_to_bry("0041", 65); fxt.Test_Encode_hex_to_bry("00C0", 195, 128); } - @Test public void Surrogate() { + @Test public void Surrogate() { fxt.Test_surrogate(0x64321, 0xD950, 0xDF21); // example from w:UTF-16 fxt.Test_surrogate(66643, 55297, 56403); // example from d:Boomerang } diff --git a/100_core/src/gplx/core/intls/Utf8__tst.java b/100_core/src/gplx/core/intls/Utf8__tst.java index 5d32c1488..dc652bed8 100644 --- a/100_core/src/gplx/core/intls/Utf8__tst.java +++ b/100_core/src/gplx/core/intls/Utf8__tst.java @@ -1,36 +1,36 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.core.intls; import gplx.*; import gplx.core.*; import org.junit.*; public class Utf8__tst { private Utf8__fxt fxt = new Utf8__fxt(); - @Test public void Get_prv_char_pos0() { + @Test public void Get_prv_char_pos0() { fxt.Test__Get_prv_char_pos0("abcd", 3); // len=1; (note that bry.len = 4) fxt.Test__Get_prv_char_pos0("a", 0); // len=1; short-String fxt.Test__Get_prv_char_pos0("abc¢", 3); // len=2; (note that bry.len = 5) fxt.Test__Get_prv_char_pos0("abc€", 3); // len=3; (note that bry.len = 6) fxt.Test__Get_prv_char_pos0("abc" + String_.new_u8(Byte_.Ary_by_ints(240, 164, 173, 162)), 3); // len=4; (note that bry.len = 7) } - @Test public void Increment_char_at_last_pos() { + @Test public void Increment_char_at_last_pos() { fxt.Test_Increment_char_at_last_pos("a", "b"); fxt.Test_Increment_char_at_last_pos("abc", "abd"); fxt.Test_Increment_char_at_last_pos("É", "Ê"); // len=2 fxt.Test_Increment_char_at_last_pos("€", "₭"); // len=3 } -// @Test public void Increment_char_at_last_pos_exhaustive_check() { // check all values; commented for perf +// @Test public void Increment_char_at_last_pos_exhaustive_check() { // check all values; commented for perf // Bry_bfr bfr = Bry_bfr_.New(); // int bgn = 32; // while (true) { diff --git a/100_core/src/gplx/core/ios/IoUrlTypeRegy.java b/100_core/src/gplx/core/ios/IoUrlTypeRegy.java index 13c36aa2b..df775e9cc 100644 --- a/100_core/src/gplx/core/ios/IoUrlTypeRegy.java +++ b/100_core/src/gplx/core/ios/IoUrlTypeRegy.java @@ -1,20 +1,28 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ -package gplx.core.ios; import gplx.*; import gplx.core.*; -import gplx.core.strings.*; import gplx.langs.gfs.*; +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ +package gplx.core.ios; import gplx.GfoMsg; +import gplx.Gfo_invk; +import gplx.Gfo_invk_; +import gplx.GfsCtx; +import gplx.Ordered_hash; +import gplx.Ordered_hash_; +import gplx.UsrDlg_; +import gplx.UsrMsg; +import gplx.core.strings.String_bldr; +import gplx.core.strings.String_bldr_; public class IoUrlTypeRegy implements Gfo_invk { public String[] FetchAryOr(String key, String... or) { IoUrlTypeGrp itm = (IoUrlTypeGrp)hash.Get_by(key); @@ -52,7 +60,7 @@ class IoUrlTypeGrp implements Gfo_invk { for (int i = 0; i < m.Args_count(); i++) { String s = m.ReadStr("v"); if (list.Has(s)) { - ctx.Write_warn(UsrMsg.new_("itm already has filter").Add("key", key).Add("filter", s).To_str()); + UsrDlg_.Instance.Warn(UsrMsg.new_("itm already has filter").Add("key", key).Add("filter", s).To_str()); list.Del(s); } list.Add(s, s); diff --git a/100_core/src/gplx/core/ios/IoZipWkr_tst.java b/100_core/src/gplx/core/ios/IoZipWkr_tst.java index a2269374c..1087f3bdc 100644 --- a/100_core/src/gplx/core/ios/IoZipWkr_tst.java +++ b/100_core/src/gplx/core/ios/IoZipWkr_tst.java @@ -13,14 +13,14 @@ The terms of each license can be found in the source code repository: GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt */ -package gplx.core.ios; import gplx.*; import gplx.core.*; -import org.junit.*; -public class IoZipWkr_tst { - @Test public void Basic() { - wkr = IoZipWkr.new_(Io_url_.Empty, "e \"{0}\" -o\"{1}\" -y"); - tst_Expand_genCmdString(Io_url_.wnt_fil_("C:\\fil1.zip"), Io_url_.wnt_dir_("D:\\out\\"), "e \"C:\\fil1.zip\" -o\"D:\\out\" -y"); // NOTE: not "D:\out\" because .Xto_api - } IoZipWkr wkr; - void tst_Expand_genCmdString(Io_url srcUrl, Io_url trgUrl, String expd) { - Tfds.Eq(expd, wkr.Expand_genCmdString(srcUrl, trgUrl)); - } -} +package gplx.core.ios; import gplx.*; import gplx.core.*; +import org.junit.*; +public class IoZipWkr_tst { + @Test public void Basic() { + wkr = IoZipWkr.new_(Io_url_.Empty, "e \"{0}\" -o\"{1}\" -y"); + tst_Expand_genCmdString(Io_url_.wnt_fil_("C:\\fil1.zip"), Io_url_.wnt_dir_("D:\\out\\"), "e \"C:\\fil1.zip\" -o\"D:\\out\" -y"); // NOTE: not "D:\out\" because .Xto_api + } IoZipWkr wkr; + void tst_Expand_genCmdString(Io_url srcUrl, Io_url trgUrl, String expd) { + Tfds.Eq(expd, wkr.Expand_genCmdString(srcUrl, trgUrl)); + } +} diff --git a/100_core/src/gplx/core/ios/Io_download_fmt_tst.java b/100_core/src/gplx/core/ios/Io_download_fmt_tst.java index 93659a9d4..198cc0d45 100644 --- a/100_core/src/gplx/core/ios/Io_download_fmt_tst.java +++ b/100_core/src/gplx/core/ios/Io_download_fmt_tst.java @@ -1,24 +1,24 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.core.ios; import gplx.*; import gplx.core.*; import org.junit.*; import gplx.core.envs.*; public class Io_download_fmt_tst { Io_download_fmt_fxt fxt = new Io_download_fmt_fxt(); @Before public void init() {fxt.Clear();} - @Test public void Fmt() { + @Test public void Fmt() { fxt.Clear().Ini("downloading ~{src_name}: ~{prog_left} left (@ ~{prog_rate}); ~{prog_done} of ~{src_len} (~{prog_pct}%)", "http://a.org/b.png", Io_mgr.Len_kb * 10); fxt.Now_add_f(1000).Prog_done_(1 * Io_mgr.Len_kb).Prog_pct_(1 * 1000).Prog_rate_(Io_mgr.Len_kb).Prog_left_(9 * 1000) .Prog_msg_("downloading b.png: 09s left (@ 1.000 KBps); 1.000 KB of 10.000 KB (10.00%)") @@ -32,7 +32,7 @@ public class Io_download_fmt_tst { .Download_(Io_mgr.Len_kb) ; } - @Test public void Tilde() { + @Test public void Tilde() { fxt.Clear().Ini("a~b", "http://a.org/b.png", Io_mgr.Len_kb * 10); } } diff --git a/100_core/src/gplx/core/ios/Io_size__tst.java b/100_core/src/gplx/core/ios/Io_size__tst.java index 3c1aa7779..f8bfb7d3c 100644 --- a/100_core/src/gplx/core/ios/Io_size__tst.java +++ b/100_core/src/gplx/core/ios/Io_size__tst.java @@ -1,23 +1,23 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.core.ios; import gplx.*; import gplx.core.*; import org.junit.*; public class Io_size__tst { private Io_size__fxt fxt = new Io_size__fxt(); - @Test public void XtoLong() { + @Test public void XtoLong() { fxt.Test_XtoLong("1", 1); fxt.Test_XtoLong("1 KB", 1024); fxt.Test_XtoLong("1 MB", 1024 * 1024); @@ -32,21 +32,21 @@ public class Io_size__tst { // fxt.Test_XtoLongFail("1.1"); // DELETED:do not check for fractional bytes; EX: 10.7 GB DATE:2015-01-06 // fxt.Test_XtoLongFail("1.51 kb"); } - @Test public void To_str() { + @Test public void To_str() { fxt.Test_XtoStr(1, "1.000 B"); fxt.Test_XtoStr(1024, "1.000 KB"); fxt.Test_XtoStr(1536, "1.500 KB"); fxt.Test_XtoStr(1024 * 1024, "1.000 MB"); fxt.Test_XtoStr(1016, "1,016.000 B"); // NOTE: 1016 is not 1.016 KB } - @Test public void Xto_str_full() { + @Test public void Xto_str_full() { fxt.Test_Xto_str( 500, 1, "#,###", " ", Bool_.Y, "1 KB"); fxt.Test_Xto_str( 1000, 1, "#,###", " ", Bool_.Y, "1 KB"); fxt.Test_Xto_str( 2000, 1, "#,###", " ", Bool_.Y, "2 KB"); fxt.Test_Xto_str( 1234567, 1, "#,###", " ", Bool_.Y, "1,206 KB"); fxt.Test_Xto_str(1234567890, 1, "#,###", " ", Bool_.Y, "1,205,633 KB"); } - @Test public void EqualsTest() { + @Test public void EqualsTest() { fxt.Test_Equals("1", "1"); fxt.Test_Equals("1 kb", "1 kb"); fxt.Test_Equals("1024", "1 kb"); @@ -54,18 +54,18 @@ public class Io_size__tst { fxt.Test_Equals("1024 kb", "1 mb"); fxt.Test_Equals("1.5 kb", "1536 b"); } - @Test public void To_str_new___b___0() {fxt.Test__to_str_new( 0, 2, "0 B");} - @Test public void To_str_new___b___1() {fxt.Test__to_str_new( 1, 2, "1 B");} - @Test public void To_str_new__kb___1_501__1() {fxt.Test__to_str_new( 1538, 1, "1.5 KB");} - @Test public void To_str_new__kb___1_501__2() {fxt.Test__to_str_new( 1538, 2, "1.50 KB");} - @Test public void To_str_new__kb___1_501__3() {fxt.Test__to_str_new( 1538, 3, "1.501 KB");} - @Test public void To_str_new__kb___1_512__1() {fxt.Test__to_str_new( 1549, 1, "1.5 KB");} - @Test public void To_str_new__kb___1_512__2() {fxt.Test__to_str_new( 1549, 2, "1.51 KB");} - @Test public void To_str_new__kb___1_512__3() {fxt.Test__to_str_new( 1549, 3, "1.512 KB");} - @Test public void To_str_new__mb___1_512__1() {fxt.Test__to_str_new((1024 * 1024) + 536871, 1, "1.5 MB");} - @Test public void To_str_new__mb___1_512__2() {fxt.Test__to_str_new((1024 * 1024) + 536871, 2, "1.51 MB");} - @Test public void To_str_new__mb___1_512__3() {fxt.Test__to_str_new((1024 * 1024) + 536871, 3, "1.512 MB");} - @Test public void To_str_new__gb___1() {fxt.Test__to_str_new(1819264175, 2, "1.69 GB");} + @Test public void To_str_new___b___0() {fxt.Test__to_str_new( 0, 2, "0 B");} + @Test public void To_str_new___b___1() {fxt.Test__to_str_new( 1, 2, "1 B");} + @Test public void To_str_new__kb___1_501__1() {fxt.Test__to_str_new( 1538, 1, "1.5 KB");} + @Test public void To_str_new__kb___1_501__2() {fxt.Test__to_str_new( 1538, 2, "1.50 KB");} + @Test public void To_str_new__kb___1_501__3() {fxt.Test__to_str_new( 1538, 3, "1.501 KB");} + @Test public void To_str_new__kb___1_512__1() {fxt.Test__to_str_new( 1549, 1, "1.5 KB");} + @Test public void To_str_new__kb___1_512__2() {fxt.Test__to_str_new( 1549, 2, "1.51 KB");} + @Test public void To_str_new__kb___1_512__3() {fxt.Test__to_str_new( 1549, 3, "1.512 KB");} + @Test public void To_str_new__mb___1_512__1() {fxt.Test__to_str_new((1024 * 1024) + 536871, 1, "1.5 MB");} + @Test public void To_str_new__mb___1_512__2() {fxt.Test__to_str_new((1024 * 1024) + 536871, 2, "1.51 MB");} + @Test public void To_str_new__mb___1_512__3() {fxt.Test__to_str_new((1024 * 1024) + 536871, 3, "1.512 MB");} + @Test public void To_str_new__gb___1() {fxt.Test__to_str_new(1819264175, 2, "1.69 GB");} } class Io_size__fxt { public void Test_XtoLong(String raw, long expd) {Tfds.Eq(expd, Io_size_.parse_or(raw, Long_.Min_value));} diff --git a/100_core/src/gplx/core/ios/streams/IoStream_mem_tst.java b/100_core/src/gplx/core/ios/streams/IoStream_mem_tst.java index bceed5e8d..726cc0aa9 100644 --- a/100_core/src/gplx/core/ios/streams/IoStream_mem_tst.java +++ b/100_core/src/gplx/core/ios/streams/IoStream_mem_tst.java @@ -13,16 +13,16 @@ The terms of each license can be found in the source code repository: GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt */ -package gplx.core.ios.streams; import gplx.*; import gplx.core.*; import gplx.core.ios.*; -import org.junit.*; //using System.IO; /*Stream*/ -public class IoStream_mem_tst { - @Test public void Write() { // confirm that changes written to Stream acquired via .AdpObj are written to IoStream_mem.Buffer - IoStream_mem stream = IoStream_mem.wtr_data_(Io_url_.Empty, 0); - byte[] data = Bry_.New_by_ints(1); - stream.Write(data, 0, Array_.Len(data)); - - Tfds.Eq(1L , stream.Len()); - Tfds.Eq((byte)1 , stream.Buffer()[0]); - stream.Rls(); - } -} +package gplx.core.ios.streams; import gplx.*; import gplx.core.*; import gplx.core.ios.*; +import org.junit.*; //using System.IO; /*Stream*/ +public class IoStream_mem_tst { + @Test public void Write() { // confirm that changes written to Stream acquired via .AdpObj are written to IoStream_mem.Buffer + IoStream_mem stream = IoStream_mem.wtr_data_(Io_url_.Empty, 0); + byte[] data = Bry_.New_by_ints(1); + stream.Write(data, 0, Array_.Len(data)); + + Tfds.Eq(1L , stream.Len()); + Tfds.Eq((byte)1 , stream.Buffer()[0]); + stream.Rls(); + } +} diff --git a/100_core/src/gplx/core/ios/streams/IoStream_mock_tst.java b/100_core/src/gplx/core/ios/streams/IoStream_mock_tst.java index fc04c7a95..28227cbc1 100644 --- a/100_core/src/gplx/core/ios/streams/IoStream_mock_tst.java +++ b/100_core/src/gplx/core/ios/streams/IoStream_mock_tst.java @@ -1,27 +1,27 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.core.ios.streams; import gplx.*; import gplx.core.*; import gplx.core.ios.*; import org.junit.*; public class IoStream_mock_tst { @Before public void init() {fxt.Clear();} IoStream_mock_fxt fxt = new IoStream_mock_fxt(); - @Test public void Basic() { + @Test public void Basic() { fxt.Init_src_str_("abcde").Init_trg_len_(5).Init_rdr_limit_(2).Init_read_len_(2); fxt.Test_read("ab").Test_read("cd").Test_read("e"); } - @Test public void Read_limit() { + @Test public void Read_limit() { fxt.Init_src_str_("abcde").Init_trg_len_(5).Init_rdr_limit_(2).Init_read_len_(4); fxt.Test_read("ab").Test_read("cd").Test_read("e"); } diff --git a/100_core/src/gplx/core/ios/streams/Io_stream_rdr__tst.java b/100_core/src/gplx/core/ios/streams/Io_stream_rdr__tst.java index 32e5d1350..94c403e21 100644 --- a/100_core/src/gplx/core/ios/streams/Io_stream_rdr__tst.java +++ b/100_core/src/gplx/core/ios/streams/Io_stream_rdr__tst.java @@ -1,24 +1,24 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.core.ios.streams; import gplx.*; import gplx.core.*; import gplx.core.ios.*; import org.junit.*; public class Io_stream_rdr__tst { @Before public void init() {fxt.Clear();} private Io_stream_rdr__fxt fxt = new Io_stream_rdr__fxt(); @After public void term() {fxt.Rls();} - @Test public void Bz2_read() { + @Test public void Bz2_read() { fxt .Init_stream("abcd") // read everything at once .Expd_bytes_read(4).Test_read(0, 4, "abcd"); fxt .Init_stream("abcd") // read in steps diff --git a/100_core/src/gplx/core/ios/zips/Io_zip_mgr_tst.java b/100_core/src/gplx/core/ios/zips/Io_zip_mgr_tst.java index 113d73ba7..ded7d4e92 100644 --- a/100_core/src/gplx/core/ios/zips/Io_zip_mgr_tst.java +++ b/100_core/src/gplx/core/ios/zips/Io_zip_mgr_tst.java @@ -13,17 +13,17 @@ The terms of each license can be found in the source code repository: GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt */ -package gplx.core.ios.zips; import gplx.*; import gplx.core.*; import gplx.core.ios.*; -import org.junit.*; -public class Io_zip_mgr_tst { - @Test public void Zip_unzip() { - Zip_unzip_tst("abcdefghijklmnopqrstuvwxyz"); - } - private void Zip_unzip_tst(String s) { - Io_zip_mgr zip_mgr = Io_zip_mgr_base.Instance; - byte[] src = Bry_.new_a7(s); - byte[] zip = zip_mgr.Zip_bry(src, 0, src.length); - byte[] unz = zip_mgr.Unzip_bry(zip, 0, zip.length); - Tfds.Eq_ary(src, unz); - } -} +package gplx.core.ios.zips; import gplx.*; import gplx.core.*; import gplx.core.ios.*; +import org.junit.*; +public class Io_zip_mgr_tst { + @Test public void Zip_unzip() { + Zip_unzip_tst("abcdefghijklmnopqrstuvwxyz"); + } + private void Zip_unzip_tst(String s) { + Io_zip_mgr zip_mgr = Io_zip_mgr_base.Instance; + byte[] src = Bry_.new_a7(s); + byte[] zip = zip_mgr.Zip_bry(src, 0, src.length); + byte[] unz = zip_mgr.Unzip_bry(zip, 0, zip.length); + Tfds.Eq_ary(src, unz); + } +} diff --git a/100_core/src/gplx/core/js/Js_wtr_tst.java b/100_core/src/gplx/core/js/Js_wtr_tst.java index b4d3053db..ea72719c7 100644 --- a/100_core/src/gplx/core/js/Js_wtr_tst.java +++ b/100_core/src/gplx/core/js/Js_wtr_tst.java @@ -1,23 +1,23 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.core.js; import gplx.*; import gplx.core.*; import org.junit.*; public class Js_wtr_tst { @Before public void Init() {fxt.Clear();} private Js_wtr_fxt fxt = new Js_wtr_fxt(); - @Test public void Basic() { + @Test public void Basic() { fxt.Test_write_val_html("abc" , "'abc'"); fxt.Test_write_val_html("a'b" , "'a\\'b'"); fxt.Test_write_val_html("a\"b" , "'a\\\"b'"); diff --git a/100_core/src/gplx/core/lists/List_adp_sorter_tst.java b/100_core/src/gplx/core/lists/List_adp_sorter_tst.java index 5eca0abe3..8bdb9c3cf 100644 --- a/100_core/src/gplx/core/lists/List_adp_sorter_tst.java +++ b/100_core/src/gplx/core/lists/List_adp_sorter_tst.java @@ -1,27 +1,27 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.core.lists; import gplx.*; import gplx.core.*; import org.junit.*; public class List_adp_sorter_tst { - @Test public void Basic() { + @Test public void Basic() { Object[] src = new Object[] {0,8,1,7,2,6,3,5,4}; List_adp_sorter.new_().Sort(src, src.length); Tfds.Eq_ary(src, Sequential(0, 8)); } - @Test public void Basic2() { + @Test public void Basic2() { Object[] src = new Object[] {"0","8","1","7","2","6","3","5","4"}; List_adp_sorter.new_().Sort(src, src.length); Tfds.Eq_ary(src, new Object[] {"0","1","2","3","4","5","6","7","8"}); diff --git a/100_core/src/gplx/core/lists/StackAdp_tst.java b/100_core/src/gplx/core/lists/StackAdp_tst.java index 99a367b26..c3a82e5f9 100644 --- a/100_core/src/gplx/core/lists/StackAdp_tst.java +++ b/100_core/src/gplx/core/lists/StackAdp_tst.java @@ -13,19 +13,19 @@ The terms of each license can be found in the source code repository: GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt */ -package gplx.core.lists; import gplx.*; import gplx.core.*; -import org.junit.*; +package gplx.core.lists; import gplx.*; import gplx.core.*; +import org.junit.*; public class StackAdp_tst { - @Test public void XtoList() { - tst_XtoList(1, 2, 3); - } - void tst_XtoList(int... ary) { - StackAdp stack = StackAdp_.new_(); - for (int i : ary) - stack.Push(i); - List_adp list = stack.XtoList(); - int[] actl = (int[])list.To_ary(int.class); - for (int i = 0; i < ary.length; i++) - Tfds.Eq(ary[i], actl[i]); - } -} + @Test public void XtoList() { + tst_XtoList(1, 2, 3); + } + void tst_XtoList(int... ary) { + StackAdp stack = StackAdp_.new_(); + for (int i : ary) + stack.Push(i); + List_adp list = stack.XtoList(); + int[] actl = (int[])list.To_ary(int.class); + for (int i = 0; i < ary.length; i++) + Tfds.Eq(ary[i], actl[i]); + } +} diff --git a/100_core/src/gplx/core/lists/rings/Ring__long__tst.java b/100_core/src/gplx/core/lists/rings/Ring__long__tst.java index 0735bc495..dfbf219a6 100644 --- a/100_core/src/gplx/core/lists/rings/Ring__long__tst.java +++ b/100_core/src/gplx/core/lists/rings/Ring__long__tst.java @@ -1,28 +1,28 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.core.lists.rings; import gplx.*; import gplx.core.*; import gplx.core.lists.*; import org.junit.*; import gplx.core.tests.*; public class Ring__long__tst { private final Ring__long__fxt fxt = new Ring__long__fxt(); - @Test public void Basic__1() {fxt.Clear().Add(1) .Test__to_ary(1);} - @Test public void Basic__2() {fxt.Clear().Add(1, 2) .Test__to_ary(1, 2);} - @Test public void Basic__3() {fxt.Clear().Add(1, 2, 3) .Test__to_ary(1, 2, 3);} - @Test public void Wrap__1() {fxt.Clear().Add(1, 2, 3, 4) .Test__to_ary(2, 3, 4);} - @Test public void Wrap__2() {fxt.Clear().Add(1, 2, 3, 4, 5) .Test__to_ary(3, 4, 5);} - @Test public void Wrap__3() {fxt.Clear().Add(1, 2, 3, 4, 5, 6) .Test__to_ary(4, 5, 6);} + @Test public void Basic__1() {fxt.Clear().Add(1) .Test__to_ary(1);} + @Test public void Basic__2() {fxt.Clear().Add(1, 2) .Test__to_ary(1, 2);} + @Test public void Basic__3() {fxt.Clear().Add(1, 2, 3) .Test__to_ary(1, 2, 3);} + @Test public void Wrap__1() {fxt.Clear().Add(1, 2, 3, 4) .Test__to_ary(2, 3, 4);} + @Test public void Wrap__2() {fxt.Clear().Add(1, 2, 3, 4, 5) .Test__to_ary(3, 4, 5);} + @Test public void Wrap__3() {fxt.Clear().Add(1, 2, 3, 4, 5, 6) .Test__to_ary(4, 5, 6);} } class Ring__long__fxt { private Ring__long ring = new Ring__long(3); diff --git a/100_core/src/gplx/core/lists/rings/Ring__string__tst.java b/100_core/src/gplx/core/lists/rings/Ring__string__tst.java index aa22a6b71..c15562e76 100644 --- a/100_core/src/gplx/core/lists/rings/Ring__string__tst.java +++ b/100_core/src/gplx/core/lists/rings/Ring__string__tst.java @@ -1,24 +1,24 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.core.lists.rings; import gplx.*; import gplx.core.*; import gplx.core.lists.*; import org.junit.*; public class Ring__string__tst { private final Ring__string__fxt fxt = new Ring__string__fxt(); @Before public void init() {fxt.Clear();} - @Test public void Basic() { + @Test public void Basic() { fxt.Clear().Max_(3).Push_many("a") .Expd("a"); fxt.Clear().Max_(3).Push_many("a", "b") .Expd("a", "b"); fxt.Clear().Max_(3).Push_many("a", "b", "c") .Expd("a", "b", "c"); diff --git a/100_core/src/gplx/core/log_msgs/Gfo_msg_root_tst.java b/100_core/src/gplx/core/log_msgs/Gfo_msg_root_tst.java index 76bfd0ec9..a77c71db3 100644 --- a/100_core/src/gplx/core/log_msgs/Gfo_msg_root_tst.java +++ b/100_core/src/gplx/core/log_msgs/Gfo_msg_root_tst.java @@ -1,33 +1,33 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.core.log_msgs; import gplx.*; import gplx.core.*; import org.junit.*; public class Gfo_msg_root_tst { Gfo_msg_root_fxt fxt = new Gfo_msg_root_fxt(); @Before public void setup() {fxt.Reset();} - @Test public void Str() { + @Test public void Str() { fxt.Clear().Expd_data_str_("failed a0 b0").Tst_data_new_many("proj.cls.proc", "err_0", "failed ~{0} ~{1}", "a0", "b0"); fxt.Clear().Expd_data_str_("failed a1 b1").Tst_data_new_many("proj.cls.proc", "err_0", "failed ~{0} ~{1}", "a1", "b1"); } -// @Test public void Item() { // DISABLED: no longer registering items with owner; +// @Test public void Item() { // DISABLED: no longer registering items with owner; // fxt.Clear().Expd_item_uid_(0).Expd_item_fmtr_arg_exists_(Bool_.Y).Tst_data_new_many("proj.cls.proc", "err_0", "failed ~{0} ~{1}", "a0", "b0"); // fxt.Clear().Expd_item_uid_(1).Expd_item_fmtr_arg_exists_(Bool_.N).Tst_data_new_many("proj.cls.proc", "err_1", "failed"); // fxt.Clear().Expd_item_uid_(0).Tst_data_new_many("proj.cls.proc", "err_0", "failed ~{0} ~{1}", "a0", "b0"); // make sure item_uid stays the same // } - @Test public void Cache() { + @Test public void Cache() { fxt.Mgr().Data_ary_len_(2); fxt.Clear().Expd_data_uid_(0).Tst_data_new_many("x", "err_0", "a"); fxt.Clear().Expd_data_uid_(1).Tst_data_new_many("x", "err_0", "b"); diff --git a/100_core/src/gplx/core/primitives/EnmParser_tst.java b/100_core/src/gplx/core/primitives/EnmParser_tst.java index b8480ac6f..57ca90568 100644 --- a/100_core/src/gplx/core/primitives/EnmParser_tst.java +++ b/100_core/src/gplx/core/primitives/EnmParser_tst.java @@ -1,25 +1,25 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.core.primitives; import gplx.*; import gplx.core.*; import org.junit.*; public class EnmParser_tst { @Before public void setup() { parser = EnmMgr.new_(); } - @Test public void Basic() { // 1,2,4,8 + @Test public void Basic() { // 1,2,4,8 parser.BitRngEnd_(8); run_Reg(0, "zero"); run_Reg(1, "one"); @@ -32,7 +32,7 @@ public class EnmParser_tst { tst_Convert("eight", 8); tst_Convert("one+eight", 9); } - @Test public void Keys() { + @Test public void Keys() { parser.BitRngBgn_(65536).BitRngEnd_(262144); run_Reg( 65, "a"); run_Reg( 65536, "shift"); @@ -43,7 +43,7 @@ public class EnmParser_tst { tst_Convert("ctrl+a", 65 + 131072); tst_Convert("shift+ctrl+a", 65 + 65536 + 131072); } - @Test public void Prefix() { + @Test public void Prefix() { parser.Prefix_("key.").BitRngBgn_(128).BitRngEnd_(128); run_Reg(65, "a"); tst_Convert("key.a", 65); diff --git a/400_xowa/src/gplx/core/primitives/Gfo_number_parser.java b/100_core/src/gplx/core/primitives/Gfo_number_parser.java similarity index 95% rename from 400_xowa/src/gplx/core/primitives/Gfo_number_parser.java rename to 100_core/src/gplx/core/primitives/Gfo_number_parser.java index bbfb195ac..ea93cd63d 100644 --- a/400_xowa/src/gplx/core/primitives/Gfo_number_parser.java +++ b/100_core/src/gplx/core/primitives/Gfo_number_parser.java @@ -1,193 +1,195 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2020 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ -package gplx.core.primitives; - -import gplx.Byte_ascii; -import gplx.Decimal_adp; -import gplx.Decimal_adp_; -import gplx.Int_; -import gplx.Math_; - -public class Gfo_number_parser { - public int Rv_as_int() {return (int)num_val;} private long num_val = 0; - public long Rv_as_long() {return num_val;} - public Decimal_adp Rv_as_dec() {return dec_val == null ? Decimal_adp_.long_(num_val) : dec_val;} private Decimal_adp dec_val = null; - public boolean Is_int() {return dec_val == null && (num_val >= Int_.Min_value && num_val <= Int_.Max_value);} - public boolean Has_err() {return has_err;} private boolean has_err; - public boolean Has_frac() {return has_frac;} private boolean has_frac; - public boolean Hex_enabled() {return hex_enabled;} public Gfo_number_parser Hex_enabled_(boolean v) {hex_enabled = v; return this;} private boolean hex_enabled; - public Gfo_number_parser Ignore_chars_(byte[] v) {this.ignore_chars = v; return this;} private byte[] ignore_chars; - public Gfo_number_parser Ignore_space_at_end_y_() {this.ignore_space_at_end = true; return this;} private boolean ignore_space_at_end; - public void Clear() { - ignore_chars = null; - } - public Gfo_number_parser Parse(byte[] src) {return Parse(src, 0, src.length);} - public Gfo_number_parser Parse(byte[] ary, int bgn, int end) { - int loop_bgn = end - 1, loop_end = bgn - 1, exp_multiplier = 1, factor = 10; - long multiplier = 1, frc_multiplier = 1; - num_val = 0; dec_val = null; boolean comma_nil = true; - long frc_int = 0; - has_err = false; has_frac = false; boolean has_exp = false, has_neg = false, exp_neg = false, has_plus = false, has_num = false; - boolean input_is_hex = false; - if (hex_enabled) { - if (loop_end + 2 < end) { // ArrayOutOfBounds check - byte b_2 = ary[loop_end + 2]; - switch (b_2) { - case Byte_ascii.Ltr_x: - case Byte_ascii.Ltr_X: // is 2nd char x? - if (ary[loop_end + 1] == Byte_ascii.Num_0) { // is 1st char 0? - factor = 16; - input_is_hex = true; - } - break; - default: - break; - } - } - } - for (int i = loop_bgn; i > loop_end; i--) { - byte cur = ary[i]; - switch (cur) { - case Byte_ascii.Num_0: - case Byte_ascii.Num_1: - case Byte_ascii.Num_2: - case Byte_ascii.Num_3: - case Byte_ascii.Num_4: - case Byte_ascii.Num_5: - case Byte_ascii.Num_6: - case Byte_ascii.Num_7: - case Byte_ascii.Num_8: - case Byte_ascii.Num_9: - num_val += (cur - Byte_ascii.Num_0) * multiplier; - multiplier *= factor; - has_num = true; - break; - case Byte_ascii.Dot: - if (has_frac) return Has_err_y_(); - frc_int = num_val; - num_val = 0; - frc_multiplier = multiplier; - multiplier = 1; - has_frac = true; - break; - case Byte_ascii.Comma: - if (comma_nil) - comma_nil = false; - else - return Has_err_y_(); - break; - case Byte_ascii.Dash: - if (has_neg) return Has_err_y_(); - has_neg = true; - break; - case Byte_ascii.Space: - if (i == bgn) {} // space at bgn - else if (i == end - 1 && ignore_space_at_end) {} // ignore space at end; DATE:2015-04-29 - else - return Has_err_y_(); - break; - case Byte_ascii.Plus: - if (has_plus) return Has_err_y_(); - has_plus = true; - break; - case Byte_ascii.Ltr_e: - case Byte_ascii.Ltr_E: - if (input_is_hex) { - num_val += 14 * multiplier; // NOTE: 14=value of e/E - multiplier *= factor; - has_num = true; - } - else { - if (has_exp) return Has_err_y_(); - exp_neg = has_neg; - exp_multiplier = (int)Math_.Pow(10, num_val); - num_val = 0; - multiplier = 1; - has_exp = true; - has_neg = false; - has_plus = false; // allow +1E+2 - has_num = false; // 2020-09-07|ISSUE#:795|scientific notation requires coefficient; set has_num to false which will fail below if no coefficient - } - break; - case Byte_ascii.Ltr_A: - case Byte_ascii.Ltr_B: - case Byte_ascii.Ltr_C: - case Byte_ascii.Ltr_D: - case Byte_ascii.Ltr_F: - if (input_is_hex) { - num_val += (cur - Byte_ascii.Ltr_A + 10) * multiplier; - multiplier *= factor; - has_num = true; - } - else - return Has_err_y_(); - break; - case Byte_ascii.Ltr_a: - case Byte_ascii.Ltr_b: - case Byte_ascii.Ltr_c: - case Byte_ascii.Ltr_d: - case Byte_ascii.Ltr_f: - if (input_is_hex) { - num_val += (cur - Byte_ascii.Ltr_a + 10) * multiplier; - multiplier *= factor; - has_num = true; - } - else - return Has_err_y_(); - break; - case Byte_ascii.Ltr_x: - case Byte_ascii.Ltr_X: - if (input_is_hex) - return (factor == 16) ? this : Has_err_y_(); // check for '0x' - else - return Has_err_y_(); - default: - if (ignore_chars != null) { - int ignore_chars_len = ignore_chars.length; - boolean ignored = false; - for (int j = 0; j < ignore_chars_len; ++j) { - if (cur == ignore_chars[j]) { - ignored = true; - break; - } - } - if (ignored) continue; - } - return Has_err_y_(); - } - } - if (!has_num) return Has_err_y_(); // handles situations wherein just symbols; EX: "+", ".", "-.", " , " etc. - if (has_frac) { - long full_val = (((num_val * frc_multiplier) + frc_int)); - if (has_neg) full_val *= -1; - if (has_exp) { - if (exp_neg) frc_multiplier *= exp_multiplier; // divide, so apply to frc - else full_val *= exp_multiplier; // multiply, so apply to full_val - } - dec_val = Decimal_adp_.divide_(full_val, frc_multiplier); - } - else { - if (has_neg) num_val *= -1; - if (has_exp) { - num_val = exp_neg - ? num_val / exp_multiplier - : num_val * exp_multiplier; - } - } - return this; - } - private Gfo_number_parser Has_err_y_() {has_err = true; return this;} -} +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2020 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ +package gplx.core.primitives; + +import gplx.Byte_ascii; +import gplx.Decimal_adp; +import gplx.Decimal_adp_; +import gplx.Int_; +import gplx.Math_; + +public class Gfo_number_parser { + public int Rv_as_int() {return (int)num_val;} private long num_val = 0; + public long Rv_as_long() {return num_val;} + public Decimal_adp Rv_as_dec() {return dec_val == null ? Decimal_adp_.long_(num_val) : dec_val;} private Decimal_adp dec_val = null; + public boolean Is_int() {return dec_val == null && (num_val >= Int_.Min_value && num_val <= Int_.Max_value);} + public boolean Is_long() {return dec_val == null;} + public boolean Has_err() {return has_err;} private boolean has_err; + public boolean Has_frac() {return has_frac;} private boolean has_frac; + public boolean Hex_enabled() {return hex_enabled;} public Gfo_number_parser Hex_enabled_(boolean v) {hex_enabled = v; return this;} private boolean hex_enabled; + public Gfo_number_parser Ignore_chars_(byte[] v) {this.ignore_chars = v; return this;} private byte[] ignore_chars; + public Gfo_number_parser Ignore_space_at_end_y_() {this.ignore_space_at_end = true; return this;} private boolean ignore_space_at_end; + public Gfo_number_parser Clear() { + ignore_chars = null; + return this; + } + public Gfo_number_parser Parse(byte[] src) {return Parse(src, 0, src.length);} + public Gfo_number_parser Parse(byte[] ary, int bgn, int end) { + int loop_bgn = end - 1, loop_end = bgn - 1, exp_multiplier = 1, factor = 10; + long multiplier = 1, frc_multiplier = 1; + num_val = 0; dec_val = null; boolean comma_nil = true; + long frc_int = 0; + has_err = false; has_frac = false; boolean has_exp = false, has_neg = false, exp_neg = false, has_plus = false, has_num = false; + boolean input_is_hex = false; + if (hex_enabled) { + if (loop_end + 2 < end) { // ArrayOutOfBounds check + byte b_2 = ary[loop_end + 2]; + switch (b_2) { + case Byte_ascii.Ltr_x: + case Byte_ascii.Ltr_X: // is 2nd char x? + if (ary[loop_end + 1] == Byte_ascii.Num_0) { // is 1st char 0? + factor = 16; + input_is_hex = true; + } + break; + default: + break; + } + } + } + for (int i = loop_bgn; i > loop_end; i--) { + byte cur = ary[i]; + switch (cur) { + case Byte_ascii.Num_0: + case Byte_ascii.Num_1: + case Byte_ascii.Num_2: + case Byte_ascii.Num_3: + case Byte_ascii.Num_4: + case Byte_ascii.Num_5: + case Byte_ascii.Num_6: + case Byte_ascii.Num_7: + case Byte_ascii.Num_8: + case Byte_ascii.Num_9: + num_val += (cur - Byte_ascii.Num_0) * multiplier; + multiplier *= factor; + has_num = true; + break; + case Byte_ascii.Dot: + if (has_frac) return Has_err_y_(); + frc_int = num_val; + num_val = 0; + frc_multiplier = multiplier; + multiplier = 1; + has_frac = true; + break; + case Byte_ascii.Comma: + if (comma_nil) + comma_nil = false; + else + return Has_err_y_(); + break; + case Byte_ascii.Dash: + if (has_neg) return Has_err_y_(); + has_neg = true; + break; + case Byte_ascii.Space: + if (i == bgn) {} // space at bgn + else if (i == end - 1 && ignore_space_at_end) {} // ignore space at end; DATE:2015-04-29 + else + return Has_err_y_(); + break; + case Byte_ascii.Plus: + if (has_plus) return Has_err_y_(); + has_plus = true; + break; + case Byte_ascii.Ltr_e: + case Byte_ascii.Ltr_E: + if (input_is_hex) { + num_val += 14 * multiplier; // NOTE: 14=value of e/E + multiplier *= factor; + has_num = true; + } + else { + if (has_exp) return Has_err_y_(); + exp_neg = has_neg; + exp_multiplier = (int)Math_.Pow(10, num_val); + num_val = 0; + multiplier = 1; + has_exp = true; + has_neg = false; + has_plus = false; // allow +1E+2 + has_num = false; // 2020-09-07|ISSUE#:795|scientific notation requires coefficient; set has_num to false which will fail below if no coefficient + } + break; + case Byte_ascii.Ltr_A: + case Byte_ascii.Ltr_B: + case Byte_ascii.Ltr_C: + case Byte_ascii.Ltr_D: + case Byte_ascii.Ltr_F: + if (input_is_hex) { + num_val += (cur - Byte_ascii.Ltr_A + 10) * multiplier; + multiplier *= factor; + has_num = true; + } + else + return Has_err_y_(); + break; + case Byte_ascii.Ltr_a: + case Byte_ascii.Ltr_b: + case Byte_ascii.Ltr_c: + case Byte_ascii.Ltr_d: + case Byte_ascii.Ltr_f: + if (input_is_hex) { + num_val += (cur - Byte_ascii.Ltr_a + 10) * multiplier; + multiplier *= factor; + has_num = true; + } + else + return Has_err_y_(); + break; + case Byte_ascii.Ltr_x: + case Byte_ascii.Ltr_X: + if (input_is_hex) + return (factor == 16) ? this : Has_err_y_(); // check for '0x' + else + return Has_err_y_(); + default: + if (ignore_chars != null) { + int ignore_chars_len = ignore_chars.length; + boolean ignored = false; + for (int j = 0; j < ignore_chars_len; ++j) { + if (cur == ignore_chars[j]) { + ignored = true; + break; + } + } + if (ignored) continue; + } + return Has_err_y_(); + } + } + if (!has_num) return Has_err_y_(); // handles situations wherein just symbols; EX: "+", ".", "-.", " , " etc. + if (has_frac) { + long full_val = (((num_val * frc_multiplier) + frc_int)); + if (has_neg) full_val *= -1; + if (has_exp) { + if (exp_neg) frc_multiplier *= exp_multiplier; // divide, so apply to frc + else full_val *= exp_multiplier; // multiply, so apply to full_val + } + dec_val = Decimal_adp_.divide_(full_val, frc_multiplier); + } + else { + if (has_neg) num_val *= -1; + if (has_exp) { + num_val = exp_neg + ? num_val / exp_multiplier + : num_val * exp_multiplier; + } + } + return this; + } + private Gfo_number_parser Has_err_y_() {has_err = true; return this;} +} diff --git a/100_core/src/gplx/core/primitives/Int_ary.java b/100_core/src/gplx/core/primitives/Int_ary.java new file mode 100644 index 000000000..b8ea53700 --- /dev/null +++ b/100_core/src/gplx/core/primitives/Int_ary.java @@ -0,0 +1,59 @@ +package gplx.core.primitives; +import gplx.Err_; +public class Int_ary { + private int[] ary; private int len, max; + public Int_ary(int max) { + this.len = 0; + this.max = max; + this.ary = new int[max]; + } + public int[] Ary() {return ary;} + public void Clear() { + for (int i = 0; i < len; ++i) + ary[i] = 0; + len = 0; + } + public int Len() {return len;} + public int Get_at_or_fail(int i) { + if (i > -1 && i < len) return ary[i]; + else throw Err_.new_("core.int_ary", "index is invalid", "i", i, "len", len); + } + public void Add(int v) { + if (len == max) { + int new_max = max * 2; + int[] new_ary = new int[new_max]; + for (int i = 0; i < len; ++i) + new_ary[i] = ary[i]; + this.ary = new_ary; + this.max = new_max; + } + ary[len] = v; + ++len; + } + public int Pop_or_fail() { + if (len == 0) throw Err_.new_("core.int_ary", "stack is empty"); + return Pop_or(-1); + } + public int Pop_or(int or) { + if (len == 0) return or; + int rv = ary[len - 1]; + --len; + return rv; + } + public int Idx_of(int find) { + for (int i = len - 1; i > -1; --i) { + if (ary[i] == find) return i; + } + return Not_found; + } + public boolean Del_from_end(int find) { + int find_idx = Idx_of(find); if (find_idx == Not_found) return false; + int last_idx = len - 1; + for (int i = find_idx; i < last_idx; ++i) + ary[i] = ary[i + 1]; + ary[last_idx] = 0; + --len; + return true; + } + public static final int Not_found = -1; +} diff --git a/100_core/src/gplx/core/security/algos/gplx_crypto/Crc32.java b/100_core/src/gplx/core/security/algos/gplx_crypto/Crc32.java new file mode 100644 index 000000000..ac1d55b25 --- /dev/null +++ b/100_core/src/gplx/core/security/algos/gplx_crypto/Crc32.java @@ -0,0 +1,38 @@ +package gplx.core.security.algos.gplx_crypto; import gplx.Int_; +public class Crc32 { + int crc = 0; /** The crc data checksum so far. */ + public String CalcHash(byte[] ary) { + Reset(); + Calc(ary); + return Int_.To_str_hex(Crc()); + } + public int Crc() {return crc;}//(int)(crc & 0xffffffffL);} + public void Reset() {crc = 0;} + public void Calc(int val) { + int tmp = ~crc; + tmp = CrcTable[(tmp ^ val) & 0xff] ^ (0x7FFFFFFF & tmp >>> 8); //#<>(int)((uint)tmp >> 8)~tmp >>> 8 + crc = ~tmp; + } + public void Calc(byte[] ary) {Calc(ary, 0, ary.length);} + public void Calc(byte[] ary, int off, int len) { + int tmp = ~crc; + while (--len >= 0) + tmp = CrcTable[(tmp ^ ary[off++]) & 0xff] ^ (0x7FFFFFFF & tmp >>> 8);//#<>(int)((uint)tmp >> 8)~tmp >>> 8 + crc = ~tmp; + } + static int[] CrcTable = CrcTable_make(); + static int[] CrcTable_make () { + int[] rv = new int[256]; + for (int i = 0; i < 256; i++) { + int tmp = i; + for (int k = 8; --k >= 0;) { + if ((tmp & 1) != 0) + tmp = (int)(0xedb88320 ^ tmp >>> 1); //#<>(int)((uint)tmp >> 1)~tmp >>> 1 + else + tmp = tmp >>> 1; //#<>(int)((uint)tmp >> 1)~tmp >>> 1 + } + rv[i] = tmp; + } + return rv; + } +} diff --git a/100_core/src/gplx/core/security/algos/gplx_crypto/Crc32_tst.java b/100_core/src/gplx/core/security/algos/gplx_crypto/Crc32_tst.java new file mode 100644 index 000000000..f8b3a0caa --- /dev/null +++ b/100_core/src/gplx/core/security/algos/gplx_crypto/Crc32_tst.java @@ -0,0 +1,66 @@ +package gplx.core.security.algos.gplx_crypto; import gplx.Bry_; +import gplx.Int_; +import gplx.Io_mgr; +import gplx.Io_url; +import gplx.String_; +import gplx.Tfds; +import gplx.core.consoles.Console_adp__sys; +import gplx.core.ios.streams.IoStream; +import gplx.core.ios.streams.IoStream_; +import gplx.core.strings.String_bldr; +import gplx.core.strings.String_bldr_; +import org.junit.Test; +public class Crc32_tst { + Crc32 crc32 = new Crc32(); + @Test public void Basic() { + tst_Crc32("00000000", ""); + tst_Crc32("E8B7BE43", "a"); + tst_Crc32("4C2750BD", "abcdefghijklmnopqrstuvwxyz"); + tst_Crc32("ABF77822", "ABCDEFGHIJKLMNOPQRSTUVWXYZ"); + } + void tst_Crc32(String expd, String dat) {Tfds.Eq(expd, crc32.CalcHash(Bry_.new_u8(dat)), expd);} +} +class Crc32_mgr { + Crc32 crc32 = new Crc32(); + public void SearchDir(Io_url dir) { + Io_url[] urlAry = Io_mgr.Instance.QueryDir_args(dir).Recur_().ExecAsUrlAry(); + String_bldr sb = String_bldr_.new_(); + for (Io_url url : urlAry) { + String expd = Extract(url); + String actl = expd == String_.Empty ? String_.Empty : CheckFile(url); + String status = Status(expd, actl); + sb.Add(status).Add("|"); + sb.Add(url.Xto_api()).Add("|"); + sb.Add(expd).Add("|"); sb.Add(actl).Add_char_nl(); + Console_adp__sys.Instance.Write_fmt_w_nl("{0} {1} {2}", status, actl, url.NameOnly()); + } + Io_mgr.Instance.SaveFilStr(dir.GenSubFil("results.csv"), sb.To_str()); + } + String Status(String expd, String actl) { + if (expd == String_.Empty) return "none"; + return String_.Eq(expd, actl) ? "ok " : "BAD"; + } + String Extract(Io_url url) { + String urlStr = url.NameOnly(); + int bgnPos = String_.FindBwd(urlStr, "["); if (bgnPos == String_.Find_none) return String_.Empty; + int endPos = String_.FindFwd(urlStr, "]", bgnPos); if (endPos == String_.Find_none) return String_.Empty; + String crc = String_.Mid(urlStr, bgnPos + 1, endPos); + return String_.Upper(crc); + } + String CheckFile(Io_url url) { + IoStream stream = IoStream_.Null; + int pos = 0, readLen = 0; + crc32.Reset(); + byte[] ary = new byte[256 * 256]; + try { + stream = Io_mgr.Instance.OpenStreamRead(url); + while (true) { + readLen = stream.Read(ary, pos, ary.length); + crc32.Calc(ary, 0, readLen); + if (readLen < 1) break; + } + } + finally {stream.Rls();} + return Int_.To_str_hex(crc32.Crc()); + } +} diff --git a/100_core/src/gplx/core/security/algos/gplx_crypto/Hash_algo__tth_192__tst.java b/100_core/src/gplx/core/security/algos/gplx_crypto/Hash_algo__tth_192__tst.java index ff090f981..50c17cb68 100644 --- a/100_core/src/gplx/core/security/algos/gplx_crypto/Hash_algo__tth_192__tst.java +++ b/100_core/src/gplx/core/security/algos/gplx_crypto/Hash_algo__tth_192__tst.java @@ -1,34 +1,34 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.core.security.algos.gplx_crypto; import gplx.*; import gplx.core.*; import gplx.core.security.*; import gplx.core.security.algos.*; import org.junit.*; import gplx.core.consoles.*; import gplx.core.ios.*; /*IoStream*/ public class Hash_algo__tth_192__tst { // REF: http://open-content.net/specs/draft-jchapweske-thex-02.html; DC++ 0.698 private final Hash_algo__fxt fxt = new Hash_algo__fxt(Hash_algo_.New__tth_192()); - @Test public void Empty() {fxt.Test__hash("LWPNACQDBZRYXW3VHJVCJ64QBZNGHOHHHZWCLNQ", "");} - @Test public void Null__1() {fxt.Test__hash("VK54ZIEEVTWNAUI5D5RDFIL37LX2IQNSTAXFKSA", "\0");} - @Test public void ab() {fxt.Test__hash("XQXRSGMB3PSN2VGZYJMNJG6SOOQ3JIGQHD2I6PQ", "ab");} - @Test public void abc() {fxt.Test__hash("ASD4UJSEH5M47PDYB46KBTSQTSGDKLBHYXOMUIA", "abc");} - @Test public void abde() {fxt.Test__hash("SQF2PFTVIFRR5KJSI45IDENXMB43NI7EIXYGHGI", "abcd");} - @Test public void abcde() {fxt.Test__hash("SKGLNP5WV7ZUMF6IUK5CYXBE3PI4C6PHWNVM2YQ", "abcde");} - @Test public void abcdefghi() {fxt.Test__hash("RUIKHZFO4NIY6NNUHJMAC2I26U3U65FZWCO3UFY", "abcdefghi");} + @Test public void Empty() {fxt.Test__hash("LWPNACQDBZRYXW3VHJVCJ64QBZNGHOHHHZWCLNQ", "");} + @Test public void Null__1() {fxt.Test__hash("VK54ZIEEVTWNAUI5D5RDFIL37LX2IQNSTAXFKSA", "\0");} + @Test public void ab() {fxt.Test__hash("XQXRSGMB3PSN2VGZYJMNJG6SOOQ3JIGQHD2I6PQ", "ab");} + @Test public void abc() {fxt.Test__hash("ASD4UJSEH5M47PDYB46KBTSQTSGDKLBHYXOMUIA", "abc");} + @Test public void abde() {fxt.Test__hash("SQF2PFTVIFRR5KJSI45IDENXMB43NI7EIXYGHGI", "abcd");} + @Test public void abcde() {fxt.Test__hash("SKGLNP5WV7ZUMF6IUK5CYXBE3PI4C6PHWNVM2YQ", "abcde");} + @Test public void abcdefghi() {fxt.Test__hash("RUIKHZFO4NIY6NNUHJMAC2I26U3U65FZWCO3UFY", "abcdefghi");} // @Test public void a__x_1024() {fxt.Test__hash("L66Q4YVNAFWVS23X2HJIRA5ZJ7WXR3F26RSASFA", String_.Repeat("A", 1024));} // @Test public void a__x_1025() {fxt.Test__hash("PZMRYHGY6LTBEH63ZWAHDORHSYTLO4LEFUIKHWY", String_.Repeat("A", 1025));} - // @Test + // @Test public void A__Pow27() {fxt.Test__hash("QNIJO36QDIQREUT3HWK4MDVKD2T6OENAEKYADTQ", String_.Repeat("A", (int)Math_.Pow(2, 27))); } } diff --git a/100_core/src/gplx/core/security/algos/gplx_crypto/Hash_algo__tth_192_tree_tst.java b/100_core/src/gplx/core/security/algos/gplx_crypto/Hash_algo__tth_192_tree_tst.java index c87431834..30e7edfc9 100644 --- a/100_core/src/gplx/core/security/algos/gplx_crypto/Hash_algo__tth_192_tree_tst.java +++ b/100_core/src/gplx/core/security/algos/gplx_crypto/Hash_algo__tth_192_tree_tst.java @@ -1,22 +1,22 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.core.security.algos.gplx_crypto; import gplx.*; import gplx.core.*; import gplx.core.security.*; import gplx.core.security.algos.*; import org.junit.*; public class Hash_algo__tth_192_tree_tst { - @Test public void CalcRecursiveHalves() { + @Test public void CalcRecursiveHalves() { tst_CalcRecursiveHalves(129, 128); tst_CalcRecursiveHalves(128, 127); tst_CalcRecursiveHalves(100, 99); @@ -29,7 +29,7 @@ public class Hash_algo__tth_192_tree_tst { tst_CalcRecursiveHalves(1, 0); tst_CalcRecursiveHalves(0, 0); } - @Test public void CalcWorkUnits() { + @Test public void CalcWorkUnits() { tst_CalcWorkUnits(101, 21); // leafs; 10 full, 1 part (+11) -> reduce 11 to 5+1 (+5) -> reduce 6 to 3 (+3) -> reduce 3 to 1+1 (+1) -> reduce 2 to 1 (+1) tst_CalcWorkUnits(100, 19); // leafs; 10 full (+10) -> reduce 10 to 5 (+5) -> reduce 5 to 2+1 (+2) -> reduce 3 to 1+1 (+1) -> reduce 2 to 1 (+1) tst_CalcWorkUnits(30, 5); // leafs; 3 full (+3) -> reduce 3 to 1+1 (+1) -> reduce 2 to 1 (+1) diff --git a/100_core/src/gplx/core/security/algos/gplx_crypto/Hash_console_wtr_tst.java b/100_core/src/gplx/core/security/algos/gplx_crypto/Hash_console_wtr_tst.java index 2e1a0549c..20225cacf 100644 --- a/100_core/src/gplx/core/security/algos/gplx_crypto/Hash_console_wtr_tst.java +++ b/100_core/src/gplx/core/security/algos/gplx_crypto/Hash_console_wtr_tst.java @@ -1,23 +1,23 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.core.security.algos.gplx_crypto; import gplx.*; import gplx.core.*; import gplx.core.security.*; import gplx.core.security.algos.*; import org.junit.*; import gplx.core.consoles.*; import gplx.core.ios.streams.*; /*IoStream*/ public class Hash_console_wtr_tst { private final Hash_console_wtr_fxt fxt = new Hash_console_wtr_fxt(); - @Test public void Basic() { + @Test public void Basic() { fxt.Test__Status(10, " - hash: 100%"); fxt.Test__Status(11, " - hash: 66%"); fxt.Test__Status(30, " - hash: 40%", " - hash: 60%", " - hash: 100%"); diff --git a/100_core/src/gplx/core/security/algos/jre/Jre_hash_algo__md5__tst.java b/100_core/src/gplx/core/security/algos/jre/Jre_hash_algo__md5__tst.java index 21cf053e7..7186588b1 100644 --- a/100_core/src/gplx/core/security/algos/jre/Jre_hash_algo__md5__tst.java +++ b/100_core/src/gplx/core/security/algos/jre/Jre_hash_algo__md5__tst.java @@ -1,31 +1,31 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.core.security.algos.jre; import gplx.*; import gplx.core.*; import gplx.core.security.*; import gplx.core.security.algos.*; import org.junit.*; public class Jre_hash_algo__md5__tst { // REF: https://www.cosic.esat.kuleuven.be/nessie/testvectors/hash/md5/Md5-128.unverified.test-vectors private final Hash_algo__fxt fxt = new Hash_algo__fxt(Hash_algo_.New__md5()); - @Test public void Empty() {fxt.Test__hash("d41d8cd98f00b204e9800998ecf8427e", "");} - @Test public void a() {fxt.Test__hash("0cc175b9c0f1b6a831c399e269772661", "a");} - @Test public void abc() {fxt.Test__hash("900150983cd24fb0d6963f7d28e17f72", "abc");} - @Test public void message_digest() {fxt.Test__hash("f96b697d7cb7938d525a2f31aaf161d0", "message digest");} - @Test public void a_z() {fxt.Test__hash("c3fcd3d76192e4007dfb496cca67e13b", "abcdefghijklmnopqrstuvwxyz");} - @Test public void a_q__mixed() {fxt.Test__hash("8215ef0796a20bcaaae116d3876c664a", "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq");} - @Test public void A_Z__a_z__0_9() {fxt.Test__hash("d174ab98d277d9f5a5611c2c9f419d9f", "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789");} - //@Test + @Test public void Empty() {fxt.Test__hash("d41d8cd98f00b204e9800998ecf8427e", "");} + @Test public void a() {fxt.Test__hash("0cc175b9c0f1b6a831c399e269772661", "a");} + @Test public void abc() {fxt.Test__hash("900150983cd24fb0d6963f7d28e17f72", "abc");} + @Test public void message_digest() {fxt.Test__hash("f96b697d7cb7938d525a2f31aaf161d0", "message digest");} + @Test public void a_z() {fxt.Test__hash("c3fcd3d76192e4007dfb496cca67e13b", "abcdefghijklmnopqrstuvwxyz");} + @Test public void a_q__mixed() {fxt.Test__hash("8215ef0796a20bcaaae116d3876c664a", "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq");} + @Test public void A_Z__a_z__0_9() {fxt.Test__hash("d174ab98d277d9f5a5611c2c9f419d9f", "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789");} + //@Test public void Num__x_8() {fxt.Test__hash("57edf4a22be3c955ac49da2e2107b67a", String_.Repeat("1234567890", 8));} - //@Test + //@Test public void A__x_1million() {fxt.Test__hash("7707d6ae4e027c70eea2a935c2296f21", String_.Repeat("a", 1000000));} } diff --git a/100_core/src/gplx/core/security/algos/jre/Jre_hash_algo__sha1__tst.java b/100_core/src/gplx/core/security/algos/jre/Jre_hash_algo__sha1__tst.java index 4e264f12f..9d68e533b 100644 --- a/100_core/src/gplx/core/security/algos/jre/Jre_hash_algo__sha1__tst.java +++ b/100_core/src/gplx/core/security/algos/jre/Jre_hash_algo__sha1__tst.java @@ -1,29 +1,29 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.core.security.algos.jre; import gplx.*; import gplx.core.*; import gplx.core.security.*; import gplx.core.security.algos.*; import org.junit.*; public class Jre_hash_algo__sha1__tst { // REF: https://www.cosic.esat.kuleuven.be/nessie/testvectors/ private final Hash_algo__fxt fxt = new Hash_algo__fxt(Hash_algo_.New__sha1()); - @Test public void Empty() {fxt.Test__hash("da39a3ee5e6b4b0d3255bfef95601890afd80709", "");} - @Test public void a() {fxt.Test__hash("86f7e437faa5a7fce15d1ddcb9eaeaea377667b8", "a");} - @Test public void abc() {fxt.Test__hash("a9993e364706816aba3e25717850c26c9cd0d89d", "abc");} - @Test public void message_digest() {fxt.Test__hash("c12252ceda8be8994d5fa0290a47231c1d16aae3", "message digest");} - @Test public void a_z() {fxt.Test__hash("32d10c7b8cf96570ca04ce37f2a19d84240d3a89", "abcdefghijklmnopqrstuvwxyz");} - @Test public void a_q__mixed() {fxt.Test__hash("84983e441c3bd26ebaae4aa1f95129e5e54670f1", "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq");} - @Test public void A_Z__a_z__0_9() {fxt.Test__hash("761c457bf73b14d27e9e9265c46f4b4dda11f940", "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789");} + @Test public void Empty() {fxt.Test__hash("da39a3ee5e6b4b0d3255bfef95601890afd80709", "");} + @Test public void a() {fxt.Test__hash("86f7e437faa5a7fce15d1ddcb9eaeaea377667b8", "a");} + @Test public void abc() {fxt.Test__hash("a9993e364706816aba3e25717850c26c9cd0d89d", "abc");} + @Test public void message_digest() {fxt.Test__hash("c12252ceda8be8994d5fa0290a47231c1d16aae3", "message digest");} + @Test public void a_z() {fxt.Test__hash("32d10c7b8cf96570ca04ce37f2a19d84240d3a89", "abcdefghijklmnopqrstuvwxyz");} + @Test public void a_q__mixed() {fxt.Test__hash("84983e441c3bd26ebaae4aa1f95129e5e54670f1", "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq");} + @Test public void A_Z__a_z__0_9() {fxt.Test__hash("761c457bf73b14d27e9e9265c46f4b4dda11f940", "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789");} // @Test public void Num() {fxt.Test__hash("50abf5706a150990a08b2c5ea40fa0e585554732", String_.Repeat("1234567890", 8));} //@Test diff --git a/100_core/src/gplx/core/security/algos/jre/Jre_hash_algo__sha2_256__tst.java b/100_core/src/gplx/core/security/algos/jre/Jre_hash_algo__sha2_256__tst.java index d63bb37a5..9fcf7de16 100644 --- a/100_core/src/gplx/core/security/algos/jre/Jre_hash_algo__sha2_256__tst.java +++ b/100_core/src/gplx/core/security/algos/jre/Jre_hash_algo__sha2_256__tst.java @@ -1,29 +1,29 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.core.security.algos.jre; import gplx.*; import gplx.core.*; import gplx.core.security.*; import gplx.core.security.algos.*; import org.junit.*; public class Jre_hash_algo__sha2_256__tst { // REF: https://www.cosic.esat.kuleuven.be/nessie/testvectors/ private final Hash_algo__fxt fxt = new Hash_algo__fxt(Hash_algo_.New__sha2_256()); - @Test public void Empty() {fxt.Test__hash("e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "");} - @Test public void a() {fxt.Test__hash("ca978112ca1bbdcafac231b39a23dc4da786eff8147c4e72b9807785afee48bb", "a");} - @Test public void abc() {fxt.Test__hash("ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad", "abc");} - @Test public void message_digest() {fxt.Test__hash("f7846f55cf23e14eebeab5b4e1550cad5b509e3348fbc4efa3a1413d393cb650", "message digest");} - @Test public void a_z() {fxt.Test__hash("71c480df93d6ae2f1efad1447c66c9525e316218cf51fc8d9ed832f2daf18b73", "abcdefghijklmnopqrstuvwxyz");} - @Test public void a_q__mixed() {fxt.Test__hash("248d6a61d20638b8e5c026930c3e6039a33ce45964ff2167f6ecedd419db06c1", "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq");} - @Test public void A_Z__a_z__0_9() {fxt.Test__hash("db4bfcbd4da0cd85a60c3c37d3fbd8805c77f15fc6b1fdfe614ee0a7c8fdb4c0", "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789");} + @Test public void Empty() {fxt.Test__hash("e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "");} + @Test public void a() {fxt.Test__hash("ca978112ca1bbdcafac231b39a23dc4da786eff8147c4e72b9807785afee48bb", "a");} + @Test public void abc() {fxt.Test__hash("ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad", "abc");} + @Test public void message_digest() {fxt.Test__hash("f7846f55cf23e14eebeab5b4e1550cad5b509e3348fbc4efa3a1413d393cb650", "message digest");} + @Test public void a_z() {fxt.Test__hash("71c480df93d6ae2f1efad1447c66c9525e316218cf51fc8d9ed832f2daf18b73", "abcdefghijklmnopqrstuvwxyz");} + @Test public void a_q__mixed() {fxt.Test__hash("248d6a61d20638b8e5c026930c3e6039a33ce45964ff2167f6ecedd419db06c1", "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq");} + @Test public void A_Z__a_z__0_9() {fxt.Test__hash("db4bfcbd4da0cd85a60c3c37d3fbd8805c77f15fc6b1fdfe614ee0a7c8fdb4c0", "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789");} // @Test public void Num() {fxt.Test__hash("f371bc4a311f2b009eef952dd83ca80e2b60026c8e935592d0f9c308453c813e", String_.Repeat("1234567890", 8));} //@Test diff --git a/100_core/src/gplx/core/texts/BaseXXConverter_tst.java b/100_core/src/gplx/core/texts/BaseXXConverter_tst.java index f8287cc83..f774cdb3d 100644 --- a/100_core/src/gplx/core/texts/BaseXXConverter_tst.java +++ b/100_core/src/gplx/core/texts/BaseXXConverter_tst.java @@ -1,22 +1,22 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.core.texts; import gplx.*; import gplx.core.*; import org.junit.*; public class BaseXXConverter_tst { - @Test public void Base32() { + @Test public void Base32() { tst_Base32("", ""); tst_Base32("f", "MY"); tst_Base32("fo", "MZXQ"); @@ -28,7 +28,7 @@ public class BaseXXConverter_tst { tst_Base32("a", "ME"); tst_Base32("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567", "IFBEGRCFIZDUQSKKJNGE2TSPKBIVEU2UKVLFOWCZLIZDGNBVGY3Q"); } - @Test public void Base64() { + @Test public void Base64() { tst_Base64("", ""); tst_Base64("f", "Zg=="); tst_Base64("fo", "Zm8="); diff --git a/100_core/src/gplx/core/texts/CharStream_tst.java b/100_core/src/gplx/core/texts/CharStream_tst.java index 3466f7c85..af128de27 100644 --- a/100_core/src/gplx/core/texts/CharStream_tst.java +++ b/100_core/src/gplx/core/texts/CharStream_tst.java @@ -1,37 +1,37 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.core.texts; import gplx.*; import gplx.core.*; import org.junit.*; public class CharStream_tst { @Before public void setup() { stream = CharStream.pos0_("abcdefgh"); } - @Test public void To_str() { + @Test public void To_str() { Tfds.Eq(stream.To_str(), "abcdefgh"); } - @Test public void CurrentText() { + @Test public void CurrentText() { stream.MoveNextBy(1); Tfds.Eq(stream.XtoStrAtCur(2), "bc"); Tfds.Eq(stream.To_str(), "abcdefgh"); } - @Test public void CurrentText_outOfBounds() { + @Test public void CurrentText_outOfBounds() { stream.MoveNextBy(7); Tfds.Eq(stream.XtoStrAtCur(2), "h"); } - @Test public void Match() { + @Test public void Match() { stream.MoveNextBy(6); tst_Match(true, "g"); tst_Match(false, "z"); @@ -39,7 +39,7 @@ public class CharStream_tst { tst_Match(false, "gz"); tst_Match(false, "ghi"); } - @Test public void AtBounds() { + @Test public void AtBounds() { stream.Move_to(-1); tst_AtBounds(true, false, false); diff --git a/100_core/src/gplx/core/texts/RegxPatn_cls_ioMatch_tst.java b/100_core/src/gplx/core/texts/RegxPatn_cls_ioMatch_tst.java index 62dfc663c..ee7546449 100644 --- a/100_core/src/gplx/core/texts/RegxPatn_cls_ioMatch_tst.java +++ b/100_core/src/gplx/core/texts/RegxPatn_cls_ioMatch_tst.java @@ -1,50 +1,50 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.core.texts; import gplx.*; import gplx.core.*; import org.junit.*; public class RegxPatn_cls_ioMatch_tst { - @Test public void SimpleMatches() { + @Test public void SimpleMatches() { tst_Matches("file.cs", "file.cs", true); // basic tst_Matches("file.cs", "file.cs.exe", false); // fail: must match name precisely tst_Matches("file.cs", "tst_file.cs", false); // fail: must match name precisely } - @Test public void Wildcard() { + @Test public void Wildcard() { tst_Matches("*.cs", "file.cs", true); // pass: before tst_Matches("file*", "file_valid.cs", true); // pass: after tst_Matches("*.exe", "file.cs", false); // fail: before tst_Matches("file*", "invalid_file.cs", false); // fail: after } - @Test public void DoubleWildcard() { + @Test public void DoubleWildcard() { tst_Matches("*cs*", "file.cs", true); // pass: after tst_Matches("*cs*", "csFile.exe", true); // pass: before tst_Matches("*cs*", "file.cs.exe", true); // pass: middle tst_Matches("*cs*", "file.exe", false); // fail } - @Test public void Compound() { + @Test public void Compound() { tst_Matches("*.cs|*.exe", "file.cs", true); // pass: match first tst_Matches("*.cs|*.exe", "file.exe", true); // pass: match second tst_Matches("*.cs|*.exe", "file.dll", false); // fail: match neither tst_Matches("*.cs|*.exe", "file.cs.exe.dll", false); // fail: match neither (though both are embedded) } - @Test public void Backslash() { + @Test public void Backslash() { tst_Matches("*\\bin\\*", "C:\\project\\bin\\", true); // pass: dir tst_Matches("*\\bin\\*", "C:\\project\\bin\\file.dll", true); // pass: fil tst_Matches("*\\bin\\*", "C:\\project\\binFiles\\", false); // fail } - @Test public void MixedCase() { + @Test public void MixedCase() { tst_Matches("file.cs", "file.cs", true); // pass: same case tst_Matches("file.cs", "File.cS", true); // pass: diff case } diff --git a/100_core/src/gplx/core/texts/RegxPatn_cls_like_tst.java b/100_core/src/gplx/core/texts/RegxPatn_cls_like_tst.java index c381e8dbc..2b83baa0f 100644 --- a/100_core/src/gplx/core/texts/RegxPatn_cls_like_tst.java +++ b/100_core/src/gplx/core/texts/RegxPatn_cls_like_tst.java @@ -1,28 +1,28 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.core.texts; import gplx.*; import gplx.core.*; import org.junit.*; import gplx.langs.regxs.*; public class RegxPatn_cls_like_tst { - @Test public void Basic() { + @Test public void Basic() { tst_Match("abcd", "abcd", true); // basic; pass tst_Match("abcd", "zbcd", false); // basic; fail tst_Match("abcd", "abc", false); // no wildcard; must be exact match tst_Match("a cd", "a cd", true); // check space works } - @Test public void Wildcard() { + @Test public void Wildcard() { tst_Match("abcd", "a%", true); // bgn; pass tst_Match("abcd", "b%", false); // bgn; fail tst_Match("abcd", "%d", true); // end; pass @@ -32,12 +32,12 @@ public class RegxPatn_cls_like_tst { tst_Match("abcd", "%a%", true); // flank; bgn; pass tst_Match("abcd", "%d%", true); // flank; end; pass } - @Test public void Any() { + @Test public void Any() { tst_Match("abcd", "a_cd", true); // basic; pass tst_Match("abcd", "z_cd", false); // basic; fail tst_Match("abcd", "a_c", false); // fail; check no wildcard } - @Test public void CharSet() { + @Test public void CharSet() { tst_Match("abcd", "a[b]cd", true); // pass tst_Match("abcd", "a[x]cd", false); // fail tst_Match("abcd", "a[bcde]cd", true); // multiple; pass @@ -45,20 +45,20 @@ public class RegxPatn_cls_like_tst { tst_Match("abcd", "a[^z]cd", true); // not; pass tst_Match("abcd", "a[^b]cd", false); // not; fail } - @Test public void Escape() { + @Test public void Escape() { tst_Match("a%b", "a|%b", true); // escape wildcard; pass tst_Match("a%bc", "a|%b", false); // escape wildcard; fail tst_Match("a|b", "a|b", false); // escape char; fail tst_Match("a|b", "a||b", true); // escape char; pass } - @Test public void Escape_diffChar() { + @Test public void Escape_diffChar() { tst_Match("a%b", "a~%b", '~', true); // escape wildcard; pass tst_Match("a%bc", "a~%b", '~', false); // escape wildcard; fail tst_Match("a|b", "a|b", '~', true); // no escape needed tst_Match("a~b", "a~b", '~', false); // escape char; fail tst_Match("a~b", "a~~b", '~', true); // escape char; pass } - @Test public void Chars() { // Escape Regx_bldr; ex: LIKE 'a{' -> a\{ + @Test public void Chars() { // Escape Regx_bldr; ex: LIKE 'a{' -> a\{ tst_EscapeRegxChar(Regx_bldr.Tkn_Escape); // \ tst_EscapeRegxChar(Regx_bldr.Tkn_GroupBegin); // [ tst_EscapeRegxChar(Regx_bldr.Tkn_GroupEnd); // ] diff --git a/100_core/src/gplx/core/texts/StringTableBldr_tst.java b/100_core/src/gplx/core/texts/StringTableBldr_tst.java index d01f972fe..c1f3eaa4f 100644 --- a/100_core/src/gplx/core/texts/StringTableBldr_tst.java +++ b/100_core/src/gplx/core/texts/StringTableBldr_tst.java @@ -1,25 +1,25 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.core.texts; import gplx.*; import gplx.core.*; import org.junit.*; public class StringTableBldr_tst { @Before public void setup() { bldr = StringTableBldr.new_(); } StringTableBldr bldr; - @Test public void TwoCols() { + @Test public void TwoCols() { bldr.Add("a", "aa") .Add("bb", "b"); tst_XtoStr @@ -28,7 +28,7 @@ public class StringTableBldr_tst { , "" ); } - @Test public void RightAlign() { + @Test public void RightAlign() { bldr.Add("a", "aa") .Add("bb", "b"); bldr.FetchAtOrNew(0).Halign_(StringTableColAlign.Right); @@ -39,7 +39,7 @@ public class StringTableBldr_tst { , "" ); } - @Test public void CenterAlign() { + @Test public void CenterAlign() { bldr.Add("aaaa", "a") .Add("b", "bbbb"); bldr.FetchAtOrNew(0).Halign_(StringTableColAlign.Mid); diff --git a/100_core/src/gplx/core/threads/poolables/Gfo_poolable_mgr_tst.java b/100_core/src/gplx/core/threads/poolables/Gfo_poolable_mgr_tst.java index 040af5ccc..5bd776e95 100644 --- a/100_core/src/gplx/core/threads/poolables/Gfo_poolable_mgr_tst.java +++ b/100_core/src/gplx/core/threads/poolables/Gfo_poolable_mgr_tst.java @@ -1,36 +1,36 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.core.threads.poolables; import gplx.*; import gplx.core.*; import gplx.core.threads.*; import org.junit.*; public class Gfo_poolable_mgr_tst { private final Gfo_poolable_mgr_tstr tstr = new Gfo_poolable_mgr_tstr(); @Before public void init() {tstr.Clear();} - @Test public void Get__one() { + @Test public void Get__one() { tstr.Test__get(0); tstr.Test__free__len(0); tstr.Test__pool__len(2); } - @Test public void Get__many__expand() { + @Test public void Get__many__expand() { tstr.Test__get(0); tstr.Test__get(1); tstr.Test__get(2); tstr.Test__free__len(0); tstr.Test__pool__len(4); } - @Test public void Rls__lifo() { + @Test public void Rls__lifo() { tstr.Test__get(0); tstr.Test__get(1); tstr.Test__get(2); @@ -40,7 +40,7 @@ public class Gfo_poolable_mgr_tst { tstr.Test__pool__nxt(0); tstr.Test__free__len(0); } - @Test public void Rls__fifo() { + @Test public void Rls__fifo() { tstr.Test__get(0); tstr.Test__get(1); tstr.Test__get(2); diff --git a/100_core/src/gplx/core/times/DateAdp_parser_tst.java b/100_core/src/gplx/core/times/DateAdp_parser_tst.java index dc5a6d10a..b2465ac23 100644 --- a/100_core/src/gplx/core/times/DateAdp_parser_tst.java +++ b/100_core/src/gplx/core/times/DateAdp_parser_tst.java @@ -1,23 +1,23 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.core.times; import gplx.*; import gplx.core.*; import org.junit.*; public class DateAdp_parser_tst { @Before public void init() {} DateAdp_parser_fxt fxt = new DateAdp_parser_fxt(); - @Test public void Parse_gplx() { + @Test public void Parse_gplx() { fxt.Test_Parse_iso8651_like("2000-01-02T03:04:05.006-05:00" , 2000, 1, 2, 3, 4, 5, 6); fxt.Test_Parse_iso8651_like("2000-01-02" , 2000, 1, 2, 0, 0, 0, 0); } diff --git a/100_core/src/gplx/core/times/Time_span__basic_tst.java b/100_core/src/gplx/core/times/Time_span__basic_tst.java index e4e643064..8aa62fa62 100644 --- a/100_core/src/gplx/core/times/Time_span__basic_tst.java +++ b/100_core/src/gplx/core/times/Time_span__basic_tst.java @@ -1,66 +1,66 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.core.times; import gplx.*; import gplx.core.*; import org.junit.*; public class Time_span__basic_tst { - @Test public void seconds_() { + @Test public void seconds_() { Time_span expd = Time_span_.fracs_(123987); Time_span actl = Time_span_.seconds_(123.987); Tfds.Eq(expd, actl); } - @Test public void TotalSecs() { + @Test public void TotalSecs() { Time_span val = Time_span_.fracs_(1987); Tfds.Eq_decimal(Decimal_adp_.parts_(1, 987), val.Total_secs()); } - @Test public void Units() { + @Test public void Units() { tst_Units("01:02:03.987", 1, 2, 3, 987); tst_Units("01:00:03", 1, 0, 3, 0); tst_Units("01:00:00.987", 1, 0, 0, 987); tst_Units("02:00.987", 0, 2, 0, 987); } - @Test public void Add() { + @Test public void Add() { Time_span val = Time_span_.fracs_(3); Time_span arg = Time_span_.fracs_(2); Time_span expd = Time_span_.fracs_(5); Time_span actl = val.Add(arg); Tfds.Eq(expd, actl); } - @Test public void Subtract() { + @Test public void Subtract() { Time_span val = Time_span_.fracs_(3); Time_span arg = Time_span_.fracs_(2); Time_span expd = Time_span_.fracs_(1); Time_span actl = val.Subtract(arg); Tfds.Eq(expd, actl); } - @Test public void Add_unit_identity() { + @Test public void Add_unit_identity() { tst_AddUnit("00:00:01.000", 0, 0, "00:00:01.000"); } - @Test public void Add_unit_basic() { + @Test public void Add_unit_basic() { tst_AddUnit("01:59:58.987", 0, 1013, "02:00:00.000"); tst_AddUnit("01:59:58.987", 1, 2, "02:00:00.987"); tst_AddUnit("01:59:58.987", 2, 1, "02:00:58.987"); tst_AddUnit("01:59:58.987", 3, 1, "02:59:58.987"); } - @Test public void Add_unit_negative() { + @Test public void Add_unit_negative() { tst_AddUnit("01:00:00.00", 0, -1, "00:59:59.999"); tst_AddUnit("01:00:00.00", 1, -1, "00:59:59.000"); tst_AddUnit("01:00:00.00", 2, -1, "00:59:00.000"); tst_AddUnit("01:00:00.00", 3, -1, "00:00:00.000"); } - @Test public void XtoStrUiAbbrv() { + @Test public void XtoStrUiAbbrv() { tst_XtoStrUiAbbrv("01:02:03.004", "1h 2m 3s 4f"); tst_XtoStrUiAbbrv("00:00:03.004", "3s 4f"); tst_XtoStrUiAbbrv("00:00:03.000", "3s 0f"); diff --git a/100_core/src/gplx/core/times/Time_span__parse_tst.java b/100_core/src/gplx/core/times/Time_span__parse_tst.java index 8d997d849..c62a5f770 100644 --- a/100_core/src/gplx/core/times/Time_span__parse_tst.java +++ b/100_core/src/gplx/core/times/Time_span__parse_tst.java @@ -1,45 +1,45 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.core.times; import gplx.*; import gplx.core.*; import org.junit.*; public class Time_span__parse_tst { - @Test public void Zero() { + @Test public void Zero() { tst_Parse("0", 0); } - @Test public void Milliseconds() { + @Test public void Milliseconds() { tst_Parse("0.987", 987); tst_Parse("0.00199", 1); // do not parse as 199 tst_Parse("0.1", 100); // do not parse as 1 } - @Test public void Seconds() { + @Test public void Seconds() { tst_Parse("1.987", 1987); } - @Test public void Minutes() { + @Test public void Minutes() { tst_Parse("1:02.987", 62987); } - @Test public void MinuteSecondOnly() { + @Test public void MinuteSecondOnly() { tst_Parse("1:02", 62000); } - @Test public void Hour() { + @Test public void Hour() { tst_Parse("1:02:03.987", 3723987); } - @Test public void Negative() { + @Test public void Negative() { tst_Parse("-1:02:03.987", -3723987); } - @Test public void Loopholes() { + @Test public void Loopholes() { tst_Parse("001:02", 62000); // multiple leading zeroes tst_Parse("1.2.3.4", 1200); // ignore all decimals except first tst_Parse("60:60.9999", 3660999); // value does not need to be bounded to limits (except fracs, which is always < 1000) diff --git a/100_core/src/gplx/core/times/Time_span__to_str_tst.java b/100_core/src/gplx/core/times/Time_span__to_str_tst.java index dc265f2c4..65f97e2fb 100644 --- a/100_core/src/gplx/core/times/Time_span__to_str_tst.java +++ b/100_core/src/gplx/core/times/Time_span__to_str_tst.java @@ -1,43 +1,43 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.core.times; import gplx.*; import gplx.core.*; import org.junit.*; public class Time_span__to_str_tst { - @Test public void Zero() { + @Test public void Zero() { tst_Default(0, "0"); } - @Test public void MinuteSeconds() { + @Test public void MinuteSeconds() { tst_Default(77000, "1:17"); } - @Test public void ZeroSuppression() { + @Test public void ZeroSuppression() { tst_Default(660000, "11:00"); //fractional 0 and leading 0s are suppressed; i.e.: not 00:11:00.000 } - @Test public void HourTest() { + @Test public void HourTest() { tst_Default(3723987, "1:02:03.987"); } - @Test public void NegSeconds() { + @Test public void NegSeconds() { tst_Default(-2000, "-2"); } - @Test public void NegMins() { + @Test public void NegMins() { tst_Default(-60000, "-1:00"); } - @Test public void NegHours() { + @Test public void NegHours() { tst_Default(-3723981, "-1:02:03.981"); } - @Test public void ZeroPadding() { + @Test public void ZeroPadding() { tst_ZeroPadding("0", "00:00:00.000"); tst_ZeroPadding("1:02:03.123", "01:02:03.123"); tst_ZeroPadding("1", "00:00:01.000"); diff --git a/100_core/src/gplx/core/type_xtns/DateAdpClassXtn_tst.java b/100_core/src/gplx/core/type_xtns/DateAdpClassXtn_tst.java index 5760066ee..3a10cc1b6 100644 --- a/100_core/src/gplx/core/type_xtns/DateAdpClassXtn_tst.java +++ b/100_core/src/gplx/core/type_xtns/DateAdpClassXtn_tst.java @@ -13,14 +13,14 @@ The terms of each license can be found in the source code repository: GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt */ -package gplx.core.type_xtns; import gplx.*; import gplx.core.*; -import org.junit.*; -public class DateAdpClassXtn_tst { - @Test public void XtoDb() { - tst_XtoDb("20091115 220102.999", "2009-11-15 22:01:02.999"); - } - void tst_XtoDb(String val, String expdRaw) { - String actlRaw = (String)DateAdpClassXtn.Instance.XtoDb(DateAdp_.parse_gplx(val)); - Tfds.Eq(expdRaw, actlRaw); - } -} +package gplx.core.type_xtns; import gplx.*; import gplx.core.*; +import org.junit.*; +public class DateAdpClassXtn_tst { + @Test public void XtoDb() { + tst_XtoDb("20091115 220102.999", "2009-11-15 22:01:02.999"); + } + void tst_XtoDb(String val, String expdRaw) { + String actlRaw = (String)DateAdpClassXtn.Instance.XtoDb(DateAdp_.parse_gplx(val)); + Tfds.Eq(expdRaw, actlRaw); + } +} diff --git a/100_core/src/gplx/langs/dsvs/DsvDataRdr_csv_dat_tst.java b/100_core/src/gplx/langs/dsvs/DsvDataRdr_csv_dat_tst.java index e04413cec..f4558b296 100644 --- a/100_core/src/gplx/langs/dsvs/DsvDataRdr_csv_dat_tst.java +++ b/100_core/src/gplx/langs/dsvs/DsvDataRdr_csv_dat_tst.java @@ -1,39 +1,39 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.langs.dsvs; import gplx.*; import gplx.langs.*; import org.junit.*; import gplx.core.strings.*; import gplx.core.gfo_ndes.*; -public class DsvDataRdr_csv_dat_tst { +public class DsvDataRdr_csv_dat_tst { @Before public void setup() { fx.Parser_(DsvParser.csv_(false, GfoFldList_.Null)); fx.Clear(); } DsvDataRdr_fxt fx = DsvDataRdr_fxt.new_(); - @Test public void Empty() { + @Test public void Empty() { fx.run_parse_(""); fx.tst_DatNull(); } - @Test public void Fld_0() { + @Test public void Fld_0() { fx.run_parse_("a"); fx.tst_DatCsv(fx.ary_("a")); } - @Test public void Fld_N() { + @Test public void Fld_N() { fx.run_parse_("a,b,c"); fx.tst_FldListCsv("fld0", "fld1", "fld2"); fx.tst_DatCsv(fx.ary_("a", "b", "c")); } - @Test public void Row_N() { + @Test public void Row_N() { fx.run_parse_ ( "a,b,c", String_.CrLf , "1,2,3" @@ -43,43 +43,43 @@ public class DsvDataRdr_csv_dat_tst { , fx.ary_("1", "2", "3") ); } - @Test public void Escape_WhiteSpace() { + @Test public void Escape_WhiteSpace() { fx.run_parse_("a,\" \t\",c"); fx.tst_DatCsv(fx.ary_("a", " \t", "c")); } - @Test public void Escape_FldSep() { + @Test public void Escape_FldSep() { fx.run_parse_("a,\",\",c"); fx.tst_DatCsv(fx.ary_("a", ",", "c")); } - @Test public void Escape_RowSep() { + @Test public void Escape_RowSep() { fx.run_parse_("a,\"" + String_.CrLf + "\",c"); fx.tst_DatCsv(fx.ary_("a", String_.CrLf, "c")); } - @Test public void Escape_Quote() { + @Test public void Escape_Quote() { fx.run_parse_("a,\"\"\"\",c"); fx.tst_DatCsv(fx.ary_("a", "\"", "c")); } - @Test public void Blank_Null() { + @Test public void Blank_Null() { fx.run_parse_("a,,c"); fx.tst_DatCsv(fx.ary_("a", null, "c")); } - @Test public void Blank_EmptyString() { + @Test public void Blank_EmptyString() { fx.run_parse_("a,\"\",c"); fx.tst_DatCsv(fx.ary_("a", "", "c")); } - @Test public void Blank_Null_Multiple() { + @Test public void Blank_Null_Multiple() { fx.run_parse_(",,"); fx.tst_DatCsv(fx.ary_(null, null, null)); } - @Test public void TrailingNull() { + @Test public void TrailingNull() { fx.run_parse_("a,"); fx.tst_DatCsv(fx.ary_("a", null)); } - @Test public void TrailingEmpty() { + @Test public void TrailingEmpty() { fx.run_parse_("a,\"\""); fx.tst_DatCsv(fx.ary_("a", "")); } - @Test public void Quote_Error() { + @Test public void Quote_Error() { try { fx.run_parse_("a,\"\" ,c"); Tfds.Fail_expdError(); @@ -88,7 +88,7 @@ public class DsvDataRdr_csv_dat_tst { Tfds.Eq_true(String_.Has(Err_.Message_lang(e), "invalid quote in quoted field")); } } - @Test public void Misc_AllowValsLessThanFields() { + @Test public void Misc_AllowValsLessThanFields() { // assume null when vals.Count < fields.Count; PURPOSE: MsExcel will not save trailing commas for csvExport; ex: a, -> a fx.run_parse_ ( "a0,a1", String_.CrLf @@ -99,7 +99,7 @@ public class DsvDataRdr_csv_dat_tst { , fx.ary_("b0", null) ); } - @Test public void Misc_NewLineValidForSingleColumnTables() { + @Test public void Misc_NewLineValidForSingleColumnTables() { fx.run_parse_ ( "a", String_.CrLf , String_.CrLf @@ -113,7 +113,7 @@ public class DsvDataRdr_csv_dat_tst { , fx.ary_null_() ); } - @Test public void Misc_NewLineValidForSingleColumnTables_FirstLine() { + @Test public void Misc_NewLineValidForSingleColumnTables_FirstLine() { fx.run_parse_ ( String_.CrLf , "b", String_.CrLf @@ -125,7 +125,7 @@ public class DsvDataRdr_csv_dat_tst { , fx.ary_("c") ); } - @Test public void Hdr_Basic() { + @Test public void Hdr_Basic() { fx.Parser_(DsvParser.csv_(true, GfoFldList_.Null)); fx.run_parse_ ( "id,name", String_.CrLf @@ -134,7 +134,7 @@ public class DsvDataRdr_csv_dat_tst { fx.tst_FldListCsv("id", "name"); fx.tst_DatCsv(fx.ary_("0", "me")); } -// @Test public void Hdr_Manual() { +// @Test public void Hdr_Manual() { // fx.Parser_(DsvParser.csv_(false, GfoFldList_.new_().Add("id", IntClassXtn.Instance).Add("name", StringClassXtn.Instance), true)); // fx.run_parse_("0,me"); // fx.tst_DatCsv(fx.ary_(0, "me")); // NOTE: testing auto-parsing of id to int b/c id fld is IntClassXtn.Instance; diff --git a/100_core/src/gplx/langs/dsvs/DsvDataRdr_dsv_dat_tst.java b/100_core/src/gplx/langs/dsvs/DsvDataRdr_dsv_dat_tst.java index 296f36eac..f3256c082 100644 --- a/100_core/src/gplx/langs/dsvs/DsvDataRdr_dsv_dat_tst.java +++ b/100_core/src/gplx/langs/dsvs/DsvDataRdr_dsv_dat_tst.java @@ -1,28 +1,28 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.langs.dsvs; import gplx.*; import gplx.langs.*; import org.junit.*; -public class DsvDataRdr_dsv_dat_tst { +public class DsvDataRdr_dsv_dat_tst { @Before public void setup() {fx.Clear();} DsvDataRdr_fxt fx = DsvDataRdr_fxt.new_(); - @Test public void NameOnly() { + @Test public void NameOnly() { fx.run_parse_("tableName, ,\" \",#"); fx.tst_Tbls("tableName"); fx.tst_Dat(0); } - @Test public void Rows_N() { + @Test public void Rows_N() { fx.run_parse_lines_ ( "numbers, ,\" \",#" , "1,2,3" @@ -34,7 +34,7 @@ public class DsvDataRdr_dsv_dat_tst { , fx.ary_("4", "5", "6") ); } - @Test public void Tbls_N() { + @Test public void Tbls_N() { fx.run_parse_lines_ ( "letters, ,\" \",#" , "a,b,c" @@ -46,7 +46,7 @@ public class DsvDataRdr_dsv_dat_tst { fx.tst_Dat(0, fx.ary_("a", "b", "c")); fx.tst_Dat(1, fx.ary_("1", "2", "3"), fx.ary_("4", "5", "6")); } - @Test public void IgnoreTrailingBlankRow() { + @Test public void IgnoreTrailingBlankRow() { fx.run_parse_lines_ ( "letters, ,\" \",#" , "a,b,c" @@ -55,7 +55,7 @@ public class DsvDataRdr_dsv_dat_tst { fx.tst_Tbls("letters"); fx.tst_Dat(0, fx.ary_("a", "b", "c")); } - @Test public void AllowCommentsDuringData() { + @Test public void AllowCommentsDuringData() { fx.run_parse_lines_ ( "letters, ,\" \",#" , "a,b,c" diff --git a/100_core/src/gplx/langs/dsvs/DsvDataRdr_dsv_hdr_tst.java b/100_core/src/gplx/langs/dsvs/DsvDataRdr_dsv_hdr_tst.java index 164f3a6ee..075606cec 100644 --- a/100_core/src/gplx/langs/dsvs/DsvDataRdr_dsv_hdr_tst.java +++ b/100_core/src/gplx/langs/dsvs/DsvDataRdr_dsv_hdr_tst.java @@ -1,23 +1,23 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.langs.dsvs; import gplx.*; import gplx.langs.*; import org.junit.*; import gplx.core.gfo_ndes.*; import gplx.core.type_xtns.*; -public class DsvDataRdr_dsv_hdr_tst { +public class DsvDataRdr_dsv_hdr_tst { @Before public void setup() {fx.Clear();} DsvDataRdr_fxt fx = DsvDataRdr_fxt.new_(); - @Test public void Names() { + @Test public void Names() { fx.run_parse_lines_ ( "id,name, ,\" \",@" , "0,me" @@ -30,7 +30,7 @@ public class DsvDataRdr_dsv_hdr_tst { , fx.ary_("1", "you") ); } - @Test public void Types() { + @Test public void Types() { fx.run_parse_lines_ ( "int," + StringClassXtn.Key_const + ", ,\" \",$" , "0,me" @@ -42,7 +42,7 @@ public class DsvDataRdr_dsv_hdr_tst { , fx.ary_(1, "you") ); } - @Test public void NamesAndTypes() { + @Test public void NamesAndTypes() { fx.run_parse_lines_ ( "id,name, ,\" \",@" , "int," + StringClassXtn.Key_const + ", ,\" \",$" @@ -55,7 +55,7 @@ public class DsvDataRdr_dsv_hdr_tst { , fx.ary_(1, "you") ); } - @Test public void MultipleTables_NoData() { + @Test public void MultipleTables_NoData() { fx.run_parse_lines_ ( "persons, ,\" \",#" , "id,name, ,\" \",@" @@ -68,7 +68,7 @@ public class DsvDataRdr_dsv_hdr_tst { fx.tst_Dat(0); fx.tst_Dat(1); } - @Test public void Comment() { + @Test public void Comment() { fx.run_parse_lines_ ( "--------------------, ,\" \",//" , "tbl0, ,\" \",#" diff --git a/100_core/src/gplx/langs/dsvs/DsvDataRdr_dsv_misc_tst.java b/100_core/src/gplx/langs/dsvs/DsvDataRdr_dsv_misc_tst.java index 28f1a7b79..e2d0ff003 100644 --- a/100_core/src/gplx/langs/dsvs/DsvDataRdr_dsv_misc_tst.java +++ b/100_core/src/gplx/langs/dsvs/DsvDataRdr_dsv_misc_tst.java @@ -1,23 +1,23 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.langs.dsvs; import gplx.*; import gplx.langs.*; import org.junit.*; import gplx.core.gfo_ndes.*; import gplx.core.type_xtns.*; -public class DsvDataRdr_dsv_misc_tst { +public class DsvDataRdr_dsv_misc_tst { @Before public void setup() {fx.Clear();} DsvDataRdr_fxt fx = DsvDataRdr_fxt.new_(); - @Test public void CmdDlm_NearMatches() { + @Test public void CmdDlm_NearMatches() { fx.run_parse_("a, ,b"); fx.tst_DatCsv(fx.ary_("a", " ", "b")); fx.Clear(); @@ -30,7 +30,7 @@ public class DsvDataRdr_dsv_misc_tst { fx.tst_DatCsv(fx.ary_("a", " ", "b", " ", "c")); fx.Clear(); } - @Test public void CmdDlm_DoNotSpanLines() { + @Test public void CmdDlm_DoNotSpanLines() { fx.run_parse_lines_ ( "a, " , "\" \",b" @@ -40,11 +40,11 @@ public class DsvDataRdr_dsv_misc_tst { , fx.ary_(" ", "b") ); } - @Test public void CmdDlm_SecondFldMustBeQuoted() { + @Test public void CmdDlm_SecondFldMustBeQuoted() { fx.run_parse_lines_("a, , ,b"); // will fail with "invalid command: b", if second , , is interpreted as command delimiter fx.tst_DatCsv(fx.ary_("a", " ", " ", "b")); } - @Test public void Null_Int() { + @Test public void Null_Int() { fx.run_parse_ // not using run_parse_lines_ b/c (a) will have extra lineBreak; (b) test will look funny; ( "int," + StringClassXtn.Key_const + ", ,\" \",$", String_.CrLf , ",val1" @@ -53,7 +53,7 @@ public class DsvDataRdr_dsv_misc_tst { fx.tst_Flds(0, GfoFldList_.new_().Add("fld0", IntClassXtn.Instance).Add("fld1", StringClassXtn.Instance)); fx.tst_Dat(0, fx.ary_(null, "val1")); } - @Test public void Null_String() { + @Test public void Null_String() { fx.run_parse_ // not using run_parse_lines_ b/c (a) will have extra lineBreak; (b) test will look funny; ( StringClassXtn.Key_const + "," + StringClassXtn.Key_const + ", ,\" \",$", String_.CrLf , ",val1" @@ -62,7 +62,7 @@ public class DsvDataRdr_dsv_misc_tst { fx.tst_Flds(0, GfoFldList_.new_().Add("fld0", StringClassXtn.Instance).Add("fld1", StringClassXtn.Instance)); fx.tst_Dat(0, fx.ary_(null, "val1")); } - @Test public void EmptyString() { + @Test public void EmptyString() { fx.run_parse_ // not using run_parse_lines_ b/c (a) will have extra lineBreak; (b) test will look funny; ( StringClassXtn.Key_const + "," + StringClassXtn.Key_const + ", ,\" \",$", String_.CrLf , "\"\",val1" diff --git a/100_core/src/gplx/langs/dsvs/DsvDataRdr_layout_tst.java b/100_core/src/gplx/langs/dsvs/DsvDataRdr_layout_tst.java index 1f70bcd79..912475d60 100644 --- a/100_core/src/gplx/langs/dsvs/DsvDataRdr_layout_tst.java +++ b/100_core/src/gplx/langs/dsvs/DsvDataRdr_layout_tst.java @@ -1,42 +1,42 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.langs.dsvs; import gplx.*; import gplx.langs.*; import org.junit.*; import gplx.core.gfo_ndes.*; import gplx.core.type_xtns.*; -public class DsvDataRdr_layout_tst { - @Test public void TableName() { +public class DsvDataRdr_layout_tst { + @Test public void TableName() { run_parse_lines("table0, ,\" \",#"); tst_Layout(0, DsvHeaderItm.Id_TableName); } - @Test public void Comment() { + @Test public void Comment() { run_parse_lines("-------------, ,\" \",//", "data"); // need dataLine or parser will throw away standalone header tst_Layout(0, DsvHeaderItm.Id_Comment); } - @Test public void BlankLine() { + @Test public void BlankLine() { run_parse_lines("", "data"); // need dataLine or parser will throw away standalone header tst_Layout(0, DsvHeaderItm.Id_BlankLine); } - @Test public void LeafNames() { + @Test public void LeafNames() { run_parse_lines("id,name, ,\" \",@"); tst_Layout(0, DsvHeaderItm.Id_LeafNames); } - @Test public void LeafTypes() { + @Test public void LeafTypes() { run_parse_lines("int," + StringClassXtn.Key_const + ", ,\" \",$"); tst_Layout(0, DsvHeaderItm.Id_LeafTypes); } - @Test public void Combined() { + @Test public void Combined() { run_parse_lines ( "" , "-------------, ,\" \",//" @@ -55,7 +55,7 @@ public class DsvDataRdr_layout_tst { , DsvHeaderItm.Id_Comment ); } - @Test public void Tbl_N() { + @Test public void Tbl_N() { run_parse_lines ( "" , "*************, ,\" \",//" @@ -83,7 +83,7 @@ public class DsvDataRdr_layout_tst { , DsvHeaderItm.Id_Comment ); } - @Test public void Tbl_N_FirstIsEmpty() { + @Test public void Tbl_N_FirstIsEmpty() { run_parse_lines ( "" , "*************, ,\" \",//" diff --git a/100_core/src/gplx/langs/dsvs/DsvDataWtr_csv_tst.java b/100_core/src/gplx/langs/dsvs/DsvDataWtr_csv_tst.java index 8ddf6cd77..8ce6c9786 100644 --- a/100_core/src/gplx/langs/dsvs/DsvDataWtr_csv_tst.java +++ b/100_core/src/gplx/langs/dsvs/DsvDataWtr_csv_tst.java @@ -1,37 +1,37 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.langs.dsvs; import gplx.*; import gplx.langs.*; import org.junit.*; import gplx.core.gfo_ndes.*; import gplx.core.type_xtns.*; public class DsvDataWtr_csv_tst { - @Test public void Dat_Val_0() { + @Test public void Dat_Val_0() { root = fx_nde.csv_dat_(); this.AddCsvRow(root); expd = String_.Concat_lines_crlf(""); fx.tst_XtoStr(wtr, root, expd); } - @Test public void Dat_Val_1() { + @Test public void Dat_Val_1() { root = fx_nde.csv_dat_(); this.AddCsvRow(root, "a"); expd = String_.Concat_lines_crlf("a"); fx.tst_XtoStr(wtr, root, expd); } - @Test public void Dat_Val_N() { + @Test public void Dat_Val_N() { root = fx_nde.csv_dat_(); this.AddCsvRow(root, "a", "b", "c"); expd = String_.Concat_lines_crlf("a,b,c"); fx.tst_XtoStr(wtr, root, expd); } - @Test public void Dat_Row_N() { + @Test public void Dat_Row_N() { root = fx_nde.csv_dat_(); this.AddCsvRow(root, "a", "b", "c"); this.AddCsvRow(root, "d", "e", "f"); @@ -41,37 +41,37 @@ public class DsvDataWtr_csv_tst { ); fx.tst_XtoStr(wtr, root, expd); } - @Test public void Dat_Escape_FldSpr() { // , + @Test public void Dat_Escape_FldSpr() { // , root = fx_nde.csv_dat_(); this.AddCsvRow(root, "a", ",", "c"); expd = String_.Concat_lines_crlf("a,\",\",c"); fx.tst_XtoStr(wtr, root, expd); } - @Test public void Dat_Escape_RcdSpr() { // NewLine + @Test public void Dat_Escape_RcdSpr() { // NewLine root = fx_nde.csv_dat_(); this.AddCsvRow(root, "a", String_.CrLf, "c"); expd = String_.Concat_lines_crlf("a,\"" + String_.CrLf + "\",c"); fx.tst_XtoStr(wtr, root, expd); } - @Test public void Dat_Escape_Quote() { // " -> "" + @Test public void Dat_Escape_Quote() { // " -> "" root = fx_nde.csv_dat_(); this.AddCsvRow(root, "a", "\"", "c"); expd = String_.Concat_lines_crlf("a,\"\"\"\",c"); fx.tst_XtoStr(wtr, root, expd); } - @Test public void Dat_Whitespace() { + @Test public void Dat_Whitespace() { root = fx_nde.csv_dat_(); this.AddCsvRow(root, "a", " b\t", "c"); expd = String_.Concat_lines_crlf("a, b\t,c"); fx.tst_XtoStr(wtr, root, expd); } - @Test public void Dat_Null() { + @Test public void Dat_Null() { root = fx_nde.csv_dat_(); this.AddCsvRow(root, "a", null, "c"); expd = String_.Concat_lines_crlf("a,,c"); fx.tst_XtoStr(wtr, root, expd); } - @Test public void Dat_EmptyString() { + @Test public void Dat_EmptyString() { root = fx_nde.csv_dat_(); this.AddCsvRow(root, "a", "", "c"); expd = String_.Concat_lines_crlf("a,\"\",c"); fx.tst_XtoStr(wtr, root, expd); } - @Test public void Hdr_Flds() { + @Test public void Hdr_Flds() { wtr = DsvDataWtr_.csv_hdr_(); GfoFldList flds = GfoFldList_.new_().Add("id", StringClassXtn.Instance).Add("name", StringClassXtn.Instance); root = fx_nde.csv_hdr_(flds); this.AddCsvRow(root, "0", "me"); diff --git a/100_core/src/gplx/langs/dsvs/DsvDataWtr_tbls_tst.java b/100_core/src/gplx/langs/dsvs/DsvDataWtr_tbls_tst.java index a3472b0f4..b52f35501 100644 --- a/100_core/src/gplx/langs/dsvs/DsvDataWtr_tbls_tst.java +++ b/100_core/src/gplx/langs/dsvs/DsvDataWtr_tbls_tst.java @@ -1,18 +1,18 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.langs.dsvs; import gplx.*; import gplx.langs.*; import org.junit.*; import gplx.core.gfo_ndes.*; public class DsvDataWtr_tbls_tst { @@ -21,12 +21,12 @@ public class DsvDataWtr_tbls_tst { layout.HeaderList().Add_TableName(); wtr.InitWtr(DsvStoreLayout.Key_const, layout); } - @Test public void Rows_0() { + @Test public void Rows_0() { root = fx_nde.tbl_("tbl0"); expd = String_.Concat_lines_crlf( "tbl0, ,\" \",#"); fx.tst_XtoStr(wtr, root, expd); } - @Test public void Rows_N() { + @Test public void Rows_N() { root = fx_nde.tbl_ ( "numbers" , fx_nde.row_vals_(1, 2, 3) @@ -39,7 +39,7 @@ public class DsvDataWtr_tbls_tst { ); fx.tst_XtoStr(wtr, root, expd); } - @Test public void Tbls_N_Empty() { + @Test public void Tbls_N_Empty() { root = fx_nde.root_ ( fx_nde.tbl_("tbl0") , fx_nde.tbl_("tbl1") @@ -50,7 +50,7 @@ public class DsvDataWtr_tbls_tst { ); fx.tst_XtoStr(wtr, root, expd); } - @Test public void Tbls_N() { + @Test public void Tbls_N() { root = fx_nde.root_ ( fx_nde.tbl_("letters" , fx_nde.row_vals_("a", "b", "c")) diff --git a/100_core/src/gplx/langs/gfs/GfsCore.java b/100_core/src/gplx/langs/gfs/GfsCore.java index 11982383a..11edccad5 100644 --- a/100_core/src/gplx/langs/gfs/GfsCore.java +++ b/100_core/src/gplx/langs/gfs/GfsCore.java @@ -1,18 +1,18 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.langs.gfs; import gplx.*; import gplx.langs.*; import gplx.core.gfo_regys.*; public class GfsCore implements Gfo_invk { diff --git a/100_core/src/gplx/langs/gfs/GfsCoreHelp.java b/100_core/src/gplx/langs/gfs/GfsCoreHelp.java deleted file mode 100644 index 2c0cb7f27..000000000 --- a/100_core/src/gplx/langs/gfs/GfsCoreHelp.java +++ /dev/null @@ -1,71 +0,0 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ -package gplx.langs.gfs; import gplx.*; import gplx.langs.*; -import gplx.core.strings.*; -class GfsCoreHelp implements Gfo_invk { - public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) { - String path = m.ReadStrOr("path", ""); - if (String_.Eq(path, "")) { - String_bldr sb = String_bldr_.new_(); - for (int i = 0; i < core.Root_as_regy().Count(); i++) { - GfsRegyItm itm = (GfsRegyItm)core.Root_as_regy().Get_at(i); - sb.Add_spr_unless_first(itm.Key(), String_.CrLf, i); - } - return sb.To_str(); - } - else return Exec(ctx, core.Root_as_regy(), path); - } - public static Err Err_Unhandled(String objPath, String key) {return Err_.new_wo_type("obj does not handle msgKey", "objPath", objPath, "key", key).Trace_ignore_add_1_();} - static Err Err_Unhandled(String[] itmAry, int i) { - String_bldr sb = String_bldr_.new_(); - for (int j = 0; j < i; j++) - sb.Add_spr_unless_first(itmAry[j], ".", j); - return Err_Unhandled(sb.To_str(), itmAry[i]); - } - static Object Exec(GfsCtx rootCtx, Gfo_invk rootInvk, String path) { - String[] itmAry = String_.Split(path, "."); - Gfo_invk invk = rootInvk; - GfsCtx ctx = GfsCtx.new_(); - Object curRv = null; - for (int i = 0; i < itmAry.length; i++) { - String itm = itmAry[i]; - curRv = invk.Invk(ctx, 0, itm, GfoMsg_.Null); - if (curRv == Gfo_invk_.Rv_unhandled) throw Err_Unhandled(itmAry, i); - invk = (Gfo_invk)curRv; - } - GfsCoreHelp helpData = GfsCoreHelp.as_(curRv); - if (helpData != null) { // last itm is actually Method - return ""; - } - else { - ctx = GfsCtx.new_().Help_browseMode_(true); - invk.Invk(ctx, 0, "", GfoMsg_.Null); - String_bldr sb = String_bldr_.new_(); - for (int i = 0; i < ctx.Help_browseList().Count(); i++) { - String s = (String)ctx.Help_browseList().Get_at(i); - sb.Add_spr_unless_first(s, String_.CrLf, i); - } - return sb.To_str(); - } - } - public static GfsCoreHelp as_(Object obj) {return obj instanceof GfsCoreHelp ? (GfsCoreHelp)obj : null;} - public static GfsCoreHelp new_(GfsCore core) { - GfsCoreHelp rv = new GfsCoreHelp(); - rv.core = core; - return rv; - } GfsCoreHelp() {} - GfsCore core; -} diff --git a/100_core/src/gplx/langs/gfs/GfsCore_.java b/100_core/src/gplx/langs/gfs/GfsCore_.java index fd97ecbeb..221441d28 100644 --- a/100_core/src/gplx/langs/gfs/GfsCore_.java +++ b/100_core/src/gplx/langs/gfs/GfsCore_.java @@ -1,19 +1,28 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ -package gplx.langs.gfs; import gplx.*; import gplx.langs.*; +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ +package gplx.langs.gfs; import gplx.Err_; +import gplx.GfoMsg; +import gplx.Gfo_invk; +import gplx.Gfo_invk_; +import gplx.Gfo_usr_dlg_; +import gplx.GfsCtx; +import gplx.Object_; +import gplx.String_; +import gplx.Type_; +import gplx.UsrDlg_; public class GfsCore_ { public static final String Arg_primitive = "v"; public static Object Exec(GfsCtx ctx, Gfo_invk owner_invk, GfoMsg owner_msg, Object owner_primitive, int depth) { @@ -25,8 +34,7 @@ public class GfsCore_ { if (ctx.Fail_if_unhandled()) throw Err_.new_wo_type("Object does not support key", "key", owner_msg.Key(), "ownerType", Type_.Canonical_name_by_obj(owner_invk)); else { - Gfo_usr_dlg usr_dlg = ctx.Usr_dlg(); - if (usr_dlg != null) usr_dlg.Warn_many(GRP_KEY, "unhandled_key", "Object does not support key: key=~{0} ownerType=~{1}", owner_msg.Key(), Type_.Canonical_name_by_obj(owner_invk)); + Gfo_usr_dlg_.Instance.Warn_many(GRP_KEY, "unhandled_key", "Object does not support key: key=~{0} ownerType=~{1}", owner_msg.Key(), Type_.Canonical_name_by_obj(owner_invk)); return Gfo_invk_.Noop; } } diff --git a/100_core/src/gplx/langs/gfs/GfsLibIni_core.java b/100_core/src/gplx/langs/gfs/GfsLibIni_core.java index 217618b68..d03a2a00c 100644 --- a/100_core/src/gplx/langs/gfs/GfsLibIni_core.java +++ b/100_core/src/gplx/langs/gfs/GfsLibIni_core.java @@ -1,23 +1,25 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ -package gplx.langs.gfs; import gplx.*; import gplx.langs.*; -import gplx.core.gfo_regys.*; +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ +package gplx.langs.gfs; import gplx.DateAdp_; +import gplx.GfoTemplateFactory; +import gplx.Io_url_; +import gplx.RandomAdp_; +import gplx.core.gfo_regys.GfoRegy; public class GfsLibIni_core implements GfsLibIni { public void Ini(GfsCore core) { - core.AddCmd(GfsCoreHelp.new_(core), "help"); core.AddObj(DateAdp_.Gfs, "Date_"); core.AddObj(RandomAdp_.Gfs, "RandomAdp_"); core.AddObj(GfoTemplateFactory.Instance, "factory"); diff --git a/100_core/src/gplx/langs/gfs/Gfs_Date_tst.java b/100_core/src/gplx/langs/gfs/Gfs_Date_tst.java index c6a6ea836..9e9abb445 100644 --- a/100_core/src/gplx/langs/gfs/Gfs_Date_tst.java +++ b/100_core/src/gplx/langs/gfs/Gfs_Date_tst.java @@ -1,18 +1,18 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.langs.gfs; import gplx.*; import gplx.langs.*; import org.junit.*; public class Gfs_Date_tst { @@ -21,10 +21,10 @@ public class Gfs_Date_tst { fx.AddObj(DateAdp_.Gfs, "Date_"); Datetime_now.Manual_y_(); } GfsCoreFxt fx; - @Test public void Now() { + @Test public void Now() { fx.tst_MsgStr(fx.msg_(String_.Ary("Date_", "Now")), DateAdp_.parse_gplx("2001-01-01 00:00:00.000")); } - @Test public void Add_day() { + @Test public void Add_day() { fx.tst_MsgStr(fx.msg_(String_.Ary("Date_", "Now", "Add_day"), Keyval_.new_("days", 1)), DateAdp_.parse_gplx("2001-01-02 00:00:00.000")); } } diff --git a/100_core/src/gplx/langs/regxs/Regx_adp__tst.java b/100_core/src/gplx/langs/regxs/Regx_adp__tst.java index 6404831a0..d4ef0ea27 100644 --- a/100_core/src/gplx/langs/regxs/Regx_adp__tst.java +++ b/100_core/src/gplx/langs/regxs/Regx_adp__tst.java @@ -1,54 +1,54 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.langs.regxs; import gplx.*; import gplx.langs.*; import org.junit.*; import gplx.core.tests.*; public class Regx_adp__tst implements TfdsEqListItmStr { - @Test public void Match() { + @Test public void Match() { tst_Match("a", "a", true); // basic tst_Match("a", "b", false); // matchNot tst_Match("a", "ab", true); // matchPart tst_Match("a\\+b", "a+b", true); // matchEscape tst_Match("[^a]", "b", true); // charSet_negate } void tst_Match(String find, String input, boolean expd) {Tfds.Eq(expd, Regx_adp_.Match(input, find));} - @Test public void Match_all() { + @Test public void Match_all() { tst_Match_all("#REDIRECT [[Template:Error]]", "^\\p{Nd}*", 1); // handle match = true but len = 0; DATE:2013-04-11 tst_Match_all("a", "$", 1); // $ should match once, not zero; DATE:2014-09-02 } void tst_Match_all(String input, String regx, int expd) {Tfds.Eq(expd, Regx_adp_.new_(regx).Match_all(input, 0).length);} - @Test public void Replace() { + @Test public void Replace() { tst_Replace("ab", "a", "b", "bb"); // basic tst_Replace("ab", "c", "b", "ab"); // replaceNot tst_Replace("aba", "a", "b", "bbb"); // replaceMultiple } void tst_Replace(String input, String find, String replace, String expd) {Tfds.Eq(expd, Regx_adp_.Replace(input, find, replace));} - @Test public void Match_WholeWord() { + @Test public void Match_WholeWord() { tst_WholeWord("a", "ab a", true); // pass a tst_WholeWord("a", "ab c", false); // fail ab tst_WholeWord("a", "a_", false); // fail a_ tst_WholeWord("[a]", "a [a] c", true); // pass [a] tst_WholeWord("[a]", "a[a]c", false); // fail a[a]c } void tst_WholeWord(String regx, String text, boolean expd) {Tfds.Eq(expd, Regx_adp_.Match(text, Regx_bldr.WholeWord(regx)));} - @Test public void Match_As() { + @Test public void Match_As() { tst_Regx("public static [A-Za-z0-9_]+ as_\\(Object obj\\)", "public static Obj1 as_(Object obj) {return obj instanceof Obj1 ? (Obj1)obj : null;}", true); tst_Regx("public static [A-Za-z0-9_]+ as_\\(Object obj\\)", "public static boolean Asterisk(Object obj) {}", false); } void tst_Regx(String regx, String text, boolean expd) {Tfds.Eq(expd, Regx_adp_.Match(text, regx));} - @Test public void Find() { + @Test public void Find() { tst_Matches("b", "a b c b a", match_(2, 1), match_(6, 1)); tst_Matches("d", "a b c b a"); tst_Matches("b", "a b c b a b b", matches_(2, 6, 10, 12)); // BUGFIX: multiple entries did not work b/c of += instead of + } - @Test public void Groups() { + @Test public void Groups() { tst_Groups("abc def ghi dz", "(d\\p{L}+)", "def", "def", "dz", "dz"); tst_Groups("abc def", "(de)(g?)", "de", "de", ""); // NOTE: (g?) doesn't capture anything, but still add a group for it; DATE:2019-12-28 tst_Groups("-123.456", "^-?(([0-9]+)(?:\\.([0-9]+))?)", "-123.456", "123.456", "123", "456"); // NOTE: -123.456 captured even though it's not part of a group; DATE:2019-12-28 diff --git a/100_core/src/gplx/langs/xmls/HierStrBldr_tst.java b/100_core/src/gplx/langs/xmls/HierStrBldr_tst.java index 5d5044034..17e686b96 100644 --- a/100_core/src/gplx/langs/xmls/HierStrBldr_tst.java +++ b/100_core/src/gplx/langs/xmls/HierStrBldr_tst.java @@ -1,36 +1,36 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.langs.xmls; import gplx.*; import gplx.langs.*; import org.junit.*; import gplx.core.ios.*; import gplx.core.texts.*; public class HierStrBldr_tst { @Before public void setup() {bldr = new HierStrBldr();} HierStrBldr bldr; - @Test public void Hier0() { + @Test public void Hier0() { bldr.Ctor("/root/", "dir_{0}/", "idx_{0}.csv", "000"); tst_MakeName( 0, "/root/idx_000.csv"); tst_MakeName( 1, "/root/idx_001.csv"); tst_MakeName(10, "/root/idx_010.csv"); } - @Test public void Hier1() { + @Test public void Hier1() { bldr.Ctor("/root/", "dir_{0}/", "idx_{0}.csv", "000", 10); tst_MakeName( 0, "/root/dir_000/idx_000.csv"); tst_MakeName( 1, "/root/dir_000/idx_001.csv"); tst_MakeName(10, "/root/dir_010/idx_010.csv"); } - @Test public void Hier2() { + @Test public void Hier2() { bldr.Ctor("/root/", "dir_{0}/", "idx_{0}.csv", "000", 5, 10); tst_MakeName( 0, "/root/dir_000/dir_000/idx_000.csv"); tst_MakeName( 1, "/root/dir_000/dir_000/idx_001.csv"); diff --git a/100_core/src/gplx/langs/xmls/XmlDoc_tst.java b/100_core/src/gplx/langs/xmls/XmlDoc_tst.java index 0a6792344..22d0c941c 100644 --- a/100_core/src/gplx/langs/xmls/XmlDoc_tst.java +++ b/100_core/src/gplx/langs/xmls/XmlDoc_tst.java @@ -1,29 +1,29 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.langs.xmls; import gplx.*; import gplx.langs.*; import org.junit.*; public class XmlDoc_tst { String xml; XmlDoc xdoc; XmlNde xnde; - @Test public void parse() { + @Test public void parse() { xml = String_.Concat(""); xdoc = XmlDoc_.parse(xml); Tfds.Eq("root", xdoc.Root().Name()); Tfds.Eq(true, xdoc.Root().NdeType_element()); } - @Test public void Xml_outer() { + @Test public void Xml_outer() { xml = String_.Concat ( "" , "" @@ -37,7 +37,7 @@ public class XmlDoc_tst { Tfds.Eq("a", xnde.Name()); Tfds.Eq("", xnde.Xml_outer()); } - @Test public void Text_inner() { + @Test public void Text_inner() { xml = String_.Concat ( "" , "" @@ -50,7 +50,7 @@ public class XmlDoc_tst { Tfds.Eq("a", xnde.Name()); Tfds.Eq("test me", xnde.Text_inner()); } - @Test public void Atrs() { + @Test public void Atrs() { xml = String_.Concat ( "" , "" diff --git a/100_core/src/gplx/langs/xmls/XmlFileSplitter_tst.java b/100_core/src/gplx/langs/xmls/XmlFileSplitter_tst.java index a2c9129b3..14e719aaf 100644 --- a/100_core/src/gplx/langs/xmls/XmlFileSplitter_tst.java +++ b/100_core/src/gplx/langs/xmls/XmlFileSplitter_tst.java @@ -1,18 +1,18 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.langs.xmls; import gplx.*; import gplx.langs.*; import org.junit.*; import gplx.core.ios.*; import gplx.core.texts.*; @@ -21,14 +21,14 @@ public class XmlFileSplitter_tst { splitter = new XmlFileSplitter(); Io_mgr.Instance.InitEngine_mem(); } XmlFileSplitter splitter; - @Test public void FindMatchPos() { + @Test public void FindMatchPos() { tst_FindMatchPos("abcde", "a", 0); tst_FindMatchPos("abcde", "b", 1); tst_FindMatchPos("abcde", "cd", 2); tst_FindMatchPos("abcde", "f", -1); tst_FindMatchPos("abcde", "fg", -1); } void tst_FindMatchPos(String src, String find, int expd) {Tfds.Eq(expd, splitter.FindMatchPos(byte_(src), byteAry_(find)));} - @Test public void FindMatchPosRev() { + @Test public void FindMatchPosRev() { tst_FindMatchPosRev("abcde", "a", 0); tst_FindMatchPosRev("abcde", "b", 1); tst_FindMatchPosRev("abcde", "cd", 2); @@ -37,10 +37,10 @@ public class XmlFileSplitter_tst { tst_FindMatchPosRev("abcde", "za", -1); tst_FindMatchPosRev("dbcde", "d", 3); } void tst_FindMatchPosRev(String src, String find, int expd) {Tfds.Eq(expd, splitter.FindMatchPosRev(byte_(src), byteAry_(find)));} - @Test public void ExtractHdr() { + @Test public void ExtractHdr() { tst_ExtractHdr("", "", ""); } - @Test public void Split() { + @Test public void Split() { splitter.Opts().FileSizeMax_(30).XmlNames_(""); tst_Split ( "" diff --git a/100_core/src/gplx/langs/xmls/Xpath__tst.java b/100_core/src/gplx/langs/xmls/Xpath__tst.java index 251f6470c..91a7b54dd 100644 --- a/100_core/src/gplx/langs/xmls/Xpath__tst.java +++ b/100_core/src/gplx/langs/xmls/Xpath__tst.java @@ -1,22 +1,22 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.langs.xmls; import gplx.*; import gplx.langs.*; import org.junit.*; public class Xpath__tst { - @Test public void Select_all() { + @Test public void Select_all() { String xml = String_.Concat ( "" , "" diff --git a/100_core/tst/gplx/GfoMsg_rdr_tst.java b/100_core/tst/gplx/GfoMsg_rdr_tst.java index d183398a4..0bed57c11 100644 --- a/100_core/tst/gplx/GfoMsg_rdr_tst.java +++ b/100_core/tst/gplx/GfoMsg_rdr_tst.java @@ -1,18 +1,18 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx; import org.junit.*; public class GfoMsg_rdr_tst { @@ -20,31 +20,31 @@ public class GfoMsg_rdr_tst { msg = msg_().Add("a", "1").Add("b", "2").Add("c", "3"); ctx.Match("init", "init"); } GfoMsg msg; GfsCtx ctx = GfsCtx.new_(); - @Test public void Key() { + @Test public void Key() { tst_Msg(msg, "a", "1"); tst_Msg(msg, "b", "2"); tst_Msg(msg, "c", "3"); tst_Msg(msg, "d", null); } - @Test public void Pos() { + @Test public void Pos() { msg = msg_().Add("", "1").Add("", "2").Add("", "3"); tst_Msg(msg, "", "1"); tst_Msg(msg, "", "2"); tst_Msg(msg, "", "3"); tst_Msg(msg, "", null); } - @Test public void OutOfOrder() { + @Test public void OutOfOrder() { tst_Msg(msg, "c", "3"); tst_Msg(msg, "b", "2"); tst_Msg(msg, "a", "1"); } - @Test public void Key3_Pos1_Pos2() { + @Test public void Key3_Pos1_Pos2() { msg = msg_().Add("", "1").Add("", "2").Add("c", "3"); tst_Msg(msg, "c", "3"); tst_Msg(msg, "", "1"); tst_Msg(msg, "", "2"); } - @Test public void MultipleEmpty() { + @Test public void MultipleEmpty() { msg = msg_().Add("", "1").Add("", "2").Add("", "3"); tst_Msg(msg, "", "1"); tst_Msg(msg, "", "2"); diff --git a/100_core/tst/gplx/core/ios/IoEngine_dir_basic_base_tst.java b/100_core/tst/gplx/core/ios/IoEngine_dir_basic_base_tst.java index 41035b8c5..a8142c6ba 100644 --- a/100_core/tst/gplx/core/ios/IoEngine_dir_basic_base_tst.java +++ b/100_core/tst/gplx/core/ios/IoEngine_dir_basic_base_tst.java @@ -1,18 +1,18 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.core.ios; import gplx.*; import gplx.core.*; import org.junit.*; public abstract class IoEngine_dir_basic_base_tst { @@ -23,42 +23,42 @@ public abstract class IoEngine_dir_basic_base_tst { } protected IoEngine engine; @gplx.Internal protected IoEngineFxt fx; protected Io_url fil, root; protected abstract IoEngine engine_(); protected abstract void setup_hook(); - @Test @gplx.Virtual public void CreateDir() { + @Test @gplx.Virtual public void CreateDir() { fx.tst_ExistsPaths(false, root); engine.CreateDir(root); fx.tst_ExistsPaths(true, root); } - @Test public void DeleteDir() { + @Test public void DeleteDir() { engine.CreateDir(root); fx.tst_ExistsPaths(true, root); engine.DeleteDir(root); fx.tst_ExistsPaths(false, root); } - @Test public void CreateDir_createAllOwners() { + @Test public void CreateDir_createAllOwners() { Io_url subDir = root.GenSubDir_nest("sub1"); fx.tst_ExistsPaths(false, subDir, subDir.OwnerDir()); engine.CreateDir(subDir); fx.tst_ExistsPaths(true, subDir, subDir.OwnerDir()); } -// @Test public void DeleteDir_missing_fail() { +// @Test public void DeleteDir_missing_fail() { // try {engine.DeleteDir(root);} // catch {return;} // Tfds.Fail_expdError(); // } - @Test public void DeleteDir_missing_pass() { + @Test public void DeleteDir_missing_pass() { engine.DeleteDir(root); } - @Test @gplx.Virtual public void ScanDir() { + @Test @gplx.Virtual public void ScanDir() { Io_url fil = root.GenSubFil("fil1.txt"); fx.run_SaveFilText(fil, "test"); Io_url dir1 = root.GenSubDir_nest("dir1"); engine.CreateDir(dir1); Io_url dir1_1 = dir1.GenSubDir_nest("dir1_1"); engine.CreateDir(dir1_1); // NOTE: QueryDir should not recurse by default; dir1_1 should not be returned below fx.tst_ScanDir(root, dir1, fil); } - @Test public void MoveDir() { + @Test public void MoveDir() { Io_url src = root.GenSubDir_nest("src"), trg = root.GenSubDir_nest("trg"); engine.CreateDir(src); fx.tst_ExistsPaths(true, src); fx.tst_ExistsPaths(false, trg); @@ -66,7 +66,7 @@ public abstract class IoEngine_dir_basic_base_tst { engine.MoveDir(src, trg); fx.tst_ExistsPaths(false, src); fx.tst_ExistsPaths(true, trg); } - @Test @gplx.Virtual public void CopyDir() { + @Test @gplx.Virtual public void CopyDir() { Io_url src = root.GenSubDir_nest("src"), trg = root.GenSubDir_nest("trg"); engine.CreateDir(src); fx.tst_ExistsPaths(true, src); fx.tst_ExistsPaths(false, trg); diff --git a/100_core/tst/gplx/core/ios/IoEngine_dir_basic_system_tst.java b/100_core/tst/gplx/core/ios/IoEngine_dir_basic_system_tst.java index 3b2790193..f7a0e3c2a 100644 --- a/100_core/tst/gplx/core/ios/IoEngine_dir_basic_system_tst.java +++ b/100_core/tst/gplx/core/ios/IoEngine_dir_basic_system_tst.java @@ -13,14 +13,14 @@ The terms of each license can be found in the source code repository: GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt */ -package gplx.core.ios; import gplx.*; import gplx.core.*; -import org.junit.*; -public class IoEngine_dir_basic_system_tst extends IoEngine_dir_basic_base_tst { - @Override protected void setup_hook() { - root = Tfds.RscDir.GenSubDir_nest("100_core", "ioEngineTest", "_temp"); - IoEngine_xrg_deleteDir.new_(root).Recur_().ReadOnlyFails_off().Exec(); - } @Override protected IoEngine engine_() {return IoEngine_system.new_();} - @Test @Override public void ScanDir() { - super.ScanDir(); - } -} +package gplx.core.ios; import gplx.*; import gplx.core.*; +import org.junit.*; +public class IoEngine_dir_basic_system_tst extends IoEngine_dir_basic_base_tst { + @Override protected void setup_hook() { + root = Tfds.RscDir.GenSubDir_nest("100_core", "ioEngineTest", "_temp"); + IoEngine_xrg_deleteDir.new_(root).Recur_().ReadOnlyFails_off().Exec(); + } @Override protected IoEngine engine_() {return IoEngine_system.new_();} + @Test @Override public void ScanDir() { + super.ScanDir(); + } +} diff --git a/100_core/tst/gplx/core/ios/IoEngine_dir_deep_base_tst.java b/100_core/tst/gplx/core/ios/IoEngine_dir_deep_base_tst.java index 087d8f59e..5a4000b94 100644 --- a/100_core/tst/gplx/core/ios/IoEngine_dir_deep_base_tst.java +++ b/100_core/tst/gplx/core/ios/IoEngine_dir_deep_base_tst.java @@ -1,18 +1,18 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.core.ios; import gplx.*; import gplx.core.*; import org.junit.*; public abstract class IoEngine_dir_deep_base_tst { @@ -25,32 +25,32 @@ public abstract class IoEngine_dir_deep_base_tst { } protected IoEngine engine; protected Io_url fil, root; @gplx.Internal protected IoEngineFxt fx; protected abstract IoEngine engine_(); protected abstract void setup_hook(); - @Test @gplx.Virtual public void SearchDir() { + @Test @gplx.Virtual public void SearchDir() { Io_url[] expd = paths_(src_dir0a, src_fil0a, src_dir0a_dir0a, src_dir0a_fil0a); Io_url[] actl = IoEngine_xrg_queryDir.new_(src).Recur_().DirInclude_().ExecAsUrlAry(); Tfds.Eq_ary(expd, actl); } - @Test @gplx.Virtual public void MoveDirDeep() { + @Test @gplx.Virtual public void MoveDirDeep() { fx.tst_ExistsPaths(true, srcTree); fx.tst_ExistsPaths(false, trgTree); engine.MoveDirDeep(IoEngine_xrg_xferDir.move_(src, trg).Recur_()); fx.tst_ExistsPaths(false, srcTree); fx.tst_ExistsPaths(true, trgTree); } - @Test @gplx.Virtual public void CopyDir() { + @Test @gplx.Virtual public void CopyDir() { fx.tst_ExistsPaths(true, srcTree); fx.tst_ExistsPaths(false, trgTree); engine.CopyDir(src, trg); fx.tst_ExistsPaths(true, srcTree); fx.tst_ExistsPaths(true, trgTree); } - @Test @gplx.Virtual public void DeleteDir() { + @Test @gplx.Virtual public void DeleteDir() { fx.tst_ExistsPaths(true, srcTree); engine.DeleteDirDeep(IoEngine_xrg_deleteDir.new_(src).Recur_()); fx.tst_ExistsPaths(false, srcTree); } -// @Test public virtual void CopyDir_IgnoreExisting() { +// @Test public virtual void CopyDir_IgnoreExisting() { // fx.tst_ExistsPaths(true, srcTree); fx.tst_ExistsPaths(false, trgTree); // engine.SaveFilStr(trg_dir0a_fil0a, "x"); // NOTE: this file is different than src counterpart; should be overwritten by Copy // fx.tst_ExistsPaths(true, trg_dir0a, trg_dir0a_fil0a); @@ -59,7 +59,7 @@ public abstract class IoEngine_dir_deep_base_tst { // fx.tst_ExistsPaths(true, srcTree); // fx.tst_ExistsPaths(true, trgTree); // } -// @Test public virtual void CopyDir_IgnoreExistingReadOnlyFile() { +// @Test public virtual void CopyDir_IgnoreExistingReadOnlyFile() { // fx.tst_ExistsPaths(true, srcTree); fx.tst_ExistsPaths(false, trgTree); // engine.SaveFilStr(trg_fil0a, "x"); // NOTE: this file is different than src counterpart; should be overwritten by Copy // fx.tst_ExistsPaths(true, trg_fil0a); @@ -69,7 +69,7 @@ public abstract class IoEngine_dir_deep_base_tst { // fx.tst_ExistsPaths(true, srcTree); // fx.tst_ExistsPaths(true, trgTree); // } -// @Test public void MoveDir_IgnoreExisting() { +// @Test public void MoveDir_IgnoreExisting() { // fx.tst_ExistsPaths(true, srcTree); // fx.tst_ExistsPaths(false, trgTree); // engine.SaveFilStr(trg_dir0a_fil0a, @"x"); // NOTE: this file is different than src counterpart; should be overwritten by Copy @@ -80,7 +80,7 @@ public abstract class IoEngine_dir_deep_base_tst { // fx.tst_ExistsPaths(true, srcTree); // fx.tst_ExistsPaths(true, trgTree); // } -// @Test public virtual void ProgressUi() { +// @Test public virtual void ProgressUi() { // Console_adp__mem dialog = Console_adp__mem.new_(); // engine.SearchDir(src).Recur_().Prog_(dialog).ExecAsDir(); // diff --git a/100_core/tst/gplx/core/ios/IoEngine_dir_deep_memory_tst.java b/100_core/tst/gplx/core/ios/IoEngine_dir_deep_memory_tst.java index 9e0e104f4..25805db3c 100644 --- a/100_core/tst/gplx/core/ios/IoEngine_dir_deep_memory_tst.java +++ b/100_core/tst/gplx/core/ios/IoEngine_dir_deep_memory_tst.java @@ -1,34 +1,34 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.core.ios; import gplx.*; import gplx.core.*; import org.junit.*; public class IoEngine_dir_deep_memory_tst extends IoEngine_dir_deep_base_tst { @Override protected void setup_hook() { root = Io_url_.mem_dir_("mem/root"); } @Override protected IoEngine engine_() {return IoEngine_.Mem_init_();} - @Test @Override public void SearchDir() { + @Test @Override public void SearchDir() { super.SearchDir(); } - @Test @Override public void MoveDirDeep() { + @Test @Override public void MoveDirDeep() { super.MoveDirDeep(); } - @Test @Override public void CopyDir() { + @Test @Override public void CopyDir() { super.CopyDir(); } - @Test @Override public void DeleteDir() { + @Test @Override public void DeleteDir() { super.DeleteDir(); } } diff --git a/100_core/tst/gplx/core/ios/IoEngine_fil_basic_base_tst.java b/100_core/tst/gplx/core/ios/IoEngine_fil_basic_base_tst.java index a7f874a16..9285ed075 100644 --- a/100_core/tst/gplx/core/ios/IoEngine_fil_basic_base_tst.java +++ b/100_core/tst/gplx/core/ios/IoEngine_fil_basic_base_tst.java @@ -1,18 +1,18 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.core.ios; import gplx.*; import gplx.core.*; import org.junit.*; import gplx.core.texts.*;/*EncodingAdp_*/ import gplx.core.ios.streams.*; public abstract class IoEngine_fil_basic_base_tst { @@ -23,39 +23,39 @@ public abstract class IoEngine_fil_basic_base_tst { } protected IoEngine engine; protected IoEngineFxt fx; protected Io_url fil, root; protected abstract IoEngine engine_(); protected abstract void setup_hook(); - @Test @gplx.Virtual public void ExistsFil() { + @Test @gplx.Virtual public void ExistsFil() { fx.tst_ExistsPaths(false, fil); } - @Test @gplx.Virtual public void ExistsFil_deep() { + @Test @gplx.Virtual public void ExistsFil_deep() { fx.tst_ExistsPaths(false, root.GenSubFil_nest("dir1", "dir2", "fil1.txt")); } - @Test @gplx.Virtual public void SaveFilStr() { + @Test @gplx.Virtual public void SaveFilStr() { fx.tst_ExistsPaths(false, fil, fil.OwnerDir()); fx.run_SaveFilText(fil, "text"); fx.tst_ExistsPaths(true, fil, fil.OwnerDir()); } - @Test @gplx.Virtual public void SaveFilText_autoCreateOwnerDir() { + @Test @gplx.Virtual public void SaveFilText_autoCreateOwnerDir() { fil = fil.OwnerDir().GenSubFil_nest("sub1", "fil1.txt"); fx.tst_ExistsPaths(false, fil, fil.OwnerDir()); fx.run_SaveFilText(fil, "text"); fx.tst_ExistsPaths(true, fil, fil.OwnerDir()); } - @Test @gplx.Virtual public void SaveFilText_overwrite() { + @Test @gplx.Virtual public void SaveFilText_overwrite() { fx.run_SaveFilText(fil, "text"); fx.tst_ExistsPaths(true, fil); fx.run_SaveFilText(fil, "changed"); fx.tst_LoadFilStr(fil, "changed"); } - @Test @gplx.Virtual public void SaveFilText_append() { + @Test @gplx.Virtual public void SaveFilText_append() { fx.run_SaveFilText(fil, "text"); engine.SaveFilText_api(IoEngine_xrg_saveFilStr.new_(fil, "appended").Append_()); fx.tst_LoadFilStr(fil, "text" + "appended"); } - @Test @gplx.Virtual public void SaveFilText_caseInsensitive() { + @Test @gplx.Virtual public void SaveFilText_caseInsensitive() { if (root.Info().CaseSensitive()) return; Io_url lcase = root.GenSubFil_nest("dir", "fil.txt"); Io_url ucase = root.GenSubFil_nest("DIR", "FIL.TXT"); @@ -65,7 +65,7 @@ public abstract class IoEngine_fil_basic_base_tst { fx.tst_LoadFilStr(lcase, "text"); fx.tst_LoadFilStr(ucase, "text"); } - @Test @gplx.Virtual public void SaveFilText_readOnlyFails() { + @Test @gplx.Virtual public void SaveFilText_readOnlyFails() { fx.run_SaveFilText(fil, "text"); engine.UpdateFilAttrib(fil, IoItmAttrib.readOnly_()); @@ -77,34 +77,34 @@ public abstract class IoEngine_fil_basic_base_tst { } Tfds.Fail_expdError(); } - @Test @gplx.Virtual public void LoadFilStr() { + @Test @gplx.Virtual public void LoadFilStr() { fx.run_SaveFilText(fil, "text"); fx.tst_LoadFilStr(fil, "text"); } - @Test @gplx.Virtual public void LoadFilStr_missingIgnored() { + @Test @gplx.Virtual public void LoadFilStr_missingIgnored() { Tfds.Eq("", engine.LoadFilStr(IoEngine_xrg_loadFilStr.new_(fil).MissingIgnored_())); } - @Test @gplx.Virtual public void UpdateFilAttrib() { + @Test @gplx.Virtual public void UpdateFilAttrib() { fx.run_SaveFilText(fil, "text"); fx.tst_QueryFilReadOnly(fil, false); engine.UpdateFilAttrib(fil, IoItmAttrib.readOnly_()); fx.tst_QueryFilReadOnly(fil, true); } - @Test @gplx.Virtual public void DeleteFil() { + @Test @gplx.Virtual public void DeleteFil() { fx.run_SaveFilText(fil, "text"); fx.tst_ExistsPaths(true, fil); engine.DeleteFil_api(IoEngine_xrg_deleteFil.new_(fil)); fx.tst_ExistsPaths(false, fil); } - @Test @gplx.Virtual public void DeleteFil_missing_pass() { + @Test @gplx.Virtual public void DeleteFil_missing_pass() { fil = root.GenSubFil("fileThatDoesntExist.txt"); engine.DeleteFil_api(IoEngine_xrg_deleteFil.new_(fil).MissingFails_off()); fx.tst_ExistsPaths(false, fil); } - @Test @gplx.Virtual public void DeleteFil_readOnly_fail() { + @Test @gplx.Virtual public void DeleteFil_readOnly_fail() { fx.run_SaveFilText(fil, "text"); engine.UpdateFilAttrib(fil, IoItmAttrib.readOnly_()); @@ -115,26 +115,26 @@ public abstract class IoEngine_fil_basic_base_tst { } Tfds.Fail_expdError(); } - @Test @gplx.Virtual public void DeleteFil_readOnly_pass() { + @Test @gplx.Virtual public void DeleteFil_readOnly_pass() { fx.run_SaveFilText(fil, "text"); engine.UpdateFilAttrib(fil, IoItmAttrib.readOnly_()); engine.DeleteFil_api(IoEngine_xrg_deleteFil.new_(fil).ReadOnlyFails_off()); fx.tst_ExistsPaths(false, fil); } - @Test @gplx.Virtual public void QueryFil_size() { + @Test @gplx.Virtual public void QueryFil_size() { fx.run_SaveFilText(fil, "text"); fx.tst_QueryFil_size(fil, String_.Len("text")); } - @Test @gplx.Virtual public void UpdateFilModifiedTime() { + @Test @gplx.Virtual public void UpdateFilModifiedTime() { fx.run_SaveFilText(fil, "text"); DateAdp time = Datetime_now.Dflt_add_min_(10); engine.UpdateFilModifiedTime(fil, time); fx.tst_QueryFil_modifiedTime(fil, time); } - @Test @gplx.Virtual public void OpenStreamRead() { + @Test @gplx.Virtual public void OpenStreamRead() { fx.run_SaveFilText(fil, "text"); int textLen = String_.Len("text"); @@ -148,7 +148,7 @@ public abstract class IoEngine_fil_basic_base_tst { String actl = String_.new_u8(buffer); Tfds.Eq("text", actl); } - @Test @gplx.Virtual public void OpenStreamWrite() { + @Test @gplx.Virtual public void OpenStreamWrite() { IoStream stream = IoEngine_xrg_openWrite.new_(fil).Exec(); byte[] buffer = Bry_.new_u8("text"); int textLen = String_.Len("text"); @@ -157,7 +157,7 @@ public abstract class IoEngine_fil_basic_base_tst { fx.tst_LoadFilStr(fil, "text"); } -// @Test public virtual void OpenStreamWrite_in_place() { +// @Test public virtual void OpenStreamWrite_in_place() { // byte[] buffer = Bry_.new_u8("a|b|c"); // IoStream stream = IoEngine_xrg_openWrite.new_(fil).Exec(); // stream.Write(buffer, 0, buffer.length); diff --git a/100_core/tst/gplx/core/ios/IoEngine_fil_basic_memory_tst.java b/100_core/tst/gplx/core/ios/IoEngine_fil_basic_memory_tst.java index 5580105d6..351321ae2 100644 --- a/100_core/tst/gplx/core/ios/IoEngine_fil_basic_memory_tst.java +++ b/100_core/tst/gplx/core/ios/IoEngine_fil_basic_memory_tst.java @@ -1,18 +1,18 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.core.ios; import gplx.*; import gplx.core.*; import org.junit.*; public class IoEngine_fil_basic_memory_tst extends IoEngine_fil_basic_base_tst { @@ -21,10 +21,10 @@ public class IoEngine_fil_basic_memory_tst extends IoEngine_fil_basic_base_tst { root = Io_url_.mem_dir_("mem"); fil = root.GenSubFil_nest("root", "fil.txt"); } - @Test @Override public void OpenStreamRead() { + @Test @Override public void OpenStreamRead() { super.OpenStreamRead (); } - @Test @Override public void SaveFilText_overwrite() { + @Test @Override public void SaveFilText_overwrite() { super.SaveFilText_overwrite(); // bugfix: verify changed file in ownerDir's hash @@ -32,7 +32,7 @@ public class IoEngine_fil_basic_memory_tst extends IoEngine_fil_basic_base_tst { IoItmFil_mem filItm = (IoItmFil_mem)dirItm.SubFils().Get_at(0); Tfds.Eq(filItm.Text(), "changed"); } - @Test public void RecycleFil() { + @Test public void RecycleFil() { fx.run_SaveFilText(fil, "text"); fx.tst_ExistsPaths(true, fil); diff --git a/100_core/tst/gplx/core/ios/IoEngine_fil_basic_system_tst.java b/100_core/tst/gplx/core/ios/IoEngine_fil_basic_system_tst.java index b5836a3b6..d51e72951 100644 --- a/100_core/tst/gplx/core/ios/IoEngine_fil_basic_system_tst.java +++ b/100_core/tst/gplx/core/ios/IoEngine_fil_basic_system_tst.java @@ -1,18 +1,18 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.core.ios; import gplx.*; import gplx.core.*; import org.junit.*; public class IoEngine_fil_basic_system_tst extends IoEngine_fil_basic_base_tst { @@ -21,13 +21,13 @@ public class IoEngine_fil_basic_system_tst extends IoEngine_fil_basic_base_tst { fil = root.GenSubFil("fil.txt"); IoEngine_xrg_deleteDir.new_(fil.OwnerDir()).Recur_().ReadOnlyFails_off().Exec(); } @Override protected IoEngine engine_() {return IoEngine_system.new_();} - @Test public void ExistsFil_IgnoreDifferentCasing() { + @Test public void ExistsFil_IgnoreDifferentCasing() { if (root.Info().CaseSensitive()) return; fx.run_SaveFilText(fil, "text"); fx.tst_ExistsPaths(true, fil); fx.tst_ExistsPaths(true, fil.OwnerDir().GenSubFil("FIL.txt")); } - @Test @gplx.Virtual public void RecycleFil() { + @Test @gplx.Virtual public void RecycleFil() { fx.run_SaveFilText(fil, "text"); fx.tst_ExistsPaths(true, fil); @@ -44,13 +44,13 @@ public class IoEngine_fil_basic_system_tst extends IoEngine_fil_basic_base_tst { fx.tst_ExistsPaths(true, fil); fx.tst_ExistsPaths(false, recycleXrg.RecycleUrl()); } - @Test @Override public void DeleteFil_missing_pass() { + @Test @Override public void DeleteFil_missing_pass() { super.DeleteFil_missing_pass(); } - @Test @Override public void DeleteFil_readOnly_pass() { + @Test @Override public void DeleteFil_readOnly_pass() { super.DeleteFil_readOnly_pass (); } - @Test @Override public void SaveFilText_readOnlyFails() { + @Test @Override public void SaveFilText_readOnlyFails() { super.SaveFilText_readOnlyFails(); } } diff --git a/100_core/tst/gplx/core/ios/IoEngine_fil_xfer_base_tst.java b/100_core/tst/gplx/core/ios/IoEngine_fil_xfer_base_tst.java index 30cd6087e..9cdfa6104 100644 --- a/100_core/tst/gplx/core/ios/IoEngine_fil_xfer_base_tst.java +++ b/100_core/tst/gplx/core/ios/IoEngine_fil_xfer_base_tst.java @@ -1,18 +1,18 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.core.ios; import gplx.*; import gplx.core.*; import org.junit.*; public abstract class IoEngine_fil_xfer_base_tst { @@ -26,7 +26,7 @@ public abstract class IoEngine_fil_xfer_base_tst { protected abstract IoEngine engine_(); protected abstract void setup_hook(); protected abstract Io_url AltRoot(); - @Test @gplx.Virtual public void CopyFil() { + @Test @gplx.Virtual public void CopyFil() { fx.run_SaveFilText(src, "src"); fx.run_UpdateFilModifiedTime(src, srcModifiedTime); fx.tst_ExistsPaths(true, src); fx.tst_ExistsPaths(false, trg); @@ -36,7 +36,7 @@ public abstract class IoEngine_fil_xfer_base_tst { fx.tst_LoadFilStr(trg, "src"); fx.tst_QueryFil_modifiedTime(trg, srcModifiedTime); } - @Test @gplx.Virtual public void CopyFil_overwrite_fail() { + @Test @gplx.Virtual public void CopyFil_overwrite_fail() { fx.run_SaveFilText(src, "src"); fx.run_SaveFilText(trg, "trg"); @@ -48,7 +48,7 @@ public abstract class IoEngine_fil_xfer_base_tst { } Tfds.Fail_expdError(); } - @Test @gplx.Virtual public void CopyFil_overwrite_pass() { + @Test @gplx.Virtual public void CopyFil_overwrite_pass() { fx.run_SaveFilText(src, "src"); fx.run_UpdateFilModifiedTime(src, srcModifiedTime); fx.run_SaveFilText(trg, "trg"); fx.run_UpdateFilModifiedTime(trg, trgModifiedTime); @@ -57,7 +57,7 @@ public abstract class IoEngine_fil_xfer_base_tst { fx.tst_LoadFilStr(trg, "src"); fx.tst_QueryFil_modifiedTime(trg, srcModifiedTime); } - @Test @gplx.Virtual public void MoveFil() { + @Test @gplx.Virtual public void MoveFil() { fx.run_SaveFilText(src, "src"); fx.tst_ExistsPaths(true, src); fx.tst_ExistsPaths(false, trg); @@ -66,7 +66,7 @@ public abstract class IoEngine_fil_xfer_base_tst { fx.tst_ExistsPaths(false, src); fx.tst_ExistsPaths(true, trg); } - @Test @gplx.Virtual public void MoveFil_overwrite_fail() { + @Test @gplx.Virtual public void MoveFil_overwrite_fail() { fx.run_SaveFilText(src, "src"); fx.run_SaveFilText(trg, "trg"); @@ -79,7 +79,7 @@ public abstract class IoEngine_fil_xfer_base_tst { } Tfds.Fail_expdError(); } - @Test @gplx.Virtual public void MoveFil_overwrite_pass() { + @Test @gplx.Virtual public void MoveFil_overwrite_pass() { fx.run_SaveFilText(src, "src"); fx.run_UpdateFilModifiedTime(src, srcModifiedTime); fx.run_SaveFilText(trg, "trg"); fx.run_UpdateFilModifiedTime(trg, trgModifiedTime); @@ -89,7 +89,7 @@ public abstract class IoEngine_fil_xfer_base_tst { fx.tst_LoadFilStr(trg, "src"); fx.tst_QueryFil_modifiedTime(trg, srcModifiedTime); } - @Test @gplx.Virtual public void MoveFil_betweenDrives() { + @Test @gplx.Virtual public void MoveFil_betweenDrives() { IoEngine_xrg_deleteDir.new_(AltRoot()).Recur_().ReadOnlyFails_off().Exec(); src = root.GenSubFil_nest("dir", "fil1a.txt"); trg = AltRoot().GenSubFil_nest("dir", "fil1b.txt"); diff --git a/100_core/tst/gplx/core/ios/IoEngine_stream_xfer_tst.java b/100_core/tst/gplx/core/ios/IoEngine_stream_xfer_tst.java index ebea34466..e314c783e 100644 --- a/100_core/tst/gplx/core/ios/IoEngine_stream_xfer_tst.java +++ b/100_core/tst/gplx/core/ios/IoEngine_stream_xfer_tst.java @@ -1,18 +1,18 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.core.ios; import gplx.*; import gplx.core.*; import org.junit.*; public class IoEngine_stream_xfer_tst { @@ -24,7 +24,7 @@ public class IoEngine_stream_xfer_tst { IoUrlInfoRegy.Instance.Reg(IoUrlInfo_.mem_("mem2/", trgEngine.Key())); srcDir = Io_url_.mem_dir_("mem1/dir"); trgDir = Io_url_.mem_dir_("mem2/dir"); } - @Test public void TransferBetween() { + @Test public void TransferBetween() { Io_url srcPath = srcDir.GenSubFil("fil.txt"); Io_url trgPath = trgDir.GenSubFil("fil.txt"); tst_TransferStreams(srcEngine, srcPath, trgEngine, trgPath); diff --git a/100_core/tst/gplx/core/ios/IoEngine_xrg_queryDir_tst.java b/100_core/tst/gplx/core/ios/IoEngine_xrg_queryDir_tst.java index 79bfce9fa..3aebeb533 100644 --- a/100_core/tst/gplx/core/ios/IoEngine_xrg_queryDir_tst.java +++ b/100_core/tst/gplx/core/ios/IoEngine_xrg_queryDir_tst.java @@ -1,50 +1,50 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.core.ios; import gplx.*; import gplx.core.*; import org.junit.*; public class IoEngine_xrg_queryDir_tst { @Before public void setup() { engine = IoEngine_.Mem_init_(); } IoEngine engine; Io_url[] ary; - @Test public void Basic() { + @Test public void Basic() { ary = save_text_(fil_("fil1.txt")); tst_ExecPathAry(finder_(), ary); } - @Test public void FilPath() { + @Test public void FilPath() { ary = save_text_(fil_("fil1.txt"), fil_("fil2.jpg"), fil_("fil3.txt")); tst_ExecPathAry(finder_(), ary); // default: all files tst_ExecPathAry(finder_().FilPath_("*.txt") // findPattern of *.txt , fil_("fil1.txt"), fil_("fil3.txt")); } - @Test public void Recur() { + @Test public void Recur() { ary = save_text_(fil_("fil1.txt"), fil_("dirA", "fil1A.jpg")); tst_ExecPathAry(finder_(), fil_("fil1.txt")); // default: no recursion tst_ExecPathAry(finder_().Recur_(), ary); // recurse } - @Test public void DirPattern() { + @Test public void DirPattern() { save_text_(fil_("fil1.txt"), fil_("dirA", "fil1A.jpg")); tst_ExecPathAry(finder_(), fil_("fil1.txt")); // default: files only tst_ExecPathAry(finder_().DirInclude_() // include dirs; NOTE: fil1A not returned b/c Recur_ is not true , dir_("dirA"), fil_("fil1.txt")); } - @Test public void Sort_by() { + @Test public void Sort_by() { save_text_(fil_("fil2a.txt"), fil_("fil1.txt")); tst_ExecPathAry(finder_() // default: sortByAscOrder diff --git a/100_core/tst/gplx/core/ios/IoEngine_xrg_recycleFil_tst.java b/100_core/tst/gplx/core/ios/IoEngine_xrg_recycleFil_tst.java index 39d0b2779..5d5ff59dd 100644 --- a/100_core/tst/gplx/core/ios/IoEngine_xrg_recycleFil_tst.java +++ b/100_core/tst/gplx/core/ios/IoEngine_xrg_recycleFil_tst.java @@ -13,18 +13,18 @@ The terms of each license can be found in the source code repository: GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt */ -package gplx.core.ios; import gplx.*; import gplx.core.*; -import org.junit.*; -public class IoEngine_xrg_recycleFil_tst { - @Before public void setup() { - IoEngine_.Mem_init_(); - } - @Test public void GenRecycleUrl() { - tst_GenRecycleUrl(recycle_(), Io_url_.mem_fil_("mem/z_trash/20100102/gplx.images;115559123;;fil.txt")); - tst_GenRecycleUrl(recycle_().Uuid_include_(), Io_url_.mem_fil_("mem/z_trash/20100102/gplx.images;115559123;467ffb41-cdfe-402f-b22b-be855425784b;fil.txt")); - } - IoEngine_xrg_recycleFil recycle_() {return IoEngine_xrg_recycleFil.gplx_(Io_url_.mem_fil_("mem/dir/fil.txt")).AppName_("gplx.images").Uuid_(Guid_adp_.Parse("467ffb41-cdfe-402f-b22b-be855425784b")).Time_(DateAdp_.parse_gplx("20100102_115559123"));} - void tst_GenRecycleUrl(IoEngine_xrg_recycleFil xrg, Io_url expd) { - Tfds.Eq(expd, xrg.RecycleUrl()); - } -} +package gplx.core.ios; import gplx.*; import gplx.core.*; +import org.junit.*; +public class IoEngine_xrg_recycleFil_tst { + @Before public void setup() { + IoEngine_.Mem_init_(); + } + @Test public void GenRecycleUrl() { + tst_GenRecycleUrl(recycle_(), Io_url_.mem_fil_("mem/z_trash/20100102/gplx.images;115559123;;fil.txt")); + tst_GenRecycleUrl(recycle_().Uuid_include_(), Io_url_.mem_fil_("mem/z_trash/20100102/gplx.images;115559123;467ffb41-cdfe-402f-b22b-be855425784b;fil.txt")); + } + IoEngine_xrg_recycleFil recycle_() {return IoEngine_xrg_recycleFil.gplx_(Io_url_.mem_fil_("mem/dir/fil.txt")).AppName_("gplx.images").Uuid_(Guid_adp_.Parse("467ffb41-cdfe-402f-b22b-be855425784b")).Time_(DateAdp_.parse_gplx("20100102_115559123"));} + void tst_GenRecycleUrl(IoEngine_xrg_recycleFil xrg, Io_url expd) { + Tfds.Eq(expd, xrg.RecycleUrl()); + } +} diff --git a/100_core/tst/gplx/core/ios/IoItmDir_FetchDeepOrNull_tst.java b/100_core/tst/gplx/core/ios/IoItmDir_FetchDeepOrNull_tst.java index a21798af1..82f69d641 100644 --- a/100_core/tst/gplx/core/ios/IoItmDir_FetchDeepOrNull_tst.java +++ b/100_core/tst/gplx/core/ios/IoItmDir_FetchDeepOrNull_tst.java @@ -1,18 +1,18 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.core.ios; import gplx.*; import gplx.core.*; import org.junit.*; public class IoItmDir_FetchDeepOrNull_tst { @@ -20,7 +20,7 @@ public class IoItmDir_FetchDeepOrNull_tst { drive = Io_url_.mem_dir_("mem"); rootDir = bldr.dir_(drive, bldr.dir_(drive.GenSubDir("sub1"))); } IoItm_fxt bldr = IoItm_fxt.new_(); Io_url drive; IoItmDir rootDir; - @Test public void FetchDeepOrNull() { + @Test public void FetchDeepOrNull() { tst_FetchDeepOrNull(rootDir, drive.GenSubDir("sub1"), true); tst_FetchDeepOrNull(rootDir, drive.GenSubDir("sub2"), false); tst_FetchDeepOrNull(rootDir.SubDirs().Get_at(0), drive.GenSubDir("sub1"), true); diff --git a/100_core/tst/gplx/core/ios/IoUrlInfo_alias_tst.java b/100_core/tst/gplx/core/ios/IoUrlInfo_alias_tst.java index e6c743874..87d2469a2 100644 --- a/100_core/tst/gplx/core/ios/IoUrlInfo_alias_tst.java +++ b/100_core/tst/gplx/core/ios/IoUrlInfo_alias_tst.java @@ -1,47 +1,47 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.core.ios; import gplx.*; import gplx.core.*; import org.junit.*; public class IoUrlInfo_alias_tst { IoUrlInfo_alias alias; - @Test public void MapWntToWnt() { + @Test public void MapWntToWnt() { Make("usr:\\", "D:\\usr\\"); tst_Xto_api("usr:\\dir\\fil.txt", "D:\\usr\\dir\\fil.txt"); tst_OwnerDir("usr:\\dir\\", "usr:\\"); tst_OwnerDir("usr:\\", ""); tst_NameOnly("usr:\\", "usr"); } - @Test public void MapToLnx() { + @Test public void MapToLnx() { Make("usr:\\", "/home/"); tst_Xto_api("usr:\\dir\\fil.txt", "/home/dir/fil.txt"); } - @Test public void MapLnxToWnt() { + @Test public void MapLnxToWnt() { Make("usr:/", "C:\\usr\\"); tst_Xto_api("usr:/dir/fil.txt", "C:\\usr\\dir\\fil.txt"); } - @Test public void WntToWnt() { + @Test public void WntToWnt() { Make("C:\\", "X:\\"); tst_Xto_api("C:\\dir\\fil.txt", "X:\\dir\\fil.txt"); tst_NameOnly("C:\\", "C"); } - @Test public void WntToLnx() { + @Test public void WntToLnx() { Make("C:\\", "/home/"); tst_Xto_api("C:\\dir\\fil.txt", "/home/dir/fil.txt"); } - @Test public void LnxToWnt() { + @Test public void LnxToWnt() { Make("/home/", "C:\\"); tst_Xto_api("/home/dir/fil.txt", "C:\\dir\\fil.txt"); tst_NameOnly("/home/", "home"); diff --git a/100_core/tst/gplx/core/ios/IoUrl_lnx_tst.java b/100_core/tst/gplx/core/ios/IoUrl_lnx_tst.java index 4bc122ca4..d57bd9972 100644 --- a/100_core/tst/gplx/core/ios/IoUrl_lnx_tst.java +++ b/100_core/tst/gplx/core/ios/IoUrl_lnx_tst.java @@ -1,52 +1,52 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.core.ios; import gplx.*; import gplx.core.*; import org.junit.*; public class IoUrl_lnx_tst { IoUrlFxt fx = IoUrlFxt.new_(); - @Test public void Raw() { + @Test public void Raw() { fx.tst_Xto_gplx(Io_url_.lnx_dir_("/home/"), "/home/"); fx.tst_Xto_gplx(Io_url_.lnx_dir_("/home"), "/home/"); // add / fx.tst_Xto_gplx(Io_url_.lnx_dir_("/"), "/"); fx.tst_Xto_gplx(Io_url_.lnx_fil_("/home/fil.txt"), "/home/fil.txt"); } - @Test public void Xto_api() { + @Test public void Xto_api() { fx.tst_Xto_api(Io_url_.lnx_fil_("/home/fil.txt"), "/home/fil.txt"); fx.tst_Xto_api(Io_url_.lnx_dir_("/home/"), "/home"); // del / fx.tst_Xto_api(Io_url_.lnx_dir_("/"), "/"); } - @Test public void OwnerRoot() { + @Test public void OwnerRoot() { fx.tst_OwnerRoot(Io_url_.lnx_dir_("/home/fil.txt"), "/"); fx.tst_OwnerRoot(Io_url_.lnx_dir_("/home"), "/"); fx.tst_OwnerRoot(Io_url_.lnx_dir_("root"), "/"); } - @Test public void XtoNames() { + @Test public void XtoNames() { fx.tst_XtoNames(Io_url_.lnx_dir_("/home/fil.txt"), fx.ary_("root", "home", "fil.txt")); fx.tst_XtoNames(Io_url_.lnx_dir_("/home"), fx.ary_("root", "home")); } - @Test public void IsDir() { + @Test public void IsDir() { fx.tst_IsDir(Io_url_.lnx_dir_("/home"), true); fx.tst_IsDir(Io_url_.lnx_fil_("/home/file.txt"), false); } - @Test public void OwnerDir() { + @Test public void OwnerDir() { fx.tst_OwnerDir(Io_url_.lnx_dir_("/home/lnxusr"), Io_url_.lnx_dir_("/home")); fx.tst_OwnerDir(Io_url_.lnx_dir_("/fil.txt"), Io_url_.lnx_dir_("/")); fx.tst_OwnerDir(Io_url_.lnx_dir_("/"), Io_url_.Empty); } - @Test public void NameAndExt() { + @Test public void NameAndExt() { fx.tst_NameAndExt(Io_url_.lnx_fil_("/fil.txt"), "fil.txt"); fx.tst_NameAndExt(Io_url_.lnx_dir_("/dir"), "dir/"); } diff --git a/100_core/tst/gplx/core/ios/IoUrl_map_tst.java b/100_core/tst/gplx/core/ios/IoUrl_map_tst.java index fa8c2ce43..34c3ce3aa 100644 --- a/100_core/tst/gplx/core/ios/IoUrl_map_tst.java +++ b/100_core/tst/gplx/core/ios/IoUrl_map_tst.java @@ -13,17 +13,17 @@ The terms of each license can be found in the source code repository: GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt */ -package gplx.core.ios; import gplx.*; import gplx.core.*; -import org.junit.*; -public class IoUrl_map_tst { - IoUrlFxt fx = IoUrlFxt.new_(); - @Test public void Xto_api() { - IoUrlInfo inf = IoUrlInfo_.alias_("tst:\\", "C:\\tst\\", IoEngine_.SysKey); - fx.tst_Xto_api(Io_url_.new_inf_("tst:\\dir\\fil.txt", inf), "C:\\tst\\dir\\fil.txt"); - fx.tst_Xto_api(Io_url_.new_inf_("tst:\\dir\\", inf), "C:\\tst\\dir"); // no trailing \ - } - @Test public void Xto_api_wce() { - IoUrlInfo inf = IoUrlInfo_.alias_("wce:\\", "\\SD Card\\", IoEngine_.SysKey); - fx.tst_Xto_api(Io_url_.new_inf_("wce:\\dir\\", inf), "\\SD Card\\dir"); - } -} +package gplx.core.ios; import gplx.*; import gplx.core.*; +import org.junit.*; +public class IoUrl_map_tst { + IoUrlFxt fx = IoUrlFxt.new_(); + @Test public void Xto_api() { + IoUrlInfo inf = IoUrlInfo_.alias_("tst:\\", "C:\\tst\\", IoEngine_.SysKey); + fx.tst_Xto_api(Io_url_.new_inf_("tst:\\dir\\fil.txt", inf), "C:\\tst\\dir\\fil.txt"); + fx.tst_Xto_api(Io_url_.new_inf_("tst:\\dir\\", inf), "C:\\tst\\dir"); // no trailing \ + } + @Test public void Xto_api_wce() { + IoUrlInfo inf = IoUrlInfo_.alias_("wce:\\", "\\SD Card\\", IoEngine_.SysKey); + fx.tst_Xto_api(Io_url_.new_inf_("wce:\\dir\\", inf), "\\SD Card\\dir"); + } +} diff --git a/100_core/tst/gplx/core/ios/IoUrl_wnt_tst.java b/100_core/tst/gplx/core/ios/IoUrl_wnt_tst.java index 2f051fc85..2e6fd01c1 100644 --- a/100_core/tst/gplx/core/ios/IoUrl_wnt_tst.java +++ b/100_core/tst/gplx/core/ios/IoUrl_wnt_tst.java @@ -1,77 +1,77 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.core.ios; import gplx.*; import gplx.core.*; import org.junit.*; public class IoUrl_wnt_tst { IoUrlFxt fx = IoUrlFxt.new_(); - @Test public void Raw() { + @Test public void Raw() { fx.tst_Xto_gplx(Io_url_.wnt_fil_("C:\\dir\\fil.txt"), "C:\\dir\\fil.txt"); fx.tst_Xto_gplx(Io_url_.wnt_dir_("C:\\dir\\"), "C:\\dir\\"); fx.tst_Xto_gplx(Io_url_.wnt_dir_("C:\\dir") , "C:\\dir\\"); // add \ } - @Test public void Xto_api() { + @Test public void Xto_api() { fx.tst_Xto_api(Io_url_.wnt_fil_("C:\\fil.txt"), "C:\\fil.txt"); fx.tst_Xto_api(Io_url_.wnt_dir_("C:\\dir\\"), "C:\\dir"); // del \ fx.tst_Xto_api(Io_url_.wnt_dir_("C:"), "C:"); } - @Test public void OwnerRoot() { + @Test public void OwnerRoot() { fx.tst_OwnerRoot(Io_url_.wnt_dir_("C:\\dir") , "C:\\"); fx.tst_OwnerRoot(Io_url_.wnt_dir_("C:\\fil.png") , "C:\\"); fx.tst_OwnerRoot(Io_url_.wnt_dir_("C:") , "C:\\"); } - @Test public void IsDir() { + @Test public void IsDir() { fx.tst_IsDir(Io_url_.wnt_dir_("C:\\dir\\"), true); fx.tst_IsDir(Io_url_.wnt_fil_("C:\\dir"), false); fx.tst_IsDir(Io_url_.wnt_fil_("C:\\fil.txt"), false); } - @Test public void OwnerDir() { + @Test public void OwnerDir() { fx.tst_OwnerDir(Io_url_.wnt_dir_("C:\\dir\\sub1"), Io_url_.wnt_dir_("C:\\dir")); fx.tst_OwnerDir(Io_url_.wnt_fil_("C:\\fil.txt"), Io_url_.wnt_dir_("C:")); fx.tst_OwnerDir(Io_url_.wnt_dir_("C:"), Io_url_.Empty); // fx.tst_OwnerDir(Io_url_.wnt_fil_("press enter to select this folder"), Io_url_.Empty); } - @Test public void NameAndExt() { + @Test public void NameAndExt() { fx.tst_NameAndExt(Io_url_.wnt_fil_("C:\\fil.txt"), "fil.txt"); fx.tst_NameAndExt(Io_url_.wnt_dir_("C:\\dir"), "dir\\"); } - @Test public void NameOnly() { + @Test public void NameOnly() { fx.tst_NameOnly(Io_url_.wnt_fil_("C:\\fil.txt"), "fil"); fx.tst_NameOnly(Io_url_.wnt_dir_("C:\\dir"), "dir"); fx.tst_NameOnly(Io_url_.wnt_dir_("C:"), "C"); } - @Test public void Ext() { + @Test public void Ext() { fx.tst_Ext(Io_url_.wnt_fil_("C:\\fil.txt"), ".txt"); // fil fx.tst_Ext(Io_url_.wnt_fil_("C:\\fil.multiple.txt"), ".txt"); // multiple ext fx.tst_Ext(Io_url_.wnt_fil_("C:\\fil"), ""); // no ext fx.tst_Ext(Io_url_.wnt_dir_("C:\\dir"), "\\"); // dir } - @Test public void GenSubDir_nest() { + @Test public void GenSubDir_nest() { fx.tst_GenSubDir_nest(Io_url_.wnt_dir_("C:"), fx.ary_("dir1", "sub1"), Io_url_.wnt_dir_("C:\\dir1\\sub1")); } - @Test public void GenNewExt() { + @Test public void GenNewExt() { fx.tst_GenNewExt(Io_url_.wnt_fil_("C:\\fil.gif"), ".png", Io_url_.wnt_fil_("C:\\fil.png")); // basic fx.tst_GenNewExt(Io_url_.wnt_fil_("C:\\fil.tst.gif"), ".png", Io_url_.wnt_fil_("C:\\fil.tst.png")); // last in multiple dotted } - @Test public void GenRelUrl_orEmpty() { + @Test public void GenRelUrl_orEmpty() { fx.tst_GenRelUrl_orEmpty(Io_url_.wnt_fil_("C:\\root\\fil.txt") , Io_url_.wnt_dir_("C:\\root") , "fil.txt"); // fil fx.tst_GenRelUrl_orEmpty(Io_url_.wnt_dir_("C:\\root\\dir") , Io_url_.wnt_dir_("C:\\root") , "dir\\"); // dir fx.tst_GenRelUrl_orEmpty(Io_url_.wnt_fil_("C:\\root\\dir\\fil.txt") , Io_url_.wnt_dir_("C:\\root") , "dir\\fil.txt"); // fil: nested1 fx.tst_GenRelUrl_orEmpty(Io_url_.wnt_fil_("C:\\root\\dir\\fil.txt") , Io_url_.wnt_dir_("C:") , "root\\dir\\fil.txt"); // fil: nested2 } - @Test public void GenParallel() { + @Test public void GenParallel() { fx.tst_GenParallel(Io_url_.wnt_fil_("C:\\root1\\fil.txt"), Io_url_.wnt_dir_("C:\\root1"), Io_url_.wnt_dir_("D:\\root2"), Io_url_.wnt_fil_("D:\\root2\\fil.txt")); fx.tst_GenParallel(Io_url_.wnt_dir_("C:\\root1\\dir") , Io_url_.wnt_dir_("C:\\root1"), Io_url_.wnt_dir_("D:\\root2"), Io_url_.wnt_dir_("D:\\root2\\dir")); } diff --git a/100_core/tst/gplx/core/stores/GfoNdeRdr_read_tst.java b/100_core/tst/gplx/core/stores/GfoNdeRdr_read_tst.java index 94ea997e5..16d71d694 100644 --- a/100_core/tst/gplx/core/stores/GfoNdeRdr_read_tst.java +++ b/100_core/tst/gplx/core/stores/GfoNdeRdr_read_tst.java @@ -1,38 +1,38 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.core.stores; import gplx.*; import gplx.core.*; import org.junit.*; import gplx.core.gfo_ndes.*; import gplx.core.type_xtns.*; public class GfoNdeRdr_read_tst { - @Test public void ReadInt() { + @Test public void ReadInt() { rdr = rdr_(IntClassXtn.Instance, "id", 1); Tfds.Eq(rdr.ReadInt("id"), 1); } - @Test public void ReadIntOr() { + @Test public void ReadIntOr() { rdr = rdr_(IntClassXtn.Instance, "id", 1); Tfds.Eq(rdr.ReadIntOr("id", -1), 1); } - @Test public void ReadIntElse_minus1() { + @Test public void ReadIntElse_minus1() { rdr = rdr_(IntClassXtn.Instance, "id", null); Tfds.Eq(rdr.ReadIntOr("id", -1), -1); } - @Test public void ReadInt_parse() { + @Test public void ReadInt_parse() { rdr = rdr_(StringClassXtn.Instance, "id", "1"); Tfds.Eq(rdr.ReadInt("id"), 1); } - @Test public void ReadIntElse_parse() { + @Test public void ReadIntElse_parse() { rdr = rdr_(StringClassXtn.Instance, "id", "2"); Tfds.Eq(rdr.ReadIntOr("id", -1), 2); } diff --git a/100_core/tst/gplx/core/stores/GfoNdeRdr_tst.java b/100_core/tst/gplx/core/stores/GfoNdeRdr_tst.java index eeda8c6d3..2aa05fafd 100644 --- a/100_core/tst/gplx/core/stores/GfoNdeRdr_tst.java +++ b/100_core/tst/gplx/core/stores/GfoNdeRdr_tst.java @@ -1,22 +1,22 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.core.stores; import gplx.*; import gplx.core.*; import org.junit.*; import gplx.core.gfo_ndes.*; public class GfoNdeRdr_tst { - @Test public void Subs_leafs() { + @Test public void Subs_leafs() { root = fx.root_ ( fx.row_vals_(0) @@ -25,7 +25,7 @@ public class GfoNdeRdr_tst { ); tst_NdeVals(root, 0, 1, 2); } - @Test public void Subs_ndes() { + @Test public void Subs_ndes() { root = fx.root_ ( leaf_("", 0) @@ -34,7 +34,7 @@ public class GfoNdeRdr_tst { ); tst_NdeVals(root, 0, 1, 2); } - @Test public void Subs_mix() { + @Test public void Subs_mix() { root = fx.root_ ( leaf_("", 0) @@ -43,7 +43,7 @@ public class GfoNdeRdr_tst { ); tst_NdeVals(root, 0, 1, 2); } - @Test public void Subs_rdr() { + @Test public void Subs_rdr() { root = fx.root_ ( fx.row_vals_(0) @@ -54,7 +54,7 @@ public class GfoNdeRdr_tst { Tfds.Eq(0, rdr.ReadAt(0)); Tfds.Eq_false(rdr.MoveNextPeer()); } - @Test public void MoveNextPeer_implicit() { + @Test public void MoveNextPeer_implicit() { root = fx.root_ ( fx.csv_dat_ @@ -68,7 +68,7 @@ public class GfoNdeRdr_tst { DataRdr subRdr = subsRdr.Subs(); // MoveNextPeer not needed; implicitly moves to pos=0 tst_RdrVals(subRdr, Object_.Ary(0, 1, 2)); } - @Test public void MoveNextPeer_explicit() { + @Test public void MoveNextPeer_explicit() { root = fx.root_ ( fx.csv_dat_ @@ -83,7 +83,7 @@ public class GfoNdeRdr_tst { DataRdr subRdr = subsRdr.Subs(); tst_RdrVals(subRdr, Object_.Ary(0, 1, 2)); } - @Test public void Xpath_basic() { + @Test public void Xpath_basic() { root = fx.root_ ( leaf_("root", 0) , leaf_("root", 1) @@ -91,7 +91,7 @@ public class GfoNdeRdr_tst { ); tst_Xpath_all(root, "root", 0, 1, 2); } - @Test public void Xpath_nested() { + @Test public void Xpath_nested() { root = fx.root_ ( fx.tbl_("owner" , leaf_("root", 0) @@ -100,7 +100,7 @@ public class GfoNdeRdr_tst { )); tst_Xpath_all(root, "owner/root", 0, 1, 2); } - @Test public void Xpath_null() { + @Test public void Xpath_null() { root = fx.root_ ( leaf_("match", 0) ); @@ -108,13 +108,13 @@ public class GfoNdeRdr_tst { DataRdr sub = rootRdr.Subs_byName("no_match"); Tfds.Eq_false(sub.MoveNextPeer()); } - @Test public void Xpath_moveFirst_basic() { + @Test public void Xpath_moveFirst_basic() { root = fx.root_ ( leaf_("nde0", 0) ); tst_Xpath_first(root, "nde0", 0); } - @Test public void Xpath_moveFirst_shallow() { + @Test public void Xpath_moveFirst_shallow() { root = fx.root_ ( leaf_("nde0", 0) , leaf_("nde1", 1) @@ -122,7 +122,7 @@ public class GfoNdeRdr_tst { ); tst_Xpath_first(root, "nde2", 2); } - @Test public void Xpath_moveFirst_nested() { + @Test public void Xpath_moveFirst_nested() { root = fx.root_ ( node_("nde0", Object_.Ary("0") , leaf_("nde00", "00") @@ -130,7 +130,7 @@ public class GfoNdeRdr_tst { tst_Xpath_first(root, "nde0", "0"); tst_Xpath_first(root, "nde0/nde00", "00"); } - @Test public void Xpath_moveFirst_nested_similarName() { + @Test public void Xpath_moveFirst_nested_similarName() { root = fx.root_ ( node_("nde0", Object_.Ary("0") , leaf_("nde00", "00") @@ -140,7 +140,7 @@ public class GfoNdeRdr_tst { )); tst_Xpath_first(root, "nde1/nde00", "10"); } - @Test public void Xpath_moveFirst_many() { + @Test public void Xpath_moveFirst_many() { root = fx.root_ ( leaf_("root", 0) , leaf_("root", 1) @@ -148,7 +148,7 @@ public class GfoNdeRdr_tst { ); tst_Xpath_first(root, "root", 0); // returns first } - @Test public void Xpath_moveFirst_null() { + @Test public void Xpath_moveFirst_null() { root = fx.root_ ( leaf_("nde0", 0) , leaf_("nde1", 1) diff --git a/100_core/tst/gplx/core/stores/xmls/XmlDataRdr_tst.java b/100_core/tst/gplx/core/stores/xmls/XmlDataRdr_tst.java index ce4822ff4..95f0b0684 100644 --- a/100_core/tst/gplx/core/stores/xmls/XmlDataRdr_tst.java +++ b/100_core/tst/gplx/core/stores/xmls/XmlDataRdr_tst.java @@ -1,29 +1,29 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.core.stores.xmls; import gplx.*; import gplx.core.*; import gplx.core.stores.*; import org.junit.*; public class XmlDataRdr_tst { - @Test public void Read() { + @Test public void Read() { DataRdr rdr = fx.rdr_(""); Tfds.Eq(rdr.NameOfNode(), "title"); Tfds.Eq(rdr.ReadStr("name"), "first"); Tfds.Eq(rdr.ReadInt("id"), 1); Tfds.Eq(rdr.ReadBool("profiled"), false); } - @Test public void None() { + @Test public void None() { DataRdr rdr = fx.rdr_ ( "<root>" , "<find/>" @@ -31,7 +31,7 @@ public class XmlDataRdr_tst { ); fx.tst_Subs_ByName(rdr, "no_nde", "no_atr"); } - @Test public void One() { + @Test public void One() { DataRdr rdr = fx.rdr_ ( "<root>" , "<find id=\"f0\" />" @@ -39,7 +39,7 @@ public class XmlDataRdr_tst { ); fx.tst_Subs_ByName(rdr, "find", "id", "f0"); } - @Test public void One_IgnoreOthers() { + @Test public void One_IgnoreOthers() { DataRdr rdr = fx.rdr_ ( "<root>" , "<find id=\"f0\" />" @@ -48,7 +48,7 @@ public class XmlDataRdr_tst { ); fx.tst_Subs_ByName(rdr, "find", "id", "f0"); } - @Test public void Many() { + @Test public void Many() { DataRdr rdr = fx.rdr_ ( "<root>" , "<find id=\"f0\" />" @@ -57,7 +57,7 @@ public class XmlDataRdr_tst { ); fx.tst_Subs_ByName(rdr, "find", "id", "f0", "f1"); } - @Test public void Nested() { + @Test public void Nested() { DataRdr rdr = fx.rdr_ ( "<root>" , "<sub1>" @@ -68,7 +68,7 @@ public class XmlDataRdr_tst { ); fx.tst_Subs_ByName(rdr, "sub1/find", "id", "f0", "f1"); } - @Test public void Nested_IgnoreOthers() { + @Test public void Nested_IgnoreOthers() { DataRdr rdr = fx.rdr_ ( "<root>" , "<sub1>" diff --git a/100_core/tst/gplx/core/stores/xmls/XmlDataWtr_tst.java b/100_core/tst/gplx/core/stores/xmls/XmlDataWtr_tst.java index 5627f345c..8d7ad69d7 100644 --- a/100_core/tst/gplx/core/stores/xmls/XmlDataWtr_tst.java +++ b/100_core/tst/gplx/core/stores/xmls/XmlDataWtr_tst.java @@ -1,35 +1,35 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.core.stores.xmls; import gplx.*; import gplx.core.*; import gplx.core.stores.*; import org.junit.*; public class XmlDataWtr_tst { @Before public void setup() { wtr = XmlDataWtr.new_(); } - @Test public void WriteNodeBgn() { + @Test public void WriteNodeBgn() { wtr.WriteNodeBgn("chapter"); tst_XStr(wtr, "<chapter />", String_.CrLf); } - @Test public void Attributes() { + @Test public void Attributes() { wtr.WriteNodeBgn("chapter"); wtr.WriteData("id", 1); wtr.WriteData("name", "first"); tst_XStr(wtr, "<chapter id=\"1\" name=\"first\" />", String_.CrLf); } - @Test public void Subs() { + @Test public void Subs() { wtr.WriteNodeBgn("title"); wtr.WriteNodeBgn("chapters"); wtr.WriteNodeBgn("chapter"); @@ -41,7 +41,7 @@ public class XmlDataWtr_tst { , "", String_.CrLf ); } - @Test public void Subs_Iterate() { + @Test public void Subs_Iterate() { wtr.WriteNodeBgn("titles"); for (int title = 1; title <= 2; title++) { wtr.WriteNodeBgn("title"); @@ -62,7 +62,7 @@ public class XmlDataWtr_tst { , "", String_.CrLf ); } - @Test public void Peers() { + @Test public void Peers() { wtr.WriteNodeBgn("title"); wtr.WriteNodeBgn("chapters"); wtr.WriteNodeEnd(); @@ -74,7 +74,7 @@ public class XmlDataWtr_tst { , "", String_.CrLf ); } - @Test public void AtrsWithNesting() { + @Test public void AtrsWithNesting() { wtr.WriteNodeBgn("title"); wtr.WriteData("id", 1); wtr.WriteData("name", "first"); diff --git a/110_gfml/.classpath b/110_gfml/.classpath deleted file mode 100644 index d858d25a6..000000000 --- a/110_gfml/.classpath +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - diff --git a/110_gfml/tst/gplx/gfml/GfmlDataRdr_tst.java b/110_gfml/tst/gplx/gfml/GfmlDataRdr_tst.java index e93912241..6b257b5d4 100644 --- a/110_gfml/tst/gplx/gfml/GfmlDataRdr_tst.java +++ b/110_gfml/tst/gplx/gfml/GfmlDataRdr_tst.java @@ -1,28 +1,28 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.gfml; import gplx.*; import org.junit.*; import gplx.core.stores.*; public class GfmlDataRdr_tst { - @Test public void Raw() { + @Test public void Raw() { raw = "root:{}"; rdr = rdr_(raw); Tfds.Eq(rdr.NameOfNode(), "root"); } - @Test public void Atrs() { + @Test public void Atrs() { raw = "root:id=1 name=me isPresent=true dateOf='2006-12-08';"; rdr = rdr_(raw); @@ -31,7 +31,7 @@ public class GfmlDataRdr_tst { Tfds.Eq(rdr.ReadBool("isPresent"), true); Tfds.Eq_date(rdr.ReadDate("dateOf"), DateAdp_.parse_gplx("2006-12-08")); } - @Test public void Subs() { + @Test public void Subs() { raw = String_.Concat_any( "root:{", " computers:id=1 {", @@ -63,7 +63,7 @@ public class GfmlDataRdr_tst { } Tfds.Eq(idx, 2); } - @Test public void SelectRdr() { + @Test public void SelectRdr() { raw = String_.Concat_any( "root:{", " person:name=me {}", @@ -78,7 +78,7 @@ public class GfmlDataRdr_tst { Tfds.Eq(computer.NameOfNode(), "computer"); Tfds.Eq(computer.ReadStr("brand"), "noname"); } -// @Test public void Subs_byKey() { +// @Test public void Subs_byKey() { // raw = String_.Concat_any( // "root:", // " person=(name=me)", @@ -89,7 +89,7 @@ public class GfmlDataRdr_tst { // Tfds.Eq(person.NameOfNode, "person"); // Tfds.Eq(person.ReadStr("name"), "me"); // } -// @Test public void Type() { +// @Test public void Type() { // raw = String_.Concat_any( // "root:{", // " _type:{example{explicit_val; bool_val; int_val; string_val; long_val; date_val; float_val; decimal_val;}}", diff --git a/110_gfml/tst/gplx/gfml/z011_IntObjHash_tst.java b/110_gfml/tst/gplx/gfml/z011_IntObjHash_tst.java index 4b4efc799..962d7e230 100644 --- a/110_gfml/tst/gplx/gfml/z011_IntObjHash_tst.java +++ b/110_gfml/tst/gplx/gfml/z011_IntObjHash_tst.java @@ -1,42 +1,42 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.gfml; import gplx.*; import org.junit.*; -public class z011_IntObjHash_tst { +public class z011_IntObjHash_tst { @Before public void setup() { hash = new IntObjHash_base(); } IntObjHash_base hash; - @Test public void Empty() { + @Test public void Empty() { tst_Count(0); tst_Fetch(1, null); } - @Test public void Add() { + @Test public void Add() { hash.Add(1, "1"); tst_Count(1); tst_Fetch(1, "1"); tst_Fetch(2, null); } - @Test public void Del() { + @Test public void Del() { hash.Add(1, "1"); hash.Del(1); tst_Count(0); tst_Fetch(1, null); } - @Test public void Clear() { + @Test public void Clear() { hash.Add(1, "1"); hash.Add(32, "32"); tst_Fetch(1, "1"); @@ -48,7 +48,7 @@ public class z011_IntObjHash_tst { tst_Fetch(2, null); tst_Fetch(32, null); } - @Test public void Add_bug() { // fails after expanding ary, and fetching at key=n*16 + @Test public void Add_bug() { // fails after expanding ary, and fetching at key=n*16 hash.Add(1, "1"); tst_Count(1); tst_Fetch(1, "1"); diff --git a/110_gfml/tst/gplx/gfml/z012_GfmlTrie_tst.java b/110_gfml/tst/gplx/gfml/z012_GfmlTrie_tst.java index 2fb1bb426..bbdb72df6 100644 --- a/110_gfml/tst/gplx/gfml/z012_GfmlTrie_tst.java +++ b/110_gfml/tst/gplx/gfml/z012_GfmlTrie_tst.java @@ -1,18 +1,18 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.gfml; import gplx.*; import org.junit.*; import gplx.core.texts.*; /*CharStream*/ @@ -20,28 +20,28 @@ public class z012_GfmlTrie_tst { @Before public void setup() { trie = GfmlTrie.new_(); } GfmlTrie trie; - @Test public void Null() { + @Test public void Null() { tst_FindMatch_first("", null); tst_FindMatch_first("{", null); } - @Test public void OneChar() { + @Test public void OneChar() { trie.Add("{", "val0"); tst_FindMatch_first("{", "val0"); tst_FindMatch_first(":", null); } - @Test public void TwoChar() { + @Test public void TwoChar() { trie.Add("/*", "val0"); tst_FindMatch_first("/*", "val0"); tst_FindMatch_first("//", null); } - @Test public void ManySym() { + @Test public void ManySym() { trie.Add(":", "val0"); trie.Add("{", "val1"); tst_FindMatch_first(":", "val0"); tst_FindMatch_first("{", "val1"); tst_FindMatch_first("-", null); } - @Test public void Overlap_1_2() { + @Test public void Overlap_1_2() { trie.Add("[", "val0"); trie.Add("[:", "val1"); tst_FindMatch_first("[", "val0"); @@ -49,7 +49,7 @@ public class z012_GfmlTrie_tst { tst_FindMatch_first("[-", "val0"); tst_FindMatch_first(":", null); } - @Test public void Overlap_2_1() { + @Test public void Overlap_2_1() { trie.Add("[:", "val0"); trie.Add("[", "val1"); tst_FindMatch_first("[:", "val0"); @@ -57,7 +57,7 @@ public class z012_GfmlTrie_tst { tst_FindMatch_first("[-", "val1"); tst_FindMatch_first(":", null); } - @Test public void Overlap_1_1() { + @Test public void Overlap_1_1() { trie.Add("[", "val0"); trie.Add("[", "val1"); tst_FindMatch_first("[", "val1"); // return last added diff --git a/110_gfml/tst/gplx/gfml/z015_GfmlDocPos_tst.java b/110_gfml/tst/gplx/gfml/z015_GfmlDocPos_tst.java index 6ba899921..d6364ac3d 100644 --- a/110_gfml/tst/gplx/gfml/z015_GfmlDocPos_tst.java +++ b/110_gfml/tst/gplx/gfml/z015_GfmlDocPos_tst.java @@ -1,45 +1,45 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.gfml; import gplx.*; import org.junit.*; -public class z015_GfmlDocPos_tst { +public class z015_GfmlDocPos_tst { GfmlDocPos root = GfmlDocPos_.Root; - @Test public void Root() { + @Test public void Root() { tst_Path(root, "0"); } - @Test public void MoveDown() { + @Test public void MoveDown() { tst_Path(root.NewDown(0), "0_0"); tst_Path(root.NewDown(0).NewDown(0), "0_0_0"); tst_Path(root.NewDown(1).NewDown(2), "0_1_2"); } - @Test public void MoveUp() { + @Test public void MoveUp() { tst_Path(root.NewDown(1).NewDown(2).NewUp(), "0_1"); } - @Test public void CompareTo_same() { + @Test public void CompareTo_same() { GfmlDocPos lhs = root.NewDown(0); GfmlDocPos rhs = root.NewDown(0); tst_CompareTo(lhs, rhs, CompareAble_.Same); } - @Test public void CompareTo_diffIndex() { + @Test public void CompareTo_diffIndex() { GfmlDocPos lhs = root.NewDown(0); GfmlDocPos rhs = root.NewDown(1); tst_CompareTo(lhs, rhs, CompareAble_.Less); tst_CompareTo(rhs, lhs, CompareAble_.More); } - @Test public void CompareTo_diffLevel() { + @Test public void CompareTo_diffLevel() { GfmlDocPos lhs = root; GfmlDocPos rhs = root.NewDown(0); tst_CompareTo(lhs, rhs, CompareAble_.Less); diff --git a/110_gfml/tst/gplx/gfml/z016_GfmlScopeList_tst.java b/110_gfml/tst/gplx/gfml/z016_GfmlScopeList_tst.java index f1c5e88b4..1ceb9b46f 100644 --- a/110_gfml/tst/gplx/gfml/z016_GfmlScopeList_tst.java +++ b/110_gfml/tst/gplx/gfml/z016_GfmlScopeList_tst.java @@ -1,32 +1,32 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.gfml; import gplx.*; import org.junit.*; public class z016_GfmlScopeList_tst { @Before public void setup() { list = GfmlScopeList.new_("test"); } GfmlScopeList list; - @Test public void None() { + @Test public void None() { tst_Itm(list, GfmlDocPos_.Root, null); } - @Test public void One() { + @Test public void One() { run_Add(list, var_("val1")); tst_Itm(list, GfmlDocPos_.Root, "val1"); } - @Test public void ByPos() { + @Test public void ByPos() { run_Add(list, var_("val1").DocPos_(docPos_(0, 0))); run_Add(list, var_("val2").DocPos_(docPos_(0, 0, 0))); tst_Itm(list, docPos_(0, 0), "val1"); diff --git a/110_gfml/tst/gplx/gfml/z017_GfmlStringHighlighter_tst.java b/110_gfml/tst/gplx/gfml/z017_GfmlStringHighlighter_tst.java index e18c5a657..e9b360923 100644 --- a/110_gfml/tst/gplx/gfml/z017_GfmlStringHighlighter_tst.java +++ b/110_gfml/tst/gplx/gfml/z017_GfmlStringHighlighter_tst.java @@ -1,22 +1,22 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.gfml; import gplx.*; import org.junit.*; public class z017_GfmlStringHighlighter_tst { - @Test public void Short() { + @Test public void Short() { tst_Err(sh_().Raw_("a=").Mark_(1, '=', "key tkn").Mark_(2, '?', "EOS:missing data") , "< >" , " a= " @@ -26,14 +26,14 @@ public class z017_GfmlStringHighlighter_tst { , "[2] ? EOS:missing data" ); } - @Test public void Whitespace() { + @Test public void Whitespace() { tst_Err(sh_().Raw_("a\t\nb").Mark_(0, ' ', "") , "< tn >" , " a b " , " " ); } - @Test public void Long() { + @Test public void Long() { tst_Err(sh_().Raw_("abcdefghijklmnopqrstuvwxyzyxwvutsrqponmlkjihgfedcba").Mark_(0, '{', "bgn").Mark_(50, '}', "end") , "< >" , " abcdefghijklmnopqrstuvwxyzyxwvutsrqponmlkjihgfedcba " diff --git a/110_gfml/tst/gplx/gfml/z051_GfmlFldPool_keyed_tst.java b/110_gfml/tst/gplx/gfml/z051_GfmlFldPool_keyed_tst.java index 8399959bf..269f13585 100644 --- a/110_gfml/tst/gplx/gfml/z051_GfmlFldPool_keyed_tst.java +++ b/110_gfml/tst/gplx/gfml/z051_GfmlFldPool_keyed_tst.java @@ -1,18 +1,18 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.gfml; import gplx.*; import org.junit.*; public class z051_GfmlFldPool_keyed_tst { @@ -21,26 +21,26 @@ public class z051_GfmlFldPool_keyed_tst { GfmlType type = makr.MakeSubType("point", "x", "y", "z"); fldPool = GfmlFldPool.new_(type); } GfmlFldPool fldPool; - @Test public void PopByKey_inOrder() { + @Test public void PopByKey_inOrder() { tst_Keyed_PopByKey(fldPool, "x", "x", "y", "z"); } - @Test public void PopByKey_outOfOrder() { + @Test public void PopByKey_outOfOrder() { tst_Keyed_PopByKey(fldPool, "y", "y", "x", "z"); } - @Test public void PopByKey_unknown() { + @Test public void PopByKey_unknown() { tst_Keyed_PopByKey(fldPool, "a", GfmlItmKeys.NullKey, "x", "y", "z"); } - @Test public void PopByKey_alreadyRemoved() { + @Test public void PopByKey_alreadyRemoved() { tst_Keyed_PopByKey(fldPool, "x", "x", "y", "z"); tst_Keyed_PopByKey(fldPool, "x", GfmlItmKeys.NullKey, "y", "z"); } - @Test public void PopByKey_depleted() { + @Test public void PopByKey_depleted() { tst_Keyed_PopByKey(fldPool, "x", "x", "y", "z"); tst_Keyed_PopByKey(fldPool, "y", "y", "z"); tst_Keyed_PopByKey(fldPool, "z", "z"); tst_Keyed_PopByKey(fldPool, "x", GfmlItmKeys.NullKey); } - @Test public void PopNext_inOrder() { + @Test public void PopNext_inOrder() { tst_Keyed_PopNext(fldPool, "x", "y", "z"); tst_Keyed_PopNext(fldPool, "y", "z"); tst_Keyed_PopNext(fldPool, "z"); @@ -50,7 +50,7 @@ public class z051_GfmlFldPool_keyed_tst { } catch (Exception exc) {Err_.Noop(exc);} } - @Test public void PopByKey_PopNext() { + @Test public void PopByKey_PopNext() { tst_Keyed_PopByKey(fldPool, "y", "y", "x", "z"); tst_Keyed_PopNext(fldPool, "x", "z"); } diff --git a/110_gfml/tst/gplx/gfml/z081_GfmlDataWtr_tst.java b/110_gfml/tst/gplx/gfml/z081_GfmlDataWtr_tst.java index 4499e1910..3d6c43ebe 100644 --- a/110_gfml/tst/gplx/gfml/z081_GfmlDataWtr_tst.java +++ b/110_gfml/tst/gplx/gfml/z081_GfmlDataWtr_tst.java @@ -1,18 +1,18 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.gfml; import gplx.*; import org.junit.*; import gplx.core.stores.*; public class z081_GfmlDataWtr_tst { @@ -20,45 +20,45 @@ public class z081_GfmlDataWtr_tst { wtr = GfmlDataWtr.new_(); wtr.WriteNodeBgn("root"); } DataWtr wtr; - @Test public void Basic() { + @Test public void Basic() { tst_XtoStr(wtr, "root:;"); } - @Test public void Atr_one() { + @Test public void Atr_one() { wtr.WriteData("key", "data");; tst_XtoStr(wtr, "root:key='data';"); } - @Test public void Atr_many() { + @Test public void Atr_many() { wtr.WriteData("key1", "data1"); wtr.WriteData("key2", "data2"); tst_XtoStr(wtr, "root:key1='data1' key2='data2';"); } - @Test public void Nde_one() { + @Test public void Nde_one() { wtr.WriteNodeBgn("sub0"); tst_XtoStr(wtr, "root:{sub0:;}"); } - @Test public void Nde_many() { + @Test public void Nde_many() { wtr.WriteNodeBgn("sub0"); wtr.WriteNodeEnd(); wtr.WriteNodeBgn("sub1"); tst_XtoStr(wtr, "root:{sub0:;sub1:;}"); } - @Test public void Nde_nested() { + @Test public void Nde_nested() { wtr.WriteNodeBgn("sub0"); wtr.WriteNodeBgn("sub1"); tst_XtoStr(wtr, "root:{sub0:{sub1:;}}"); } - @Test public void OneAtrOneNde() { + @Test public void OneAtrOneNde() { wtr.WriteData("key1", "data1"); wtr.WriteNodeBgn("sub0"); tst_XtoStr(wtr, "root:key1='data1'{sub0:;}"); } - @Test public void OneAtrOneNdeOneAtr() { + @Test public void OneAtrOneNdeOneAtr() { wtr.WriteData("key1", "data1"); wtr.WriteNodeBgn("sub0"); wtr.WriteData("key2", "data2"); tst_XtoStr(wtr, "root:key1='data1'{sub0:key2='data2';}"); } - @Test public void EscapeQuote() { + @Test public void EscapeQuote() { wtr.WriteData("key", "data's");; tst_XtoStr(wtr, "root:key='data''s';"); } diff --git a/110_gfml/tst/gplx/gfml/z082_GfmlDataWtrOpts_tst.java b/110_gfml/tst/gplx/gfml/z082_GfmlDataWtrOpts_tst.java index ecb18652e..2af341601 100644 --- a/110_gfml/tst/gplx/gfml/z082_GfmlDataWtrOpts_tst.java +++ b/110_gfml/tst/gplx/gfml/z082_GfmlDataWtrOpts_tst.java @@ -1,18 +1,18 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.gfml; import gplx.*; import org.junit.*; import gplx.core.stores.*; public class z082_GfmlDataWtrOpts_tst { @@ -20,13 +20,13 @@ public class z082_GfmlDataWtrOpts_tst { wtr = GfmlDataWtr.new_(); wtr.WriteNodeBgn("root"); } DataWtr wtr; - @Test public void KeyedSpr() { + @Test public void KeyedSpr() { wtr.InitWtr(GfmlDataWtrOpts.Key_const, GfmlDataWtrOpts.new_().KeyedSeparator_("\t")); wtr.WriteData("key1", "data1"); wtr.WriteData("key2", "data2"); tst_XtoStr(wtr, "root:key1='data1'\tkey2='data2';"); } - @Test public void IndentNamesOn() { + @Test public void IndentNamesOn() { wtr.InitWtr(GfmlDataWtrOpts.Key_const, GfmlDataWtrOpts.new_().IndentNodesOn_()); wtr.WriteNodeBgn("nde1"); wtr.WriteNodeBgn("nde2"); @@ -39,7 +39,7 @@ public class z082_GfmlDataWtrOpts_tst { , "}" )); } - @Test public void IgnoreNullNamesOn() { + @Test public void IgnoreNullNamesOn() { wtr.InitWtr(GfmlDataWtrOpts.Key_const, GfmlDataWtrOpts.new_().IgnoreNullNamesOn_()); wtr.WriteNodeBgn(""); wtr.WriteData("key1", "data1"); diff --git a/110_gfml/tst/gplx/gfml/z091_GfmlLxr_basic_tst.java b/110_gfml/tst/gplx/gfml/z091_GfmlLxr_basic_tst.java index 798cf1263..e4b3c4e82 100644 --- a/110_gfml/tst/gplx/gfml/z091_GfmlLxr_basic_tst.java +++ b/110_gfml/tst/gplx/gfml/z091_GfmlLxr_basic_tst.java @@ -1,18 +1,18 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.gfml; import gplx.*; import org.junit.*; import gplx.core.texts.*; /*CharStream*/ @@ -20,20 +20,20 @@ public class z091_GfmlLxr_basic_tst { @Before public void setup() { rootLxr = GfmlLxr_.general_("gfml.root", GfmlTkn_.cmd_("tkn:text", GfmlBldrCmd_.Null)); } GfmlLxr rootLxr; - @Test public void Empty() { + @Test public void Empty() { tst_Fetch(""); } - @Test public void General() { + @Test public void General() { tst_Fetch("text", "text"); } - @Test public void Solo() { + @Test public void Solo() { ini_AddSymbol(","); tst_Fetch(",", ","); tst_Fetch(",data0", ",", "data0"); tst_Fetch("data0,", "data0", ","); tst_Fetch("data0,data1", "data0", ",", "data1"); } - @Test public void Range() { + @Test public void Range() { ini_AddRange(" ", "\t"); tst_Fetch(" ", " "); tst_Fetch(" a", " ", "a"); diff --git a/110_gfml/tst/gplx/gfml/z101_core_ndeInline_tst.java b/110_gfml/tst/gplx/gfml/z101_core_ndeInline_tst.java index 232a90010..086848f40 100644 --- a/110_gfml/tst/gplx/gfml/z101_core_ndeInline_tst.java +++ b/110_gfml/tst/gplx/gfml/z101_core_ndeInline_tst.java @@ -1,18 +1,18 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.gfml; import gplx.*; import org.junit.*; public class z101_core_ndeInline_tst { @@ -20,7 +20,7 @@ public class z101_core_ndeInline_tst { @Before public void setup() { fx.ini_RootLxr_Add(GfmlDocLxrs.NdeInline_lxr()); } - @Test public void One() { + @Test public void One() { fx.tst_Doc("a;", fx.nde_().Atru_("a")); fx.tst_Tkn("a;" , fx.tkn_grp_ @@ -28,7 +28,7 @@ public class z101_core_ndeInline_tst { , fx.tkn_itm_(";") )); } - @Test public void Many() { + @Test public void Many() { fx.tst_Doc("a;b;" , fx.nde_().Atru_("a") , fx.nde_().Atru_("b") diff --git a/110_gfml/tst/gplx/gfml/z102_core_whitespace_tst.java b/110_gfml/tst/gplx/gfml/z102_core_whitespace_tst.java index fc9cc5183..b2576e4f9 100644 --- a/110_gfml/tst/gplx/gfml/z102_core_whitespace_tst.java +++ b/110_gfml/tst/gplx/gfml/z102_core_whitespace_tst.java @@ -1,18 +1,18 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.gfml; import gplx.*; import org.junit.*; public class z102_core_whitespace_tst { @@ -23,7 +23,7 @@ public class z102_core_whitespace_tst { , GfmlDocLxrs.Whitespace_lxr() ); } - @Test public void Space() { + @Test public void Space() { fx.tst_Doc("a b;", fx.nde_().Atru_("a").Atru_("b")); fx.tst_Tkn("a b;" , fx.tkn_grp_ @@ -34,16 +34,16 @@ public class z102_core_whitespace_tst { ) ); } - @Test public void Tab() { + @Test public void Tab() { fx.tst_Doc("a\tb;", fx.nde_().Atru_("a").Atru_("b")); } - @Test public void NewLine() { + @Test public void NewLine() { fx.tst_Doc(String_.Format("a{0}b;", String_.CrLf), fx.nde_().Atru_("a").Atru_("b")); } - @Test public void MergeSameWs() { + @Test public void MergeSameWs() { fx.tst_Doc("a b;", fx.nde_().Atru_("a").Atru_("b")); } - @Test public void MergeDiffWs() { + @Test public void MergeDiffWs() { fx.tst_Doc("a\t b;", fx.nde_().Atru_("a").Atru_("b")); fx.tst_Tkn("a\t b;" , fx.tkn_grp_ @@ -54,7 +54,7 @@ public class z102_core_whitespace_tst { ) ); } - @Test public void LeadingWs() { + @Test public void LeadingWs() { fx.tst_Doc(" a;", fx.nde_().Atru_("a")); fx.tst_Tkn(" a;" , fx.tkn_itm_(" ") @@ -64,7 +64,7 @@ public class z102_core_whitespace_tst { ) ); } - @Test public void TrailingWs() { + @Test public void TrailingWs() { fx.tst_Doc("a ;", fx.nde_().Atru_("a")); fx.tst_Tkn("a ;" , fx.tkn_grp_ diff --git a/110_gfml/tst/gplx/gfml/z103_core_elmKey_tst.java b/110_gfml/tst/gplx/gfml/z103_core_elmKey_tst.java index ea64abbf9..efbe73885 100644 --- a/110_gfml/tst/gplx/gfml/z103_core_elmKey_tst.java +++ b/110_gfml/tst/gplx/gfml/z103_core_elmKey_tst.java @@ -1,18 +1,18 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.gfml; import gplx.*; import org.junit.*; public class z103_core_elmKey_tst { @@ -23,7 +23,7 @@ public class z103_core_elmKey_tst { , GfmlDocLxrs.ElmKey_lxr() ); } - @Test public void Basic() { + @Test public void Basic() { fx.tst_Doc("a=b;", fx.nde_().Atrk_("a", "b")); fx.tst_Tkn("a=b;" , fx.tkn_grp_ @@ -32,7 +32,7 @@ public class z103_core_elmKey_tst { ) ); } - @Test public void Ws() { + @Test public void Ws() { fx.ini_RootLxr_Add(GfmlDocLxrs.Whitespace_lxr()); fx.tst_Tkn("a = b;" , fx.tkn_grp_ @@ -41,10 +41,10 @@ public class z103_core_elmKey_tst { ) ); } -// @Test public void Err_NotNamed() { +// @Test public void Err_NotNamed() { // fx.tst_Err("=", GfmlOutCmds.DatTkn_notFound_Err_()); // } -// @Test public void Err_NotValued() { +// @Test public void Err_NotValued() { // fx.tst_Err("a=;", GfmlOutCmds.elmKey_notValued_Err()); // } } diff --git a/110_gfml/tst/gplx/gfml/z111_core_comment0_tst.java b/110_gfml/tst/gplx/gfml/z111_core_comment0_tst.java index 30d75c267..45447f0bc 100644 --- a/110_gfml/tst/gplx/gfml/z111_core_comment0_tst.java +++ b/110_gfml/tst/gplx/gfml/z111_core_comment0_tst.java @@ -1,18 +1,18 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.gfml; import gplx.*; import org.junit.*; public class z111_core_comment0_tst { @@ -24,13 +24,13 @@ public class z111_core_comment0_tst { , GfmlDocLxrs.Comment0_lxr() // bgn=// end=\n ); } - @Test public void Basic() { + @Test public void Basic() { fx.tst_Doc("//a" + String_.Lf); fx.tst_Tkn("//a" + String_.Lf , fx.tkn_grp_ary_("//", "a", String_.Lf) ); } - @Test public void Data() { + @Test public void Data() { fx.tst_Doc("a;//b" + String_.Lf, fx.nde_().Atru_("a")); fx.tst_Tkn("a;//b" + String_.Lf , fx.tkn_grp_ @@ -39,7 +39,7 @@ public class z111_core_comment0_tst { , fx.tkn_grp_ary_("//", "b", String_.Lf) ); } -// @Test public void DanglingBgn() { +// @Test public void DanglingBgn() { // try { // fx.tst_Err("//", GfmlOutCmds.Frame_danglingBgn_Err_()); // Tfds.Fail_expdError(); diff --git a/110_gfml/tst/gplx/gfml/z112_core_comment1_tst.java b/110_gfml/tst/gplx/gfml/z112_core_comment1_tst.java index 2141994ef..c1effb285 100644 --- a/110_gfml/tst/gplx/gfml/z112_core_comment1_tst.java +++ b/110_gfml/tst/gplx/gfml/z112_core_comment1_tst.java @@ -1,18 +1,18 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.gfml; import gplx.*; import org.junit.*; public class z112_core_comment1_tst { @@ -23,13 +23,13 @@ public class z112_core_comment1_tst { , GfmlDocLxrs.Comment1_lxr() ); } - @Test public void Basic() { + @Test public void Basic() { fx.tst_Doc("/*a*/"); fx.tst_Tkn("/*a*/" , fx.tkn_grp_ary_("/*", "a", "*/") ); } - @Test public void Data() { + @Test public void Data() { fx.tst_Doc("a;/*b*/", fx.nde_().Atru_("a")); fx.tst_Tkn("a;/*b*/" , fx.tkn_grp_ @@ -38,22 +38,22 @@ public class z112_core_comment1_tst { , fx.tkn_grp_ary_("/*", "b", "*/") ); } - @Test public void IgnoreWs() { + @Test public void IgnoreWs() { fx.tst_Tkn("/* b c */" , fx.tkn_grp_ary_("/*", " b c ", "*/") ); } - @Test public void EscapeBgn() { + @Test public void EscapeBgn() { fx.tst_Tkn("/* /*/* */" , fx.tkn_grp_ary_("/*", " ", "/*/*", " ", "*/") ); } - @Test public void EscapeEnd() { + @Test public void EscapeEnd() { fx.tst_Tkn("/* */*/ */" , fx.tkn_grp_ary_("/*", " ", "*/*/", " ", "*/") ); } - @Test public void Nest() { + @Test public void Nest() { fx.tst_Tkn("/* b0 /* c */ b1 */" , fx.tkn_grp_ ( fx.tkn_itm_("/*") diff --git a/110_gfml/tst/gplx/gfml/z120_quotes_eval0_tst.java b/110_gfml/tst/gplx/gfml/z120_quotes_eval0_tst.java index e656d2401..b159a5b85 100644 --- a/110_gfml/tst/gplx/gfml/z120_quotes_eval0_tst.java +++ b/110_gfml/tst/gplx/gfml/z120_quotes_eval0_tst.java @@ -1,18 +1,18 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.gfml; import gplx.*; import org.junit.*; public class z120_quotes_eval0_tst { @@ -23,7 +23,7 @@ public class z120_quotes_eval0_tst { , GfmlDocLxrs.Eval0_lxr() ); } - @Test public void Basic() { + @Test public void Basic() { fx.tst_Doc("<~t>;", fx.nde_().Atru_("\t")); fx.tst_Tkn("<~t>;" , fx.tkn_grp_ @@ -33,7 +33,7 @@ public class z120_quotes_eval0_tst { ) ); } - @Test public void DoublingIsNotEscaping() { + @Test public void DoublingIsNotEscaping() { fx.tst_Doc("<~t>>>;", fx.nde_().Atru_("\t").Atru_(">>")); // >> does not resolve to > } } diff --git a/110_gfml/tst/gplx/gfml/z121_quotes_quotes0_tst.java b/110_gfml/tst/gplx/gfml/z121_quotes_quotes0_tst.java index e4928f11c..452c650c2 100644 --- a/110_gfml/tst/gplx/gfml/z121_quotes_quotes0_tst.java +++ b/110_gfml/tst/gplx/gfml/z121_quotes_quotes0_tst.java @@ -1,18 +1,18 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.gfml; import gplx.*; import org.junit.*; public class z121_quotes_quotes0_tst { @@ -23,7 +23,7 @@ public class z121_quotes_quotes0_tst { , GfmlDocLxrs.Quote0_lxr() ); } - @Test public void Basic() { + @Test public void Basic() { fx.tst_Doc("'abc';", fx.nde_().Atru_("abc")); fx.tst_Tkn("'abc';" , fx.tkn_grp_ @@ -33,7 +33,7 @@ public class z121_quotes_quotes0_tst { ) ); } - @Test public void Escape() { + @Test public void Escape() { fx.tst_Doc("'a''b';", fx.nde_().Atru_("a'b")); fx.tst_Tkn("'a''b';" , fx.tkn_grp_ @@ -43,7 +43,7 @@ public class z121_quotes_quotes0_tst { ) ); } - @Test public void ManyAtrs_LastQuoted() { // bugfix + @Test public void ManyAtrs_LastQuoted() { // bugfix fx.ini_RootLxr_Add(GfmlDocLxrs.Whitespace_lxr()); fx.tst_Doc("a 'b';", fx.nde_().Atru_("a").Atru_("b")); } diff --git a/110_gfml/tst/gplx/gfml/z122_quotes_quote0_eval0_tst.java b/110_gfml/tst/gplx/gfml/z122_quotes_quote0_eval0_tst.java index 528182269..e89b1b15f 100644 --- a/110_gfml/tst/gplx/gfml/z122_quotes_quote0_eval0_tst.java +++ b/110_gfml/tst/gplx/gfml/z122_quotes_quote0_eval0_tst.java @@ -1,18 +1,18 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.gfml; import gplx.*; import org.junit.*; public class z122_quotes_quote0_eval0_tst { @@ -23,7 +23,7 @@ public class z122_quotes_quote0_eval0_tst { , GfmlDocLxrs.Quote0_Eval0_lxr() ); } - @Test public void Basic() { + @Test public void Basic() { fx.tst_Doc("'a<~t>b';", fx.nde_().Atru_("a\tb")); fx.tst_Tkn("'a<~t>b';" , fx.tkn_grp_ @@ -39,7 +39,7 @@ public class z122_quotes_quote0_eval0_tst { ) ); } - @Test public void QuoteInside() { + @Test public void QuoteInside() { fx.tst_Doc("'a<~'t'>b';", fx.nde_().Atru_("a\tb")); fx.tst_Tkn("'a<~'t'>b';" , fx.tkn_grp_ diff --git a/110_gfml/tst/gplx/gfml/z123_quotes_quoteBlock_tst.java b/110_gfml/tst/gplx/gfml/z123_quotes_quoteBlock_tst.java index 1e997bc0e..02541ccbd 100644 --- a/110_gfml/tst/gplx/gfml/z123_quotes_quoteBlock_tst.java +++ b/110_gfml/tst/gplx/gfml/z123_quotes_quoteBlock_tst.java @@ -1,18 +1,18 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.gfml; import gplx.*; import org.junit.*; public class z123_quotes_quoteBlock_tst { @@ -23,16 +23,16 @@ public class z123_quotes_quoteBlock_tst { , GfmlDocLxrs.QuoteBlock_lxr() ); } - @Test public void Basic() { + @Test public void Basic() { fx.tst_Doc("|'abc'|;", fx.nde_().Atru_("abc")); } - @Test public void Escape_bgn() { + @Test public void Escape_bgn() { fx.tst_Doc("|'a|'|'b'|;", fx.nde_().Atru_("a|'b")); } - @Test public void Escape_end() { + @Test public void Escape_end() { fx.tst_Doc("|'a'|'|b'|;", fx.nde_().Atru_("a'|b")); } - @Test public void Nest() { + @Test public void Nest() { fx.tst_Doc("|'a|'-'|b'|;", fx.nde_().Atru_("a-b")); } } diff --git a/110_gfml/tst/gplx/gfml/z124_quotes_quoteFold_tst.java b/110_gfml/tst/gplx/gfml/z124_quotes_quoteFold_tst.java index 0fdf68650..55dfb87c0 100644 --- a/110_gfml/tst/gplx/gfml/z124_quotes_quoteFold_tst.java +++ b/110_gfml/tst/gplx/gfml/z124_quotes_quoteFold_tst.java @@ -1,18 +1,18 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.gfml; import gplx.*; import org.junit.*; public class z124_quotes_quoteFold_tst { @@ -23,10 +23,10 @@ public class z124_quotes_quoteFold_tst { , GfmlDocLxrs.QuoteFold_lxr() ); } - @Test public void Quote() { + @Test public void Quote() { fx.tst_Doc("^'a b'^;", fx.nde_().Atru_("a b")); } - @Test public void Tab() { + @Test public void Tab() { fx.tst_Doc("^'a\tb'^;", fx.nde_().Atru_("ab")); fx.tst_Tkn("^'a\tb'^;" , fx.tkn_grp_ @@ -35,25 +35,25 @@ public class z124_quotes_quoteFold_tst { , fx.tkn_itm_(";")) ); } - @Test public void NewLine() { + @Test public void NewLine() { fx.tst_Doc(String_.Concat("^'a", String_.CrLf, "b'^;"), fx.nde_().Atru_("ab")); } - @Test public void Eval() { + @Test public void Eval() { fx.tst_Doc("^'a<~t>b'^;", fx.nde_().Atru_("a\tb")); } - @Test public void Nest() { + @Test public void Nest() { fx.tst_Doc("^'a^'-'^b'^;", fx.nde_().Atru_("a-b")); } - @Test public void EscapeBgn() { + @Test public void EscapeBgn() { fx.tst_Doc("^'a^'^'b'^;", fx.nde_().Atru_("a^'b")); } - @Test public void EscapeEnd() { + @Test public void EscapeEnd() { fx.tst_Doc("^'a'^'^b'^;", fx.nde_().Atru_("a'^b")); } - @Test public void Comment0() { + @Test public void Comment0() { fx.tst_Doc(String_.Concat("^'a//comment", String_.CrLf, "b'^;"), fx.nde_().Atru_("ab")); } - @Test public void Comment1() { + @Test public void Comment1() { fx.tst_Doc("^'a/*comment*/b'^;", fx.nde_().Atru_("ab")); } } diff --git a/110_gfml/tst/gplx/gfml/z151_ndeSubs_basic_tst.java b/110_gfml/tst/gplx/gfml/z151_ndeSubs_basic_tst.java index 882b8ac00..49e7953f7 100644 --- a/110_gfml/tst/gplx/gfml/z151_ndeSubs_basic_tst.java +++ b/110_gfml/tst/gplx/gfml/z151_ndeSubs_basic_tst.java @@ -1,18 +1,18 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.gfml; import gplx.*; import org.junit.*; public class z151_ndeSubs_basic_tst { @@ -23,29 +23,29 @@ public class z151_ndeSubs_basic_tst { , GfmlDocLxrs.NdeBodyEnd_lxr() ); } - @Test public void Basic() { + @Test public void Basic() { fx.tst_Doc("{}", fx.nde_()); fx.tst_Tkn("{}" , fx.tkn_grp_ary_("{", "}") ); } - @Test public void Many() { + @Test public void Many() { fx.tst_Doc("{}{}", fx.nde_(), fx.nde_()); } - @Test public void Nested() { + @Test public void Nested() { fx.tst_Doc("{{}}" , fx.nde_().Subs_ ( fx.nde_()) ); } - @Test public void NestedMany() { + @Test public void NestedMany() { fx.tst_Doc("{{}{}}" , fx.nde_().Subs_ ( fx.nde_() , fx.nde_() )); } - @Test public void Complex() { + @Test public void Complex() { fx.tst_Doc(String_.Concat ( "{" , "{" diff --git a/110_gfml/tst/gplx/gfml/z152_ndeSubs_data_tst.java b/110_gfml/tst/gplx/gfml/z152_ndeSubs_data_tst.java index 674a38a37..e194ef032 100644 --- a/110_gfml/tst/gplx/gfml/z152_ndeSubs_data_tst.java +++ b/110_gfml/tst/gplx/gfml/z152_ndeSubs_data_tst.java @@ -1,18 +1,18 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.gfml; import gplx.*; import org.junit.*; public class z152_ndeSubs_data_tst { @@ -25,37 +25,37 @@ public class z152_ndeSubs_data_tst { , GfmlDocLxrs.Whitespace_lxr() ); } - @Test public void ToInline() { + @Test public void ToInline() { fx.tst_Doc("{a;}" , fx.nde_().Subs_ ( fx.nde_().Atru_("a")) ); } - @Test public void ToInline_many() { + @Test public void ToInline_many() { fx.tst_Doc("{a b;}" , fx.nde_().Subs_ ( fx.nde_().Atru_("a").Atru_("b")) ); } - @Test public void ToBody() { + @Test public void ToBody() { fx.tst_Doc("{a{}}" , fx.nde_().Subs_ ( fx.nde_().Atru_("a")) ); } - @Test public void ToBody_many() { + @Test public void ToBody_many() { fx.tst_Doc("{a b{}}" , fx.nde_().Subs_ ( fx.nde_().Atru_("a").Atru_("b")) ); } - @Test public void ToBody_manyNest() { + @Test public void ToBody_manyNest() { fx.tst_Doc("a{b;}" , fx.nde_().Atru_("a").Subs_ ( fx.nde_().Atru_("b")) ); } - @Test public void ToBody_many2() { + @Test public void ToBody_many2() { fx.tst_Doc("a{b{c;}}" , fx.nde_().Atru_("a").Subs_ ( fx.nde_().Atru_("b").Subs_ diff --git a/110_gfml/tst/gplx/gfml/z161_ndeHdrs_inline_tst.java b/110_gfml/tst/gplx/gfml/z161_ndeHdrs_inline_tst.java index 4f29e33b5..948987a8c 100644 --- a/110_gfml/tst/gplx/gfml/z161_ndeHdrs_inline_tst.java +++ b/110_gfml/tst/gplx/gfml/z161_ndeHdrs_inline_tst.java @@ -1,18 +1,18 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.gfml; import gplx.*; import org.junit.*; public class z161_ndeHdrs_inline_tst { @@ -24,19 +24,19 @@ public class z161_ndeHdrs_inline_tst { , GfmlDocLxrs.Whitespace_lxr() ); } - @Test public void Basic() { + @Test public void Basic() { fx.tst_Doc("a:;", fx.nde_().Hnd_("a")); fx.tst_Tkn("a:;" , fx.tkn_grp_ary_("a", ":", ";") ); } - @Test public void Many() { + @Test public void Many() { fx.tst_Doc("a:;b:;" , fx.nde_().Hnd_("a") , fx.nde_().Hnd_("b") ); } - @Test public void Ws() { + @Test public void Ws() { fx.tst_Tkn("a : ;" , fx.tkn_grp_ary_("a", " ", ":", " ", ";") ); diff --git a/110_gfml/tst/gplx/gfml/z162_ndeHdrs_err_tst.java b/110_gfml/tst/gplx/gfml/z162_ndeHdrs_err_tst.java index b6ae550ac..90ca2d400 100644 --- a/110_gfml/tst/gplx/gfml/z162_ndeHdrs_err_tst.java +++ b/110_gfml/tst/gplx/gfml/z162_ndeHdrs_err_tst.java @@ -1,18 +1,18 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.gfml; import gplx.*; import org.junit.*; public class z162_ndeHdrs_err_tst { @@ -22,10 +22,10 @@ public class z162_ndeHdrs_err_tst { ( GfmlDocLxrs.NdeHeader_lxr() ); } - @Test public void NotNamed() { + @Test public void NotNamed() { fx.tst_Err(":", UsrMsg_mok.new_(GfmlUsrMsgs.fail_DatTkn_notFound())); } - @Test public void Dangling() { + @Test public void Dangling() { fx.tst_Err("a{", UsrMsg_mok.new_(GfmlUsrMsgs.fail_Frame_danglingBgn())); } } diff --git a/110_gfml/tst/gplx/gfml/z163_ndeHdrs_body_tst.java b/110_gfml/tst/gplx/gfml/z163_ndeHdrs_body_tst.java index fda01eb5e..925c30a1c 100644 --- a/110_gfml/tst/gplx/gfml/z163_ndeHdrs_body_tst.java +++ b/110_gfml/tst/gplx/gfml/z163_ndeHdrs_body_tst.java @@ -1,18 +1,18 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.gfml; import gplx.*; import org.junit.*; public class z163_ndeHdrs_body_tst { @@ -24,22 +24,22 @@ public class z163_ndeHdrs_body_tst { , GfmlDocLxrs.NdeBodyEnd_lxr() ); } - @Test public void Basic() { + @Test public void Basic() { fx.tst_Doc("a:{}", fx.nde_().Hnd_("a")); } - @Test public void Many() { + @Test public void Many() { fx.tst_Doc("a:{}b:{}" , fx.nde_().Hnd_("a") , fx.nde_().Hnd_("b") ); } - @Test public void Nested() { + @Test public void Nested() { fx.tst_Doc("a:{b:{}}" , fx.nde_().Hnd_("a").Subs_ ( fx.nde_().Hnd_("b")) ); } - @Test public void NestedMany() { + @Test public void NestedMany() { fx.tst_Doc("a:{b:{}c:{}}" , fx.nde_().Hnd_("a").Subs_ ( fx.nde_().Hnd_("b") diff --git a/110_gfml/tst/gplx/gfml/z164_hdeHdrs_data_tst.java b/110_gfml/tst/gplx/gfml/z164_hdeHdrs_data_tst.java index eb9a6b838..77d50cbb5 100644 --- a/110_gfml/tst/gplx/gfml/z164_hdeHdrs_data_tst.java +++ b/110_gfml/tst/gplx/gfml/z164_hdeHdrs_data_tst.java @@ -1,18 +1,18 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.gfml; import gplx.*; import org.junit.*; public class z164_hdeHdrs_data_tst { @@ -26,7 +26,7 @@ public class z164_hdeHdrs_data_tst { , GfmlDocLxrs.NdeBodyEnd_lxr() ); } - @Test public void Bas1() { + @Test public void Bas1() { fx.tst_Tkn("a:b;" , fx.tkn_grp_ ( fx.tkn_itm_("a") @@ -35,7 +35,7 @@ public class z164_hdeHdrs_data_tst { , fx.tkn_itm_(";") )); } - @Test public void Basic3() { + @Test public void Basic3() { fx.tst_Tkn("a:b{c;}" , fx.tkn_grp_ ( fx.tkn_itm_("a") diff --git a/110_gfml/tst/gplx/gfml/z181_ndeDots_basic_tst.java b/110_gfml/tst/gplx/gfml/z181_ndeDots_basic_tst.java index a04f67d29..a554aba0b 100644 --- a/110_gfml/tst/gplx/gfml/z181_ndeDots_basic_tst.java +++ b/110_gfml/tst/gplx/gfml/z181_ndeDots_basic_tst.java @@ -1,18 +1,18 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.gfml; import gplx.*; import org.junit.*; public class z181_ndeDots_basic_tst { @@ -25,7 +25,7 @@ public class z181_ndeDots_basic_tst { , GfmlDocLxrs.NdeBodyEnd_lxr() ); } - @Test public void One() { + @Test public void One() { fx.tst_Doc("{a.b;c;}" , fx.nde_().ChainId_(0).Subs_ ( fx.nde_().Hnd_("a").ChainId_(1).Subs_ @@ -49,7 +49,7 @@ public class z181_ndeDots_basic_tst { , fx.tkn_itm_("}") )); } - @Test public void Many() { + @Test public void Many() { fx.tst_Doc("{a.b.c.d;e;}" , fx.nde_().ChainId_(0).Subs_ ( fx.nde_().Hnd_("a").ChainId_(1).Subs_ diff --git a/110_gfml/tst/gplx/gfml/z182_ndeDots_subs_tst.java b/110_gfml/tst/gplx/gfml/z182_ndeDots_subs_tst.java index adc363c42..9537649c4 100644 --- a/110_gfml/tst/gplx/gfml/z182_ndeDots_subs_tst.java +++ b/110_gfml/tst/gplx/gfml/z182_ndeDots_subs_tst.java @@ -1,18 +1,18 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.gfml; import gplx.*; import org.junit.*; public class z182_ndeDots_subs_tst { @@ -24,7 +24,7 @@ public class z182_ndeDots_subs_tst { , GfmlDocLxrs.NdeBodyEnd_lxr() ); } GfmlParse_fxt fx = GfmlParse_fxt.new_(); - @Test public void Basic() { + @Test public void Basic() { fx.tst_Doc("{a.b{}z;}" , fx.nde_().ChainId_(0).Subs_ ( fx.nde_().Hnd_("a").ChainId_(1).Subs_ @@ -33,7 +33,7 @@ public class z182_ndeDots_subs_tst { , fx.nde_().Atru_("z").ChainId_(0) )); } - @Test public void Nest() { + @Test public void Nest() { fx.ini_RootLxr_Add(GfmlDocLxrs.NdeHeader_lxr()); fx.tst_Doc("{a.b.c{d:e;}z;}" // shorthand of {a{b{c{d:e;}}}} , fx.nde_().ChainId_(0).Subs_ @@ -47,7 +47,7 @@ public class z182_ndeDots_subs_tst { , fx.nde_().ChainId_(0).Atru_("z") )); } - @Test public void Chain() { + @Test public void Chain() { fx.tst_Doc("{a.b.c;z;}" , fx.nde_().ChainId_(0).Subs_ ( fx.nde_().Hnd_("a").ChainId_(1).Subs_ @@ -57,7 +57,7 @@ public class z182_ndeDots_subs_tst { , fx.nde_().ChainId_(0).Atru_("z") )); } - @Test public void NdeHdr() { + @Test public void NdeHdr() { fx.ini_RootLxr_Add(GfmlDocLxrs.NdeHeader_lxr()); fx.tst_Doc("{a:b.c;z;}" , fx.nde_().ChainId_(0).Subs_ diff --git a/110_gfml/tst/gplx/gfml/z183_ndeDots_parens_tst.java b/110_gfml/tst/gplx/gfml/z183_ndeDots_parens_tst.java index e928d213a..b0c508ed8 100644 --- a/110_gfml/tst/gplx/gfml/z183_ndeDots_parens_tst.java +++ b/110_gfml/tst/gplx/gfml/z183_ndeDots_parens_tst.java @@ -1,18 +1,18 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.gfml; import gplx.*; import org.junit.*; public class z183_ndeDots_parens_tst { @@ -26,7 +26,7 @@ public class z183_ndeDots_parens_tst { , GfmlDocLxrs.NdeHdrEnd_lxr() ); } GfmlParse_fxt fx = GfmlParse_fxt.new_(); - @Test public void Basic() { + @Test public void Basic() { fx.tst_Doc("{a.b(c);z;}" , fx.nde_().ChainId_(0).Subs_ ( fx.nde_().Hnd_("a").ChainId_(1).Subs_ @@ -35,7 +35,7 @@ public class z183_ndeDots_parens_tst { , fx.nde_().ChainId_(0).Atru_("z") )); } - @Test public void Basic_tkn() { + @Test public void Basic_tkn() { //A_('1'); fx.tst_Tkn("a(c);" , fx.tkn_grp_ @@ -45,7 +45,7 @@ public class z183_ndeDots_parens_tst { ) ); } - @Test public void Basic2_tkn() { + @Test public void Basic2_tkn() { fx.tst_Tkn("a.b(c);" , fx.tkn_grp_ ( fx.tkn_itm_("a"), fx.tkn_itm_(".") @@ -55,7 +55,7 @@ public class z183_ndeDots_parens_tst { ) ); } - @Test public void Many() { + @Test public void Many() { fx.ini_RootLxr_Add(GfmlDocLxrs.Whitespace_lxr()); fx.tst_Doc("{a.b(c d e);z;}" , fx.nde_().ChainId_(0).Subs_ @@ -65,7 +65,7 @@ public class z183_ndeDots_parens_tst { , fx.nde_().ChainId_(0).Atru_("z") )); } -// @Test public void Many2() { +// @Test public void Many2() { // fx.ini_RootLxr_Add(GfmlDocLxrs.Whitespace_lxr()); // fx.tst_Doc("{a.b(c){d();}}" // , fx.nde_().ChainId_(0).Subs_ @@ -76,7 +76,7 @@ public class z183_ndeDots_parens_tst { // ) // )); // } - @Test public void Chain() { + @Test public void Chain() { fx.ini_RootLxr_Add(GfmlDocLxrs.Whitespace_lxr()); fx.tst_Doc("{a.b(c).d(e);z;}" , fx.nde_().ChainId_(0).Subs_ @@ -88,7 +88,7 @@ public class z183_ndeDots_parens_tst { , fx.nde_().ChainId_(0).Atru_("z") )); } - @Test public void Nest() { + @Test public void Nest() { fx.tst_Doc("{a.b(c.d);z;}" , fx.nde_().ChainId_(0).Subs_ ( fx.nde_().Hnd_("a").ChainId_(1).Subs_ @@ -101,7 +101,7 @@ public class z183_ndeDots_parens_tst { , fx.nde_().Atru_("z") )); } - @Test public void Nest_longer() { + @Test public void Nest_longer() { fx.tst_Doc("{a.b.c(d.e.f);z;}" , fx.nde_().ChainId_(0).Subs_ ( fx.nde_().Hnd_("a").ChainId_(1).Subs_ @@ -118,7 +118,7 @@ public class z183_ndeDots_parens_tst { , fx.nde_().Atru_("z") )); } - @Test public void Nest_deeper() { + @Test public void Nest_deeper() { fx.tst_Doc("{a.b(c.d(e.f));z;}" , fx.nde_().ChainId_(0).Subs_ ( fx.nde_().Hnd_("a").ChainId_(1).Subs_ diff --git a/110_gfml/tst/gplx/gfml/z184_ndeDots_atrSpr_tst.java b/110_gfml/tst/gplx/gfml/z184_ndeDots_atrSpr_tst.java index 4eafcaf02..7d8cb8919 100644 --- a/110_gfml/tst/gplx/gfml/z184_ndeDots_atrSpr_tst.java +++ b/110_gfml/tst/gplx/gfml/z184_ndeDots_atrSpr_tst.java @@ -1,18 +1,18 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.gfml; import gplx.*; import org.junit.*; public class z184_ndeDots_atrSpr_tst { @@ -27,7 +27,7 @@ public class z184_ndeDots_atrSpr_tst { , GfmlDocLxrs.AtrSpr_lxr() ); } GfmlParse_fxt fx = GfmlParse_fxt.new_(); - @Test public void NestMult() { + @Test public void NestMult() { fx.ini_RootLxr_Add(GfmlDocLxrs.AtrSpr_lxr()); fx.tst_Doc("{a.b(c.d,e.f);z;}" , fx.nde_().ChainId_(0).Subs_ diff --git a/110_gfml/tst/gplx/gfml/z191_ndeProps_basic_tst.java b/110_gfml/tst/gplx/gfml/z191_ndeProps_basic_tst.java index 713558a11..23345c6c6 100644 --- a/110_gfml/tst/gplx/gfml/z191_ndeProps_basic_tst.java +++ b/110_gfml/tst/gplx/gfml/z191_ndeProps_basic_tst.java @@ -1,18 +1,18 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.gfml; import gplx.*; import org.junit.*; public class z191_ndeProps_basic_tst { @@ -27,20 +27,20 @@ public class z191_ndeProps_basic_tst { , GfmlDocLxrs.NdeInline_lxr() ); } - @Test public void Basic() { + @Test public void Basic() { fx.tst_Doc("a:[b]{}" , fx.nde_().Hnd_("a").Subs_ ( fx.nde_().KeyedSubObj_().Atru_("b")) ); } - @Test public void Basic_empty() { + @Test public void Basic_empty() { fx.tst_Tkn("[];" , fx.tkn_grp_ ( fx.tkn_grp_ary_("[", "]") , fx.tkn_itm_(";") )); } - @Test public void Hdr() { + @Test public void Hdr() { fx.tst_Tkn("a[];" , fx.tkn_grp_ ( fx.tkn_grp_ary_("a") @@ -48,52 +48,52 @@ public class z191_ndeProps_basic_tst { , fx.tkn_itm_(";") )); } - @Test public void WithInnerNde() { + @Test public void WithInnerNde() { fx.tst_Doc("a:[b]{c;}" , fx.nde_().Hnd_("a").Subs_ ( fx.nde_().KeyedSubObj_().Atru_("b") , fx.nde_().Atru_("c") )); } - @Test public void DoesNotUsurpDatTknForName() { + @Test public void DoesNotUsurpDatTknForName() { fx.tst_Doc("a:b[c]{}" , fx.nde_().Hnd_("a").Atru_("b").Subs_ ( fx.nde_().KeyedSubObj_().Atru_("c") )); } - @Test public void NoHeader_body() { + @Test public void NoHeader_body() { fx.tst_Doc("a[b]{}" , fx.nde_().Atru_("a").Subs_ ( fx.nde_().KeyedSubObj_().Atru_("b") )); } - @Test public void NoHeader_inline() { + @Test public void NoHeader_inline() { fx.tst_Doc("a[b];" , fx.nde_().Atru_("a").Subs_ ( fx.nde_().KeyedSubObj_().Atru_("b") )); } - @Test public void Nesting() { + @Test public void Nesting() { fx.tst_Doc("a:[b:;]{}" , fx.nde_().Hnd_("a").Subs_ ( fx.nde_().KeyedSubObj_().Subs_ ( fx.nde_().Hnd_("b")) )); } - @Test public void Nesting2() { + @Test public void Nesting2() { fx.tst_Doc("a:[b{}]{}" , fx.nde_().Hnd_("a").Subs_ ( fx.nde_().KeyedSubObj_().Atru_("b") )); } - @Test public void CanBeKeyed_header() { + @Test public void CanBeKeyed_header() { fx.ini_RootLxr_Add(GfmlDocLxrs.ElmKey_lxr()); fx.tst_Doc("a:b=[c];" , fx.nde_().Hnd_("a").Subs_ ( fx.nde_().KeyedSubObj_().Key_("b").Atru_("c") )); } - @Test public void CanBeKeyed2_inline() { + @Test public void CanBeKeyed2_inline() { fx.ini_RootLxr_Add ( GfmlDocLxrs.Whitespace_lxr() , GfmlDocLxrs.ElmKey_lxr() @@ -103,12 +103,12 @@ public class z191_ndeProps_basic_tst { ( fx.nde_().KeyedSubObj_().Key_("b").Atru_("c") )); } - @Test public void Sole() { + @Test public void Sole() { fx.ini_RootLxr_Add(GfmlDocLxrs.Whitespace_lxr()); fx.tst_Doc("[a b]" , fx.nde_().KeyedSubObj_().Atru_("a").Atru_("b")); } - @Test public void Nest1() { + @Test public void Nest1() { fx.ini_RootLxr_Add(GfmlDocLxrs.Whitespace_lxr()); fx.tst_Doc("[a [b]]" , fx.nde_().Atru_("a").Subs_ diff --git a/110_gfml/tst/gplx/gfml/z192_ndeProps_dots_tst.java b/110_gfml/tst/gplx/gfml/z192_ndeProps_dots_tst.java index 38c0375e3..e2cdff6bd 100644 --- a/110_gfml/tst/gplx/gfml/z192_ndeProps_dots_tst.java +++ b/110_gfml/tst/gplx/gfml/z192_ndeProps_dots_tst.java @@ -1,18 +1,18 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.gfml; import gplx.*; import org.junit.*; public class z192_ndeProps_dots_tst { @@ -27,7 +27,7 @@ public class z192_ndeProps_dots_tst { , GfmlDocLxrs.NdePropEnd_lxr() ); } - @Test public void Stress() { + @Test public void Stress() { fx.tst_Doc("a.b[c];" , fx.nde_().Hnd_("a").Subs_ ( fx.nde_().Hnd_("b").Subs_ diff --git a/110_gfml/tst/gplx/gfml/z400_GfmlTypeMakr_tst.java b/110_gfml/tst/gplx/gfml/z400_GfmlTypeMakr_tst.java index c12add123..6e6f3400b 100644 --- a/110_gfml/tst/gplx/gfml/z400_GfmlTypeMakr_tst.java +++ b/110_gfml/tst/gplx/gfml/z400_GfmlTypeMakr_tst.java @@ -1,25 +1,25 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.gfml; import gplx.*; import org.junit.*; public class z400_GfmlTypeMakr_tst { @Before public void setup() { makr = GfmlTypeMakr.new_(); } GfmlTypeMakr makr; GfmlType type; GfmlTypeCompiler_fxt fx = GfmlTypeCompiler_fxt.new_(); - @Test public void MakeSubType() { + @Test public void MakeSubType() { type = makr.MakeSubType("point", "x", "y"); fx.tst_Type ( fx.typ_().Key_("point").Subs_ @@ -30,7 +30,7 @@ public class z400_GfmlTypeMakr_tst { ); tst_XtoAry(makr, "point"); } - @Test public void MakeSubTypeAsOwner() { + @Test public void MakeSubTypeAsOwner() { type = makr.MakeSubTypeAsOwner("item"); fx.tst_Type ( fx.typ_().Key_("item") @@ -39,7 +39,7 @@ public class z400_GfmlTypeMakr_tst { tst_Owner(makr, "item"); tst_XtoAry(makr, "item"); } - @Test public void MakeSubTypeAsOwner_MakeSubType() { + @Test public void MakeSubTypeAsOwner_MakeSubType() { type = makr.MakeSubTypeAsOwner("item"); makr.MakeSubType("pos", "x", "y"); fx.tst_Type diff --git a/110_gfml/tst/gplx/gfml/z401_types_compile_basic_tst.java b/110_gfml/tst/gplx/gfml/z401_types_compile_basic_tst.java index f17b701f2..94409a3cc 100644 --- a/110_gfml/tst/gplx/gfml/z401_types_compile_basic_tst.java +++ b/110_gfml/tst/gplx/gfml/z401_types_compile_basic_tst.java @@ -1,25 +1,25 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.gfml; import gplx.*; import org.junit.*; public class z401_types_compile_basic_tst { @Before public void setup() { fx.run_InitPragma(fx.Regy(), GfmlPragmaType.new_()); } GfmlTypeCompiler_fxt fx = GfmlTypeCompiler_fxt.new_(); - @Test public void Basic() { + @Test public void Basic() { fx.tst_Compile ( fx.nde_().Atrs_("point", "gfml.point").Subs_ ( fx.nde_().Atru_("x") @@ -28,7 +28,7 @@ public class z401_types_compile_basic_tst { , fx.typ_().Name_("point").Key_("gfml.point").Atrs_("x", "y") ); } - @Test public void Nest() { + @Test public void Nest() { fx.tst_Compile ( fx.nde_().Atrs_("item", "gfml.item").Subs_ ( fx.nde_().Atru_("pos").Atrk_("type", "gfml.item.point") @@ -38,7 +38,7 @@ public class z401_types_compile_basic_tst { ) ); } - @Test public void NestMany() { + @Test public void NestMany() { fx.tst_Compile ( fx.nde_().Atrs_("item", "gfml.item").Subs_ ( fx.nde_().Atru_("pos").Atrk_("type", "gfml.item.point") @@ -50,7 +50,7 @@ public class z401_types_compile_basic_tst { ) ); } - @Test public void Recurse() { + @Test public void Recurse() { fx.tst_Compile ( fx.nde_().Atrs_("widget", "gfml.widget").Subs_ ( fx.nde_().Atru_("widget").Atrk_("type", "gfml.widget") diff --git a/110_gfml/tst/gplx/gfml/z402_types_compile_implicit_tst.java b/110_gfml/tst/gplx/gfml/z402_types_compile_implicit_tst.java index 7c883b62b..1bcde896b 100644 --- a/110_gfml/tst/gplx/gfml/z402_types_compile_implicit_tst.java +++ b/110_gfml/tst/gplx/gfml/z402_types_compile_implicit_tst.java @@ -1,25 +1,25 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.gfml; import gplx.*; import org.junit.*; public class z402_types_compile_implicit_tst { @Before public void setup() { fx.run_InitPragma(fx.Regy(), GfmlPragmaType.new_()); } GfmlTypeCompiler_fxt fx = GfmlTypeCompiler_fxt.new_(); - @Test public void Fld_typeKey_leaf() { + @Test public void Fld_typeKey_leaf() { fx.tst_Compile ( fx.nde_().Atrs_("point", "gfml.point").Subs_ ( fx.nde_().Atru_("x").Atrk_("type", "gfml.int") // explicit @@ -30,7 +30,7 @@ public class z402_types_compile_implicit_tst { , fx.fld_().Name_("y").TypeKey_("gfml.String") )); } - @Test public void Fld_typeKey_nest() { + @Test public void Fld_typeKey_nest() { fx.tst_Compile ( fx.nde_().Atrs_("rect", "gfml.rect").Subs_ ( fx.nde_().Atru_("pos").Atrk_("type", "gfml.point").Subs_ // explicit @@ -47,7 +47,7 @@ public class z402_types_compile_implicit_tst { , fx.fld_().Name_("size").TypeKey_("gfml.rect/size") )); } - @Test public void Typ_key() { + @Test public void Typ_key() { fx.tst_Compile ( fx.nde_().Atrs_("point", "gfml.point") // explicit: gfml.point , fx.typ_().Name_("point").Key_("gfml.point") diff --git a/110_gfml/tst/gplx/gfml/z403_types_compile_default_tst.java b/110_gfml/tst/gplx/gfml/z403_types_compile_default_tst.java index d8db39498..6413dc679 100644 --- a/110_gfml/tst/gplx/gfml/z403_types_compile_default_tst.java +++ b/110_gfml/tst/gplx/gfml/z403_types_compile_default_tst.java @@ -1,25 +1,25 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.gfml; import gplx.*; import org.junit.*; public class z403_types_compile_default_tst { @Before public void setup() { fx.run_InitPragma(fx.Regy(), GfmlPragmaType.new_()); } GfmlTypeCompiler_fxt fx = GfmlTypeCompiler_fxt.new_(); - @Test public void Basic() { + @Test public void Basic() { fx.tst_Compile ( fx.nde_().Atrs_("point", "gfml.point").Subs_ ( fx.nde_().Atru_("x").Atrk_("default", "10") @@ -30,7 +30,7 @@ public class z403_types_compile_default_tst { , fx.fld_().Name_("y").Default_(GfmlTkn_.NullRaw) )); } - @Test public void Nde() { + @Test public void Nde() { fx.tst_Compile ( fx.nde_().Atrs_("rect", "gfml.rect").Subs_ ( fx.nde_().Atru_("point").Subs_ @@ -41,7 +41,7 @@ public class z403_types_compile_default_tst { ( ndek_("point", atr_("x", "1"), atr_("y", "2"))) )); } - @Test public void Nde_unnamed() { + @Test public void Nde_unnamed() { fx.tst_Compile ( fx.nde_().Atrs_("rect", "gfml.rect").Subs_ ( fx.nde_().Atru_("point").Subs_ diff --git a/110_gfml/tst/gplx/gfml/z411_types_apply_atrs_basic_tst.java b/110_gfml/tst/gplx/gfml/z411_types_apply_atrs_basic_tst.java index 36d1945d8..b42ef0232 100644 --- a/110_gfml/tst/gplx/gfml/z411_types_apply_atrs_basic_tst.java +++ b/110_gfml/tst/gplx/gfml/z411_types_apply_atrs_basic_tst.java @@ -1,60 +1,60 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.gfml; import gplx.*; import org.junit.*; public class z411_types_apply_atrs_basic_tst { @Before public void setup() { pointType = fx.typ_().Key_("point").Atrs_("x", "y", "z"); } GfmlTypeCompiler_fxt fx = GfmlTypeCompiler_fxt.new_(); GfmlTyp_mok pointType; - @Test public void Unnamed_one() { + @Test public void Unnamed_one() { fx.tst_Resolve ( pointType , fx.nde_().Hnd_("point").Atru_("10") , fx.nde_().Typ_("point").Atrk_("x", "10") ); } - @Test public void Unnamed_three() { + @Test public void Unnamed_three() { fx.tst_Resolve ( pointType , fx.nde_().Hnd_("point").Atrs_("10", "20", "30") , fx.nde_().Typ_("point").Atrk_("x", "10").Atrk_("y", "20").Atrk_("z", "30") ); } - @Test public void Keys_partial1() { + @Test public void Keys_partial1() { fx.tst_Resolve ( pointType , fx.nde_().Hnd_("point").Atrk_("x", "10").Atrs_("20", "30") , fx.nde_().Typ_("point").Atrk_("x", "10").Atrk_("y", "20").Atrk_("z", "30") ); } - @Test public void Keys_partial2() { + @Test public void Keys_partial2() { fx.tst_Resolve ( pointType , fx.nde_().Hnd_("point").Atrk_("x", "10").Atrk_("y", "20").Atru_("30") , fx.nde_().Typ_("point").Atrk_("x", "10").Atrk_("y", "20").Atrk_("z", "30") ); } - @Test public void OutOfOrder_z_1() { + @Test public void OutOfOrder_z_1() { fx.tst_Resolve ( pointType , fx.nde_().Hnd_("point").Atrk_("z", "30").Atrs_("10", "20") , fx.nde_().Typ_("point").Atrk_("z", "30").Atrk_("x", "10").Atrk_("y", "20") ); } - @Test public void OutOfOrder_z_2() { + @Test public void OutOfOrder_z_2() { fx.tst_Resolve ( pointType , fx.nde_().Hnd_("point").Atru_("10").Atrk_("z", "30").Atru_("20") diff --git a/110_gfml/tst/gplx/gfml/z421_types_apply_ndes_basic_tst.java b/110_gfml/tst/gplx/gfml/z421_types_apply_ndes_basic_tst.java index 29f9d5cbb..96e4859cc 100644 --- a/110_gfml/tst/gplx/gfml/z421_types_apply_ndes_basic_tst.java +++ b/110_gfml/tst/gplx/gfml/z421_types_apply_ndes_basic_tst.java @@ -1,18 +1,18 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.gfml; import gplx.*; import org.junit.*; public class z421_types_apply_ndes_basic_tst { @@ -27,7 +27,7 @@ public class z421_types_apply_ndes_basic_tst { ( GfmlFld_mok.new_().ini_ndk_("pos", "pos") ).XtoGfmlType()); } GfmlTypeCompiler_fxt fx = GfmlTypeCompiler_fxt.new_(); - @Test public void NamedNde_but_UnnamedAtr() { + @Test public void NamedNde_but_UnnamedAtr() { fx.tst_Resolve ( fx.nde_().Hnd_("rect").Subs_ ( fx.nde_().Key_("pos").Atrs_("1") @@ -37,7 +37,7 @@ public class z421_types_apply_ndes_basic_tst { ) ); } - @Test public void UnnamedNde() { + @Test public void UnnamedNde() { fx.tst_Resolve ( fx.nde_().Hnd_("rect").Subs_ ( fx.nde_().Key_(GfmlTkn_.NullRaw).Atrs_("1") diff --git a/110_gfml/tst/gplx/gfml/z422_types_apply_ndes_multi_tst.java b/110_gfml/tst/gplx/gfml/z422_types_apply_ndes_multi_tst.java index 34150dbc5..7267962b6 100644 --- a/110_gfml/tst/gplx/gfml/z422_types_apply_ndes_multi_tst.java +++ b/110_gfml/tst/gplx/gfml/z422_types_apply_ndes_multi_tst.java @@ -1,18 +1,18 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.gfml; import gplx.*; import org.junit.*; public class z422_types_apply_ndes_multi_tst { @@ -33,7 +33,7 @@ public class z422_types_apply_ndes_multi_tst { , GfmlFld_mok.new_().ini_ndk_("size", "size") ).XtoGfmlType()); } GfmlTypeCompiler_fxt fx = GfmlTypeCompiler_fxt.new_(); - @Test public void Unnamed() { + @Test public void Unnamed() { fx.tst_Resolve ( fx.nde_().Hnd_("rect").Subs_ ( fx.nde_().Key_(GfmlTkn_.NullRaw).Atrs_("1") @@ -45,7 +45,7 @@ public class z422_types_apply_ndes_multi_tst { ) ); } - @Test public void Partial() { + @Test public void Partial() { fx.tst_Resolve ( fx.nde_().Hnd_("rect").Subs_ ( fx.nde_().Key_("pos").Atrs_("1") @@ -57,7 +57,7 @@ public class z422_types_apply_ndes_multi_tst { ) ); } - @Test public void OutOfOrder() { + @Test public void OutOfOrder() { fx.tst_Resolve ( fx.nde_().Hnd_("rect").Subs_ ( fx.nde_().Key_("size").Atrs_("3") diff --git a/110_gfml/tst/gplx/gfml/z423_types_apply_ndes_misc_tst.java b/110_gfml/tst/gplx/gfml/z423_types_apply_ndes_misc_tst.java index c9b0b6d36..f46dc3c69 100644 --- a/110_gfml/tst/gplx/gfml/z423_types_apply_ndes_misc_tst.java +++ b/110_gfml/tst/gplx/gfml/z423_types_apply_ndes_misc_tst.java @@ -1,24 +1,24 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.gfml; import gplx.*; import org.junit.*; public class z423_types_apply_ndes_misc_tst { @Before public void setup() { } GfmlTypeCompiler_fxt fx = GfmlTypeCompiler_fxt.new_(); - @Test public void Recurse() { + @Test public void Recurse() { fx.Regy().Add( fx.typ_().Key_("item").Subs_ ( GfmlFld_mok.new_().ini_atr_("key") @@ -31,7 +31,7 @@ public class z423_types_apply_ndes_misc_tst { ( fx.nde_().Hnd_("item").Atrk_("key", "2") )); } - @Test public void OwnerTypePrecedesTopLevel() { + @Test public void OwnerTypePrecedesTopLevel() { GfmlTypeMakr makr = GfmlTypeMakr.new_(); GfmlType topLevelSize = makr.MakeSubType("size", "width", "height"); GfmlType rect = makr.MakeSubTypeAsOwner("rect"); diff --git a/110_gfml/tst/gplx/gfml/z424_types_apply_ndes_nest_tst.java b/110_gfml/tst/gplx/gfml/z424_types_apply_ndes_nest_tst.java index 233763227..60b1edd37 100644 --- a/110_gfml/tst/gplx/gfml/z424_types_apply_ndes_nest_tst.java +++ b/110_gfml/tst/gplx/gfml/z424_types_apply_ndes_nest_tst.java @@ -1,18 +1,18 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.gfml; import gplx.*; import org.junit.*; public class z424_types_apply_ndes_nest_tst { @@ -22,7 +22,7 @@ public class z424_types_apply_ndes_nest_tst { makr.MakeSubType("pos", "x", "y"); fx.Regy().Add_ary(makr.Xto_bry()); } GfmlTypeCompiler_fxt fx = GfmlTypeCompiler_fxt.new_(); - @Test public void InvokeByHnd() { + @Test public void InvokeByHnd() { fx.tst_Resolve ( fx.nde_().Hnd_("gfml.item").Subs_ ( fx.nde_().Hnd_("pos").Atrs_("10", "20")) @@ -30,7 +30,7 @@ public class z424_types_apply_ndes_nest_tst { ( fx.nde_().Typ_("gfml.item/pos").Atrk_("x", "10").Atrk_("y", "20") )); } - @Test public void InvokeByTyp() { + @Test public void InvokeByTyp() { fx.tst_Resolve ( fx.nde_().Hnd_("gfml.item").Subs_ ( fx.nde_().Hnd_("gfml.item/pos").Atrs_("10", "20")) @@ -38,7 +38,7 @@ public class z424_types_apply_ndes_nest_tst { ( fx.nde_().Typ_("gfml.item/pos").Atrk_("x", "10").Atrk_("y", "20") )); } - @Test public void NoInvokeByName() { + @Test public void NoInvokeByName() { fx.tst_Resolve ( fx.nde_().Hnd_("gfml.item").Subs_ ( fx.nde_().Hnd_("gfml.item").Atrs_("10", "20")) // item is not in .SubFlds, but is in regy @@ -46,7 +46,7 @@ public class z424_types_apply_ndes_nest_tst { ( fx.nde_().Typ_("gfml.item").Atrs_("10", "20") )); } - @Test public void Name_subLevel() { + @Test public void Name_subLevel() { GfmlTypeMakr makr = GfmlTypeMakr.new_(); makr.MakeRootType("font", "size"); makr.MakeSubType("color", "name"); @@ -56,7 +56,7 @@ public class z424_types_apply_ndes_nest_tst { , fx.nde_().Typ_(GfmlType_.AnyKey).Atru_("blue")// confirm that subFlds in other types are not selectable by name; i.e.: must be font/color, not just color ); } - @Test public void Unresolved() { + @Test public void Unresolved() { fx.tst_Resolve ( fx.nde_().Hnd_("").Atrs_("10", "20") , fx.nde_().Typ_(GfmlType_.AnyKey).Atrs_("10", "20") diff --git a/110_gfml/tst/gplx/gfml/z441_types_parse_basic_tst.java b/110_gfml/tst/gplx/gfml/z441_types_parse_basic_tst.java index 724858067..0ec332531 100644 --- a/110_gfml/tst/gplx/gfml/z441_types_parse_basic_tst.java +++ b/110_gfml/tst/gplx/gfml/z441_types_parse_basic_tst.java @@ -1,30 +1,30 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.gfml; import gplx.*; import org.junit.*; public class z441_types_parse_basic_tst { GfmlTypeCompiler_fxt fx = GfmlTypeCompiler_fxt.new_(); - @Test public void Null() { + @Test public void Null() { fx.tst_Parse(String_.Concat ( "point:1;" ) , fx.nde_().Hnd_("point").Typ_(GfmlType_.AnyKey).Atru_("1") ); } - @Test public void Basic() { + @Test public void Basic() { fx.tst_Parse(String_.Concat ( "_type:{" , "point {" @@ -36,7 +36,7 @@ public class z441_types_parse_basic_tst { , fx.nde_().Hnd_("point").Typ_("point").Atrk_("x", "1") ); } - @Test public void MultipleAtrs() { + @Test public void MultipleAtrs() { fx.tst_Parse(String_.Concat ( "_type:{" , "point {" diff --git a/110_gfml/tst/gplx/gfml/z442_types_parse_default_tst.java b/110_gfml/tst/gplx/gfml/z442_types_parse_default_tst.java index e4fb4cfc6..715a92d63 100644 --- a/110_gfml/tst/gplx/gfml/z442_types_parse_default_tst.java +++ b/110_gfml/tst/gplx/gfml/z442_types_parse_default_tst.java @@ -1,22 +1,22 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.gfml; import gplx.*; import org.junit.*; public class z442_types_parse_default_tst { - @Test public void Basic() { + @Test public void Basic() { fx.tst_Parse(String_.Concat ( "_type:{" , "point {x;}" @@ -26,7 +26,7 @@ public class z442_types_parse_default_tst { , fx.nde_().Hnd_("point").Typ_("point").Atrk_("x", "1") ); } - @Test public void Pinned() { + @Test public void Pinned() { fx.tst_Parse(String_.Concat ( "_type:{" , "point {x;}" @@ -38,7 +38,7 @@ public class z442_types_parse_default_tst { , fx.nde_().Hnd_("point").Typ_("point").Atrk_("x", "2") ); } - @Test public void Many() { + @Test public void Many() { fx.tst_Parse(String_.Concat ( "_type:{" , "point {x;}" // point is always pinned @@ -51,7 +51,7 @@ public class z442_types_parse_default_tst { , fx.nde_().Hnd_("point").Typ_("point").Atrk_("x", "2") ); } - @Test public void Nested() { + @Test public void Nested() { fx.tst_Parse(String_.Concat ( "_type:{" , "item {" @@ -65,7 +65,7 @@ public class z442_types_parse_default_tst { ) ); } - @Test public void NestedWithAtr() { + @Test public void NestedWithAtr() { fx.tst_Parse(String_.Concat ( "_type:{" , "item {" diff --git a/110_gfml/tst/gplx/gfml/z443_types_parse_keyd_tst.java b/110_gfml/tst/gplx/gfml/z443_types_parse_keyd_tst.java index 1e29f27cd..c69569977 100644 --- a/110_gfml/tst/gplx/gfml/z443_types_parse_keyd_tst.java +++ b/110_gfml/tst/gplx/gfml/z443_types_parse_keyd_tst.java @@ -1,22 +1,22 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.gfml; import gplx.*; import org.junit.*; public class z443_types_parse_keyd_tst { - @Test public void Basic() { + @Test public void Basic() { fx.tst_Parse(String_.Concat ( "[10 12];" ) diff --git a/110_gfml/tst/gplx/gfml/z451_dflts_compile_tst.java b/110_gfml/tst/gplx/gfml/z451_dflts_compile_tst.java index 822637c80..20a2564d2 100644 --- a/110_gfml/tst/gplx/gfml/z451_dflts_compile_tst.java +++ b/110_gfml/tst/gplx/gfml/z451_dflts_compile_tst.java @@ -1,18 +1,18 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.gfml; import gplx.*; import org.junit.*; public class z451_dflts_compile_tst { @@ -21,14 +21,14 @@ public class z451_dflts_compile_tst { pragma = GfmlPragmaDefault.new_(); fx_typ.run_InitPragma(regy, pragma); } GfmlTypRegy regy; GfmlPragmaDefault pragma; GfmlDefaultItem_fxt fx = GfmlDefaultItem_fxt.new_(); GfmlTypeCompiler_fxt fx_typ = GfmlTypeCompiler_fxt.new_(); - @Test public void Basic() { + @Test public void Basic() { GfmlNde gnde = fx_typ.run_Resolve(regy, "_default/type/atr" , fx_typ.nde_().Atru_("x").Atru_("10") ); GfmlDefaultItem actl = pragma.CompileItem(gnde, "point"); fx.tst_Item(actl, fx.make_("point", "x", "10")); } - @Test public void Many() { + @Test public void Many() { GfmlNde gnde = fx_typ.run_Resolve(regy, "_default/type" , fx_typ.nde_().Atru_("point").Subs_ ( fx_typ.nde_().Atrs_("x", "10") diff --git a/110_gfml/tst/gplx/gfml/z452_dflts_exec_tst.java b/110_gfml/tst/gplx/gfml/z452_dflts_exec_tst.java index fe651bb8b..bc5f338df 100644 --- a/110_gfml/tst/gplx/gfml/z452_dflts_exec_tst.java +++ b/110_gfml/tst/gplx/gfml/z452_dflts_exec_tst.java @@ -1,25 +1,25 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.gfml; import gplx.*; import org.junit.*; public class z452_dflts_exec_tst { @Before public void setup() { type = make_("gfml.point", "point", "x"); } GfmlDefaultItem item; GfmlType type; GfmlDefaultItem_fxt fx_item = GfmlDefaultItem_fxt.new_(); - @Test public void Basic() { + @Test public void Basic() { tst_SubFldDefault(type, "x", null); item = fx_item.make_("gfml.point", "x", "10"); @@ -29,7 +29,7 @@ public class z452_dflts_exec_tst { item.Exec_end(type); tst_SubFldDefault(type, "x", null); } - @Test public void Overwrite() { + @Test public void Overwrite() { ini_SubFldDefault_add(type, "x", "0"); tst_SubFldDefault(type, "x", "0"); @@ -40,7 +40,7 @@ public class z452_dflts_exec_tst { item.Exec_end(type); tst_SubFldDefault(type, "x", "0"); } - @Test public void CreateDefault() { + @Test public void CreateDefault() { tst_SubFldExists(type, "y", false); item = fx_item.make_("gfml.point", "y", "10"); @@ -51,7 +51,7 @@ public class z452_dflts_exec_tst { item.Exec_end(type); tst_SubFldExists(type, "y", false); } - @Test public void DefaultTkn() { + @Test public void DefaultTkn() { Object[] ary = ini_eval_("0"); GfmlTkn varTkn = (GfmlTkn)ary[0]; GfmlVarItm varItem = (GfmlVarItm)ary[1]; diff --git a/110_gfml/tst/gplx/gfml/z455_dflts_scope_tst.java b/110_gfml/tst/gplx/gfml/z455_dflts_scope_tst.java index 416dc9df2..35e72cd66 100644 --- a/110_gfml/tst/gplx/gfml/z455_dflts_scope_tst.java +++ b/110_gfml/tst/gplx/gfml/z455_dflts_scope_tst.java @@ -1,18 +1,18 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.gfml; import gplx.*; import org.junit.*; public class z455_dflts_scope_tst { @@ -23,7 +23,7 @@ public class z455_dflts_scope_tst { GfmlType type = makr.MakeRootType("point", "point", "x", "y").DocPos_(rootPos); regy.Add(type); } GfmlDocPos rootPos, currPos; GfmlTypRegy regy; - @Test public void Basic() { + @Test public void Basic() { currPos = rootPos.NewDown(0); tst_FetchOrNullByPos(regy, "point", rootPos, "point", "x", "y"); tst_FetchOrNullByPos(regy, "point", currPos, "point", "x", "y"); diff --git a/110_gfml/tst/gplx/gfml/z456_dflts_parse_tst.java b/110_gfml/tst/gplx/gfml/z456_dflts_parse_tst.java index cb35e42c8..1540b5359 100644 --- a/110_gfml/tst/gplx/gfml/z456_dflts_parse_tst.java +++ b/110_gfml/tst/gplx/gfml/z456_dflts_parse_tst.java @@ -1,22 +1,22 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.gfml; import gplx.*; import org.junit.*; public class z456_dflts_parse_tst { - @Test public void Fix_DefaultChangesPinnedType() { + @Test public void Fix_DefaultChangesPinnedType() { fx.tst_Parse(String_.Concat ( "_type:{" , "item {" diff --git a/110_gfml/tst/gplx/gfml/z481_vars_compile_tst.java b/110_gfml/tst/gplx/gfml/z481_vars_compile_tst.java index e43b7fa49..dfaae3a6b 100644 --- a/110_gfml/tst/gplx/gfml/z481_vars_compile_tst.java +++ b/110_gfml/tst/gplx/gfml/z481_vars_compile_tst.java @@ -1,18 +1,18 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.gfml; import gplx.*; import org.junit.*; public class z481_vars_compile_tst { @@ -21,7 +21,7 @@ public class z481_vars_compile_tst { pragma = GfmlPragmaVar.new_(); fx.run_InitPragma(regy, pragma); } GfmlTypeCompiler_fxt fx = GfmlTypeCompiler_fxt.new_(); GfmlTypRegy regy; GfmlPragmaVar pragma; - @Test public void Text1() { + @Test public void Text1() { GfmlNde gnde = fx.run_Resolve(regy, "_var/text" , fx.nde_().Atru_("key_test").Atru_("val_test").Atru_("context_test")); diff --git a/110_gfml/tst/gplx/gfml/z482_vars_parse_tst.java b/110_gfml/tst/gplx/gfml/z482_vars_parse_tst.java index 7e6fa6796..f7bda4104 100644 --- a/110_gfml/tst/gplx/gfml/z482_vars_parse_tst.java +++ b/110_gfml/tst/gplx/gfml/z482_vars_parse_tst.java @@ -1,23 +1,23 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.gfml; import gplx.*; import org.junit.*; public class z482_vars_parse_tst { GfmlTypeCompiler_fxt fx = GfmlTypeCompiler_fxt.new_(); - @Test public void Basic() { + @Test public void Basic() { fx.tst_Parse(String_.Concat ( "_var:{" , " size '20,20';" @@ -27,7 +27,7 @@ public class z482_vars_parse_tst { , fx.nde_().Atru_("20,20") ); } - @Test public void Many() { + @Test public void Many() { fx.tst_Parse(String_.Concat ( "_var:{" , " size '20,20';" @@ -38,7 +38,7 @@ public class z482_vars_parse_tst { , fx.nde_().Atru_("20,20").Atru_("30,30") ); } - @Test public void Deferred() { + @Test public void Deferred() { fx.tst_Parse(String_.Concat ( "_var:{" , " key0 '<~key1>';" @@ -51,7 +51,7 @@ public class z482_vars_parse_tst { , fx.nde_().Atru_("val1") ); } - @Test public void Swap() { + @Test public void Swap() { fx.tst_Parse(String_.Concat ( "{" , " _var:{" @@ -70,7 +70,7 @@ public class z482_vars_parse_tst { ) ); } - @Test public void Context() { + @Test public void Context() { fx.tst_Parse(String_.Concat ( "_var:{" , " size '20,20' gui;" diff --git a/110_gfml/tst/gplx/gfml/z501_lxr_parse_tst.java b/110_gfml/tst/gplx/gfml/z501_lxr_parse_tst.java index 78e41ddc7..69253c258 100644 --- a/110_gfml/tst/gplx/gfml/z501_lxr_parse_tst.java +++ b/110_gfml/tst/gplx/gfml/z501_lxr_parse_tst.java @@ -1,23 +1,23 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.gfml; import gplx.*; import org.junit.*; public class z501_lxr_parse_tst { GfmlTypeCompiler_fxt fx = GfmlTypeCompiler_fxt.new_(); - @Test public void SymCreate() { + @Test public void SymCreate() { fx.tst_Parse(String_.Concat ( "_lxr_sym:key='gfml.elm_key_1' raw='<-' cmd='gfml.elm_key';" , "a<-1;" @@ -25,7 +25,7 @@ public class z501_lxr_parse_tst { , fx.nde_().Atrk_("a", "1") ); } - @Test public void SymUpdate() { + @Test public void SymUpdate() { fx.tst_Parse(String_.Concat ( "_lxr_sym:key='gfml.elm_key_0' raw='<-';" , "a<-1 b=1;" @@ -33,7 +33,7 @@ public class z501_lxr_parse_tst { , fx.nde_().Atrk_("a", "1").Atru_("b=1") ); } - @Test public void SwapCreate() { + @Test public void SwapCreate() { fx.tst_Parse(String_.Concat ( "_lxr_sym:key='gfml.swap_0' raw='/?/?' val='/?';" , "/?/?;" @@ -41,7 +41,7 @@ public class z501_lxr_parse_tst { , fx.nde_().Atru_("/?") ); } - @Test public void FrameCreate() { + @Test public void FrameCreate() { fx.tst_Parse(String_.Concat ( "_lxr_frame:key='gfml.comment_2' type='comment' bgn='/-' end='-/';" , "a=/-ignore-/b;" @@ -49,7 +49,7 @@ public class z501_lxr_parse_tst { , fx.nde_().Atrk_("a", "b") ); } - @Test public void FrameUpdate() { + @Test public void FrameUpdate() { fx.tst_Parse(String_.Concat ( "_lxr_frame:key='gfml.comment_0' bgn='--' end='!';" , "a=--ignore!" @@ -75,7 +75,7 @@ public class z501_lxr_parse_tst { // how to change inner lxrs (lookup by key?) } -// @Test public void FrameUpdateEval() { +// @Test public void FrameUpdateEval() { // raw = String_.Concat // ( "_lxr_frame:key='gfml.eval_0' bgn='~<' end='>';" // how to handle '<~' where <~ (block quote) // , "a=~[t];" diff --git a/110_gfml/tst/gplx/gfml/z601_edit_atr_tst.java b/110_gfml/tst/gplx/gfml/z601_edit_atr_tst.java index 4f08a1aba..545063f14 100644 --- a/110_gfml/tst/gplx/gfml/z601_edit_atr_tst.java +++ b/110_gfml/tst/gplx/gfml/z601_edit_atr_tst.java @@ -1,75 +1,75 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.gfml; import gplx.*; import org.junit.*; public class z601_edit_atr_tst { GfmlUpdateFx fx = GfmlUpdateFx.new_(); - @Test public void Basic() { + @Test public void Basic() { fx .Raw_("a=1;").Update_(fx.atr_().NdeIdxs_(0).Atr_("a", "2")) .tst_("a=2;"); } - @Test public void WhiteSpaceComment() { + @Test public void WhiteSpaceComment() { fx .Raw_("a = /*comment*/1;").Update_(fx.atr_().NdeIdxs_(0).Atr_("a", "2")) .tst_("a = /*comment*/2;"); } - @Test public void Quoted() { + @Test public void Quoted() { fx .Raw_("a='1';").Update_(fx.atr_().NdeIdxs_(0).Atr_("a", "2")) .tst_("a='2';"); } - @Test public void EmbeddedQuote() { + @Test public void EmbeddedQuote() { fx .Raw_("a=1;").Update_(fx.atr_().NdeIdxs_(0).Atr_("a", "1'2")) .tst_("a='1''2';"); } - @Test public void ReuseQuote() { + @Test public void ReuseQuote() { fx .Raw_("a=|'1'|;").Update_(fx.atr_().NdeIdxs_(0).Atr_("a", "2")) .tst_("a=|'2'|;"); } - @Test public void ReuseQuoteWithEmbeddedQuote() { + @Test public void ReuseQuoteWithEmbeddedQuote() { fx .Raw_("a=|'1'2'|;").Update_(fx.atr_().NdeIdxs_(0).Atr_("a", "2'3")) .tst_("a=|'2'3'|;"); } -// @Test public void AtrIdx() { +// @Test public void AtrIdx() { // fx .Raw_("1;").Update_(fx.atr_().NdeIdxs_(0).AtrIdx_(0, "2")) // .tst_("2;"); // } -// @Test public void AtrIdx_parens() { +// @Test public void AtrIdx_parens() { // fx .Raw_("A_('1');").Update_(fx.atr_().NdeIdxs_(0).AtrIdx_(0, "2")) // .tst_("A_('2');"); // } - @Test public void AddNew() { + @Test public void AddNew() { fx .Raw_("a:;").Update_(fx.atr_().NdeIdxs_(0).Atr_("b", "1")) .tst_("a:b='1';"); } - @Test public void AddExisting() { + @Test public void AddExisting() { fx .Raw_("a='1';").Update_(fx.atr_().NdeIdxs_(0).Atr_("b", "2")) .tst_("a='1' b='2';"); } - @Test public void Add_many() { + @Test public void Add_many() { fx .Raw_("a='1';").Update_(fx.atr_().NdeIdxs_(0).Atr_("b", "2")).Update_(fx.atr_().NdeIdxs_(0).Atr_("c", "3")) .tst_("a='1' b='2' c='3';"); } - @Test public void AddNode() { + @Test public void AddNode() { fx .Raw_("a(){}").Update_(fx.nde_().NdeIdxs_(0).Nest_("b")) .tst_("a(){b(){}}"); } - @Test public void AddNodeMany() { + @Test public void AddNodeMany() { fx .Raw_("a(){}").Update_(fx.nde_().NdeIdxs_(0).Nest_("b")).Update_(fx.nde_().NdeIdxs_(0).Nest_("c")) .tst_("a(){b(){}c(){}}"); } - @Test public void EditNode() { + @Test public void EditNode() { fx .Raw_("a(){b(){}}").Update_(fx.nde_().NdeIdxs_(0).Nest_("b")) .tst_("a(){b(){}}"); } diff --git a/110_gfml/tst/gplx/gfml/z602_edit_nde_tst.java b/110_gfml/tst/gplx/gfml/z602_edit_nde_tst.java index 6f40114ee..9c7ff4569 100644 --- a/110_gfml/tst/gplx/gfml/z602_edit_nde_tst.java +++ b/110_gfml/tst/gplx/gfml/z602_edit_nde_tst.java @@ -13,10 +13,10 @@ The terms of each license can be found in the source code repository: GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt */ -package gplx.gfml; import gplx.*; -import org.junit.*; -public class z602_edit_nde_tst { - GfmlUpdateFx fx = GfmlUpdateFx.new_(); - @Test public void Basic() { - } -} +package gplx.gfml; import gplx.*; +import org.junit.*; +public class z602_edit_nde_tst { + GfmlUpdateFx fx = GfmlUpdateFx.new_(); + @Test public void Basic() { + } +} diff --git a/110_gfml/tst/gplx/gfml/z801_useCase_DataRdr_tst.java b/110_gfml/tst/gplx/gfml/z801_useCase_DataRdr_tst.java index 7e7fc5f01..6acda72d2 100644 --- a/110_gfml/tst/gplx/gfml/z801_useCase_DataRdr_tst.java +++ b/110_gfml/tst/gplx/gfml/z801_useCase_DataRdr_tst.java @@ -1,24 +1,24 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.gfml; import gplx.*; import org.junit.*; import gplx.core.stores.*; public class z801_useCase_DataRdr_tst { String raw; - @Test public void Subs_byName() { + @Test public void Subs_byName() { raw = String_.Concat ( "_type:{" , " item {" diff --git a/110_gfml/tst/gplx/gfml/z803_useCase_KbdKeyboard_tst.java b/110_gfml/tst/gplx/gfml/z803_useCase_KbdKeyboard_tst.java index 00cece517..b5b554c8e 100644 --- a/110_gfml/tst/gplx/gfml/z803_useCase_KbdKeyboard_tst.java +++ b/110_gfml/tst/gplx/gfml/z803_useCase_KbdKeyboard_tst.java @@ -1,23 +1,23 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.gfml; import gplx.*; import org.junit.*; public class z803_useCase_KbdKeyboard_tst { String raw; GfmlDoc gdoc; - @Test public void Quote() { // smokeTest; make sure DefaultLxr supports both quoting mechanisms + @Test public void Quote() { // smokeTest; make sure DefaultLxr supports both quoting mechanisms fx.tst_Parse(String_.Concat ( "gfui-keyboard-ui:{" , " keyQuote {" @@ -34,7 +34,7 @@ public class z803_useCase_KbdKeyboard_tst { ) ); } - @Test public void Key_LtrA() { + @Test public void Key_LtrA() { fx.tst_Parse(String_.Concat ( TypeHeader , "keys:{" @@ -52,7 +52,7 @@ public class z803_useCase_KbdKeyboard_tst { ) ); } - @Test public void Load_Smoke() { + @Test public void Load_Smoke() { Io_url url = Tfds.RscDir.GenSubFil_nest("110_gfml", "cfgs_archive", "gfui-keyboard-ui.cfg.gfml"); raw = Io_mgr.Instance.LoadFilStr(url); gdoc = GfmlDoc_.parse_any_eol_(raw); diff --git a/110_gfml/tst/gplx/gfml/z811_useCase_GfmlIoSql_tst.java b/110_gfml/tst/gplx/gfml/z811_useCase_GfmlIoSql_tst.java index b4d61f33a..2cec1d592 100644 --- a/110_gfml/tst/gplx/gfml/z811_useCase_GfmlIoSql_tst.java +++ b/110_gfml/tst/gplx/gfml/z811_useCase_GfmlIoSql_tst.java @@ -1,28 +1,28 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.gfml; import gplx.*; import org.junit.*; public class z811_useCase_GfmlIoSql_tst { - @Test public void Basic() { + @Test public void Basic() { tst_Doc("fld1=val1", nde_("fld").Atrs_add_("word", "fld1").Atrs_add_("op", "=").Atrs_add_("word", "val1")); tst_Doc("fld1 = val1", nde_("fld").Atrs_add_("word", "fld1").Atrs_add_("op", "=").Atrs_add_("word", "val1")); tst_Doc("fld1='val1'", nde_("fld").Atrs_add_("word", "fld1").Atrs_add_("op", "=").Atrs_add_("word", "val1")); tst_Doc("fld1='val 1'", nde_("fld").Atrs_add_("word", "fld1").Atrs_add_("op", "=").Atrs_add_("word", "val 1")); } - @Test public void Basic2() { + @Test public void Basic2() { tst_Doc("1=1 OR 2=2", nde_("fld").Atrs_add_("word", "1").Atrs_add_("op", "=").Atrs_add_("word", "1") .Atrs_add_("word", "OR") .Atrs_add_("word", "2").Atrs_add_("op", "=").Atrs_add_("word", "2") diff --git a/110_gfml/tst/gplx/gfml/z901_perf_tst.java b/110_gfml/tst/gplx/gfml/z901_perf_tst.java index a26387e91..51ff131e8 100644 --- a/110_gfml/tst/gplx/gfml/z901_perf_tst.java +++ b/110_gfml/tst/gplx/gfml/z901_perf_tst.java @@ -1,23 +1,23 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.gfml; import gplx.*; import org.junit.*; import gplx.core.strings.*; import gplx.core.envs.*; public class z901_perf_tst { TimerWatch tmr = TimerWatch.new_(); - @Test public void EmptyTestSoJunitWillNotFail() {} + @Test public void EmptyTestSoJunitWillNotFail() {} // @Test public void Long() { // String longText = String_.Repeat("a", 30 * 1000 * 1000); @@ -45,7 +45,7 @@ public class z901_perf_tst { GfmlDoc_.parse_any_eol_(sbGfml.To_str()); tmr.End_and_print("gfml"); // 1700 } - //@Test + //@Test public void Prop() { int max = 100 * 1000 * 1000; PerfFieldVsProc c = new PerfFieldVsProc(); @@ -64,7 +64,7 @@ public class z901_perf_tst { tmr.End_and_print("proc"); Tfds.Write(v); } -// @Test +// @Test // public void ClassComp() { // int max = 100 * 1000 * 1000; // ClassType ct = new ClassType3(); diff --git a/140_dbs/.classpath b/140_dbs/.classpath deleted file mode 100644 index 520316500..000000000 --- a/140_dbs/.classpath +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff --git a/140_dbs/src/gplx/dbs/Db_attach_mgr__tst.java b/140_dbs/src/gplx/dbs/Db_attach_mgr__tst.java index 59a73fe0f..af3940b6e 100644 --- a/140_dbs/src/gplx/dbs/Db_attach_mgr__tst.java +++ b/140_dbs/src/gplx/dbs/Db_attach_mgr__tst.java @@ -1,23 +1,23 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.dbs; import gplx.*; import org.junit.*; import gplx.core.tests.*; import gplx.dbs.qrys.*; public class Db_attach_mgr__tst { private final Db_attach_mgr__fxt fxt = new Db_attach_mgr__fxt(); - @Test public void Basic() { + @Test public void Basic() { Db_qry__select_cmd qry = Db_qry_.select_() .Cols_w_tbl_("t1", "fld_1") .Cols_w_tbl_("t2", "fld_2") diff --git a/140_dbs/src/gplx/dbs/Db_conn_info_tst.java b/140_dbs/src/gplx/dbs/Db_conn_info_tst.java index 0404c2f70..d674e18a6 100644 --- a/140_dbs/src/gplx/dbs/Db_conn_info_tst.java +++ b/140_dbs/src/gplx/dbs/Db_conn_info_tst.java @@ -1,25 +1,25 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.dbs; import gplx.*; import org.junit.*; public class Db_conn_info_tst { @Before public void setup() { regy.Add(Db_conn_info_mock.Instance); } private final Db_conn_info_pool regy = new Db_conn_info_pool(); - @Test public void Parse() { + @Test public void Parse() { tst_Parse("gplx_key=mock;id=1;", kv_("id", "1")); // one; gplx_key removed tst_Parse("gplx_key=mock;id=1;name=me;", kv_("id", "1"), kv_("name", "me")); // many tst_Parse("gplx_key=mock;id=1;name=me" , kv_("id", "1"), kv_("name", "me")); // no semi-colon at end @@ -30,7 +30,7 @@ public class Db_conn_info_tst { Tfds.Eq_ary_str(expd, mock.Kvs()); } } -class Db_conn_info_mock extends Db_conn_info__base { +class Db_conn_info_mock extends Db_conn_info__base { public Db_conn_info_mock(String raw, String db_api, String database) {super(raw, db_api, database);} public Keyval[] Kvs() {return kvs;} Keyval[] kvs; @Override public String Key() {return Tid_const;} public static final String Tid_const = "mock"; diff --git a/140_dbs/src/gplx/dbs/Db_crt_.java b/140_dbs/src/gplx/dbs/Db_crt_.java index 29c6a7686..fdec0876d 100644 --- a/140_dbs/src/gplx/dbs/Db_crt_.java +++ b/140_dbs/src/gplx/dbs/Db_crt_.java @@ -18,6 +18,7 @@ import gplx.core.criterias.*; public class Db_crt_ { public static final Criteria Wildcard = Criteria_.All; public static Criteria New_and (Criteria lhs, Criteria rhs) {return Criteria_.And(lhs, rhs);} + public static Criteria New_or (Criteria lhs, Criteria rhs) {return Criteria_.Or(lhs, rhs);} public static Criteria_fld New_eq (String key, Object val) {return Criteria_fld.new_(key, Criteria_.eq_(val));} public static Criteria_fld New_eq (String pre, String key, Object val) {return Criteria_fld.new_(pre, key, Criteria_.eq_(val));} public static Criteria_fld New_eq_not (String key, Object val) {return Criteria_fld.new_(key, Criteria_.eqn_(val));} diff --git a/140_dbs/src/gplx/dbs/Db_crt_tst.java b/140_dbs/src/gplx/dbs/Db_crt_tst.java index a73ad6a2e..0bd39e446 100644 --- a/140_dbs/src/gplx/dbs/Db_crt_tst.java +++ b/140_dbs/src/gplx/dbs/Db_crt_tst.java @@ -1,40 +1,40 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.dbs; import gplx.*; import org.junit.*; import gplx.core.criterias.*; import gplx.core.gfo_ndes.*; import gplx.core.type_xtns.*; public class Db_crt_tst { @Before public void setup() { row = GfoNde_.vals_(GfoFldList_.new_().Add("id", IntClassXtn.Instance).Add("name", StringClassXtn.Instance), Object_.Ary(1, "me")); } - @Test public void EqualTest() { + @Test public void EqualTest() { crt = Db_crt_.New_eq("id", 1); tst_Match(true, row, crt); } - @Test public void EqualFalseTest() { + @Test public void EqualFalseTest() { crt = Db_crt_.New_eq("id", 2); tst_Match(false, row, crt); } - @Test public void AndCompositeTest() { + @Test public void AndCompositeTest() { crt = Criteria_.And(Db_crt_.New_eq("id", 1), Db_crt_.New_eq("name", "me")); tst_Match(true, row, crt); crt = Criteria_.And(Db_crt_.New_eq("id", 1), Db_crt_.New_eq("name", "you")); tst_Match(false, row, crt); } - @Test public void OrCompositeTest() { + @Test public void OrCompositeTest() { crt = Criteria_.Or(Db_crt_.New_eq("id", 1), Db_crt_.New_eq("name", "you")); tst_Match(true, row, crt); diff --git a/140_dbs/src/gplx/dbs/Dbmeta_fld_list.java b/140_dbs/src/gplx/dbs/Dbmeta_fld_list.java index e09bc2c3b..487cd3c66 100644 --- a/140_dbs/src/gplx/dbs/Dbmeta_fld_list.java +++ b/140_dbs/src/gplx/dbs/Dbmeta_fld_list.java @@ -1,18 +1,18 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.dbs; import gplx.*; public class Dbmeta_fld_list { private final Ordered_hash flds = Ordered_hash_.New(); @@ -31,6 +31,7 @@ public class Dbmeta_fld_list { public String Add_int_dflt(String name, int dflt) {return Add(Dbmeta_fld_itm.new_int(name).Default_(dflt));} public String Add_int_null(String name) {return Add(Dbmeta_fld_itm.new_int(name).Nullable_y_());} public String Add_long(String name) {return Add(Dbmeta_fld_itm.new_long(name));} + public String Add_long_null(String name) {return Add(Dbmeta_fld_itm.new_long(name).Nullable_y_());} public String Add_float(String name) {return Add(Dbmeta_fld_itm.new_float(name));} public String Add_double(String name) {return Add(Dbmeta_fld_itm.new_double(name));} public String Add_text(String name) {return Add(Dbmeta_fld_itm.new_text(name));} diff --git a/140_dbs/src/gplx/dbs/diffs/builds/Gfdb_diff_bldr_tst.java b/140_dbs/src/gplx/dbs/diffs/builds/Gfdb_diff_bldr_tst.java index 71194e0a2..e8ebff449 100644 --- a/140_dbs/src/gplx/dbs/diffs/builds/Gfdb_diff_bldr_tst.java +++ b/140_dbs/src/gplx/dbs/diffs/builds/Gfdb_diff_bldr_tst.java @@ -1,45 +1,45 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.dbs.diffs.builds; import gplx.*; import gplx.dbs.*; import gplx.dbs.diffs.*; import org.junit.*; import gplx.dbs.*; import gplx.dbs.metas.*; import gplx.dbs.engines.mems.*; public class Gfdb_diff_bldr_tst { private final Gfdb_diff_bldr_fxt fxt = new Gfdb_diff_bldr_fxt(); @Before public void init() {fxt.Clear();} - @Test public void Same() { + @Test public void Same() { fxt.Init__tbl__old(Object_.Ary(1, "A") , Object_.Ary(2, "B")); fxt.Init__tbl__cur(Object_.Ary(1, "A") , Object_.Ary(2, "B")); fxt.Test__bld(); } - @Test public void Update() { + @Test public void Update() { fxt.Init__tbl__old(Object_.Ary(1, "A") , Object_.Ary(2, "B")); fxt.Init__tbl__cur(Object_.Ary(1, "A1") , Object_.Ary(2, "B1")); fxt.Test__bld("U|1|A1", "U|2|B1"); } - @Test public void Insert() { + @Test public void Insert() { fxt.Init__tbl__old(Object_.Ary(1, "A")); fxt.Init__tbl__cur(Object_.Ary(1, "A") , Object_.Ary(2, "B")); fxt.Test__bld("I|2|B"); } - @Test public void Delete() { + @Test public void Delete() { fxt.Init__tbl__old(Object_.Ary(1, "A") , Object_.Ary(2, "B")); fxt.Init__tbl__cur(Object_.Ary(1, "A")); fxt.Test__bld("D|2"); } - @Test public void Basic() { + @Test public void Basic() { fxt.Init__tbl__old ( Object_.Ary(1, "A") , Object_.Ary(2, "B") diff --git a/140_dbs/src/gplx/dbs/diffs/cmds/Gfdb_diff_cmd_sql_bldr_tst.java b/140_dbs/src/gplx/dbs/diffs/cmds/Gfdb_diff_cmd_sql_bldr_tst.java index ee7881039..5a643b71d 100644 --- a/140_dbs/src/gplx/dbs/diffs/cmds/Gfdb_diff_cmd_sql_bldr_tst.java +++ b/140_dbs/src/gplx/dbs/diffs/cmds/Gfdb_diff_cmd_sql_bldr_tst.java @@ -1,24 +1,24 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.dbs.diffs.cmds; import gplx.*; import gplx.dbs.*; import gplx.dbs.diffs.*; import org.junit.*; import gplx.dbs.*; import gplx.dbs.engines.mems.*; public class Gfdb_diff_cmd_sql_bldr_tst { private final Gfdb_diff_cmd_sql_bldr_fxt fxt = new Gfdb_diff_cmd_sql_bldr_fxt(); - @Test public void Insert() { + @Test public void Insert() { fxt.Test__insert("tbl1", String_.Ary("key1", "key2"), String_.Ary("fld1", "fld2"), 0, 99, String_.Concat_lines_nl_skip_last ( "INSERT INTO db_curr.tbl1" , "SELECT d.key1, d.key2, d.fld1, d.fld2" @@ -28,7 +28,7 @@ public class Gfdb_diff_cmd_sql_bldr_tst { , "AND k.diff_uid BETWEEN 0 AND 99;" )); } - @Test public void Update() { + @Test public void Update() { fxt.Test__update("tbl1", String_.Ary("key1", "key2"), String_.Ary("fld1", "fld2"), 0, 99, String_.Concat_lines_nl_skip_last ( "REPLACE INTO db_curr.tbl1" , "SELECT d.key1, d.key2, d.fld1, d.fld2" @@ -38,7 +38,7 @@ public class Gfdb_diff_cmd_sql_bldr_tst { , "AND k.diff_uid BETWEEN 0 AND 99;" )); } - @Test public void Delete() { + @Test public void Delete() { fxt.Test__delete("tbl1", String_.Ary("key1", "key2"), 0, 99, String_.Concat_lines_nl_skip_last ( "DELETE db_curr.tbl1" , "WHERE key1 || '|' || key2 IN" diff --git a/140_dbs/src/gplx/dbs/engines/Db_engine_sql_base.java b/140_dbs/src/gplx/dbs/engines/Db_engine_sql_base.java index 7be65896a..6a7de7342 100644 --- a/140_dbs/src/gplx/dbs/engines/Db_engine_sql_base.java +++ b/140_dbs/src/gplx/dbs/engines/Db_engine_sql_base.java @@ -1,22 +1,46 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ -package gplx.dbs.engines; import gplx.*; import gplx.dbs.*; -import java.sql.*; -import gplx.core.stores.*; -import gplx.dbs.engines.*; import gplx.dbs.metas.*; import gplx.dbs.qrys.*; import gplx.dbs.sqls.*; import gplx.dbs.sqls.wtrs.*; import gplx.dbs.conn_props.*; import gplx.dbs.qrys.bats.*; +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ +package gplx.dbs.engines; import gplx.Err_; +import gplx.Gfo_usr_dlg; +import gplx.Gfo_usr_dlg_; +import gplx.Io_url; +import gplx.Keyval; +import gplx.core.stores.DataRdr; +import gplx.dbs.Db_conn; +import gplx.dbs.Db_conn_info; +import gplx.dbs.Db_qry; +import gplx.dbs.Db_qry_; +import gplx.dbs.Db_rdr; +import gplx.dbs.Db_rdr__basic; +import gplx.dbs.Db_stmt; +import gplx.dbs.Dbmeta_fld_itm; +import gplx.dbs.Dbmeta_idx_itm; +import gplx.dbs.Dbmeta_tbl_itm; +import gplx.dbs.conn_props.Db_conn_props_mgr; +import gplx.dbs.metas.Dbmeta_tbl_mgr; +import gplx.dbs.qrys.Db_qry_sql; +import gplx.dbs.qrys.Db_stmt_cmd; +import gplx.dbs.qrys.bats.Db_batch_mgr; +import gplx.dbs.sqls.Sql_qry_wtr; + +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Statement; public abstract class Db_engine_sql_base implements Db_engine { @gplx.Internal protected void Ctor(Db_conn_info conn_info) {this.conn_info = conn_info;} public abstract String Tid(); @@ -27,12 +51,14 @@ public abstract class Db_engine_sql_base implements Db_engine { public abstract Db_engine New_clone(Db_conn_info conn_info); public Db_rdr Exec_as_rdr__rls_manual(Object rdr_obj, String sql) {return New_rdr(null, rdr_obj, sql);} public Db_rdr Exec_as_rdr__rls_auto(Db_stmt stmt, Object rdr_obj, String sql) {return New_rdr(stmt, rdr_obj, sql);} - @gplx.Virtual public Db_rdr New_rdr_clone() {return new Db_rdr__basic();} - @gplx.Virtual public Db_stmt Stmt_by_qry(Db_qry qry) {return new Db_stmt_cmd(this, qry);} - @gplx.Virtual public void Txn_bgn(String name) {Exec_as_obj(Db_qry_sql.xtn_("BEGIN TRANSACTION;"));} - @gplx.Virtual public String Txn_end() {Exec_as_obj(Db_qry_sql.xtn_("COMMIT TRANSACTION;")); batch_mgr.Txn_end().Run(this); return "";} - @gplx.Virtual public void Txn_cxl() {Exec_as_obj(Db_qry_sql.xtn_("ROLLBACK TRANSACTION;"));} - @gplx.Virtual public void Txn_sav() { + public Db_rdr New_rdr_clone() {return new Db_rdr__basic();} + public Db_stmt Stmt_by_qry(Db_qry qry) {return new Db_stmt_cmd(this, qry);} + protected String Txn_bgn_str() {return "BEGIN TRANSACTION;";} + protected String Txn_end_str() {return "COMMIT TRANSACTION;";} + public void Txn_bgn(String name) {Exec_as_obj(Db_qry_sql.xtn_(this.Txn_bgn_str()));} + public String Txn_end() {Exec_as_obj(Db_qry_sql.xtn_(this.Txn_end_str())); batch_mgr.Txn_end().Run(this); return "";} + public void Txn_cxl() {Exec_as_obj(Db_qry_sql.xtn_("ROLLBACK TRANSACTION;"));} + public void Txn_sav() { String txn_name = this.Txn_end(); this.Txn_bgn(txn_name); } @@ -68,7 +94,7 @@ public abstract class Db_engine_sql_base implements Db_engine { } this.Meta_mgr().Load_all(); } - @gplx.Virtual public void Meta_idx_delete(String idx) { + public void Meta_idx_delete(String idx) { if (Meta_idx_exists(idx)) Exec_as_int("DROP INDEX " + idx); } public void Meta_fld_append(String tbl, Dbmeta_fld_itm fld) { @@ -82,14 +108,14 @@ public abstract class Db_engine_sql_base implements Db_engine { } this.Meta_mgr().Load_all(); } - @gplx.Virtual public boolean Meta_tbl_exists(String tbl) {return false;} - @gplx.Virtual public boolean Meta_fld_exists(String tbl, String fld) {return false;} - @gplx.Virtual public boolean Meta_idx_exists(String idx) {return false;} + public boolean Meta_tbl_exists(String tbl) {return false;} + public boolean Meta_fld_exists(String tbl, String fld) {return false;} + public boolean Meta_idx_exists(String idx) {return false;} public abstract Dbmeta_tbl_mgr Meta_mgr(); - @gplx.Virtual public void Env_db_attach(String alias, Io_url db_url) {} - @gplx.Virtual public void Env_db_attach(String alias, Db_conn db_url) {} - @gplx.Virtual public void Env_db_detach(String alias) {} - @gplx.Virtual public DataRdr New_rdr(ResultSet rdr, String sql) {return gplx.core.stores.Db_data_rdr_.new_(rdr, sql);} + public void Env_db_attach(String alias, Io_url db_url) {} + public void Env_db_attach(String alias, Db_conn db_url) {} + public void Env_db_detach(String alias) {} + public DataRdr New_rdr(ResultSet rdr, String sql) {return gplx.core.stores.Db_data_rdr_.new_(rdr, sql);} private Db_rdr New_rdr(Db_stmt stmt, Object rdr, String sql) { Db_rdr__basic rv = (Db_rdr__basic)New_rdr_clone(); rv.Ctor(stmt, (ResultSet)rdr, sql); diff --git a/140_dbs/src/gplx/dbs/engines/mems/Mem_exec_select_tst.java b/140_dbs/src/gplx/dbs/engines/mems/Mem_exec_select_tst.java index 560c112fe..e24048d89 100644 --- a/140_dbs/src/gplx/dbs/engines/mems/Mem_exec_select_tst.java +++ b/140_dbs/src/gplx/dbs/engines/mems/Mem_exec_select_tst.java @@ -1,23 +1,23 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.dbs.engines.mems; import gplx.*; import gplx.dbs.*; import gplx.dbs.engines.*; import org.junit.*; import gplx.dbs.sqls.itms.*; public class Mem_exec_select_tst { private final Mem_db_fxt__single fxt = new Mem_db_fxt__single(); - @Test public void Basic() { + @Test public void Basic() { fxt.Exec__create_tbl("tbl_1", "fld_1"); fxt.Exec__insert("tbl_1" , String_.Ary("a_1") @@ -51,7 +51,7 @@ public class Mem_exec_select_tst { , String_.Ary("a_2") ); } - @Test public void Join__single() { + @Test public void Join__single() { fxt.Exec__create_tbl("tbl_1", "fld_a", "fld_1a"); fxt.Exec__create_tbl("tbl_2", "fld_a", "fld_2a"); fxt.Exec__insert("tbl_1" @@ -83,7 +83,7 @@ public class Mem_exec_select_tst { , String_.Ary("a_2", "1a_2", "2a_2") ); } - @Test public void Join__many() { + @Test public void Join__many() { fxt.Exec__create_tbl("tbl_1", "fld_a", "fld_1a"); fxt.Exec__create_tbl("tbl_2", "fld_a", "fld_2a"); fxt.Exec__insert("tbl_1" diff --git a/140_dbs/src/gplx/dbs/engines/mysql/Mysql_engine.java b/140_dbs/src/gplx/dbs/engines/mysql/Mysql_engine.java index fd5ef0e49..7fa298c8e 100644 --- a/140_dbs/src/gplx/dbs/engines/mysql/Mysql_engine.java +++ b/140_dbs/src/gplx/dbs/engines/mysql/Mysql_engine.java @@ -13,15 +13,26 @@ The terms of each license can be found in the source code repository: GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt */ -package gplx.dbs.engines.mysql; import gplx.*; import gplx.dbs.*; import gplx.dbs.engines.*; -import gplx.core.stores.*; import gplx.dbs.engines.*; import gplx.dbs.sqls.*; import gplx.dbs.metas.*; +package gplx.dbs.engines.mysql; +import gplx.Err_; +import gplx.core.stores.DataRdr; +import gplx.core.stores.Db_data_rdr; +import gplx.dbs.Db_conn_info; +import gplx.dbs.engines.Db_engine; +import gplx.dbs.engines.Db_engine_sql_base; +import gplx.dbs.metas.Dbmeta_tbl_mgr; +import gplx.dbs.sqls.Sql_qry_wtr; +import gplx.dbs.sqls.Sql_qry_wtr_; import gplx.dbs.wkrs.SqlWkrMgr; -import java.sql.*; +import java.sql.Connection; +import java.sql.ResultSet; public class Mysql_engine extends Db_engine_sql_base { @Override public String Tid() {return Mysql_conn_info.Tid_const;} @Override public Sql_qry_wtr Sql_wtr() {return Sql_qry_wtr_.New__mysql();} @Override public void CtorConn(SqlWkrMgr wkrMgr) {} + @Override protected String Txn_bgn_str() {return "START TRANSACTION;";} + @Override protected String Txn_end_str() {return "COMMIT;";} @Override public Db_engine New_clone(Db_conn_info connectInfo) { Mysql_engine rv = new Mysql_engine(); rv.Ctor(connectInfo); diff --git a/140_dbs/src/gplx/dbs/engines/sqlite/Sqlite_engine.java b/140_dbs/src/gplx/dbs/engines/sqlite/Sqlite_engine.java index f7ad5e76c..b1bd0bbf3 100644 --- a/140_dbs/src/gplx/dbs/engines/sqlite/Sqlite_engine.java +++ b/140_dbs/src/gplx/dbs/engines/sqlite/Sqlite_engine.java @@ -13,17 +13,44 @@ The terms of each license can be found in the source code repository: GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt */ -package gplx.dbs.engines.sqlite; import gplx.*; import gplx.dbs.*; import gplx.dbs.engines.*; -import java.sql.*; -import gplx.core.stores.*; import gplx.dbs.engines.*; import gplx.dbs.engines.sqlite.*; import gplx.dbs.metas.*; import gplx.dbs.sqls.*; -import gplx.dbs.qrys.*; -import gplx.core.consoles.Console_adp_; -import gplx.core.consoles.Console_adp__sys; +package gplx.dbs.engines.sqlite; import gplx.Bool_; +import gplx.Byte_; +import gplx.DateAdp; +import gplx.DateAdp_; +import gplx.Decimal_adp; +import gplx.Decimal_adp_; +import gplx.Err_; +import gplx.Float_; +import gplx.Gfo_usr_dlg_; +import gplx.Int_; +import gplx.Io_mgr; +import gplx.Io_url; +import gplx.Keyval; +import gplx.Keyval_; +import gplx.Long_; +import gplx.String_; +import gplx.Type_; import gplx.core.ios.IoItmFil; - +import gplx.core.stores.DataRdr; +import gplx.core.stores.Db_data_rdr; +import gplx.dbs.Db_conn; +import gplx.dbs.Db_conn_info; +import gplx.dbs.Db_qry; +import gplx.dbs.Db_rdr; +import gplx.dbs.Db_rdr__basic; +import gplx.dbs.Db_stmt; +import gplx.dbs.Dbmeta_fld_itm; +import gplx.dbs.engines.Db_engine; +import gplx.dbs.engines.Db_engine_sql_base; +import gplx.dbs.metas.Dbmeta_tbl_mgr; +import gplx.dbs.sqls.Sql_qry_wtr_; import gplx.dbs.wkrs.SqlWkrMgr; import gplx.dbs.wkrs.randoms.SqliteRandomWkr; import org.sqlite.SQLiteConnection; + +import java.sql.Connection; +import java.sql.ResultSet; +import java.sql.SQLException; public class Sqlite_engine extends Db_engine_sql_base { private final Sqlite_txn_mgr txn_mgr; private final Sqlite_schema_mgr schema_mgr; Sqlite_engine() { @@ -138,13 +165,28 @@ class Sqlite_rdr extends Db_data_rdr { @Override public float ReadFloat(String @Override public Decimal_adp ReadDecimal(String key) {return ReadDecimalOr(key, null);} @Override public Decimal_adp ReadDecimalOr(String key, Decimal_adp or) { Object val = Read(key); - Double d = ((Double)val); - return val == null ? or : Decimal_adp_.double_(d); + if (val == null) return or; + if (Type_.Eq_by_obj(val, Double.class)) { + return Decimal_adp_.double_((Double)val); + } + else if (Type_.Eq_by_obj(val, Integer.class)) { // 2021-09-16|needed for gfds + return Decimal_adp_.int_((Integer)val); + } + else { + throw Err_.New("sqlite decimal must be either double or int; val={0}", val); + } } @Override public DateAdp ReadDate(String key) {return ReadDateOr(key, null);} @Override public DateAdp ReadDateOr(String key, DateAdp or) { Object val = Read(key); - return val == null ? or : DateAdp_.parse_fmt((String)val, "M/dd/yyyy hh:mm tt"); + if (val == null) return or; + String valStr = (String)val; + try { + return DateAdp_.parse_fmt(valStr, "M/dd/yyyy hh:mm tt"); + } + catch (Exception exc) { // 2021-09-16|needed for gfds + return DateAdp_.parse_fmt(valStr, "yyyy-MM-dd hh:mm:ss"); + } } @Override public boolean ReadBool(String key) {return ReadBoolOr(key, false);} @Override public boolean ReadBoolOr(String key, boolean or) { diff --git a/140_dbs/src/gplx/dbs/engines/sqlite/Sqlite_engine_.java b/140_dbs/src/gplx/dbs/engines/sqlite/Sqlite_engine_.java index 2de80f79d..d6d9175a4 100644 --- a/140_dbs/src/gplx/dbs/engines/sqlite/Sqlite_engine_.java +++ b/140_dbs/src/gplx/dbs/engines/sqlite/Sqlite_engine_.java @@ -1,20 +1,21 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ -package gplx.dbs.engines.sqlite; import gplx.*; import gplx.dbs.*; import gplx.dbs.engines.*; -import gplx.core.primitives.*; import gplx.dbs.qrys.*; import gplx.dbs.utls.*; import gplx.dbs.engines.*; import gplx.dbs.engines.sqlite.*; +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ +package gplx.dbs.engines.sqlite; import gplx.*; import gplx.dbs.*; +import gplx.dbs.qrys.*; + public class Sqlite_engine_ { public static void Db_attach(Db_conn p, String alias, String url) { String s = String_.Format("ATTACH '{0}' AS {1};", url, alias); @@ -74,5 +75,6 @@ public class Sqlite_engine_ { public static String X_date_to_str(DateAdp v) {return v == Date_null ? "" : v.XtoStr_fmt_iso_8561();} public static final DateAdp Date_null = null; public static final byte Wildcard_byte = Byte_ascii.Hash; + public static final String Wildcard_str = "%"; public static int Read_only_detection = Io_mgr.Read_only__basic__file; } diff --git a/140_dbs/src/gplx/dbs/engines/tdbs/TdbConnectInfo_tst.java b/140_dbs/src/gplx/dbs/engines/tdbs/TdbConnectInfo_tst.java index bf1271142..be1dfb3e5 100644 --- a/140_dbs/src/gplx/dbs/engines/tdbs/TdbConnectInfo_tst.java +++ b/140_dbs/src/gplx/dbs/engines/tdbs/TdbConnectInfo_tst.java @@ -13,18 +13,18 @@ The terms of each license can be found in the source code repository: GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt */ -package gplx.dbs.engines.tdbs; import gplx.*; import gplx.dbs.*; import gplx.dbs.engines.*; -import org.junit.*; -public class TdbConnectInfo_tst { - @Test public void Full() { - Db_conn_info connectInfo = Db_conn_info_.parse("gplx_key=tdb;url=C:\\dir\\xmpl.tdb;format=dsv;"); - tst_Parse(connectInfo, Io_url_.new_any_("C:\\dir\\xmpl.tdb"), "dsv"); - } - @Test public void DefaultFormat() { - Db_conn_info connectInfo = Db_conn_info_.parse("gplx_key=tdb;url=C:\\dir\\xmpl.tdb"); // dsv Format inferred - tst_Parse(connectInfo, Io_url_.new_any_("C:\\dir\\xmpl.tdb"), "dsv"); - } - void tst_Parse(Db_conn_info connectInfo, Io_url url, String format) { - Tfds.Eq(((Tdb_conn_info)connectInfo).Url(), url); - } -} +package gplx.dbs.engines.tdbs; import gplx.*; import gplx.dbs.*; import gplx.dbs.engines.*; +import org.junit.*; +public class TdbConnectInfo_tst { + @Test public void Full() { + Db_conn_info connectInfo = Db_conn_info_.parse("gplx_key=tdb;url=C:\\dir\\xmpl.tdb;format=dsv;"); + tst_Parse(connectInfo, Io_url_.new_any_("C:\\dir\\xmpl.tdb"), "dsv"); + } + @Test public void DefaultFormat() { + Db_conn_info connectInfo = Db_conn_info_.parse("gplx_key=tdb;url=C:\\dir\\xmpl.tdb"); // dsv Format inferred + tst_Parse(connectInfo, Io_url_.new_any_("C:\\dir\\xmpl.tdb"), "dsv"); + } + void tst_Parse(Db_conn_info connectInfo, Io_url url, String format) { + Tfds.Eq(((Tdb_conn_info)connectInfo).Url(), url); + } +} diff --git a/140_dbs/src/gplx/dbs/engines/tdbs/TdbDbLoadMgr_tst.java b/140_dbs/src/gplx/dbs/engines/tdbs/TdbDbLoadMgr_tst.java index ebea35470..bd5d68123 100644 --- a/140_dbs/src/gplx/dbs/engines/tdbs/TdbDbLoadMgr_tst.java +++ b/140_dbs/src/gplx/dbs/engines/tdbs/TdbDbLoadMgr_tst.java @@ -1,18 +1,18 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.dbs.engines.tdbs; import gplx.*; import gplx.dbs.*; import gplx.dbs.engines.*; import org.junit.*; import gplx.core.gfo_ndes.*; import gplx.core.type_xtns.*; import gplx.core.stores.*; /*DsvDataRdr*/ import gplx.langs.dsvs.*; /*DsvDataWtr*/ @@ -24,7 +24,7 @@ public class TdbDbLoadMgr_tst { } TdbDatabase db; TdbDbLoadMgr loadMgr = TdbDbLoadMgr.new_(); TdbDbSaveMgr saveMgr = TdbDbSaveMgr.new_(); DataRdr rdr; DataWtr wtr; - @Test public void ReadDbFiles() { + @Test public void ReadDbFiles() { String raw = String_.Concat_lines_crlf ( "=======DIF======================, ,\" \",//" , "_files, ,\" \",#" @@ -45,7 +45,7 @@ public class TdbDbLoadMgr_tst { db.Files().DataObj_Wtr(wtr); Tfds.Eq(wtr.To_str(), raw); } - @Test public void ReadDbTbls() { + @Test public void ReadDbTbls() { String raw = String_.Concat_lines_crlf ( "=======DIF======================, ,\" \",//" , "_tables, ,\" \",#" @@ -66,7 +66,7 @@ public class TdbDbLoadMgr_tst { db.Tables().DataObj_Wtr(wtr); Tfds.Eq(wtr.To_str(), raw); } - @Test public void ReadTbl() { + @Test public void ReadTbl() { String raw = String_.Concat_lines_crlf ( "=======DIF======================, ,\" \",//" , "tbl0, ,\" \",#" diff --git a/140_dbs/src/gplx/dbs/engines/tdbs/TdbDbSaveMgr_tst.java b/140_dbs/src/gplx/dbs/engines/tdbs/TdbDbSaveMgr_tst.java index 4f004beb1..06f90e902 100644 --- a/140_dbs/src/gplx/dbs/engines/tdbs/TdbDbSaveMgr_tst.java +++ b/140_dbs/src/gplx/dbs/engines/tdbs/TdbDbSaveMgr_tst.java @@ -1,18 +1,18 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.dbs.engines.tdbs; import gplx.*; import gplx.dbs.*; import gplx.dbs.engines.*; import org.junit.*; import gplx.core.stores.*; import gplx.langs.dsvs.*; import gplx.core.type_xtns.*; @@ -22,7 +22,7 @@ public class TdbDbSaveMgr_tst { db = TdbDatabase.new_(dbInfo); wtr.Clear(); } TdbDatabase db; TdbDbSaveMgr saveMgr = TdbDbSaveMgr.new_(); DataWtr wtr = DsvDataWtr_.new_(); - @Test public void WriteDbFils() { + @Test public void WriteDbFils() { String expd = String_.Concat_lines_crlf ( "" , "" @@ -38,7 +38,7 @@ public class TdbDbSaveMgr_tst { String actl = wtr.To_str(); Tfds.Eq(expd, actl); } - @Test public void WriteDbTbls() { + @Test public void WriteDbTbls() { String expd = String_.Concat_lines_crlf ( "" , "" @@ -53,7 +53,7 @@ public class TdbDbSaveMgr_tst { String actl = wtr.To_str(); Tfds.Eq(expd, actl); } - @Test public void WriteTbl() { + @Test public void WriteTbl() { String expd = String_.Concat_lines_crlf ( "" , "" diff --git a/140_dbs/src/gplx/dbs/engines/tdbs/TdbFlush_tst.java b/140_dbs/src/gplx/dbs/engines/tdbs/TdbFlush_tst.java index a880cd20f..d15e61092 100644 --- a/140_dbs/src/gplx/dbs/engines/tdbs/TdbFlush_tst.java +++ b/140_dbs/src/gplx/dbs/engines/tdbs/TdbFlush_tst.java @@ -1,18 +1,18 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.dbs.engines.tdbs; import gplx.*; import gplx.dbs.*; import gplx.dbs.engines.*; import org.junit.*; import gplx.core.ios.*; /*IoMgrFxt*/ import gplx.dbs.qrys.*; import gplx.core.type_xtns.*; @@ -23,7 +23,7 @@ public class TdbFlush_tst { } TdbEngine engine; Io_url dbPath = Io_url_.mem_fil_("mem/dir/db0.dsv"); DateAdp time = DateAdp_.parse_gplx("2001-01-01"); TdbEngineFxt fx_engine = TdbEngineFxt.new_(); IoMgrFxt fx_io = IoMgrFxt.new_(); - @Test public void FlushNewDb() { + @Test public void FlushNewDb() { fx_engine.tst_FilesCount(engine, 1); fx_engine.tst_File(engine, 0, TdbFile.MainFileId, Io_url_.mem_fil_("mem/dir/db0.dsv"), "dsv"); fx_io.tst_Exists(false, dbPath); @@ -31,7 +31,7 @@ public class TdbFlush_tst { engine.FlushAll(); fx_io.tst_Exists(true, dbPath); } - @Test public void IgnoreFlushedDb() { + @Test public void IgnoreFlushedDb() { engine.FlushAll(); fx_io.tst_Exists(true, dbPath); fx_io.run_UpdateFilModifiedTime(dbPath, time); @@ -39,7 +39,7 @@ public class TdbFlush_tst { engine.FlushAll(); fx_io.tst_QueryFilModified(true, dbPath, time); } - @Test public void FlushNewTbl() { + @Test public void FlushNewTbl() { engine.FlushAll(); fx_engine.run_MakeTbl(engine, "tbl0", TdbFile.MainFileId); fx_io.run_UpdateFilModifiedTime(dbPath, time); @@ -47,7 +47,7 @@ public class TdbFlush_tst { engine.FlushAll(); fx_io.tst_QueryFilModified(false, dbPath, time); } - @Test public void IgnoreFlushedTbl() { + @Test public void IgnoreFlushedTbl() { fx_engine.run_MakeTbl(engine, "tbl0", TdbFile.MainFileId); engine.FlushAll(); fx_io.run_UpdateFilModifiedTime(dbPath, time); @@ -55,7 +55,7 @@ public class TdbFlush_tst { engine.FlushAll(); fx_io.tst_QueryFilModified(true, dbPath, time); } - @Test public void FlushDirtyTbl() { + @Test public void FlushDirtyTbl() { fx_engine.run_MakeTbl(engine, "tbl0", TdbFile.MainFileId); engine.FlushAll(); fx_io.run_UpdateFilModifiedTime(dbPath, time); @@ -64,7 +64,7 @@ public class TdbFlush_tst { engine.FlushAll(); fx_io.tst_QueryFilModified(false, dbPath, time); } - @Test public void FlushDirtyFilOnly() { + @Test public void FlushDirtyFilOnly() { Io_url dbPathOther = Io_url_.mem_fil_("mem/dir/db1.dsv"); TdbFile filOther = fx_engine.run_MakeFile(engine, dbPathOther); Tfds.Eq(false, Object_.Eq(filOther.Id(), TdbFile.MainFileId)); fx_engine.run_MakeTbl(engine, "tbl0", TdbFile.MainFileId); fx_engine.run_MakeTbl(engine, "tbl1", filOther.Id()); diff --git a/140_dbs/src/gplx/dbs/metas/parsers/Dbmeta_parser__fld_tst.java b/140_dbs/src/gplx/dbs/metas/parsers/Dbmeta_parser__fld_tst.java index 1885ef312..4e287ec11 100644 --- a/140_dbs/src/gplx/dbs/metas/parsers/Dbmeta_parser__fld_tst.java +++ b/140_dbs/src/gplx/dbs/metas/parsers/Dbmeta_parser__fld_tst.java @@ -1,30 +1,30 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.dbs.metas.parsers; import gplx.*; import gplx.dbs.*; import gplx.dbs.metas.*; import org.junit.*; public class Dbmeta_parser__fld_tst { @Before public void init() {fxt.Clear();} private Dbmeta_parser__fld_fxt fxt = new Dbmeta_parser__fld_fxt(); - @Test public void Parse_type() { + @Test public void Parse_type() { fxt.Test_parse_type("int" , fxt.Make_type(Dbmeta_fld_tid.Tid__int)); fxt.Test_parse_type("varchar(255)" , fxt.Make_type(Dbmeta_fld_tid.Tid__str, 255)); fxt.Test_parse_type("decimal(12,10)" , fxt.Make_type(Dbmeta_fld_tid.Tid__decimal, 12, 10)); fxt.Test_parse_type(" int" , fxt.Make_type(Dbmeta_fld_tid.Tid__int)); fxt.Test_parse_type(" decimal ( 12 , 10 )" , fxt.Make_type(Dbmeta_fld_tid.Tid__decimal, 12, 10)); } - @Test public void Parse_fld() { + @Test public void Parse_fld() { fxt.Test_parse_fld("name_1 int" , fxt.Make_fld("name_1", Dbmeta_fld_tid.Tid__int, Dbmeta_fld_itm.Nullable_unknown)); fxt.Test_parse_fld("name_1 int null" , fxt.Make_fld("name_1", Dbmeta_fld_tid.Tid__int, Dbmeta_fld_itm.Nullable_null)); fxt.Test_parse_fld("name_1 int not null" , fxt.Make_fld("name_1", Dbmeta_fld_tid.Tid__int, Dbmeta_fld_itm.Nullable_not_null)); @@ -33,7 +33,7 @@ public class Dbmeta_parser__fld_tst { fxt.Test_parse_fld("name_1 int not null default -1" , fxt.Make_fld("name_1", Dbmeta_fld_tid.Tid__int, Dbmeta_fld_itm.Nullable_not_null, Bool_.Y, Bool_.N, -1)); fxt.Test_parse_fld("name_1 varchar(3) not null default 'abc'" , fxt.Make_fld("name_1", Dbmeta_fld_tid.Tid__str, Dbmeta_fld_itm.Nullable_not_null, Bool_.Y, Bool_.N, "abc")); } - @Test public void Comment() { + @Test public void Comment() { fxt.Test_parse_fld("name_1 int --a\n" , fxt.Make_fld("name_1", Dbmeta_fld_tid.Tid__int, Dbmeta_fld_itm.Nullable_unknown)); } } diff --git a/140_dbs/src/gplx/dbs/metas/parsers/Dbmeta_parser__idx_tst.java b/140_dbs/src/gplx/dbs/metas/parsers/Dbmeta_parser__idx_tst.java index fe27b2f6f..550677303 100644 --- a/140_dbs/src/gplx/dbs/metas/parsers/Dbmeta_parser__idx_tst.java +++ b/140_dbs/src/gplx/dbs/metas/parsers/Dbmeta_parser__idx_tst.java @@ -1,25 +1,25 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.dbs.metas.parsers; import gplx.*; import gplx.dbs.*; import gplx.dbs.metas.*; import org.junit.*; public class Dbmeta_parser__idx_tst { @Before public void init() {fxt.Clear();} private final Dbmeta_parser__idx_fxt fxt = new Dbmeta_parser__idx_fxt(); - @Test public void Unique() {fxt.Test_parse("CREATE UNIQUE INDEX idx_1 ON tbl_1 (fld_1, fld_2, fld_3)" , fxt.Make_idx(Bool_.Y, "idx_1", "tbl_1", "fld_1", "fld_2", "fld_3"));} - @Test public void Normal() {fxt.Test_parse("CREATE INDEX idx_1 ON tbl_1 (fld_1, fld_2, fld_3)" , fxt.Make_idx(Bool_.N, "idx_1", "tbl_1", "fld_1", "fld_2", "fld_3"));} - @Test public void Fld_1() {fxt.Test_parse("CREATE INDEX idx_1 ON tbl_1 (fld_1)" , fxt.Make_idx(Bool_.N, "idx_1", "tbl_1", "fld_1"));} + @Test public void Unique() {fxt.Test_parse("CREATE UNIQUE INDEX idx_1 ON tbl_1 (fld_1, fld_2, fld_3)" , fxt.Make_idx(Bool_.Y, "idx_1", "tbl_1", "fld_1", "fld_2", "fld_3"));} + @Test public void Normal() {fxt.Test_parse("CREATE INDEX idx_1 ON tbl_1 (fld_1, fld_2, fld_3)" , fxt.Make_idx(Bool_.N, "idx_1", "tbl_1", "fld_1", "fld_2", "fld_3"));} + @Test public void Fld_1() {fxt.Test_parse("CREATE INDEX idx_1 ON tbl_1 (fld_1)" , fxt.Make_idx(Bool_.N, "idx_1", "tbl_1", "fld_1"));} } class Dbmeta_parser__idx_fxt { private final Dbmeta_parser__idx parser = new Dbmeta_parser__idx(); diff --git a/140_dbs/src/gplx/dbs/metas/parsers/Dbmeta_parser__tbl_tst.java b/140_dbs/src/gplx/dbs/metas/parsers/Dbmeta_parser__tbl_tst.java index 57151b089..bd015ced6 100644 --- a/140_dbs/src/gplx/dbs/metas/parsers/Dbmeta_parser__tbl_tst.java +++ b/140_dbs/src/gplx/dbs/metas/parsers/Dbmeta_parser__tbl_tst.java @@ -1,26 +1,26 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.dbs.metas.parsers; import gplx.*; import gplx.dbs.*; import gplx.dbs.metas.*; import org.junit.*; import gplx.dbs.engines.sqlite.*; public class Dbmeta_parser__tbl_tst { @Before public void init() {fxt.Clear();} private Dbmeta_parser__tbl_fxt fxt = new Dbmeta_parser__tbl_fxt(); - @Test public void Test_parse() { + @Test public void Test_parse() { fxt.Test_parse("CREATE TABLE tbl_1 (fld_1 int, fld_2 int)", fxt.Make_tbl("tbl_1", "fld_1", "fld_2")); } - @Test public void Test_smoke() { + @Test public void Test_smoke() { fxt.Test_parse(String_.Concat_lines_nl_skip_last ( "CREATE TABLE page" , "( page_id integer NOT NULL PRIMARY KEY" diff --git a/140_dbs/src/gplx/dbs/metas/parsers/Sql_bry_rdr_tst.java b/140_dbs/src/gplx/dbs/metas/parsers/Sql_bry_rdr_tst.java index 42946d40b..4ceb8c2ca 100644 --- a/140_dbs/src/gplx/dbs/metas/parsers/Sql_bry_rdr_tst.java +++ b/140_dbs/src/gplx/dbs/metas/parsers/Sql_bry_rdr_tst.java @@ -1,23 +1,23 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.dbs.metas.parsers; import gplx.*; import gplx.dbs.*; import gplx.dbs.metas.*; import org.junit.*; public class Sql_bry_rdr_tst { @Before public void init() {fxt.Clear();} private Sql_bry_rdr_fxt fxt = new Sql_bry_rdr_fxt(); - @Test public void Skip_ws() { + @Test public void Skip_ws() { fxt.Test_skip_ws("a", 0); // char fxt.Test_skip_ws("\ta", 1); // tab fxt.Test_skip_ws("\na", 1); // \n @@ -26,7 +26,7 @@ public class Sql_bry_rdr_tst { fxt.Test_skip_ws("\t\n\r a", 4); // multi fxt.Test_skip_ws("", 0); // eos } - @Test public void Read_sql_identifier() { + @Test public void Read_sql_identifier() { fxt.Test_read_sql_identifier("a", "a"); // one fxt.Test_read_sql_identifier("abc_1", "abc_1"); // many fxt.Test_read_sql_identifier("[abc_1]", "abc_1"); // bracket diff --git a/140_dbs/src/gplx/dbs/qrys/Db_qry__select_cmd.java b/140_dbs/src/gplx/dbs/qrys/Db_qry__select_cmd.java index 9e3a71bba..cba9937ab 100644 --- a/140_dbs/src/gplx/dbs/qrys/Db_qry__select_cmd.java +++ b/140_dbs/src/gplx/dbs/qrys/Db_qry__select_cmd.java @@ -1,21 +1,21 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.dbs.qrys; import gplx.*; import gplx.dbs.*; import gplx.core.criterias.*; -import gplx.dbs.sqls.*; import gplx.dbs.sqls.itms.*; +import gplx.dbs.sqls.itms.*; public class Db_qry__select_cmd implements Db_qry { public int Tid() {return Db_qry_.Tid_select;} public boolean Exec_is_rdr() {return Bool_.Y;} @@ -30,6 +30,7 @@ public class Db_qry__select_cmd implements Db_qry { } public Db_qry__select_cmd Join_(String name, String alias, Sql_join_fld... join_flds) {return Join_(Sql_tbl_itm.Tid__inner, Sql_tbl_itm.Db__null , name, alias, join_flds);} public Db_qry__select_cmd Join_(String db, String name, String alias, Sql_join_fld... join_flds) {return Join_(Sql_tbl_itm.Tid__inner, db , name, alias, join_flds);} + public Db_qry__select_cmd Join_(int join_tid, String name, String alias, Sql_join_fld... join_flds) {return Join_(join_tid, Sql_tbl_itm.Db__null, name, alias, join_flds);} public Db_qry__select_cmd Join_(int join_tid, String db, String name, String alias, Sql_join_fld... join_flds) { if (from == null) throw Err_.new_("sql_qry", "super table is not defined"); from.Tbls.Add(new Sql_tbl_itm(join_tid, db, name, alias, join_flds)); @@ -107,5 +108,5 @@ public class Db_qry__select_cmd implements Db_qry { } public String To_sql__exec(gplx.dbs.sqls.Sql_qry_wtr wtr) {return wtr.To_sql_str(this, Bool_.N);} - public String To_sql__prep(gplx.dbs.sqls.Sql_qry_wtr wtr) {return wtr.To_sql_str(this, Bool_.Y);} + public String To_sql__prep(gplx.dbs.sqls.Sql_qry_wtr wtr) {return wtr.To_sql_str(this, Bool_.Y);} } diff --git a/140_dbs/src/gplx/dbs/qrys/Db_qry_dml_tst.java b/140_dbs/src/gplx/dbs/qrys/Db_qry_dml_tst.java index 43c14b133..6a07ef248 100644 --- a/140_dbs/src/gplx/dbs/qrys/Db_qry_dml_tst.java +++ b/140_dbs/src/gplx/dbs/qrys/Db_qry_dml_tst.java @@ -1,37 +1,37 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.dbs.qrys; import gplx.*; import gplx.dbs.*; import org.junit.*; import gplx.core.criterias.*; public class Db_qry_dml_tst { - @Test public void Delete_basic() { + @Test public void Delete_basic() { tst_XtoSql(Db_qry_delete.new_("tbl0", Db_crt_.New_eq("fld0", "val0")) , "DELETE FROM tbl0 WHERE fld0 = 'val0'"); } - @Test public void Insert_basic() { + @Test public void Insert_basic() { tst_XtoSql(new Db_qry_insert("tbl0").Val_int("id", 0).Val_str("name", "me").Val_date("time", DateAdp_.parse_gplx("2007-12-23")) , "INSERT INTO tbl0 (id, name, time) VALUES (0, 'me', '2007-12-23 00:00:00.000')"); } - @Test public void Update_basic() { + @Test public void Update_basic() { Db_qry_update qry = new Db_qry_update(); qry.From_("tbl0"); qry.Where_(Db_crt_.New_eq("id", 0)).Val_str("name", "me"); tst_XtoSql(qry, "UPDATE tbl0 SET name='me' WHERE id = 0"); } - @Test public void Update_all() { + @Test public void Update_all() { Db_qry_update qry = new Db_qry_update(); qry.From_("tbl0"); qry.Val_int("id", 1).Val_str("name", "me").Val_date("startTime", DateAdp_.parse_gplx("2007-12-23")); diff --git a/140_dbs/src/gplx/dbs/qrys/Db_qry_select_tst.java b/140_dbs/src/gplx/dbs/qrys/Db_qry_select_tst.java index 22c629af5..6286110e4 100644 --- a/140_dbs/src/gplx/dbs/qrys/Db_qry_select_tst.java +++ b/140_dbs/src/gplx/dbs/qrys/Db_qry_select_tst.java @@ -1,84 +1,84 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.dbs.qrys; import gplx.*; import gplx.dbs.*; import org.junit.*; import gplx.dbs.sqls.*; public class Db_qry_select_tst { @Before public void setup() { cmd = new Db_qry__select_cmd(); } Db_qry__select_cmd cmd; String expd; - @Test public void Basic() { + @Test public void Basic() { cmd.Cols_("fld0", "fld1").From_("tbl0"); expd = "SELECT fld0, fld1 FROM tbl0"; tst_XtoStr(cmd, expd); } - @Test public void OrderDoesNotMatter() { + @Test public void OrderDoesNotMatter() { cmd.From_("tbl0").Cols_("fld0", "fld1"); expd = "SELECT fld0, fld1 FROM tbl0"; tst_XtoStr(cmd, expd); } - @Test public void DefaultAllFields() { + @Test public void DefaultAllFields() { cmd.From_("tbl0"); expd = "SELECT * FROM tbl0"; tst_XtoStr(cmd, expd); } - @Test public void Where() { + @Test public void Where() { cmd.From_("tbl0").Where_(Db_crt_.New_eq("fld0", 0)); expd = "SELECT * FROM tbl0 WHERE fld0 = 0"; tst_XtoStr(cmd, expd); } - @Test public void Join() { + @Test public void Join() { cmd.From_("tbl0").Join_("tbl1", "t1", Db_qry_.New_join__join("fld1", "tbl0", "fld0")); expd = "SELECT * FROM tbl0 INNER JOIN tbl1 t1 ON tbl0.fld0 = t1.fld1"; tst_XtoStr(cmd, expd); } - @Test public void OrderBy() { + @Test public void OrderBy() { cmd.From_("tbl0").Order_("fld0", true); expd = "SELECT * FROM tbl0 ORDER BY fld0"; tst_XtoStr(cmd, expd); } - @Test public void OrderByMany() { + @Test public void OrderByMany() { cmd.From_("tbl0").Order_asc_many_("fld0", "fld1"); expd = "SELECT * FROM tbl0 ORDER BY fld0, fld1"; tst_XtoStr(cmd, expd); } - @Test public void Limit() { + @Test public void Limit() { cmd.From_("tbl0").Limit_(10); expd = "SELECT * FROM tbl0 LIMIT 10"; tst_XtoStr(cmd, expd); } -// @Test public void GroupBy() { +// @Test public void GroupBy() { // cmd.From_("tbl0").groupBy_("fld0", "fld1"); // expd = "SELECT fld0, fld1 FROM tbl0 GROUP BY fld0, fld1"; // Tfds.Eq(cmd.To_str(), expd); // } -// @Test public void Union() { +// @Test public void Union() { // cmd.From_("tbl0").select("fld0").union_(qry2.from("tbl1").select("fld0")); // cmd.From_("tbl0").select("fld0").union_().from("tbl1").select("fld0"); // feasible, but will be bad later when trying to access Db_qry__select_cmd props // expd = "SELECT fld0 FROM tbl0 UNION SELECT fld0 FROM tbl1"; // Tfds.Eq(cmd.To_str(), expd); // } -// @Test public void Having() { +// @Test public void Having() { // cmd.From_("tbl0").groupBy_("fld0", "fld1"); // expd = "SELECT fld0, fld1 FROM tbl0 GROUP BY fld0, fld1 HAVING Count(fld0) > 1"; // Tfds.Eq(cmd.To_str(), expd); diff --git a/140_dbs/src/gplx/dbs/qrys/Db_qry_sql_tst.java b/140_dbs/src/gplx/dbs/qrys/Db_qry_sql_tst.java index 96ed0cee3..77698500b 100644 --- a/140_dbs/src/gplx/dbs/qrys/Db_qry_sql_tst.java +++ b/140_dbs/src/gplx/dbs/qrys/Db_qry_sql_tst.java @@ -1,37 +1,37 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.dbs.qrys; import gplx.*; import gplx.dbs.*; import org.junit.*; import gplx.dbs.sqls.*; public class Db_qry_sql_tst { @Before public void init() {fxt.Clear();} private Db_qry_sql_fxt fxt = new Db_qry_sql_fxt(); - @Test public void Insert() { + @Test public void Insert() { fxt.Test_qry ( Db_qry_insert.new_("tbl", "k1", "k2", "k3", "k4", "k5", "k6", "k7", "k8", "k9") , Object_.Ary(123, Bool_.Y, 1.23d, 123L, 123f, Byte_ascii.Num_1, "123", DateAdp_.parse_iso8561("1981-04-05T14:30:30"), Decimal_adp_.parse("1.23")) , "INSERT INTO tbl (k1, k2, k3, k4, k5, k6, k7, k8, k9) VALUES (123, 1, 1.23, 123, 123, 1, '123', '1981-04-05 14:30:30.000', 1.23)" ); } - @Test public void Update() { + @Test public void Update() { fxt.Test_qry ( Db_qry_update.New("tbl", String_.Ary("k1", "k2"), "k3", "k4") , Object_.Ary("v3", "v4", "v1", "v2") , "UPDATE tbl SET k3='v3', k4='v4' WHERE (k1 = 'v1' AND k2 = 'v2')" ); } - @Test public void Delete() { + @Test public void Delete() { fxt.Test_qry ( Db_qry_delete.new_("tbl", String_.Ary("k1", "k2")) , Object_.Ary("v1", "v2") diff --git a/140_dbs/src/gplx/dbs/qrys/Db_stmt_cmd.java b/140_dbs/src/gplx/dbs/qrys/Db_stmt_cmd.java index f1ac4b48a..3c65f0c96 100644 --- a/140_dbs/src/gplx/dbs/qrys/Db_stmt_cmd.java +++ b/140_dbs/src/gplx/dbs/qrys/Db_stmt_cmd.java @@ -1,6 +1,6 @@ /* XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com +Copyright (C) 2012-2021 gnosygnu@gmail.com XOWA is licensed under the terms of the General Public License (GPL) Version 3, or alternatively under the terms of the Apache License Version 2.0. @@ -13,164 +13,279 @@ The terms of each license can be found in the source code repository: GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt */ -package gplx.dbs.qrys; import gplx.*; import gplx.dbs.*; -import java.sql.*; -import gplx.dbs.engines.*; import gplx.dbs.sqls.*; import gplx.core.stores.*; -public class Db_stmt_cmd implements Db_stmt { - private static final String Key_na = ""; // key is not_available; only called by procs with signature of Val( v); - private Db_engine engine; - private PreparedStatement stmt = null; - private String sql; private int val_idx = 0; - public Db_stmt_cmd(Db_engine engine, Db_qry qry) {Ctor_stmt(engine, qry);} - public void Ctor_stmt(Db_engine engine, Db_qry qry) { - this.engine = engine; - sql = qry.Tid() == Db_qry_.Tid_select_in_tbl ? ((Db_qry__select_in_tbl)qry).To_sql__exec(engine.Sql_wtr()) : engine.Sql_wtr().To_sql_str(qry, true); - Reset_stmt(); - } - public Db_stmt Reset_stmt() { - stmt = (PreparedStatement)engine.Stmt_by_sql(sql); - return this; - } - public Db_stmt Crt_bool_as_byte(String k, boolean v) {return Add_byte_by_bool(Bool_.Y, k, v);} - public Db_stmt Val_bool_as_byte(String k, boolean v) {return Add_byte_by_bool(Bool_.N, k, v);} - public Db_stmt Val_bool_as_byte(boolean v) {return Add_byte_by_bool(Bool_.N, Key_na, v);} - private Db_stmt Add_byte_by_bool(boolean where, String k, boolean v) {return Add_byte(where, k, v ? Bool_.Y_byte : Bool_.N_byte);} - public Db_stmt Crt_byte(String k, byte v) {return Add_byte(Bool_.Y, k, v);} - public Db_stmt Val_byte(String k, byte v) {return Add_byte(Bool_.N, k, v);} - public Db_stmt Val_byte(byte v) {return Add_byte(Bool_.N, Key_na, v);} - private Db_stmt Add_byte(boolean where, String k, byte v) { - if (k == Dbmeta_fld_itm.Key_null) return this; // key is explicitly null; ignore; allows version_2+ type definitions - try {stmt.setByte(++val_idx, v);} catch (Exception e) {this.Rls(); throw Err_.new_exc(e, "db", "failed to add value", "type", "byte", "val", v, "sql", sql);} - return this; - } - public Db_stmt Crt_int(String k, int v) {return Add_int(Bool_.Y, k, v);} - public Db_stmt Val_int_by_bool(String k, boolean v) {return Add_int(Bool_.N, k, v ? 1 : 0);} - public Db_stmt Val_int(String k, int v) {return Add_int(Bool_.N, k, v);} - public Db_stmt Val_int(int v) {return Add_int(Bool_.N, Key_na, v);} - private Db_stmt Add_int(boolean where, String k, int v) { - if (k == Dbmeta_fld_itm.Key_null) return this; // key is explicitly null; ignore; allows version_2+ type definitions - try {stmt.setInt(++val_idx, v);} catch (Exception e) {this.Rls(); throw Err_.new_exc(e, "db", "failed to add value", "type", "int", "val", v, "sql", sql);} - return this; - } - public Db_stmt Crt_long(String k, long v) {return Add_long(Bool_.Y, k, v);} - public Db_stmt Val_long(String k, long v) {return Add_long(Bool_.N, k, v);} - public Db_stmt Val_long(long v) {return Add_long(Bool_.N, Key_na, v);} - private Db_stmt Add_long(boolean where, String k, long v) { - if (k == Dbmeta_fld_itm.Key_null) return this; // key is explicitly null; ignore; allows version_2+ type definitions - try {stmt.setLong(++val_idx, v);} catch (Exception e) {this.Rls(); throw Err_.new_exc(e, "db", "failed to add value", "type", "long", "val", v, "sql", sql);} - return this; - } - public Db_stmt Crt_float(String k, float v) {return Add_float(Bool_.Y, k, v);} - public Db_stmt Val_float(String k, float v) {return Add_float(Bool_.N, k, v);} - public Db_stmt Val_float(float v) {return Add_float(Bool_.N, Key_na, v);} - private Db_stmt Add_float(boolean where, String k, float v) { - if (k == Dbmeta_fld_itm.Key_null) return this; // key is explicitly null; ignore; allows version_2+ type definitions - try {stmt.setFloat(++val_idx, v);} catch (Exception e) {this.Rls(); throw Err_.new_exc(e, "db", "failed to add value", "type", "float", "val", v, "sql", sql);} - return this; - } - public Db_stmt Crt_double(String k, double v) {return Add_double(Bool_.Y, k, v);} - public Db_stmt Val_double(String k, double v) {return Add_double(Bool_.N, k, v);} - public Db_stmt Val_double(double v) {return Add_double(Bool_.N, Key_na, v);} - private Db_stmt Add_double(boolean where, String k, double v) { - if (k == Dbmeta_fld_itm.Key_null) return this; // key is explicitly null; ignore; allows version_2+ type definitions - try {stmt.setDouble(++val_idx, v);} catch (Exception e) {this.Rls(); throw Err_.new_exc(e, "db", "failed to add value", "type", "double", "val", v, "sql", sql);} - return this; - } - public Db_stmt Crt_decimal(String k, Decimal_adp v) {return Add_decimal(Bool_.Y, k, v);} - public Db_stmt Val_decimal(String k, Decimal_adp v) {return Add_decimal(Bool_.N, k, v);} - public Db_stmt Val_decimal(Decimal_adp v) {return Add_decimal(Bool_.N, Key_na, v);} - private Db_stmt Add_decimal(boolean where, String k, Decimal_adp v) { - if (k == Dbmeta_fld_itm.Key_null) return this; // key is explicitly null; ignore; allows version_2+ type definitions - try {stmt.setBigDecimal(++val_idx, v.Under_as_native());} catch (Exception e) {this.Rls(); throw Err_.new_exc(e, "db", "failed to add value", "type", "decimal", "val", v, "sql", sql);} - return this; - } - public Db_stmt Crt_bry(String k, byte[] v) {return Add_bry(Bool_.Y, k, v);} - public Db_stmt Val_bry(String k, byte[] v) {return Add_bry(Bool_.N, k, v);} - public Db_stmt Val_bry(byte[] v) {return Add_bry(Bool_.N, Key_na, v);} - private Db_stmt Add_bry(boolean where, String k, byte[] v) { - if (k == Dbmeta_fld_itm.Key_null) return this; // key is explicitly null; ignore; allows version_2+ type definitions - try {stmt.setBytes(++val_idx, v);} catch (Exception e) {this.Rls(); throw Err_.new_exc(e, "db", "failed to add value", "type", "byte[]", v.length, sql);} - return this; - } - public Db_stmt Crt_bry_as_str(String k, byte[] v) {return Add_bry_as_str(Bool_.Y, k, v);} - public Db_stmt Val_bry_as_str(String k, byte[] v) {return Add_bry_as_str(Bool_.N, k, v);} - public Db_stmt Val_bry_as_str(byte[] v) {return Add_bry_as_str(Bool_.N, Key_na, v);} - private Db_stmt Add_bry_as_str(boolean where, String k, byte[] v) {return Add_str(where, k, String_.new_u8(v));} - public Db_stmt Crt_str(String k, String v) {return Add_str(Bool_.Y, k, v);} - public Db_stmt Val_str(String k, String v) {return Add_str(Bool_.N, k, v);} - public Db_stmt Val_str(String v) {return Add_str(Bool_.N, Key_na, v);} - @gplx.Virtual protected Db_stmt Add_str(boolean where, String k, String v) { - if (k == Dbmeta_fld_itm.Key_null) return this; // key is explicitly null; ignore; allows version_2+ type definitions - try {stmt.setString(++val_idx, v);} catch (Exception e) {this.Rls(); throw Err_.new_exc(e, "db", "failed to add value", "type", "String", "val", v, "sql", sql);} - return this; - } - public Db_stmt Crt_date(String k, DateAdp v) {return Add_date(Bool_.Y, k, v);} - public Db_stmt Val_date(String k, DateAdp v) {return Add_date(Bool_.N, k, v);} - @gplx.Virtual protected Db_stmt Add_date(boolean where, String k, DateAdp v) { - if (k == Dbmeta_fld_itm.Key_null) return this; // key is explicitly null; ignore; allows version_2+ type definitions - try {stmt.setTimestamp(++val_idx, new java.sql.Timestamp(v.UnderDateTime().getTime().getTime()));} catch (Exception e) {this.Rls(); throw Err_.new_exc(e, "db", "failed to add value", "type", "date", "val", v, "sql", sql);} - return this; - } - public Db_stmt Crt_text(String k, String v) {return Add_text(Bool_.Y, k, v);} - public Db_stmt Val_text(String k, String v) {return Add_text(Bool_.N, k, v);} - private Db_stmt Add_text(boolean where, String k, String v) { - if (k == Dbmeta_fld_itm.Key_null) return this; // key is explicitly null; ignore; allows version_2+ type definitions - try {stmt.setString(++val_idx, v);} catch (Exception e) {this.Rls(); throw Err_.new_exc(e, "db", "failed to add value", "type", "text", "val", v, "sql", sql);} - return this; - } - public Db_stmt Val_rdr_(gplx.core.ios.streams.Io_stream_rdr v, long rdr_len) { - try {stmt.setBinaryStream(++val_idx, (java.io.InputStream)v.Under(), (int)rdr_len);} catch (Exception e) {throw Err_.new_exc(e, "db", "failed to add value", "type", "rdr", "val", v);} - return this; - } - public boolean Exec_insert() { - try {boolean rv = stmt.execute(); return rv;} - catch (Exception e) { - this.Rls(); - Reset_stmt(); - throw Err_.new_exc(e, "db_stmt", "insert failed", "url", engine.Conn_info().Db_api(), "sql", sql); - } - } - public int Exec_update() { - try {int rv = stmt.executeUpdate(); return rv;} - catch (Exception e) { - this.Rls(); - Reset_stmt(); - throw Err_.new_exc(e, "db_stmt", "update failed", "url", engine.Conn_info().Db_api(), "sql", sql); - } - } - public int Exec_delete() { - try {int rv = stmt.executeUpdate(); return rv;} - catch (Exception e) { - this.Rls(); - Reset_stmt(); - throw Err_.new_exc(e, "db_stmt", "delete failed", "url", engine.Conn_info().Db_api(), "sql", sql); - } - } - public DataRdr Exec_select() { - try {DataRdr rv = engine.New_rdr(stmt.executeQuery(), sql); return rv;} catch (Exception e) {throw Err_.new_exc(e, "db", "failed to exec prepared statement", "sql", sql);} - } - public Db_rdr Exec_select__rls_auto() { - try {return engine.Exec_as_rdr__rls_auto(this, stmt.executeQuery(), sql);} catch (Exception e) {throw Err_.new_exc(e, "db", "select failed", "sql", sql);} - } - public Db_rdr Exec_select__rls_manual() { - try {return engine.Exec_as_rdr__rls_manual(stmt.executeQuery(), sql);} catch (Exception e) {throw Err_.new_exc(e, "db", "select failed", "sql", sql);} - } - public Object Exec_select_val() { - try {Object rv = DataRdr_.Read_1st_row_and_1st_fld(engine.New_rdr(stmt.executeQuery(), sql)); return rv;} catch (Exception e) {throw Err_.new_exc(e, "db", "failed to exec prepared statement", "sql", sql);} - } - public Db_stmt Clear() { - val_idx = 0; - try {stmt.clearBatch();} - catch (Exception e) {throw Err_.new_exc(e, "db", "failed to clear parameters", "sql", sql);} - return this; - } - public void Rls() { - if (stmt == null) return; // Null instance - try { - if (stmt.getConnection().isClosed()) return; // do not close stmt if connection is already closed; throws null error; DATE:2015-02-11 - stmt.close(); - stmt = null; - } - catch (Exception e) {throw Err_.new_exc(e, "db", "failed to close command", "sql", sql);} - } - } +package gplx.dbs.qrys; + +import gplx.Bool_; +import gplx.DateAdp; +import gplx.Decimal_adp; +import gplx.Err_; +import gplx.String_; +import gplx.core.stores.DataRdr; +import gplx.core.stores.DataRdr_; +import gplx.dbs.Db_qry; +import gplx.dbs.Db_qry_; +import gplx.dbs.Db_rdr; +import gplx.dbs.Db_stmt; +import gplx.dbs.Dbmeta_fld_itm; +import gplx.dbs.engines.Db_engine; +import gplx.objects.lists.GfoListBase; + +import java.sql.PreparedStatement; + +public class Db_stmt_cmd implements Db_stmt { + private static final String Key_na = ""; // key is not_available; only called by procs with signature of Val( v); + private Db_engine engine; + private PreparedStatement stmt = null; + private String sql; + private int val_idx = 0; + private final GfoListBase paramList = new GfoListBase<>(); + public Db_stmt_cmd(Db_engine engine, Db_qry qry) {Ctor_stmt(engine, qry);} + public void Ctor_stmt(Db_engine engine, Db_qry qry) { + this.engine = engine; + sql = qry.Tid() == Db_qry_.Tid_select_in_tbl ? ((Db_qry__select_in_tbl)qry).To_sql__exec(engine.Sql_wtr()) : engine.Sql_wtr().To_sql_str(qry, true); + Reset_stmt(); + } + public Db_stmt Reset_stmt() { + stmt = (PreparedStatement)engine.Stmt_by_sql(sql); + return this; + } + public Db_stmt Crt_bool_as_byte(String k, boolean v) {return Add_byte_by_bool(Bool_.Y, k, v);} + public Db_stmt Val_bool_as_byte(String k, boolean v) {return Add_byte_by_bool(Bool_.N, k, v);} + public Db_stmt Val_bool_as_byte(boolean v) {return Add_byte_by_bool(Bool_.N, Key_na, v);} + private Db_stmt Add_byte_by_bool(boolean where, String k, boolean v) {return Add_byte(where, k, v ? Bool_.Y_byte : Bool_.N_byte);} + public Db_stmt Crt_byte(String k, byte v) {return Add_byte(Bool_.Y, k, v);} + public Db_stmt Val_byte(String k, byte v) {return Add_byte(Bool_.N, k, v);} + public Db_stmt Val_byte(byte v) {return Add_byte(Bool_.N, Key_na, v);} + private Db_stmt Add_byte(boolean where, String k, byte v) { + if (k == Dbmeta_fld_itm.Key_null) return this; // key is explicitly null; ignore; allows version_2+ type definitions + try { + stmt.setByte(++val_idx, v); + paramList.Add(v); + } catch (Exception e) { + this.Rls(); + throw Err_.new_exc(e, "db", "failed to add value", "type", "byte", "val", v, "sql", sql); + } + return this; + } + public Db_stmt Crt_int(String k, int v) {return Add_int(Bool_.Y, k, v);} + public Db_stmt Val_int_by_bool(String k, boolean v) {return Add_int(Bool_.N, k, v ? 1 : 0);} + public Db_stmt Val_int(String k, int v) {return Add_int(Bool_.N, k, v);} + public Db_stmt Val_int(int v) {return Add_int(Bool_.N, Key_na, v);} + private Db_stmt Add_int(boolean where, String k, int v) { + if (k == Dbmeta_fld_itm.Key_null) return this; // key is explicitly null; ignore; allows version_2+ type definitions + try { + stmt.setInt(++val_idx, v); + paramList.Add(v); + } catch (Exception e) { + this.Rls(); + throw Err_.new_exc(e, "db", "failed to add value", "type", "int", "val", v, "sql", sql); + } + return this; + } + public Db_stmt Crt_long(String k, long v) {return Add_long(Bool_.Y, k, v);} + public Db_stmt Val_long(String k, long v) {return Add_long(Bool_.N, k, v);} + public Db_stmt Val_long(long v) {return Add_long(Bool_.N, Key_na, v);} + private Db_stmt Add_long(boolean where, String k, long v) { + if (k == Dbmeta_fld_itm.Key_null) return this; // key is explicitly null; ignore; allows version_2+ type definitions + try { + stmt.setLong(++val_idx, v); + paramList.Add(v); + } catch (Exception e) { + this.Rls(); + throw Err_.new_exc(e, "db", "failed to add value", "type", "long", "val", v, "sql", sql); + } + return this; + } + public Db_stmt Crt_float(String k, float v) {return Add_float(Bool_.Y, k, v);} + public Db_stmt Val_float(String k, float v) {return Add_float(Bool_.N, k, v);} + public Db_stmt Val_float(float v) {return Add_float(Bool_.N, Key_na, v);} + private Db_stmt Add_float(boolean where, String k, float v) { + if (k == Dbmeta_fld_itm.Key_null) return this; // key is explicitly null; ignore; allows version_2+ type definitions + try { + stmt.setFloat(++val_idx, v); + paramList.Add(v); + } catch (Exception e) { + this.Rls(); + throw Err_.new_exc(e, "db", "failed to add value", "type", "float", "val", v, "sql", sql); + } + return this; + } + public Db_stmt Crt_double(String k, double v) {return Add_double(Bool_.Y, k, v);} + public Db_stmt Val_double(String k, double v) {return Add_double(Bool_.N, k, v);} + public Db_stmt Val_double(double v) {return Add_double(Bool_.N, Key_na, v);} + private Db_stmt Add_double(boolean where, String k, double v) { + if (k == Dbmeta_fld_itm.Key_null) return this; // key is explicitly null; ignore; allows version_2+ type definitions + try { + stmt.setDouble(++val_idx, v); + paramList.Add(v); + } catch (Exception e) { + this.Rls(); + throw Err_.new_exc(e, "db", "failed to add value", "type", "double", "val", v, "sql", sql); + } + return this; + } + public Db_stmt Crt_decimal(String k, Decimal_adp v) {return Add_decimal(Bool_.Y, k, v);} + public Db_stmt Val_decimal(String k, Decimal_adp v) {return Add_decimal(Bool_.N, k, v);} + public Db_stmt Val_decimal(Decimal_adp v) {return Add_decimal(Bool_.N, Key_na, v);} + private Db_stmt Add_decimal(boolean where, String k, Decimal_adp v) { + if (k == Dbmeta_fld_itm.Key_null) return this; // key is explicitly null; ignore; allows version_2+ type definitions + try { + stmt.setBigDecimal(++val_idx, v.Under_as_native()); + paramList.Add(v); + } catch (Exception e) { + this.Rls(); + throw Err_.new_exc(e, "db", "failed to add value", "type", "decimal", "val", v, "sql", sql); + } + return this; + } + public Db_stmt Crt_bry(String k, byte[] v) {return Add_bry(Bool_.Y, k, v);} + public Db_stmt Val_bry(String k, byte[] v) {return Add_bry(Bool_.N, k, v);} + public Db_stmt Val_bry(byte[] v) {return Add_bry(Bool_.N, Key_na, v);} + private Db_stmt Add_bry(boolean where, String k, byte[] v) { + if (k == Dbmeta_fld_itm.Key_null) return this; // key is explicitly null; ignore; allows version_2+ type definitions + try { + stmt.setBytes(++val_idx, v); + paramList.Add(v); + } catch (Exception e) { + this.Rls(); + throw Err_.new_exc(e, "db", "failed to add value", "type", "byte[]", v.length, sql); + } + return this; + } + public Db_stmt Crt_bry_as_str(String k, byte[] v) {return Add_bry_as_str(Bool_.Y, k, v);} + public Db_stmt Val_bry_as_str(String k, byte[] v) {return Add_bry_as_str(Bool_.N, k, v);} + public Db_stmt Val_bry_as_str(byte[] v) {return Add_bry_as_str(Bool_.N, Key_na, v);} + private Db_stmt Add_bry_as_str(boolean where, String k, byte[] v) {return Add_str(where, k, String_.new_u8(v));} + public Db_stmt Crt_str(String k, String v) {return Add_str(Bool_.Y, k, v);} + public Db_stmt Val_str(String k, String v) {return Add_str(Bool_.N, k, v);} + public Db_stmt Val_str(String v) {return Add_str(Bool_.N, Key_na, v);} + protected Db_stmt Add_str(boolean where, String k, String v) { + if (k == Dbmeta_fld_itm.Key_null) return this; // key is explicitly null; ignore; allows version_2+ type definitions + try { + stmt.setString(++val_idx, v); + paramList.Add(v); + } catch (Exception e) { + this.Rls(); + throw Err_.new_exc(e, "db", "failed to add value", "type", "String", "val", v, "sql", sql); + } + return this; + } + public Db_stmt Crt_date(String k, DateAdp v) {return Add_date(Bool_.Y, k, v);} + public Db_stmt Val_date(String k, DateAdp v) {return Add_date(Bool_.N, k, v);} + protected Db_stmt Add_date(boolean where, String k, DateAdp v) { + if (k == Dbmeta_fld_itm.Key_null) return this; // key is explicitly null; ignore; allows version_2+ type definitions + try { + stmt.setTimestamp(++val_idx, new java.sql.Timestamp(v.UnderDateTime().getTime().getTime())); + paramList.Add(v); + } catch (Exception e) { + this.Rls(); + throw Err_.new_exc(e, "db", "failed to add value", "type", "date", "val", v, "sql", sql); + } + return this; + } + public Db_stmt Crt_text(String k, String v) {return Add_text(Bool_.Y, k, v);} + public Db_stmt Val_text(String k, String v) {return Add_text(Bool_.N, k, v);} + private Db_stmt Add_text(boolean where, String k, String v) { + if (k == Dbmeta_fld_itm.Key_null) return this; // key is explicitly null; ignore; allows version_2+ type definitions + try { + stmt.setString(++val_idx, v); + paramList.Add(v); + } catch (Exception e) { + this.Rls(); + throw Err_.new_exc(e, "db", "failed to add value", "type", "text", "val", v, "sql", sql); + } + return this; + } + public Db_stmt Val_rdr_(gplx.core.ios.streams.Io_stream_rdr v, long rdr_len) { + try { + stmt.setBinaryStream(++val_idx, (java.io.InputStream)v.Under(), (int)rdr_len); + } catch (Exception e) { + // DATE:2021-07-16: shouldn't there be a this.Rls()? + throw Err_.new_exc(e, "db", "failed to add value", "type", "rdr", "val", v); + } + return this; + } + public boolean Exec_insert() { + try {boolean rv = stmt.execute(); return rv;} + catch (Exception e) { + String sqlStr = ToSqlStr(); + this.Rls(); + Reset_stmt(); + throw Err_.new_exc(e, "db_stmt", "insert failed", "url", engine.Conn_info().Db_api(), "sql", sqlStr); + } + } + public int Exec_update() { + try {int rv = stmt.executeUpdate(); return rv;} + catch (Exception e) { + String sqlStr = ToSqlStr(); + this.Rls(); + Reset_stmt(); + throw Err_.new_exc(e, "db_stmt", "update failed", "url", engine.Conn_info().Db_api(), "sql", sqlStr); + } + } + public int Exec_delete() { + try {int rv = stmt.executeUpdate(); return rv;} + catch (Exception e) { + String sqlStr = ToSqlStr(); + this.Rls(); + Reset_stmt(); + throw Err_.new_exc(e, "db_stmt", "delete failed", "url", engine.Conn_info().Db_api(), "sql", sqlStr); + } + } + public DataRdr Exec_select() { + try { + DataRdr rv = engine.New_rdr(stmt.executeQuery(), sql); return rv; + } catch (Exception e) { + String sqlStr = ToSqlStr(); + // DATE:2021-07-16: this needs a this.Rls() / Reset_stmt + throw Err_.new_exc(e, "db", "failed to exec prepared statement", "sql", sqlStr); + } + } + public Db_rdr Exec_select__rls_auto() { + try { + return engine.Exec_as_rdr__rls_auto(this, stmt.executeQuery(), sql); + } catch (Exception e) { + String sqlStr = ToSqlStr(); + // DATE:2021-07-16: this needs a this.Rls() / Reset_stmt + throw Err_.new_exc(e, "db", "select failed", "sql", sqlStr); + } + } + public Db_rdr Exec_select__rls_manual() { + try { + return engine.Exec_as_rdr__rls_manual(stmt.executeQuery(), sql); + } catch (Exception e) { + String sqlStr = ToSqlStr(); + // DATE:2021-07-16: this needs a this.Rls() / Reset_stmt + throw Err_.new_exc(e, "db", "select failed", "sql", sqlStr); + } + } + public Object Exec_select_val() { + try { + Object rv = DataRdr_.Read_1st_row_and_1st_fld(engine.New_rdr(stmt.executeQuery(), sql)); return rv; + } catch (Exception e) { + String sqlStr = ToSqlStr(); + // DATE:2021-07-16: this needs a this.Rls() / Reset_stmt + throw Err_.new_exc(e, "db", "failed to exec prepared statement", "sql", sqlStr); + } + } + public Db_stmt Clear() { + val_idx = 0; + paramList.Clear(); + try {stmt.clearBatch();} + catch (Exception e) {throw Err_.new_exc(e, "db", "failed to clear parameters", "sql", sql);} + return this; + } + public void Rls() { + this.Clear(); // DATE:2021-07-16: added this.Clear(); + if (stmt == null) return; // Null instance + try { + if (stmt.getConnection().isClosed()) return; // do not close stmt if connection is already closed; throws null error; DATE:2015-02-11 + stmt.close(); + stmt = null; + } + catch (Exception e) {throw Err_.new_exc(e, "db", "failed to close command", "sql", sql);} + } + public String ToSqlStr() { + return Db_val_type.ToSqlStr(sql, paramList); + } +} diff --git a/140_dbs/src/gplx/dbs/qrys/Db_stmt_sql_tst.java b/140_dbs/src/gplx/dbs/qrys/Db_stmt_sql_tst.java index 3eba54705..bdecd9ec8 100644 --- a/140_dbs/src/gplx/dbs/qrys/Db_stmt_sql_tst.java +++ b/140_dbs/src/gplx/dbs/qrys/Db_stmt_sql_tst.java @@ -13,15 +13,15 @@ The terms of each license can be found in the source code repository: GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt */ -package gplx.dbs.qrys; import gplx.*; import gplx.dbs.*; -import org.junit.*; -public class Db_stmt_sql_tst { - @Before public void init() {} - @Test public void Basic() { - Db_stmt_sql stmt = new Db_stmt_sql(); - stmt.Parse(null, "UPDATE tbl_0 SET col_0 = ? WHERE col_1 = ?"); - stmt.Add("col_0", "1"); - stmt.Add("col_1", "2"); - Tfds.Eq("UPDATE tbl_0 SET col_0 = 1 WHERE col_1 = 2", stmt.Xto_sql()); - } -} +package gplx.dbs.qrys; import gplx.*; import gplx.dbs.*; +import org.junit.*; +public class Db_stmt_sql_tst { + @Before public void init() {} + @Test public void Basic() { + Db_stmt_sql stmt = new Db_stmt_sql(); + stmt.Parse(null, "UPDATE tbl_0 SET col_0 = ? WHERE col_1 = ?"); + stmt.Add("col_0", "1"); + stmt.Add("col_1", "2"); + Tfds.Eq("UPDATE tbl_0 SET col_0 = 1 WHERE col_1 = 2", stmt.Xto_sql()); + } +} diff --git a/140_dbs/src/gplx/dbs/qrys/Db_val_type.java b/140_dbs/src/gplx/dbs/qrys/Db_val_type.java index 00f0af0b3..da03d06bd 100644 --- a/140_dbs/src/gplx/dbs/qrys/Db_val_type.java +++ b/140_dbs/src/gplx/dbs/qrys/Db_val_type.java @@ -1,6 +1,6 @@ /* XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com +Copyright (C) 2012-2021 gnosygnu@gmail.com XOWA is licensed under the terms of the General Public License (GPL) Version 3, or alternatively under the terms of the Apache License Version 2.0. @@ -13,22 +13,96 @@ The terms of each license can be found in the source code repository: GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt */ -package gplx.dbs.qrys; import gplx.*; import gplx.dbs.*; +package gplx.dbs.qrys; + +import gplx.Bry_find_; +import gplx.DateAdp_; +import gplx.Decimal_adp_; +import gplx.Object_; +import gplx.String_; +import gplx.objects.lists.GfoListBase; +import gplx.objects.primitives.Bool_; +import gplx.objects.primitives.Byte_; +import gplx.objects.primitives.Char_; +import gplx.objects.primitives.Double_; +import gplx.objects.primitives.Float_; +import gplx.objects.primitives.Int_; +import gplx.objects.primitives.Long_; +import gplx.objects.primitives.Short_; +import gplx.objects.strings.bfrs.GfoStringBuilder; +import gplx.objects.types.Type_; + public class Db_val_type { - public static final byte // not serialized - Tid_null = 0 - , Tid_bool = 1 - , Tid_byte = 2 - , Tid_int32 = 3 - , Tid_int64 = 4 - , Tid_date = 5 - , Tid_decimal = 6 - , Tid_float = 7 - , Tid_double = 8 - , Tid_bry = 9 - , Tid_varchar = 10 - , Tid_nvarchar = 11 - , Tid_rdr = 12 - , Tid_text = 13 - ; -} + public static final byte // not serialized + Tid_null = 0 + , Tid_bool = 1 + , Tid_byte = 2 + , Tid_int32 = 3 + , Tid_int64 = 4 + , Tid_date = 5 + , Tid_decimal = 6 + , Tid_float = 7 + , Tid_double = 8 + , Tid_bry = 9 + , Tid_varchar = 10 + , Tid_nvarchar = 11 + , Tid_rdr = 12 + , Tid_text = 13 + , Tid_int16 = 14 + , Tid_char = 15 + , Tid_unknown = 16 + ; + public static int ToTypeId(Object o) { + Class type = o.getClass(); + if (Type_.Eq(type, Int_.Cls_ref_type)) return Tid_int32; + else if (Type_.Eq(type, String_.Cls_ref_type)) return Tid_nvarchar; + else if (Type_.Eq(type, byte[].class)) return Tid_nvarchar; + else if (Type_.Eq(type, Bool_.Cls_ref_type)) return Tid_bool; + else if (Type_.Eq(type, Byte_.Cls_ref_type)) return Tid_byte; + else if (Type_.Eq(type, Long_.Cls_ref_type)) return Tid_int64; + else if (Type_.Eq(type, Double_.Cls_ref_type)) return Tid_double; + else if (Type_.Eq(type, Decimal_adp_.Cls_ref_type)) return Tid_decimal; + else if (Type_.Eq(type, DateAdp_.Cls_ref_type)) return Tid_date; + else if (Type_.Eq(type, Float_.Cls_ref_type)) return Tid_float; + else if (Type_.Eq(type, Short_.Cls_ref_type)) return Tid_int16; + else if (Type_.Eq(type, Char_.Cls_ref_type)) return Tid_char; + else return Tid_unknown; + } + public static String ToSqlStr(String sql, GfoListBase paramList) { + try { + GfoStringBuilder sb = new GfoStringBuilder(); + int oldPos = 0; + int paramIdx = 0; + while (true) { + int newPos = String_.FindFwd(sql, "?", oldPos); + if (newPos == Bry_find_.Not_found) break; + if (paramIdx == paramList.Len()) break; + sb.AddMid(sql, oldPos, newPos); + Object paramObj = paramList.GetAt(paramIdx++); + String paramStr = Object_.Xto_str_loose_or(paramObj, ""); + boolean quote = false; + switch (ToTypeId(paramObj)) { + case Tid_char: + case Tid_bry: + case Tid_varchar: + case Tid_nvarchar: + case Tid_date: + quote = true; + break; + } + if (quote) { + sb.Add('\''); + sb.Add(String_.Replace(paramStr, "'", "\\'")); + sb.Add('\''); + } else { + sb.Add(paramStr); + } + oldPos = newPos + 1; + } + sb.AddMid(sql, oldPos); + return sb.ToStr(); + } catch (Exception exc) { + return "FAILED TO INTERPOLATE:" + sql; + } + } +} diff --git a/140_dbs/src/gplx/dbs/sqls/itms/Db_obj_ary_tst.java b/140_dbs/src/gplx/dbs/sqls/itms/Db_obj_ary_tst.java index 4ea30b47b..16f69a66c 100644 --- a/140_dbs/src/gplx/dbs/sqls/itms/Db_obj_ary_tst.java +++ b/140_dbs/src/gplx/dbs/sqls/itms/Db_obj_ary_tst.java @@ -1,27 +1,27 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.dbs.sqls.itms; import gplx.*; import gplx.dbs.*; import gplx.dbs.sqls.*; import org.junit.*; import gplx.core.strings.*; import gplx.dbs.sqls.*; import gplx.dbs.sqls.wtrs.*; public class Db_obj_ary_tst { @Before public void init() {} private Db_obj_ary_fxt fxt = new Db_obj_ary_fxt(); - @Test public void Int() { + @Test public void Int() { fxt.Init_fld("fld_0", Type_ids_.Id__int).Init_fld("fld_1", Type_ids_.Id__int).Init_vals(1, 10).Init_vals(2, 20).Test_sql("(fld_0=1 AND fld_1=10) OR (fld_0=2 AND fld_1=20)"); } - @Test public void Str() { + @Test public void Str() { fxt.Init_fld("fld_0", Type_ids_.Id__int).Init_fld("fld_1", Type_ids_.Id__str).Init_vals(1, "a").Init_vals(2, "b").Test_sql("(fld_0=1 AND fld_1='a') OR (fld_0=2 AND fld_1='b')"); } } diff --git a/140_dbs/src/gplx/dbs/sqls/wtrs/Sql_from_wtr_tst.java b/140_dbs/src/gplx/dbs/sqls/wtrs/Sql_from_wtr_tst.java index ac637ff40..651c18430 100644 --- a/140_dbs/src/gplx/dbs/sqls/wtrs/Sql_from_wtr_tst.java +++ b/140_dbs/src/gplx/dbs/sqls/wtrs/Sql_from_wtr_tst.java @@ -1,29 +1,29 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.dbs.sqls.wtrs; import gplx.*; import gplx.dbs.*; import gplx.dbs.sqls.*; import org.junit.*; public class Sql_from_wtr_tst { private final Sql_core_wtr_fxt fxt = new Sql_core_wtr_fxt(); - @Test public void Abrv() { + @Test public void Abrv() { fxt.Test__qry(Db_qry_.select_().Cols_all_().From_("tbl", "t"), "SELECT * FROM tbl t"); } - @Test public void Db() { + @Test public void Db() { fxt.Test__qry(Db_qry_.select_().Cols_all_().From_("db", "tbl", "t"), "SELECT * FROM db.tbl t"); } - @Test public void Join() { + @Test public void Join() { fxt.Test__qry ( Db_qry_.select_().Cols_all_().From_("src", "s").Join_("trg", "t", Db_qry_.New_join__join("trg_id", "s", "src_id")) , "SELECT * FROM src s INNER JOIN trg t ON s.src_id = t.trg_id"); diff --git a/140_dbs/src/gplx/dbs/sqls/wtrs/Sql_qry_wtr__ansi__tst.java b/140_dbs/src/gplx/dbs/sqls/wtrs/Sql_qry_wtr__ansi__tst.java index f560f3231..9330c86d8 100644 --- a/140_dbs/src/gplx/dbs/sqls/wtrs/Sql_qry_wtr__ansi__tst.java +++ b/140_dbs/src/gplx/dbs/sqls/wtrs/Sql_qry_wtr__ansi__tst.java @@ -1,79 +1,79 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.dbs.sqls.wtrs; import gplx.*; import gplx.dbs.*; import gplx.dbs.sqls.*; import org.junit.*; import gplx.core.criterias.*; import gplx.dbs.sqls.*; public class Sql_qry_wtr__ansi__tst { Sql_qry_wtr sqlWtr = Sql_qry_wtr_.New__basic(); - @Test public void Insert() { + @Test public void Insert() { tst_XtoSql ( Db_qry_.insert_("people").Val_int("id", 1).Val_str("name", "me") , "INSERT INTO people (id, name) VALUES (1, 'me')" ); } - @Test public void Delete() { + @Test public void Delete() { Criteria crt = Db_crt_.New_eq("id", 1); tst_XtoSql ( Db_qry_.delete_("people", crt) , "DELETE FROM people WHERE id = 1" ); } - @Test public void Update() { + @Test public void Update() { tst_XtoSql ( Db_qry_.update_("people", Db_crt_.New_eq("id", 1)).Val_str("name", "me") , "UPDATE people SET name='me' WHERE id = 1" ); } - @Test public void SelectAll() { + @Test public void SelectAll() { tst_XtoSql ( Db_qry_.select_().From_("people") , "SELECT * FROM people" ); } - @Test public void SelectFlds() { + @Test public void SelectFlds() { tst_XtoSql ( Db_qry_.select_().Cols_("id", "name").From_("people") , "SELECT id, name FROM people" ); } - @Test public void SelectOrderBy() { + @Test public void SelectOrderBy() { tst_XtoSql ( Db_qry_.select_().From_("people").Order_("name", false) , "SELECT * FROM people ORDER BY name DESC" ); } - @Test public void SelectWhere() { + @Test public void SelectWhere() { tst_XtoSql ( Db_qry_.select_().From_("people").Where_(Db_crt_.New_eq("id", 1)) , "SELECT * FROM people WHERE id = 1" ); } - @Test public void Select_From_Alias() { + @Test public void Select_From_Alias() { tst_XtoSql ( Db_qry_.select_().From_("people", "p") , "SELECT * FROM people p" ); } - @Test public void Select_Join_Alias() { + @Test public void Select_Join_Alias() { tst_XtoSql ( Db_qry_.select_().From_("people", "p").Join_("roles", "r", Db_qry_.New_join__same("p", "id")) , "SELECT * FROM people p INNER JOIN roles r ON p.id = r.id" ); } - @Test public void Prepare() { + @Test public void Prepare() { tst_XtoSql ( Db_qry_.insert_("people").Val_int("id", 1).Val_str("name", "me") , "INSERT INTO people (id, name) VALUES (?, ?)" diff --git a/140_dbs/src/gplx/dbs/sqls/wtrs/Sql_qry_wtr__iosql__tst.java b/140_dbs/src/gplx/dbs/sqls/wtrs/Sql_qry_wtr__iosql__tst.java index 67b6bce2c..1a3f9f228 100644 --- a/140_dbs/src/gplx/dbs/sqls/wtrs/Sql_qry_wtr__iosql__tst.java +++ b/140_dbs/src/gplx/dbs/sqls/wtrs/Sql_qry_wtr__iosql__tst.java @@ -1,45 +1,45 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.dbs.sqls.wtrs; import gplx.*; import gplx.dbs.*; import gplx.dbs.sqls.*; import org.junit.*; import gplx.core.strings.*; import gplx.core.criterias.*; /*Criteria_base*/ import gplx.core.ios.*; import gplx.dbs.sqls.*; import gplx.dbs.sqls.wtrs.*; public class Sql_qry_wtr__iosql__tst { - @Test public void Type() { + @Test public void Type() { fld = IoItm_base_.Prop_Type; tst_Write("type = 1", ioCrt_(fld, Criteria_.eq_(IoItmDir.Type_Dir))); tst_Write("type = 2", ioCrt_(fld, Criteria_.eq_(IoItmFil.Type_Fil))); } - @Test public void Ext() { + @Test public void Ext() { fld = IoItm_base_.Prop_Ext; tst_Write("ext = '.txt'", ioCrt_(fld, Criteria_.eq_(".txt"))); tst_Write("ext IN ('.txt', '.xml', '.html')", ioCrt_(fld, Criteria_.in_(".txt", ".xml", ".html"))); tst_Write("ext NOT IN ('.dll', '.exe')", ioCrt_(fld, Criteria_.inn_(".dll", ".exe"))); } - @Test public void Title() { + @Test public void Title() { fld = IoItm_base_.Prop_Title; tst_Write("title = 'bin'", ioCrt_(fld, Criteria_.eq_("bin"))); tst_Write("title NOT IN ('bin', 'obj')", ioCrt_(fld, Criteria_.inn_("bin", "obj"))); } - @Test public void Url() { + @Test public void Url() { fld = IoItm_base_.Prop_Path; tst_Write("url = 'C:\\fil.txt'", ioCrt_(fld, Criteria_.eq_("C:\\fil.txt"))); tst_Write("url IOMATCH '*.txt'", ioCrt_(fld, Criteria_ioMatch.parse(true, "*.txt", false))); } - @Test public void Binary() { + @Test public void Binary() { // parentheses around lhs and rhs tst_Write( "(type = 1 OR type = 2)" diff --git a/140_dbs/src/gplx/dbs/sqls/wtrs/Sql_schema_wtr_tst.java b/140_dbs/src/gplx/dbs/sqls/wtrs/Sql_schema_wtr_tst.java index 42b19e4c8..a49041f2a 100644 --- a/140_dbs/src/gplx/dbs/sqls/wtrs/Sql_schema_wtr_tst.java +++ b/140_dbs/src/gplx/dbs/sqls/wtrs/Sql_schema_wtr_tst.java @@ -1,28 +1,28 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.dbs.sqls.wtrs; import gplx.*; import gplx.dbs.*; import gplx.dbs.sqls.*; import org.junit.*; public class Sql_schema_wtr_tst { @Before public void setup() {} private final Sql_schema_wtr_fxt fxt = new Sql_schema_wtr_fxt(); - @Test public void Idx_unique() { + @Test public void Idx_unique() { fxt.Test_create_idx(Dbmeta_idx_itm.new_unique_by_tbl("tbl_name", "idx_name", "fld_1", "fld_2") , "CREATE UNIQUE INDEX IF NOT EXISTS tbl_name__idx_name ON tbl_name (fld_1, fld_2);" ); } - @Test public void Tbl_basic() { + @Test public void Tbl_basic() { Dbmeta_fld_list flds = new Dbmeta_fld_list(); flds.Add_int_pkey("fld_int_pkey"); flds.Add_bool("fld_bool"); @@ -50,7 +50,7 @@ public class Sql_schema_wtr_tst { , ");" )); } - @Test public void Tbl_alter_tbl_add() { + @Test public void Tbl_alter_tbl_add() { Dbmeta_fld_list flds = new Dbmeta_fld_list(); flds.Add_int_dflt("fld_int", -1); flds.Add_str_dflt("fld_str", 255, "a"); diff --git a/140_dbs/src/gplx/dbs/sqls/wtrs/Sql_select_wtr_tst.java b/140_dbs/src/gplx/dbs/sqls/wtrs/Sql_select_wtr_tst.java index 3d34f71a0..260167337 100644 --- a/140_dbs/src/gplx/dbs/sqls/wtrs/Sql_select_wtr_tst.java +++ b/140_dbs/src/gplx/dbs/sqls/wtrs/Sql_select_wtr_tst.java @@ -13,14 +13,14 @@ The terms of each license can be found in the source code repository: GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt */ -package gplx.dbs.sqls.wtrs; import gplx.*; import gplx.dbs.*; import gplx.dbs.sqls.*; -import org.junit.*; -public class Sql_select_wtr_tst { - private final Sql_core_wtr_fxt fxt = new Sql_core_wtr_fxt(); - @Test public void Offset__automatically_add_limit() { - fxt.Test__qry(Db_qry_.select_tbl_("tbl").Offset_(1), "SELECT * FROM tbl LIMIT -1 OFFSET 1"); - } - @Test public void Offset__do_not_overwrite_limit() { - fxt.Test__qry(Db_qry_.select_tbl_("tbl").Limit_(20).Offset_(1), "SELECT * FROM tbl LIMIT 20 OFFSET 1"); - } -} +package gplx.dbs.sqls.wtrs; import gplx.*; import gplx.dbs.*; import gplx.dbs.sqls.*; +import org.junit.*; +public class Sql_select_wtr_tst { + private final Sql_core_wtr_fxt fxt = new Sql_core_wtr_fxt(); + @Test public void Offset__automatically_add_limit() { + fxt.Test__qry(Db_qry_.select_tbl_("tbl").Offset_(1), "SELECT * FROM tbl LIMIT -1 OFFSET 1"); + } + @Test public void Offset__do_not_overwrite_limit() { + fxt.Test__qry(Db_qry_.select_tbl_("tbl").Limit_(20).Offset_(1), "SELECT * FROM tbl LIMIT 20 OFFSET 1"); + } +} diff --git a/140_dbs/src/gplx/dbs/sqls/wtrs/Sql_val_wtr_tst.java b/140_dbs/src/gplx/dbs/sqls/wtrs/Sql_val_wtr_tst.java index b8e3e057f..823d177fb 100644 --- a/140_dbs/src/gplx/dbs/sqls/wtrs/Sql_val_wtr_tst.java +++ b/140_dbs/src/gplx/dbs/sqls/wtrs/Sql_val_wtr_tst.java @@ -1,37 +1,37 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.dbs.sqls.wtrs; import gplx.*; import gplx.dbs.*; import gplx.dbs.sqls.*; import org.junit.*; public class Sql_val_wtr_tst { private final Sql_core_wtr_fxt fxt = new Sql_core_wtr_fxt(); - @Test public void Null() {fxt.Test__val(null , "NULL");} - @Test public void Bool__n() {fxt.Test__val(Bool_.N , "0");} - @Test public void Bool__y() {fxt.Test__val(Bool_.Y , "1");} - @Test public void Byte() {fxt.Test__val(Byte_.By_int(2) , "2");} - @Test public void Short() {fxt.Test__val(Short_.By_int(3) , "3");} - @Test public void Int() {fxt.Test__val(4 , "4");} - @Test public void Long() {fxt.Test__val(5 , "5");} - @Test public void Float() {fxt.Test__val(6.1f , "6.1");} - @Test public void Double() {fxt.Test__val(7.1d , "7.1");} - @Test public void Decimal() {fxt.Test__val(Decimal_adp_.float_(8) , "'8'");} - @Test public void Str() {fxt.Test__val("abc" , "'abc'");} - @Test public void Str__apos_mid() {fxt.Test__val("a'b" , "'a''b'");} - @Test public void Str__apos_bgn() {fxt.Test__val("'ab" , "'''ab'");} - @Test public void Str__apos_end() {fxt.Test__val("ab'" , "'ab'''");} - @Test public void Str__apos_many() {fxt.Test__val("a'b'c" , "'a''b''c'");} - @Test public void Str__back() {fxt.Test__val("a\\b" , "'a\\b'");} - @Test public void Date() {fxt.Test__val(DateAdp_.parse_gplx("2016-02-03") , "'2016-02-03 00:00:00.000'");} + @Test public void Null() {fxt.Test__val(null , "NULL");} + @Test public void Bool__n() {fxt.Test__val(Bool_.N , "0");} + @Test public void Bool__y() {fxt.Test__val(Bool_.Y , "1");} + @Test public void Byte() {fxt.Test__val(Byte_.By_int(2) , "2");} + @Test public void Short() {fxt.Test__val(Short_.By_int(3) , "3");} + @Test public void Int() {fxt.Test__val(4 , "4");} + @Test public void Long() {fxt.Test__val(5 , "5");} + @Test public void Float() {fxt.Test__val(6.1f , "6.1");} + @Test public void Double() {fxt.Test__val(7.1d , "7.1");} + @Test public void Decimal() {fxt.Test__val(Decimal_adp_.float_(8) , "'8'");} + @Test public void Str() {fxt.Test__val("abc" , "'abc'");} + @Test public void Str__apos_mid() {fxt.Test__val("a'b" , "'a''b'");} + @Test public void Str__apos_bgn() {fxt.Test__val("'ab" , "'''ab'");} + @Test public void Str__apos_end() {fxt.Test__val("ab'" , "'ab'''");} + @Test public void Str__apos_many() {fxt.Test__val("a'b'c" , "'a''b''c'");} + @Test public void Str__back() {fxt.Test__val("a\\b" , "'a\\b'");} + @Test public void Date() {fxt.Test__val(DateAdp_.parse_gplx("2016-02-03") , "'2016-02-03 00:00:00.000'");} } diff --git a/140_dbs/src/gplx/dbs/sqls/wtrs/Sql_where_wtr_tst.java b/140_dbs/src/gplx/dbs/sqls/wtrs/Sql_where_wtr_tst.java index 02a21845d..520b889c9 100644 --- a/140_dbs/src/gplx/dbs/sqls/wtrs/Sql_where_wtr_tst.java +++ b/140_dbs/src/gplx/dbs/sqls/wtrs/Sql_where_wtr_tst.java @@ -1,47 +1,47 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.dbs.sqls.wtrs; import gplx.*; import gplx.dbs.*; import gplx.dbs.sqls.*; import org.junit.*; import gplx.core.criterias.*; public class Sql_where_wtr_tst { private final Sql_core_wtr_fxt fxt = new Sql_core_wtr_fxt(); - @Test public void Eq() {fxt.Test__where(Db_crt_.New_eq ("fld", 1) , "fld = 1");} - @Test public void Eq_not() {fxt.Test__where(Db_crt_.New_eq_not ("fld", 1) , "fld != 1");} - @Test public void Eq_pre() {fxt.Test__where(Db_crt_.New_eq ("a", "fld", 1) , "a.fld = 1");} - @Test public void Lt() {fxt.Test__where(Db_crt_.New_lt ("fld", 1) , "fld < 1");} - @Test public void Lte() {fxt.Test__where(Db_crt_.New_lte ("fld", 1) , "fld <= 1");} - @Test public void Mt() {fxt.Test__where(Db_crt_.New_mt ("fld", 1) , "fld > 1");} - @Test public void Mte() {fxt.Test__where(Db_crt_.New_mte ("fld", 1) , "fld >= 1");} - @Test public void Between() {fxt.Test__where(Db_crt_.New_between ("fld", 1, 3) , "fld BETWEEN 1 AND 3");} - @Test public void In() {fxt.Test__where(Db_crt_.New_in ("fld", 1, 2, 3) , "fld IN (1, 2, 3)");} - @Test public void Like() {fxt.Test__where(Db_crt_.New_like ("fld", "A%") , "fld LIKE 'A%' ESCAPE '|'");} - @Test public void And__subs__2() { + @Test public void Eq() {fxt.Test__where(Db_crt_.New_eq ("fld", 1) , "fld = 1");} + @Test public void Eq_not() {fxt.Test__where(Db_crt_.New_eq_not ("fld", 1) , "fld != 1");} + @Test public void Eq_pre() {fxt.Test__where(Db_crt_.New_eq ("a", "fld", 1) , "a.fld = 1");} + @Test public void Lt() {fxt.Test__where(Db_crt_.New_lt ("fld", 1) , "fld < 1");} + @Test public void Lte() {fxt.Test__where(Db_crt_.New_lte ("fld", 1) , "fld <= 1");} + @Test public void Mt() {fxt.Test__where(Db_crt_.New_mt ("fld", 1) , "fld > 1");} + @Test public void Mte() {fxt.Test__where(Db_crt_.New_mte ("fld", 1) , "fld >= 1");} + @Test public void Between() {fxt.Test__where(Db_crt_.New_between ("fld", 1, 3) , "fld BETWEEN 1 AND 3");} + @Test public void In() {fxt.Test__where(Db_crt_.New_in ("fld", 1, 2, 3) , "fld IN (1, 2, 3)");} + @Test public void Like() {fxt.Test__where(Db_crt_.New_like ("fld", "A%") , "fld LIKE 'A%' ESCAPE '|'");} + @Test public void And__subs__2() { fxt.Test__where ( Criteria_.And ( Db_crt_.New_eq("id", 1) , Db_crt_.New_eq("name", "me") ), "(id = 1 AND name = 'me')"); } - @Test public void Or__subs__2() { + @Test public void Or__subs__2() { fxt.Test__where ( Criteria_.Or ( Db_crt_.New_eq("id", 1) , Db_crt_.New_eq("name", "me") ), "(id = 1 OR name = 'me')"); } - @Test public void Nested() { + @Test public void Nested() { fxt.Test__where ( Criteria_.Or ( Db_crt_.New_eq("id", 1) diff --git a/140_dbs/src/gplx/dbs/sys/Db_sys_mgr_tst.java b/140_dbs/src/gplx/dbs/sys/Db_sys_mgr_tst.java index 7ecb57640..e6b7c2f03 100644 --- a/140_dbs/src/gplx/dbs/sys/Db_sys_mgr_tst.java +++ b/140_dbs/src/gplx/dbs/sys/Db_sys_mgr_tst.java @@ -1,23 +1,23 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.dbs.sys; import gplx.*; import gplx.dbs.*; import org.junit.*; public class Db_sys_mgr_tst { private final Db_sys_mgr_fxt fxt = new Db_sys_mgr_fxt(); - @Test public void FetchNextId() { + @Test public void FetchNextId() { fxt.Test__autonum_next("tbl_1.fld", 1); // default to "1" on first creation fxt.Test__autonum_next("tbl_1.fld", 2); // read "2" from db } diff --git a/140_dbs/src/gplx/dbs/utls/Db_cmd_backup_tst.java b/140_dbs/src/gplx/dbs/utls/Db_cmd_backup_tst.java index fff1f6d4b..f344ba7fe 100644 --- a/140_dbs/src/gplx/dbs/utls/Db_cmd_backup_tst.java +++ b/140_dbs/src/gplx/dbs/utls/Db_cmd_backup_tst.java @@ -13,17 +13,17 @@ The terms of each license can be found in the source code repository: GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt */ -package gplx.dbs.utls; import gplx.*; import gplx.dbs.*; -import org.junit.*; -public class Db_cmd_backup_tst { - @Test public void Basic() { - Datetime_now.Manual_y_(); - Db_cmd_backup bkpWkr = Db_cmd_backup.new_() - .ExeUrl_(Io_url_.new_any_("C:\\mysql\\mysqldump.exe")) - .BkpDir_(Io_url_.new_any_("C:\\bkp\\")) - .Usr_("username") - .Pwd_("password") - .DbName_("dbname").InitVars(); - Tfds.Eq("\"C:\\mysql\\mysqldump.exe\" -u username -ppassword dbname > C:\\bkp\\dbname_20010101_0000.sql", bkpWkr.CmdText()); - } -} +package gplx.dbs.utls; import gplx.*; import gplx.dbs.*; +import org.junit.*; +public class Db_cmd_backup_tst { + @Test public void Basic() { + Datetime_now.Manual_y_(); + Db_cmd_backup bkpWkr = Db_cmd_backup.new_() + .ExeUrl_(Io_url_.new_any_("C:\\mysql\\mysqldump.exe")) + .BkpDir_(Io_url_.new_any_("C:\\bkp\\")) + .Usr_("username") + .Pwd_("password") + .DbName_("dbname").InitVars(); + Tfds.Eq("\"C:\\mysql\\mysqldump.exe\" -u username -ppassword dbname > C:\\bkp\\dbname_20010101_0000.sql", bkpWkr.CmdText()); + } +} diff --git a/140_dbs/src/gplx/gfdbs/cores/GfdbCloseAble.java b/140_dbs/src/gplx/gfdbs/cores/GfdbCloseAble.java new file mode 100644 index 000000000..db4dfaca6 --- /dev/null +++ b/140_dbs/src/gplx/gfdbs/cores/GfdbCloseAble.java @@ -0,0 +1,5 @@ +package gplx.gfdbs.cores; + +public interface GfdbCloseAble { + void Close(); +} diff --git a/140_dbs/src/gplx/gfdbs/cores/GfdbConnInfo.java b/140_dbs/src/gplx/gfdbs/cores/GfdbConnInfo.java new file mode 100644 index 000000000..179bef3c3 --- /dev/null +++ b/140_dbs/src/gplx/gfdbs/cores/GfdbConnInfo.java @@ -0,0 +1,5 @@ +package gplx.gfdbs.cores; + +public interface GfdbConnInfo { + String ConnStr(); +} diff --git a/140_dbs/src/gplx/gfdbs/cores/GfdbConnInfoSqlite.java b/140_dbs/src/gplx/gfdbs/cores/GfdbConnInfoSqlite.java new file mode 100644 index 000000000..905544822 --- /dev/null +++ b/140_dbs/src/gplx/gfdbs/cores/GfdbConnInfoSqlite.java @@ -0,0 +1,11 @@ +package gplx.gfdbs.cores; + +import gplx.Io_url; + +public class GfdbConnInfoSqlite implements GfdbConnInfo { + public GfdbConnInfoSqlite(Io_url dbFilPath) { + this.dbFilPath = dbFilPath; + } + public String ConnStr() {return null;} + public Io_url DbFilPath() {return dbFilPath;} private Io_url dbFilPath; +} diff --git a/140_dbs/src/gplx/gfdbs/cores/GfdbItm.java b/140_dbs/src/gplx/gfdbs/cores/GfdbItm.java new file mode 100644 index 000000000..20bd4a3b3 --- /dev/null +++ b/140_dbs/src/gplx/gfdbs/cores/GfdbItm.java @@ -0,0 +1,7 @@ +package gplx.gfdbs.cores; + +public interface GfdbItm { + void CtorByItm(I itm); + GfdbState DbState(); void DbStateSet(GfdbState v); + K ToPkey(); +} diff --git a/140_dbs/src/gplx/gfdbs/cores/GfdbItmFactory.java b/140_dbs/src/gplx/gfdbs/cores/GfdbItmFactory.java new file mode 100644 index 000000000..baeeef99e --- /dev/null +++ b/140_dbs/src/gplx/gfdbs/cores/GfdbItmFactory.java @@ -0,0 +1,5 @@ +package gplx.gfdbs.cores; + +public interface GfdbItmFactory { + I NewByDb(); +} diff --git a/140_dbs/src/gplx/gfdbs/cores/GfdbMeta.java b/140_dbs/src/gplx/gfdbs/cores/GfdbMeta.java new file mode 100644 index 000000000..0b2c034c9 --- /dev/null +++ b/140_dbs/src/gplx/gfdbs/cores/GfdbMeta.java @@ -0,0 +1,14 @@ +package gplx.gfdbs.cores; + +import gplx.dbs.Db_rdr; +import gplx.dbs.Db_stmt; +import gplx.dbs.Dbmeta_fld_list; + +public interface GfdbMeta extends GfdbItmFactory { + String TblName(); + Dbmeta_fld_list Flds(); + String[] Pkeys(); + void SaveStmtPkeys(Db_stmt stmt, I itm); + void SaveStmtVals(GfdbState state, Db_stmt stmt, I itm); + void LoadItm(Db_rdr rdr, I itm); +} diff --git a/140_dbs/src/gplx/gfdbs/cores/GfdbMetaBase.java b/140_dbs/src/gplx/gfdbs/cores/GfdbMetaBase.java new file mode 100644 index 000000000..7420c4e73 --- /dev/null +++ b/140_dbs/src/gplx/gfdbs/cores/GfdbMetaBase.java @@ -0,0 +1,19 @@ +package gplx.gfdbs.cores; + +import gplx.dbs.Db_stmt; +import gplx.dbs.Dbmeta_fld_list; + +public abstract class GfdbMetaBase implements GfdbMeta { + public GfdbMetaBase(String tblName) { + this.tblName = tblName; + CtorFlds(); + this.pkeys = CtorPkeys(); + } + @Override public String TblName() {return tblName;} private final String tblName; + @Override public Dbmeta_fld_list Flds() {return flds;} protected final Dbmeta_fld_list flds = new Dbmeta_fld_list(); + @Override public String[] Pkeys() {return pkeys;} protected String[] pkeys; + @Override public abstract void SaveStmtPkeys(Db_stmt stmt, I itm); + @Override public abstract void SaveStmtVals(GfdbState state, Db_stmt stmt, I itm); + protected abstract void CtorFlds(); + protected abstract String[] CtorPkeys(); +} diff --git a/140_dbs/src/gplx/gfdbs/cores/GfdbState.java b/140_dbs/src/gplx/gfdbs/cores/GfdbState.java new file mode 100644 index 000000000..0fd76da56 --- /dev/null +++ b/140_dbs/src/gplx/gfdbs/cores/GfdbState.java @@ -0,0 +1,11 @@ +package gplx.gfdbs.cores; + +public enum GfdbState { + Noop, // = 0 + Insert,// = 1 + Update,// = 2 + Delete,// = 3 + ; + public int ToDb() {return this.ordinal();} + public static GfdbState ByDb(int id) {return GfdbState.values()[id];} +} diff --git a/140_dbs/src/gplx/gfdbs/cores/GfdbTbl.java b/140_dbs/src/gplx/gfdbs/cores/GfdbTbl.java new file mode 100644 index 000000000..747419456 --- /dev/null +++ b/140_dbs/src/gplx/gfdbs/cores/GfdbTbl.java @@ -0,0 +1,47 @@ +package gplx.gfdbs.cores; + +import gplx.Err_; +import gplx.dbs.Db_conn; +import gplx.dbs.Dbmeta_idx_itm; +import gplx.dbs.Dbmeta_tbl_itm; +import gplx.dbs.qrys.Db_qry_delete; +import gplx.gfdbs.cores.cmds.GfdbModifyCmd; +import gplx.gfdbs.cores.cmds.GfdbSelectCmd; +import gplx.gfdbs.cores.cmds.GfoDbSelectWkrAll; +import gplx.gfdbs.cores.txns.GfdbTxnMgr; + +public class GfdbTbl> implements GfdbCloseAble { + protected final Db_conn conn; + protected final M meta; + public GfdbTbl(Db_conn conn, GfdbTxnMgr txnMgr, M meta) { + this.conn = conn; + this.meta = meta; + this.insertCmd = new GfdbModifyCmd<>(conn, txnMgr, meta, GfdbState.Insert); + this.updateCmd = new GfdbModifyCmd<>(conn, txnMgr, meta, GfdbState.Update); + this.deleteCmd = new GfdbModifyCmd<>(conn, txnMgr, meta, GfdbState.Delete); + this.selectAllCmd = new GfdbSelectCmd<>(conn, meta, new GfoDbSelectWkrAll<>(meta)); + } + public M Meta() {return meta;} + public void CreateTbl() { + conn.Meta_tbl_create(Dbmeta_tbl_itm.New(meta.TblName(), meta.Flds(), Dbmeta_idx_itm.new_unique_by_tbl(meta.TblName(), "pkey", meta.Pkeys()))); + } + public GfdbModifyCmd InsertCmd() {return insertCmd;} private final GfdbModifyCmd insertCmd; + public GfdbModifyCmd UpdateCmd() {return updateCmd;} private final GfdbModifyCmd updateCmd; + public GfdbModifyCmd DeleteCmd() {return deleteCmd;} private final GfdbModifyCmd deleteCmd; + public GfdbSelectCmd SelectAllCmd() {return selectAllCmd;} private final GfdbSelectCmd selectAllCmd; + public GfdbModifyCmd ModifyCmd(GfdbState dbState) { + switch (dbState) { + case Insert: return insertCmd; + case Update: return updateCmd; + case Delete: return deleteCmd; + default: throw Err_.new_unhandled_default(dbState); + } + } + public void DeleteAll() {conn.Stmt_new(Db_qry_delete.new_all_(meta.TblName())).Exec_delete();} + @Override public void Close() { + insertCmd.Close(); + updateCmd.Close(); + deleteCmd.Close(); + selectAllCmd.Close(); + } +} diff --git a/140_dbs/src/gplx/gfdbs/cores/cfgs/GfdbCfgItm.java b/140_dbs/src/gplx/gfdbs/cores/cfgs/GfdbCfgItm.java new file mode 100644 index 000000000..6805d88ee --- /dev/null +++ b/140_dbs/src/gplx/gfdbs/cores/cfgs/GfdbCfgItm.java @@ -0,0 +1,34 @@ +package gplx.gfdbs.cores.cfgs; + +import gplx.Type_; +import gplx.gfdbs.cores.GfdbState; +import gplx.gfdbs.cores.GfdbItm; + +public class GfdbCfgItm implements GfdbItm { + @Override public void CtorByItm(GfdbCfgItm itm) {this.Ctor(itm.key, itm.val);} + public GfdbCfgItm Ctor(String key, String val) { + this.key = key; + this.val = val; + return this; + } + @Override public GfdbState DbState() {return dbState;} private GfdbState dbState = GfdbState.Noop; @Override public void DbStateSet(GfdbState v) {this.dbState = v;} + @Override public String ToPkey() { + return key; + } + public String Key() {return key;} private String key; + public String Val() {return val;} private String val; + public void ValSet(String v) {this.val = v; this.dbState = GfdbState.Update;} + public int ValAdd(int add) { + Integer valInt = Integer.parseInt(val); + valInt += add; + this.ValSet(valInt.toString()); + return valInt; + } + @Override public String toString() {return Type_.SimpleName_by_obj(this) + toStringItm();} + protected String toStringItm() { + return "|dbState=" + dbState.name() + + "|key=" + key + + "|val=" + val + ; + } +} diff --git a/140_dbs/src/gplx/gfdbs/cores/cfgs/GfdbCfgMeta.java b/140_dbs/src/gplx/gfdbs/cores/cfgs/GfdbCfgMeta.java new file mode 100644 index 000000000..4c2e5b108 --- /dev/null +++ b/140_dbs/src/gplx/gfdbs/cores/cfgs/GfdbCfgMeta.java @@ -0,0 +1,32 @@ +package gplx.gfdbs.cores.cfgs; + +import gplx.dbs.Db_rdr; +import gplx.dbs.Db_stmt; +import gplx.gfdbs.cores.GfdbState; +import gplx.gfdbs.cores.GfdbMetaBase; + +public class GfdbCfgMeta extends GfdbMetaBase { + public GfdbCfgMeta() {super(GfdbCfgMeta.TBL_CORE_CFG);} + public String Key() {return key;} private String key; + public String Val() {return val;} private String val; + @Override protected void CtorFlds() { + this.key = flds.Add_str_pkey("cfg_key", 1024); + this.val = flds.Add_str("cfg_val", 1024); + } + @Override protected String[] CtorPkeys() {return new String[] {key};} + @Override public void SaveStmtPkeys(Db_stmt stmt, GfdbCfgItm itm) {stmt.Crt_str(this.Key(), itm.Key());} + @Override public void SaveStmtVals(GfdbState state, Db_stmt stmt, GfdbCfgItm itm) { + if (state == GfdbState.Insert) { + stmt.Val_str(this.Key(), itm.Key()); + } + stmt.Val_str(this.Val(), itm.Val()); + } + @Override public GfdbCfgItm NewByDb() {return new GfdbCfgItm();} + @Override public void LoadItm(Db_rdr rdr, GfdbCfgItm itm) { + itm.Ctor + ( rdr.Read_str(key) + , rdr.Read_str(val) + ); + } + public static final String TBL_CORE_CFG = "core_cfg"; +} diff --git a/140_dbs/src/gplx/gfdbs/cores/cfgs/GfdbCfgSelectWildcardWkr.java b/140_dbs/src/gplx/gfdbs/cores/cfgs/GfdbCfgSelectWildcardWkr.java new file mode 100644 index 000000000..4bcf5b0ef --- /dev/null +++ b/140_dbs/src/gplx/gfdbs/cores/cfgs/GfdbCfgSelectWildcardWkr.java @@ -0,0 +1,32 @@ +package gplx.gfdbs.cores.cfgs; + +import gplx.dbs.Db_conn; +import gplx.dbs.Db_crt_; +import gplx.dbs.Db_qry; +import gplx.dbs.Db_qry_; +import gplx.dbs.Db_rdr; +import gplx.gfdbs.cores.cmds.GfoDbSelectWkr; +import gplx.dbs.engines.sqlite.Sqlite_engine_; + +public class GfdbCfgSelectWildcardWkr implements GfoDbSelectWkr { + private final GfdbCfgMeta meta; + public GfdbCfgSelectWildcardWkr(GfdbCfgMeta meta) { + this.meta = meta; + } + @Override public Db_rdr NewRdr(Db_conn conn, Object... args) { + Db_qry qry = Db_qry_.select_() + .Cols_all_() + .From_(meta.TblName()) + .Where_ + ( + Db_crt_.New_like(meta.Key(), "") + ); + String keyPattern = (String)args[0]; + return conn.Stmt_new(qry).Clear() + .Crt_str(meta.Key(), keyPattern + Sqlite_engine_.Wildcard_str) + .Exec_select__rls_auto(); + } + @Override public void ItmLoad(Db_rdr rdr, GfdbCfgItm itm) { + meta.LoadItm(rdr, itm); + } +} diff --git a/140_dbs/src/gplx/gfdbs/cores/cfgs/GfdbCfgTbl.java b/140_dbs/src/gplx/gfdbs/cores/cfgs/GfdbCfgTbl.java new file mode 100644 index 000000000..2d0f594df --- /dev/null +++ b/140_dbs/src/gplx/gfdbs/cores/cfgs/GfdbCfgTbl.java @@ -0,0 +1,18 @@ +package gplx.gfdbs.cores.cfgs; + +import gplx.dbs.Db_conn; +import gplx.gfdbs.cores.GfdbTbl; +import gplx.gfdbs.cores.cmds.GfdbSelectCmd; +import gplx.gfdbs.cores.txns.GfdbTxnMgr; + +public class GfdbCfgTbl extends GfdbTbl { + public GfdbCfgTbl(GfdbTxnMgr txnMgr, Db_conn conn, GfdbCfgMeta meta) { + super(conn, txnMgr, meta); + this.selectWildcardCmd = new GfdbSelectCmd<>(conn, meta, new GfdbCfgSelectWildcardWkr(meta)); + } + public GfdbSelectCmd SelectWildcardCmd() {return selectWildcardCmd;} private final GfdbSelectCmd selectWildcardCmd; + @Override public void Close() { + super.Close(); + selectWildcardCmd.Close(); + } +} diff --git a/140_dbs/src/gplx/gfdbs/cores/cfgs/GfdbIdMgr.java b/140_dbs/src/gplx/gfdbs/cores/cfgs/GfdbIdMgr.java new file mode 100644 index 000000000..c7f77aeee --- /dev/null +++ b/140_dbs/src/gplx/gfdbs/cores/cfgs/GfdbIdMgr.java @@ -0,0 +1,35 @@ +package gplx.gfdbs.cores.cfgs; + +import gplx.gfdbs.cores.txns.GfdbTxnSub; +import gplx.gfdbs.cores.wkrs.GfdbListWkr; +import gplx.gfdbs.cores.wkrs.GfdbListWkrUtl; +import gplx.objects.lists.GfoIndexedList; + +public class GfdbIdMgr implements GfdbTxnSub { + private final GfoIndexedList regy = new GfoIndexedList<>(); + private final GfdbListWkr dbListWkr; + private boolean load = true; + + private static final String ID_MGR_PREFIX = "idMgr."; + + public GfdbIdMgr(GfdbCfgTbl coreCfgTbl) { + this.dbListWkr = GfdbListWkrUtl.NewByTbl(regy, coreCfgTbl, coreCfgTbl.SelectWildcardCmd(), ID_MGR_PREFIX); + } + public void Reg(String tblName) { + String key = ToCfgTblKey(tblName); + GfdbCfgItm itm = new GfdbCfgItm().Ctor(key, "0"); + regy.Add(key, itm); + } + @Override public void WhenTxnSav() { + dbListWkr.Save(); + } + public int Next(String tblName) { + if (load) { + load = false; + dbListWkr.Load(); + } + GfdbCfgItm itm = regy.GetByOrFail(ToCfgTblKey(tblName)); + return itm.ValAdd(1); + } + private String ToCfgTblKey(String tblName) {return ID_MGR_PREFIX + tblName;} +} diff --git a/140_dbs/src/gplx/gfdbs/cores/cmds/GfdbModifyCmd.java b/140_dbs/src/gplx/gfdbs/cores/cmds/GfdbModifyCmd.java new file mode 100644 index 000000000..dc7527547 --- /dev/null +++ b/140_dbs/src/gplx/gfdbs/cores/cmds/GfdbModifyCmd.java @@ -0,0 +1,63 @@ +package gplx.gfdbs.cores.cmds; + +import gplx.dbs.Db_conn; +import gplx.dbs.Db_stmt; +import gplx.dbs.Db_stmt_; +import gplx.gfdbs.cores.GfdbCloseAble; +import gplx.gfdbs.cores.GfdbMeta; +import gplx.gfdbs.cores.txns.GfdbTxnMgr; +import gplx.gfdbs.cores.GfdbState; + +public class GfdbModifyCmd implements GfdbCloseAble { + private final Db_conn conn; + private final GfdbTxnMgr txnMgr; + private Db_stmt stmt; + public GfdbModifyCmd(Db_conn conn, GfdbTxnMgr txnMgr, GfdbMeta meta, GfdbState dbState) { + this.conn = conn; + this.txnMgr = txnMgr; + this.meta = meta; + this.dbState = dbState; + } + public GfdbMeta Meta() {return meta;} private final GfdbMeta meta; + public GfdbState DbState() {return dbState;} private final GfdbState dbState; + public void ExecObject(Object o) {Exec((I)o);} + public void Exec(I itm) { + if (stmt == null) { + StmtMake(); + } + else { + stmt.Clear(); + } + if (dbState != GfdbState.Delete) { + meta.SaveStmtVals(dbState, stmt, itm); + } + StmtWhere(itm); + StmtExec(); + txnMgr.SaveCheck(); + } + private void StmtMake() { + switch (dbState) { + case Insert: stmt = conn.Stmt_insert(meta.TblName(), meta.Flds()); break; + case Delete: stmt = conn.Stmt_delete(meta.TblName(), meta.Pkeys()); break; + case Update: stmt = conn.Stmt_update_exclude(meta.TblName(), meta.Flds(), meta.Pkeys()); break; + } + } + private void StmtWhere(I itm) { + switch (dbState) { + case Delete: + case Update: + meta.SaveStmtPkeys(stmt, itm); + break; + } + } + private void StmtExec() { + switch (dbState) { + case Insert: stmt.Exec_insert(); break; + case Update: stmt.Exec_update(); break; + case Delete: stmt.Exec_delete(); break; + } + } + @Override public void Close() { + stmt = Db_stmt_.Rls(stmt); + } +} diff --git a/140_dbs/src/gplx/gfdbs/cores/cmds/GfdbSelectCmd.java b/140_dbs/src/gplx/gfdbs/cores/cmds/GfdbSelectCmd.java new file mode 100644 index 000000000..fc1fd1d25 --- /dev/null +++ b/140_dbs/src/gplx/gfdbs/cores/cmds/GfdbSelectCmd.java @@ -0,0 +1,50 @@ +package gplx.gfdbs.cores.cmds; + +import gplx.dbs.Db_conn; +import gplx.dbs.Db_rdr; +import gplx.dbs.Db_rdr_; +import gplx.gfdbs.cores.GfdbCloseAble; +import gplx.gfdbs.cores.GfdbItmFactory; +import gplx.objects.lists.GfoListBase; + +public class GfdbSelectCmd implements GfdbCloseAble, GfdbSelectList { + private final Db_conn conn; + private final GfdbItmFactory itmFactory; + private final GfoDbSelectWkr wkr; + public GfdbSelectCmd(Db_conn conn, GfdbItmFactory itmFactory, GfoDbSelectWkr wkr) { + this.conn = conn; + this.itmFactory = itmFactory; + this.wkr = wkr; + } + public GfoListBase Select(Object... args) { + GfoListBase list = new GfoListBase<>(); + Db_rdr rdr = Db_rdr_.Empty; + try { + rdr = wkr.NewRdr(conn, args); + while (rdr.Move_next()) { + I itm = itmFactory.NewByDb(); + wkr.ItmLoad(rdr, itm); + list.Add(itm); + } + } + finally {rdr.Rls();} + return list; + } + public I SelectOne(Object... args) { + Db_rdr rdr = Db_rdr_.Empty; + try { + rdr = wkr.NewRdr(conn, args); + if (rdr.Move_next()) { + I itm = itmFactory.NewByDb(); + wkr.ItmLoad(rdr, itm); + return itm; + } + else { + return null; + } + } + finally {rdr.Rls();} + } + + @Override public void Close() {} +} diff --git a/140_dbs/src/gplx/gfdbs/cores/cmds/GfdbSelectList.java b/140_dbs/src/gplx/gfdbs/cores/cmds/GfdbSelectList.java new file mode 100644 index 000000000..e8393ef7a --- /dev/null +++ b/140_dbs/src/gplx/gfdbs/cores/cmds/GfdbSelectList.java @@ -0,0 +1,8 @@ +package gplx.gfdbs.cores.cmds; + +import gplx.gfdbs.cores.GfdbCloseAble; +import gplx.objects.lists.GfoListBase; + +public interface GfdbSelectList extends GfdbCloseAble { + GfoListBase Select(Object... args); +} diff --git a/140_dbs/src/gplx/gfdbs/cores/cmds/GfoDbModifyCmdHash.java b/140_dbs/src/gplx/gfdbs/cores/cmds/GfoDbModifyCmdHash.java new file mode 100644 index 000000000..f2617ca81 --- /dev/null +++ b/140_dbs/src/gplx/gfdbs/cores/cmds/GfoDbModifyCmdHash.java @@ -0,0 +1,24 @@ +package gplx.gfdbs.cores.cmds; + +import gplx.gfdbs.cores.GfdbTbl; +import gplx.gfdbs.cores.GfdbMeta; +import gplx.gfdbs.cores.GfdbState; +import gplx.objects.lists.GfoIndexedList; + +public class GfoDbModifyCmdHash { + private final GfoIndexedList> hash = new GfoIndexedList<>(); + + public GfoDbModifyCmdHash Add(GfdbModifyCmd cmd) { + hash.Add(ToKey(cmd.Meta().TblName(), cmd.DbState()), (GfdbModifyCmd)cmd); + return this; + } + public > GfoDbModifyCmdHash AddTbl(GfdbTbl tbl) { + Add((GfdbModifyCmd)tbl.InsertCmd()); + Add((GfdbModifyCmd)tbl.UpdateCmd()); + Add((GfdbModifyCmd)tbl.DeleteCmd()); + return this; + } + private String ToKey(String type, GfdbState state) { + return type + "|" + state.name(); + } +} diff --git a/140_dbs/src/gplx/gfdbs/cores/cmds/GfoDbSelectWkr.java b/140_dbs/src/gplx/gfdbs/cores/cmds/GfoDbSelectWkr.java new file mode 100644 index 000000000..b914701ac --- /dev/null +++ b/140_dbs/src/gplx/gfdbs/cores/cmds/GfoDbSelectWkr.java @@ -0,0 +1,9 @@ +package gplx.gfdbs.cores.cmds; + +import gplx.dbs.Db_conn; +import gplx.dbs.Db_rdr; + +public interface GfoDbSelectWkr { + Db_rdr NewRdr(Db_conn conn, Object... args); + void ItmLoad(Db_rdr rdr, I itm); +} diff --git a/140_dbs/src/gplx/gfdbs/cores/cmds/GfoDbSelectWkrAll.java b/140_dbs/src/gplx/gfdbs/cores/cmds/GfoDbSelectWkrAll.java new file mode 100644 index 000000000..2eb6dcf7b --- /dev/null +++ b/140_dbs/src/gplx/gfdbs/cores/cmds/GfoDbSelectWkrAll.java @@ -0,0 +1,18 @@ +package gplx.gfdbs.cores.cmds; + +import gplx.dbs.Db_conn; +import gplx.dbs.Db_rdr; +import gplx.dbs.Db_stmt; +import gplx.gfdbs.cores.GfdbMeta; + +public class GfoDbSelectWkrAll> implements GfoDbSelectWkr { + private final M meta; + public GfoDbSelectWkrAll(M meta) { + this.meta = meta; + } + @Override public Db_rdr NewRdr(Db_conn conn, Object... args) { + Db_stmt stmt = conn.Stmt_select_all(meta.TblName(), meta.Flds()); + return stmt.Exec_select__rls_auto(); + } + @Override public void ItmLoad(Db_rdr rdr, I itm) {meta.LoadItm(rdr, itm);} +} diff --git a/140_dbs/src/gplx/gfdbs/cores/cmds/GfoDbSelectWkrOne.java b/140_dbs/src/gplx/gfdbs/cores/cmds/GfoDbSelectWkrOne.java new file mode 100644 index 000000000..724a2e963 --- /dev/null +++ b/140_dbs/src/gplx/gfdbs/cores/cmds/GfoDbSelectWkrOne.java @@ -0,0 +1,30 @@ +package gplx.gfdbs.cores.cmds; + +import gplx.Err_; +import gplx.dbs.Db_conn; +import gplx.dbs.Db_rdr; +import gplx.dbs.Db_stmt; +import gplx.dbs.Dbmeta_fld_itm; +import gplx.gfdbs.cores.GfdbMeta; +import gplx.dbs.stmts.Db_stmt_arg_list; + +public class GfoDbSelectWkrOne> implements GfoDbSelectWkr { + private final M meta; + private final String[] pkeyCols; + public GfoDbSelectWkrOne(M meta, String... pkeyCols) { + this.meta = meta; + this.pkeyCols = pkeyCols; + } + @Override public Db_rdr NewRdr(Db_conn conn, Object... pkeyVals) { + Db_stmt stmt = conn.Stmt_select(meta.TblName(), meta.Flds(), pkeyCols); + if (pkeyCols.length != pkeyVals.length) throw Err_.new_wo_type("pkey lengths don't match"); + for (int i = 0; i < pkeyCols.length; i++) { + String pkeyCol = pkeyCols[i]; + Dbmeta_fld_itm pkeyFld = meta.Flds().Get_by(pkeyCol); + Db_stmt_arg_list.Fill_crt(stmt, pkeyFld.Type().Tid_ansi(), pkeyCol, pkeyVals[i]); + } + + return stmt.Exec_select__rls_auto(); + } + @Override public void ItmLoad(Db_rdr rdr, I itm) {meta.LoadItm(rdr, itm);} +} diff --git a/140_dbs/src/gplx/gfdbs/cores/txns/GfdbTxnMgr.java b/140_dbs/src/gplx/gfdbs/cores/txns/GfdbTxnMgr.java new file mode 100644 index 000000000..465678580 --- /dev/null +++ b/140_dbs/src/gplx/gfdbs/cores/txns/GfdbTxnMgr.java @@ -0,0 +1,59 @@ +package gplx.gfdbs.cores.txns; + +import gplx.dbs.Db_conn; +import gplx.gfdbs.cores.GfdbCloseAble; +import gplx.objects.lists.GfoListBase; + +public class GfdbTxnMgr { + private final GfdbCloseAble dbMgr; + private final Db_conn conn; + private final GfoListBase subs = new GfoListBase<>(); + private boolean enabled = true; + private int saveEveryN = 1000; + private int n; + public GfdbTxnMgr(GfdbCloseAble dbMgr, Db_conn conn) { + this.dbMgr = dbMgr; + this.conn = conn; + } + public void SaveEveryNSet(int v) {this.saveEveryN = v;} + public void EnabledSet(boolean v) {this.enabled = v;} + public GfoListBase Subs() {return subs;} + public GfdbTxnMgr Bgn(String name) { + if (enabled) { + conn.Txn_bgn(name); + } + return this; + } + public GfdbTxnMgr RegSub(GfdbTxnSub... subArray) { + for (GfdbTxnSub sub : subArray) + subs.Add(sub); + return this; + } + public void Cancel() { + conn.Txn_cxl(); + } + public void SaveCheck() { + if ((n++ % saveEveryN) == 0) { + this.SaveForce(); + } + } + public void SaveForce() { + this.SubsSave(); + if (enabled) { + conn.Txn_sav(); + } + } + public void End() { + this.SubsSave(); + if (enabled) { + conn.Txn_end(); + } + dbMgr.Close(); + n = 0; + } + private void SubsSave() { + for (GfdbTxnSub sub : subs) { + sub.WhenTxnSav(); + } + } +} diff --git a/140_dbs/src/gplx/gfdbs/cores/txns/GfdbTxnSub.java b/140_dbs/src/gplx/gfdbs/cores/txns/GfdbTxnSub.java new file mode 100644 index 000000000..d9c35c464 --- /dev/null +++ b/140_dbs/src/gplx/gfdbs/cores/txns/GfdbTxnSub.java @@ -0,0 +1,5 @@ +package gplx.gfdbs.cores.txns; + +public interface GfdbTxnSub { + void WhenTxnSav(); +} diff --git a/140_dbs/src/gplx/gfdbs/cores/wkrs/GfdbListWkr.java b/140_dbs/src/gplx/gfdbs/cores/wkrs/GfdbListWkr.java new file mode 100644 index 000000000..235f92808 --- /dev/null +++ b/140_dbs/src/gplx/gfdbs/cores/wkrs/GfdbListWkr.java @@ -0,0 +1,65 @@ +package gplx.gfdbs.cores.wkrs; + +import gplx.gfdbs.cores.GfdbState; +import gplx.gfdbs.cores.GfdbItm; +import gplx.gfdbs.cores.cmds.GfdbModifyCmd; +import gplx.gfdbs.cores.cmds.GfdbSelectCmd; +import gplx.objects.lists.GfoIndexedList; +import gplx.objects.lists.GfoListBase; + +public class GfdbListWkr> { + private final GfoIndexedList regy; + private final GfdbModifyCmd insertCmd; + private final GfdbModifyCmd updateCmd; + private final GfdbModifyCmd deleteCmd; + private final GfdbSelectCmd selectCmd; + private final Object[] selectArgs; + public GfdbListWkr(GfoIndexedList regy, + GfdbModifyCmd insertCmd, GfdbModifyCmd updateCmd, GfdbModifyCmd deleteCmd, + GfdbSelectCmd selectCmd, Object[] selectArgs) { + this.regy = regy; + this.selectCmd = selectCmd; + this.selectArgs = selectArgs; + this.insertCmd = insertCmd; + this.updateCmd = updateCmd; + this.deleteCmd = deleteCmd; + } + public void Load() { + GfoListBase dbList = selectCmd.Select(selectArgs); + for (I regyItm : regy) { + regyItm.DbStateSet(GfdbState.Insert); + } + for (I dbItm : dbList) { + K key = dbItm.ToPkey(); + I regyItm = regy.GetByOrNull(key); + if (regyItm == null) { + dbItm.DbStateSet(GfdbState.Delete); + } + else { + regyItm.CtorByItm(dbItm); + regyItm.DbStateSet(GfdbState.Update); + dbItm.DbStateSet(GfdbState.Noop); + } + } + for (I itm : regy) { + SaveItm(itm); + } + for (I itm : dbList) { + SaveItm(itm); + } + } + public void Save() { + for (I itm : regy) { + SaveItm(itm); + } + } + private void SaveItm(I itm) { + GfdbState itmState = itm.DbState(); + itm.DbStateSet(GfdbState.Noop); + switch (itmState) { + case Insert: insertCmd.Exec(itm); break; + case Update: updateCmd.Exec(itm); break; + case Delete: deleteCmd.Exec(itm); break; + } + } +} diff --git a/140_dbs/src/gplx/gfdbs/cores/wkrs/GfdbListWkrUtl.java b/140_dbs/src/gplx/gfdbs/cores/wkrs/GfdbListWkrUtl.java new file mode 100644 index 000000000..983f31784 --- /dev/null +++ b/140_dbs/src/gplx/gfdbs/cores/wkrs/GfdbListWkrUtl.java @@ -0,0 +1,14 @@ +package gplx.gfdbs.cores.wkrs; + +import gplx.gfdbs.cores.GfdbItm; +import gplx.gfdbs.cores.GfdbMeta; +import gplx.gfdbs.cores.GfdbTbl; +import gplx.gfdbs.cores.cmds.GfdbSelectCmd; +import gplx.objects.lists.GfoIndexedList; + +public class GfdbListWkrUtl { + public static , M extends GfdbMeta, T extends GfdbTbl> + GfdbListWkr NewByTbl(GfoIndexedList regy, T tbl, GfdbSelectCmd selectCmd, Object... selectArgs) { + return new GfdbListWkr<>(regy, tbl.InsertCmd(), tbl.UpdateCmd(), tbl.DeleteCmd(), selectCmd, selectArgs); + } +} diff --git a/140_dbs/tst/gplx/core/stores/DbMaprMgr_tst.java b/140_dbs/tst/gplx/core/stores/DbMaprMgr_tst.java index b48a42026..106f5e501 100644 --- a/140_dbs/tst/gplx/core/stores/DbMaprMgr_tst.java +++ b/140_dbs/tst/gplx/core/stores/DbMaprMgr_tst.java @@ -1,18 +1,18 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.core.stores; import gplx.*; import gplx.core.*; import org.junit.*; import gplx.dbs.*; /*Db_conn_info*/ @@ -40,13 +40,13 @@ public class DbMaprMgr_tst { conn = Db_conn_pool.Instance.Get_or_new(Db_conn_info_.Test); Db_qry_fxt.DeleteAll(conn, "mock_discs", "mock_titles", "mock_chapters", "mock_streams"); } DbMaprMgr mgr; DbMaprWtr wtr; Db_conn conn; MockDisc disc; MockTitle title; MockChapter chapter; MockStream audio, subtitle; SrlMgr rdr; - @Test public void PurgeObjTree() { + @Test public void PurgeObjTree() { disc = MockDisc.new_().Id_(1); Db_qry_fxt.Insert_kvo(conn, "mock_discs", Keyval_list.New_with_one("disc_id", 1)); DbMaprWtrUtl.PurgeObjTree(disc, mgr, conn); Tfds.Eq(0, Db_qry_fxt.SelectAll_count(conn, "mock_discs")); } - @Test public void PurgeObjTree_deep() { + @Test public void PurgeObjTree_deep() { disc = MockDisc.new_().Id_(1); Db_qry_fxt.Insert_kvo(conn, "mock_discs", Keyval_list.New_with_one("disc_id", 1)); Db_qry_fxt.Insert_kvo(conn, "mock_titles", Keyval_list.New_with_one("disc_id", 1).Add("title_id", 1)); @@ -58,13 +58,13 @@ public class DbMaprMgr_tst { Tfds.Eq(0, Db_qry_fxt.SelectAll_count(conn, "mock_titles")); Tfds.Eq(1, Db_qry_fxt.SelectAll_count(conn, "mock_chapters")); // ignore chapter with disc_id=2 } - @Test public void Save_root() { + @Test public void Save_root() { disc = MockDisc.new_().Id_(1).Name_("disc"); wtr.StoreRoot(disc, "mock_discs"); Db_qry_fxt.tst_Select(conn, "mock_discs", Db_mock_row.vals_only_(1, "disc")); } - @Test public void Save_subs() { + @Test public void Save_subs() { disc = MockDisc.new_().Id_(1).Name_("disc"); title = MockTitle.new_().Id_(2).Name_("title").Disc_(disc); @@ -72,7 +72,7 @@ public class DbMaprMgr_tst { Db_qry_fxt.tst_Select(conn, "mock_discs", Db_mock_row.vals_only_(1, "disc")); Db_qry_fxt.tst_Select(conn, "mock_titles", Db_mock_row.vals_only_(1, 2, "title")); } - @Test public void Save_deep() { + @Test public void Save_deep() { disc = MockDisc.new_().Id_(1).Name_("disc"); title = MockTitle.new_().Id_(2).Name_("title").Disc_(disc); chapter = MockChapter.new_().Id_(3).Name_("chap").Title_(title); @@ -88,7 +88,7 @@ public class DbMaprMgr_tst { , Db_mock_row.vals_only_(1, 2, null, 5, "subtitle") ); } - @Test public void Load_root() { + @Test public void Load_root() { rdr = rdr_(); Db_qry_fxt.Insert_kvo(conn, "mock_discs", Keyval_list.New_with_one("disc_id", 1).Add("disc_name", "name")); disc = (MockDisc)rdr.StoreRoot(MockDisc.Instance, null); @@ -97,7 +97,7 @@ public class DbMaprMgr_tst { Tfds.Eq("name", disc.Name()); Tfds.Eq(0, disc.Titles().Count()); } - @Test public void Load_subs() { + @Test public void Load_subs() { rdr = rdr_(); Db_qry_fxt.Insert_kvo(conn, "mock_discs", Keyval_list.New_with_one("disc_id", 1).Add("disc_name", "name")); Db_qry_fxt.Insert_kvo(conn, "mock_titles", Keyval_list.New_with_one("disc_id", 1).Add("title_id", 1).Add("title_name", "title1")); @@ -110,7 +110,7 @@ public class DbMaprMgr_tst { Tfds.Eq("title1", ((MockTitle)disc.Titles().Get_at(0)).Name()); Tfds.Eq("title2", ((MockTitle)disc.Titles().Get_at(1)).Name()); } - @Test public void Load_deep() { + @Test public void Load_deep() { rdr = rdr_(); Db_qry_fxt.Insert_kvo(conn, "mock_discs", Keyval_list.New_with_one("disc_id", 1).Add("disc_name", "name")); Db_qry_fxt.Insert_kvo(conn, "mock_titles", Keyval_list.New_with_one("disc_id", 1).Add("title_id", 1).Add("title_name", "title1")); diff --git a/140_dbs/tst/gplx/dbs/engines/db_CrudOps_tst.java b/140_dbs/tst/gplx/dbs/engines/db_CrudOps_tst.java index 62e816145..ee2319017 100644 --- a/140_dbs/tst/gplx/dbs/engines/db_CrudOps_tst.java +++ b/140_dbs/tst/gplx/dbs/engines/db_CrudOps_tst.java @@ -1,32 +1,32 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.dbs.engines; import gplx.*; import gplx.dbs.*; import org.junit.*; import gplx.dbs.qrys.*; public class db_CrudOps_tst { CrudOpsFxt fx = new CrudOpsFxt(); - @Test public void Mysql() {if (Tfds.SkipDb) return; + @Test public void Mysql() {if (Tfds.SkipDb) return; fx.RunAll(Db_conn_fxt.Mysql()); } - @Test public void Tdb() {if (Tfds.SkipDb) return; + @Test public void Tdb() {if (Tfds.SkipDb) return; fx.RunAll(Db_conn_fxt.Tdb("100_dbs_crud_ops.dsv")); } - @Test public void Postgres() {if (Db_conn_fxt.SkipPostgres) return; + @Test public void Postgres() {if (Db_conn_fxt.SkipPostgres) return; fx.RunAll(Db_conn_fxt.Postgres()); } - @Test public void Sqlite() {if (Tfds.SkipDb) return; + @Test public void Sqlite() {if (Tfds.SkipDb) return; fx.Fx().DmlAffectedAvailable_(false); fx.RunAll(Db_conn_fxt.Sqlite()); } diff --git a/140_dbs/tst/gplx/dbs/engines/db_DataTypes_tst.java b/140_dbs/tst/gplx/dbs/engines/db_DataTypes_tst.java index 06b55a395..970e620fb 100644 --- a/140_dbs/tst/gplx/dbs/engines/db_DataTypes_tst.java +++ b/140_dbs/tst/gplx/dbs/engines/db_DataTypes_tst.java @@ -1,35 +1,35 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.dbs.engines; import gplx.*; import gplx.dbs.*; import org.junit.*; import gplx.core.type_xtns.*; import gplx.core.stores.*; public class db_DataTypes_tst { DataTypes_base_fxt fx = new DataTypes_base_fxt(); - @Test public void Mysql() {if (Tfds.SkipDb) return; + @Test public void Mysql() {if (Tfds.SkipDb) return; fx.Select_FloatStr_("0.333333"); fx.RunAll(Db_conn_fxt.Mysql()); } - @Test public void Tdb() {if (Tfds.SkipDb) return; + @Test public void Tdb() {if (Tfds.SkipDb) return; fx.Select_FloatStr_(Float_.To_str(Float_.Div(1, 3))); fx.RunAll(Db_conn_fxt.Tdb("110_dbs_multiple_data_types.dsv")); } - @Test public void Postgres() {if (Db_conn_fxt.SkipPostgres) return; + @Test public void Postgres() {if (Db_conn_fxt.SkipPostgres) return; fx.Select_FloatStr_("0.33333334"); fx.RunAll(Db_conn_fxt.Postgres()); } - @Test public void Sqlite() {if (Tfds.SkipDb) return; + @Test public void Sqlite() {if (Tfds.SkipDb) return; fx.Select_FloatStr_("0.33333334"); fx.RunAll(Db_conn_fxt.Sqlite()); } diff --git a/140_dbs/tst/gplx/dbs/groupBys/GroupBys_mysql_tst.java b/140_dbs/tst/gplx/dbs/groupBys/GroupBys_mysql_tst.java index 9ffc2783b..2d7b2bb5c 100644 --- a/140_dbs/tst/gplx/dbs/groupBys/GroupBys_mysql_tst.java +++ b/140_dbs/tst/gplx/dbs/groupBys/GroupBys_mysql_tst.java @@ -13,14 +13,14 @@ The terms of each license can be found in the source code repository: GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt */ -package gplx.dbs.groupBys; import gplx.*; import gplx.dbs.*; -import org.junit.*; -public class GroupBys_mysql_tst extends GroupBys_base_tst { - @Override protected Db_conn provider_() {return Db_conn_fxt.Mysql();} - @Test public void GroupBy_1fld() {super.GroupBy_1fld_hook();} - @Test public void GroupBy_2fld() {super.GroupBy_2fld_hook();} - @Test public void Min() {super.MinMax_hook(true);} - @Test public void Max() {super.MinMax_hook(false);} - @Test public void Count() {super.Count_hook();} - @Test public void Sum() {super.Sum_hook();} -} +package gplx.dbs.groupBys; import gplx.*; import gplx.dbs.*; +import org.junit.*; +public class GroupBys_mysql_tst extends GroupBys_base_tst { + @Override protected Db_conn provider_() {return Db_conn_fxt.Mysql();} + @Test public void GroupBy_1fld() {super.GroupBy_1fld_hook();} + @Test public void GroupBy_2fld() {super.GroupBy_2fld_hook();} + @Test public void Min() {super.MinMax_hook(true);} + @Test public void Max() {super.MinMax_hook(false);} + @Test public void Count() {super.Count_hook();} + @Test public void Sum() {super.Sum_hook();} +} diff --git a/140_dbs/tst/gplx/dbs/groupBys/GroupBys_tdb_tst.java b/140_dbs/tst/gplx/dbs/groupBys/GroupBys_tdb_tst.java index 75d1586af..b3c724c15 100644 --- a/140_dbs/tst/gplx/dbs/groupBys/GroupBys_tdb_tst.java +++ b/140_dbs/tst/gplx/dbs/groupBys/GroupBys_tdb_tst.java @@ -13,15 +13,15 @@ The terms of each license can be found in the source code repository: GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt */ -package gplx.dbs.groupBys; import gplx.*; import gplx.dbs.*; -import org.junit.*; -public class GroupBys_tdb_tst extends GroupBys_base_tst { - @Override protected Db_conn provider_() {return Db_conn_fxt.Tdb("130_dbs_group_bys.dsv");} - @Test public void GroupBy_1fld() {super.GroupBy_1fld_hook();} - @Test public void GroupBy_2fld() {super.GroupBy_2fld_hook();} - @Test public void Min() {super.MinMax_hook(true);} - @Test public void Max() {super.MinMax_hook(false);} - @Test public void Count() {super.Count_hook();} - @Test public void Sum() {super.Sum_hook();} - // Avg, CountDistinct -} +package gplx.dbs.groupBys; import gplx.*; import gplx.dbs.*; +import org.junit.*; +public class GroupBys_tdb_tst extends GroupBys_base_tst { + @Override protected Db_conn provider_() {return Db_conn_fxt.Tdb("130_dbs_group_bys.dsv");} + @Test public void GroupBy_1fld() {super.GroupBy_1fld_hook();} + @Test public void GroupBy_2fld() {super.GroupBy_2fld_hook();} + @Test public void Min() {super.MinMax_hook(true);} + @Test public void Max() {super.MinMax_hook(false);} + @Test public void Count() {super.Count_hook();} + @Test public void Sum() {super.Sum_hook();} + // Avg, CountDistinct +} diff --git a/140_dbs/tst/gplx/dbs/insertIntos/InsertIntos_mysql_tst.java b/140_dbs/tst/gplx/dbs/insertIntos/InsertIntos_mysql_tst.java index 16119dfd9..754ac6147 100644 --- a/140_dbs/tst/gplx/dbs/insertIntos/InsertIntos_mysql_tst.java +++ b/140_dbs/tst/gplx/dbs/insertIntos/InsertIntos_mysql_tst.java @@ -13,10 +13,10 @@ The terms of each license can be found in the source code repository: GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt */ -package gplx.dbs.insertIntos; import gplx.*; import gplx.dbs.*; -import org.junit.*; -public class InsertIntos_mysql_tst extends InsertIntos_base_tst { - @Override protected Db_conn provider_() {return Db_conn_fxt.Mysql();} - @Test public void Select() {super.Select_hook();} - @Test public void GroupBy() {super.GroupBy_hook();} -} +package gplx.dbs.insertIntos; import gplx.*; import gplx.dbs.*; +import org.junit.*; +public class InsertIntos_mysql_tst extends InsertIntos_base_tst { + @Override protected Db_conn provider_() {return Db_conn_fxt.Mysql();} + @Test public void Select() {super.Select_hook();} + @Test public void GroupBy() {super.GroupBy_hook();} +} diff --git a/140_dbs/tst/gplx/dbs/insertIntos/InsertIntos_tdb_tst.java b/140_dbs/tst/gplx/dbs/insertIntos/InsertIntos_tdb_tst.java index 527eafe99..f94dd781b 100644 --- a/140_dbs/tst/gplx/dbs/insertIntos/InsertIntos_tdb_tst.java +++ b/140_dbs/tst/gplx/dbs/insertIntos/InsertIntos_tdb_tst.java @@ -13,10 +13,10 @@ The terms of each license can be found in the source code repository: GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt */ -package gplx.dbs.insertIntos; import gplx.*; import gplx.dbs.*; -import org.junit.*; -public class InsertIntos_tdb_tst extends InsertIntos_base_tst { - @Override protected Db_conn provider_() {return Db_conn_fxt.Tdb("140_dbs_insert_intos.dsv");} - @Test public void Select() {super.Select_hook();} - @Test public void GroupBy() {super.GroupBy_hook();} -} +package gplx.dbs.insertIntos; import gplx.*; import gplx.dbs.*; +import org.junit.*; +public class InsertIntos_tdb_tst extends InsertIntos_base_tst { + @Override protected Db_conn provider_() {return Db_conn_fxt.Tdb("140_dbs_insert_intos.dsv");} + @Test public void Select() {super.Select_hook();} + @Test public void GroupBy() {super.GroupBy_hook();} +} diff --git a/140_dbs/tst/gplx/dbs/joins/Joins_tdb_tst.java b/140_dbs/tst/gplx/dbs/joins/Joins_tdb_tst.java index 0503fb77c..9287db20e 100644 --- a/140_dbs/tst/gplx/dbs/joins/Joins_tdb_tst.java +++ b/140_dbs/tst/gplx/dbs/joins/Joins_tdb_tst.java @@ -13,17 +13,17 @@ The terms of each license can be found in the source code repository: GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt */ -package gplx.dbs.joins; import gplx.*; import gplx.dbs.*; -import org.junit.*; -public class Joins_tdb_tst extends Joins_base_tst { - @Override protected Db_conn provider_() {return Db_conn_fxt.Tdb("120_dbs_joins.dsv");} - @Test public void InnerJoin() { - try { - InnerJoin_hook(); - } - catch (Exception exc) { - if (String_.Has(Err_.Message_lang(exc), "joins not supported for tdbs")) return; - } - Tfds.Fail("'joins not supported for tdbs' error not thrown"); - } -} +package gplx.dbs.joins; import gplx.*; import gplx.dbs.*; +import org.junit.*; +public class Joins_tdb_tst extends Joins_base_tst { + @Override protected Db_conn provider_() {return Db_conn_fxt.Tdb("120_dbs_joins.dsv");} + @Test public void InnerJoin() { + try { + InnerJoin_hook(); + } + catch (Exception exc) { + if (String_.Has(Err_.Message_lang(exc), "joins not supported for tdbs")) return; + } + Tfds.Fail("'joins not supported for tdbs' error not thrown"); + } +} diff --git a/140_dbs/tst/gplx/dbs/orderBys/OrderBys_tdb_tst.java b/140_dbs/tst/gplx/dbs/orderBys/OrderBys_tdb_tst.java index 87c93b877..5c8b1660e 100644 --- a/140_dbs/tst/gplx/dbs/orderBys/OrderBys_tdb_tst.java +++ b/140_dbs/tst/gplx/dbs/orderBys/OrderBys_tdb_tst.java @@ -1,26 +1,26 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.dbs.orderBys; import gplx.*; import gplx.dbs.*; import org.junit.*; public class OrderBys_tdb_tst extends OrderBys_base_tst { @Override protected Db_conn provider_() {return Db_conn_fxt.Tdb("120_dbs_joins.dsv");} - @Test public void Basic() { + @Test public void Basic() { Basic_hook(); } - @Test public void SameVals() { + @Test public void SameVals() { SameVals_hook(); } } @@ -28,7 +28,7 @@ public class OrderBys_tdb_tst extends OrderBys_base_tst { // import org.junit.*; // public class CrudOps_tdb_tst { // @Before public void setup() {fx = new CrudOpsFxt(Db_conn_fxt.Tdb("100_dbs_crud_ops.dsv"));} CrudOpsFxt fx; -// @Test public void FlushToDisk() { +// @Test public void FlushToDisk() { // fx.Fx().tst_ExecDml(1, Db_qry_.insert_("dbs_crud_ops").Arg_("id", 2).Arg_("name", "you")); // Db_qry_flush.new_("dbs_crud_ops").Exec_qry(fx.Fx().Conn()); // } diff --git a/140_dbs/tst/gplx/dbs/qrys/Db_val_typeTest.java b/140_dbs/tst/gplx/dbs/qrys/Db_val_typeTest.java new file mode 100644 index 000000000..c303ceac3 --- /dev/null +++ b/140_dbs/tst/gplx/dbs/qrys/Db_val_typeTest.java @@ -0,0 +1,29 @@ +package gplx.dbs.qrys; + +import gplx.Byte_; +import gplx.DateAdp_; +import gplx.Decimal_adp_; +import gplx.core.tests.Gftest; +import gplx.objects.lists.GfoListBase; +import org.junit.Test; + +public class Db_val_typeTest { + @Test public void Numbers() { + TestToSqlStr + ("ABC true 1 2 3 4.0 5 6 XYZ" + ,"ABC ? ? ? ? ? ? ? XYZ" + , true, Byte_.By_int(1), 2, (long)3, (float)4, (double)5, Decimal_adp_.int_(6) + ); + } + @Test public void Strings() { + TestToSqlStr + ("ABC 'abc' 'a\\'\"c' 'xyz' 'x\\'\"z' '2021-01-02 03:04:05.006' XYZ" + ,"ABC ? ? ? ? ? XYZ" + , "abc", "a'\"c", "xyz", "x'\"z", DateAdp_.new_(2021, 1, 2, 3, 4, 5, 6) + ); + } + private void TestToSqlStr(String expd, String sql, Object... paramArray) { + String actl = Db_val_type.ToSqlStr(sql, new GfoListBase<>().AddMany(paramArray)); + Gftest.Eq__str(expd, actl); + } +} diff --git a/140_dbs/tst/gplx/dbs/utls/PoolIds_tst.java b/140_dbs/tst/gplx/dbs/utls/PoolIds_tst.java index 5852a76ae..cc8c4db4d 100644 --- a/140_dbs/tst/gplx/dbs/utls/PoolIds_tst.java +++ b/140_dbs/tst/gplx/dbs/utls/PoolIds_tst.java @@ -1,18 +1,18 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.dbs.utls; import gplx.*; import gplx.dbs.*; import org.junit.*; public class PoolIds_tst { @@ -21,21 +21,21 @@ public class PoolIds_tst { Db_qry_fxt.DeleteAll(conn, PoolIds.Tbl_Name); mgr = PoolIds.Instance; } - @Test public void FetchNextId() { + @Test public void FetchNextId() { tst_Fetch("/test0", 0); } - @Test public void ChangeNextId_Insert() { + @Test public void ChangeNextId_Insert() { run_Change("/test0", 1); tst_Fetch("/test0", 1); } - @Test public void ChangeNextId_Update() { + @Test public void ChangeNextId_Update() { run_Change("/test0", 0); run_Change("/test0", 1); tst_Fetch("/test0", 1); } - @Test public void FetchNextId_Multiple() { + @Test public void FetchNextId_Multiple() { run_Change("/test0", 0); run_Change("/test1", 1); diff --git a/150_gfui/.classpath b/150_gfui/.classpath deleted file mode 100644 index bfe48f13b..000000000 --- a/150_gfui/.classpath +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/150_gfui/src/gplx/gfui/controls/GfuiBorderMgr_tst.java b/150_gfui/src/gplx/gfui/controls/GfuiBorderMgr_tst.java index 98e55c75a..9a0ab740c 100644 --- a/150_gfui/src/gplx/gfui/controls/GfuiBorderMgr_tst.java +++ b/150_gfui/src/gplx/gfui/controls/GfuiBorderMgr_tst.java @@ -1,38 +1,38 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.gfui.controls; import gplx.*; import gplx.gfui.*; import org.junit.*; import gplx.gfui.draws.*; import gplx.gfui.imgs.*; public class GfuiBorderMgr_tst { @Before public void setup() { borderMgr = GfuiBorderMgr.new_(); } - @Test public void NullToEdge() { // all null -> one edge + @Test public void NullToEdge() { // all null -> one edge tst_Eq(borderMgr, null, null, null, null, null); borderMgr.Top_(red); tst_Eq(borderMgr, null, red, null, null, null); } - @Test public void EdgeToAll() { // one edge -> all edge + @Test public void EdgeToAll() { // one edge -> all edge borderMgr.Top_(red); tst_Eq(borderMgr, null, red, null, null, null); borderMgr.All_(black); tst_Eq(borderMgr, black, null, null, null, null); } - @Test public void AllToEdge() { // all edge -> one new; three old + @Test public void AllToEdge() { // all edge -> one new; three old borderMgr.All_(red); tst_Eq(borderMgr, red, null, null, null, null); diff --git a/150_gfui/src/gplx/gfui/controls/customs/GfuiMoveElemBnd.java b/150_gfui/src/gplx/gfui/controls/customs/GfuiMoveElemBnd.java index cb86432ac..3f6698c1d 100644 --- a/150_gfui/src/gplx/gfui/controls/customs/GfuiMoveElemBnd.java +++ b/150_gfui/src/gplx/gfui/controls/customs/GfuiMoveElemBnd.java @@ -1,21 +1,39 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ -package gplx.gfui.controls.customs; import gplx.*; import gplx.gfui.*; import gplx.gfui.controls.*; -import gplx.gfui.ipts.*; import gplx.gfui.controls.elems.*; -import gplx.core.interfaces.*; +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ +package gplx.gfui.controls.customs; import gplx.GfoMsg; +import gplx.Gfo_invk; +import gplx.Gfo_invk_; +import gplx.GfsCtx; +import gplx.Hash_adp; +import gplx.Hash_adp_; +import gplx.List_adp; +import gplx.List_adp_; +import gplx.core.interfaces.InjectAble; +import gplx.gfui.PointAdp; +import gplx.gfui.PointAdp_; +import gplx.gfui.controls.elems.GfuiElem; +import gplx.gfui.ipts.IptArg; +import gplx.gfui.ipts.IptBnd; +import gplx.gfui.ipts.IptBnd_; +import gplx.gfui.ipts.IptEventData; +import gplx.gfui.ipts.IptEventType; +import gplx.gfui.ipts.IptEventType_; +import gplx.gfui.ipts.IptKey_; +import gplx.gfui.ipts.IptMouseBtn_; +import gplx.gfui.ipts.IptMouseMove; public class GfuiMoveElemBnd implements IptBnd, Gfo_invk, InjectAble { public String Key() {return "gplx.gfui.moveWidget";} public List_adp Ipts() {return args;} List_adp args = List_adp_.New(); @@ -29,7 +47,7 @@ public class GfuiMoveElemBnd implements IptBnd, Gfo_invk, InjectAble { } public GfuiElem TargetElem() {return targetElem;} public void TargetElem_set(GfuiElem v) {this.targetElem = v;} GfuiElem targetElem; public static final String target_idk = "target"; - @gplx.Virtual public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) { + public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) { if (ctx.Match(k, target_idk)) return targetElem; else if (ctx.Match(k, "key")) return key; else return Gfo_invk_.Rv_unhandled; @@ -66,10 +84,10 @@ public class GfuiMoveElemBnd implements IptBnd, Gfo_invk, InjectAble { public static GfuiMoveElemBnd new_() {return new GfuiMoveElemBnd();} GfuiMoveElemBnd() { args.Add_many(IptMouseBtn_.Left, IptMouseMove.AnyDirection); - IptBndArgsBldr.AddWithData(args, hash, IptKey_.Ctrl.Add(IptKey_.Up), PointAdp_.new_(0, -10)); - IptBndArgsBldr.AddWithData(args, hash, IptKey_.Ctrl.Add(IptKey_.Down), PointAdp_.new_(0, 10)); - IptBndArgsBldr.AddWithData(args, hash, IptKey_.Ctrl.Add(IptKey_.Left), PointAdp_.new_(-10, 0)); - IptBndArgsBldr.AddWithData(args, hash, IptKey_.Ctrl.Add(IptKey_.Right), PointAdp_.new_(10, 0)); + IptBndArgsBldr.AddWithData(args, hash, IptKey_.MOD_1ST.Add(IptKey_.Up), PointAdp_.new_(0, -10)); + IptBndArgsBldr.AddWithData(args, hash, IptKey_.MOD_1ST.Add(IptKey_.Down), PointAdp_.new_(0, 10)); + IptBndArgsBldr.AddWithData(args, hash, IptKey_.MOD_1ST.Add(IptKey_.Left), PointAdp_.new_(-10, 0)); + IptBndArgsBldr.AddWithData(args, hash, IptKey_.MOD_1ST.Add(IptKey_.Right), PointAdp_.new_(10, 0)); } } class IptBndArgsBldr { diff --git a/150_gfui/src/gplx/gfui/controls/customs/GfuiMoveElemBtn.java b/150_gfui/src/gplx/gfui/controls/customs/GfuiMoveElemBtn.java index 0c73d9cbb..01be8a4a6 100644 --- a/150_gfui/src/gplx/gfui/controls/customs/GfuiMoveElemBtn.java +++ b/150_gfui/src/gplx/gfui/controls/customs/GfuiMoveElemBtn.java @@ -1,20 +1,43 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ -package gplx.gfui.controls.customs; import gplx.*; import gplx.gfui.*; import gplx.gfui.controls.*; -import gplx.gfui.ipts.*; import gplx.gfui.layouts.*; import gplx.gfui.controls.gxws.*; import gplx.gfui.controls.elems.*; import gplx.gfui.controls.standards.*; import gplx.gfui.controls.windows.*; +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ +package gplx.gfui.controls.customs; import gplx.GfoMsg; +import gplx.Hash_adp; +import gplx.Hash_adp_; +import gplx.Keyval_hash; +import gplx.List_adp; +import gplx.List_adp_; +import gplx.gfui.PointAdp; +import gplx.gfui.PointAdp_; +import gplx.gfui.SizeAdp; +import gplx.gfui.SizeAdp_; +import gplx.gfui.controls.elems.GfuiElem; +import gplx.gfui.controls.elems.GfuiElem_; +import gplx.gfui.controls.gxws.GxwElem; +import gplx.gfui.controls.gxws.GxwElemFactory_; +import gplx.gfui.controls.standards.GfuiBtn; +import gplx.gfui.controls.windows.GfuiWin; +import gplx.gfui.ipts.IptBnd; +import gplx.gfui.ipts.IptBnd_; +import gplx.gfui.ipts.IptEventData; +import gplx.gfui.ipts.IptEventType; +import gplx.gfui.ipts.IptEventType_; +import gplx.gfui.ipts.IptKey_; +import gplx.gfui.ipts.IptMouseBtn_; +import gplx.gfui.ipts.IptMouseMove; +import gplx.gfui.layouts.GftGrid; public class GfuiMoveElemBtn extends GfuiBtn { @Override public GxwElem UnderElem_make(Keyval_hash ctorArgs) {return GxwElemFactory_.Instance.lbl_();} @Override public void ctor_GfuiBox_base(Keyval_hash ctorArgs) { super.ctor_GfuiBox_base(ctorArgs); @@ -78,9 +101,9 @@ class GfuiResizeFormBnd implements IptBnd { public static GfuiResizeFormBnd new_() {return new GfuiResizeFormBnd();} GfuiResizeFormBnd() { args.Add_many(IptMouseBtn_.Right, IptMouseMove.AnyDirection); - IptBndArgsBldr.AddWithData(args, hash, IptKey_.Ctrl.Add(IptKey_.Shift).Add(IptKey_.Up), SizeAdp_.new_(0, -10)); - IptBndArgsBldr.AddWithData(args, hash, IptKey_.Ctrl.Add(IptKey_.Shift).Add(IptKey_.Down), SizeAdp_.new_(0, 10)); - IptBndArgsBldr.AddWithData(args, hash, IptKey_.Ctrl.Add(IptKey_.Shift).Add(IptKey_.Left), SizeAdp_.new_(-10, 0)); - IptBndArgsBldr.AddWithData(args, hash, IptKey_.Ctrl.Add(IptKey_.Shift).Add(IptKey_.Right), SizeAdp_.new_(10, 0)); + IptBndArgsBldr.AddWithData(args, hash, IptKey_.MOD_1ST.Add(IptKey_.Shift).Add(IptKey_.Up), SizeAdp_.new_(0, -10)); + IptBndArgsBldr.AddWithData(args, hash, IptKey_.MOD_1ST.Add(IptKey_.Shift).Add(IptKey_.Down), SizeAdp_.new_(0, 10)); + IptBndArgsBldr.AddWithData(args, hash, IptKey_.MOD_1ST.Add(IptKey_.Shift).Add(IptKey_.Left), SizeAdp_.new_(-10, 0)); + IptBndArgsBldr.AddWithData(args, hash, IptKey_.MOD_1ST.Add(IptKey_.Shift).Add(IptKey_.Right), SizeAdp_.new_(10, 0)); } } diff --git a/150_gfui/src/gplx/gfui/controls/customs/GfuiMoveElemBtn_tst.java b/150_gfui/src/gplx/gfui/controls/customs/GfuiMoveElemBtn_tst.java index 06fed80fa..229c49fe9 100644 --- a/150_gfui/src/gplx/gfui/controls/customs/GfuiMoveElemBtn_tst.java +++ b/150_gfui/src/gplx/gfui/controls/customs/GfuiMoveElemBtn_tst.java @@ -1,20 +1,29 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ -package gplx.gfui.controls.customs; import gplx.*; import gplx.gfui.*; import gplx.gfui.controls.*; -import org.junit.*; import gplx.gfui.ipts.*; import gplx.gfui.controls.windows.*; import gplx.gfui.controls.standards.*; import gplx.gfui.controls.customs.*; +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ +package gplx.gfui.controls.customs; import gplx.Tfds; +import gplx.gfui.controls.standards.GfuiBtn; +import gplx.gfui.controls.standards.GfuiBtn_; +import gplx.gfui.controls.windows.GfuiWin; +import gplx.gfui.controls.windows.GfuiWin_; +import gplx.gfui.ipts.IptEventMgr; +import gplx.gfui.ipts.IptEvtDataKey; +import gplx.gfui.ipts.IptKey; +import gplx.gfui.ipts.IptKey_; +import org.junit.Before; +import org.junit.Test; public class GfuiMoveElemBtn_tst { @Before public void setup() { form = GfuiWin_.app_("form"); form.Size_(100, 100); @@ -22,12 +31,12 @@ public class GfuiMoveElemBtn_tst { GfuiMoveElemBnd bnd = GfuiMoveElemBnd.new_(); bnd.TargetElem_set(form); moveBtn.IptBnds().Add(bnd); } - @Test public void Basic() { + @Test public void Basic() { Tfds.Eq(form.X(), 0); IptEventMgr.ExecKeyDown(moveBtn, IptEvtDataKey.test_(MoveRightArg())); Tfds.Eq(form.X(), 10); } - IptKey MoveRightArg() {return IptKey_.Ctrl.Add(IptKey_.Right);} + IptKey MoveRightArg() {return IptKey_.MOD_1ST.Add(IptKey_.Right);} GfuiWin form; GfuiBtn moveBtn; } diff --git a/150_gfui/src/gplx/gfui/controls/customs/GfuiStatusBarBnd.java b/150_gfui/src/gplx/gfui/controls/customs/GfuiStatusBarBnd.java index 8300ce49f..9e9a9cbf8 100644 --- a/150_gfui/src/gplx/gfui/controls/customs/GfuiStatusBarBnd.java +++ b/150_gfui/src/gplx/gfui/controls/customs/GfuiStatusBarBnd.java @@ -13,16 +13,20 @@ The terms of each license can be found in the source code repository: GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt */ -package gplx.gfui.controls.customs; import gplx.*; import gplx.gfui.*; import gplx.gfui.controls.*; -import gplx.core.interfaces.*; -import gplx.gfui.ipts.*; import gplx.gfui.controls.windows.*; -public class GfuiStatusBarBnd implements InjectAble { - public GfuiStatusBar Bar() {return statusBar;} GfuiStatusBar statusBar = GfuiStatusBar.new_(); - public void Inject(Object owner) { - GfuiWin form = GfuiWin_.as_(owner); if (form == null) throw Err_.new_type_mismatch(GfuiWin.class, owner); - statusBar.Owner_(form, "statusBar"); - IptBnd_.cmd_to_(IptCfg_.Null, form, statusBar, GfuiStatusBar.StatusBarFocus_cmd, IptKey_.add_(IptKey_.Ctrl, IptKey_.Alt, IptKey_.T)); - statusBar.MoveButton().TargetElem_set(form); - } - public static GfuiStatusBarBnd new_() {return new GfuiStatusBarBnd();} GfuiStatusBarBnd() {} -} +package gplx.gfui.controls.customs; import gplx.Err_; +import gplx.core.interfaces.InjectAble; +import gplx.gfui.controls.windows.GfuiWin; +import gplx.gfui.controls.windows.GfuiWin_; +import gplx.gfui.ipts.IptBnd_; +import gplx.gfui.ipts.IptCfg_; +import gplx.gfui.ipts.IptKey_; +public class GfuiStatusBarBnd implements InjectAble { + public GfuiStatusBar Bar() {return statusBar;} GfuiStatusBar statusBar = GfuiStatusBar.new_(); + public void Inject(Object owner) { + GfuiWin form = GfuiWin_.as_(owner); if (form == null) throw Err_.new_type_mismatch(GfuiWin.class, owner); + statusBar.Owner_(form, "statusBar"); + IptBnd_.cmd_to_(IptCfg_.Null, form, statusBar, GfuiStatusBar.StatusBarFocus_cmd, IptKey_.add_(IptKey_.MOD_1ST, IptKey_.MOD_2ND, IptKey_.T)); + statusBar.MoveButton().TargetElem_set(form); + } + public static GfuiStatusBarBnd new_() {return new GfuiStatusBarBnd();} GfuiStatusBarBnd() {} +} diff --git a/150_gfui/src/gplx/gfui/controls/customs/GfuiStatusBoxBnd.java b/150_gfui/src/gplx/gfui/controls/customs/GfuiStatusBoxBnd.java index f6d7df8f7..5f1a23853 100644 --- a/150_gfui/src/gplx/gfui/controls/customs/GfuiStatusBoxBnd.java +++ b/150_gfui/src/gplx/gfui/controls/customs/GfuiStatusBoxBnd.java @@ -1,20 +1,33 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ -package gplx.gfui.controls.customs; import gplx.*; import gplx.gfui.*; import gplx.gfui.controls.*; -import gplx.gfui.draws.*; import gplx.gfui.ipts.*; import gplx.gfui.layouts.*; import gplx.gfui.controls.windows.*; +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ +package gplx.gfui.controls.customs; import gplx.Datetime_now; +import gplx.GfoMsg; +import gplx.Gfo_invk; +import gplx.Gfo_invk_; +import gplx.GfsCtx; +import gplx.UsrMsg; +import gplx.UsrMsgWkr_; +import gplx.gfui.DirInt; +import gplx.gfui.controls.windows.GfuiWin; +import gplx.gfui.draws.ColorAdp_; +import gplx.gfui.ipts.IptBnd_; +import gplx.gfui.ipts.IptCfg_; +import gplx.gfui.ipts.IptKey_; +import gplx.gfui.layouts.GftBand; +import gplx.gfui.layouts.GftGrid; public class GfuiStatusBoxBnd implements Gfo_invk { public GfuiStatusBox Box() {return statusBox;} GfuiStatusBox statusBox = GfuiStatusBox_.new_("statusBox"); void ShowTime() { @@ -31,7 +44,7 @@ public class GfuiStatusBoxBnd implements Gfo_invk { return rv; } void ctor_GfuiStatusBoxBnd(GfuiWin win) { - IptBnd_.cmd_to_(IptCfg_.Null, win, this, GfuiStatusBoxBnd.Invk_ShowTime, IptKey_.add_(IptKey_.Ctrl, IptKey_.Shift, IptKey_.T)); + IptBnd_.cmd_to_(IptCfg_.Null, win, this, GfuiStatusBoxBnd.Invk_ShowTime, IptKey_.add_(IptKey_.MOD_1ST, IptKey_.Shift, IptKey_.T)); statusBox.Owner_(win).Visible_off_().BackColor_(ColorAdp_.Black).TextAlignH_right_().ForeColor_(ColorAdp_.Green); win.Lyt().SubLyts().Add(GftGrid.new_().Bands_dir_(DirInt.Bwd).Bands_add(GftBand.new_().Cells_num_(1).Len1_abs_(13))); } diff --git a/150_gfui/src/gplx/gfui/controls/elems/GfuiElemBase.java b/150_gfui/src/gplx/gfui/controls/elems/GfuiElemBase.java index 582612374..026458cef 100644 --- a/150_gfui/src/gplx/gfui/controls/elems/GfuiElemBase.java +++ b/150_gfui/src/gplx/gfui/controls/elems/GfuiElemBase.java @@ -1,23 +1,73 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ -package gplx.gfui.controls.elems; import gplx.*; import gplx.gfui.*; import gplx.gfui.controls.*; -import gplx.gfui.draws.*; import gplx.gfui.gfxs.*; import gplx.gfui.ipts.*; import gplx.gfui.layouts.*; import gplx.gfui.imgs.*; import gplx.gfui.kits.core.*; -import gplx.gfui.layouts.swts.*; -import gplx.gfui.controls.*; import gplx.gfui.controls.gxws.*; import gplx.gfui.controls.standards.*; import gplx.gfui.controls.windows.*; -import gplx.core.strings.*; import gplx.core.interfaces.*; +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ +package gplx.gfui.controls.elems; import gplx.Bool_; +import gplx.Err_; +import gplx.GfoMsg; +import gplx.Gfo_evt_mgr; +import gplx.Gfo_evt_mgr_; +import gplx.Gfo_invk_; +import gplx.Gfo_invk_cmd; +import gplx.Gfo_invk_cmd_mgr; +import gplx.GfsCtx; +import gplx.Hash_adp; +import gplx.Hash_adp_; +import gplx.Keyval_hash; +import gplx.Object_; +import gplx.Ordered_hash; +import gplx.Ordered_hash_; +import gplx.String_; +import gplx.core.interfaces.InjectAble; +import gplx.gfui.GfuiAlign; +import gplx.gfui.GfuiAlign_; +import gplx.gfui.PointAdp; +import gplx.gfui.PointAdp_; +import gplx.gfui.RectAdp; +import gplx.gfui.RectAdp_; +import gplx.gfui.SizeAdp; +import gplx.gfui.SizeAdp_; +import gplx.gfui.controls.GfuiBorderMgr; +import gplx.gfui.controls.gxws.GxwCore_base; +import gplx.gfui.controls.gxws.GxwElem; +import gplx.gfui.controls.gxws.GxwElemFactory_; +import gplx.gfui.controls.windows.GfuiFocusMgr; +import gplx.gfui.controls.windows.GfuiFocusOrderer; +import gplx.gfui.controls.windows.GfuiWin; +import gplx.gfui.controls.windows.GfuiWinKeyCmdMgr; +import gplx.gfui.draws.ColorAdp; +import gplx.gfui.draws.ColorAdp_; +import gplx.gfui.draws.FontStyleAdp; +import gplx.gfui.draws.FontStyleAdp_; +import gplx.gfui.draws.PenAdp_; +import gplx.gfui.gfxs.GfxStringData; +import gplx.gfui.gfxs.PaintArgs; +import gplx.gfui.ipts.IptBndMgr; +import gplx.gfui.ipts.IptEventMgr; +import gplx.gfui.ipts.IptEventType; +import gplx.gfui.ipts.IptEvtDataKey; +import gplx.gfui.ipts.IptEvtDataKeyHeld; +import gplx.gfui.ipts.IptEvtDataMouse; +import gplx.gfui.ipts.IptKey; +import gplx.gfui.ipts.IptKey_; +import gplx.gfui.kits.core.Gfui_kit; +import gplx.gfui.kits.core.Gfui_kit_; +import gplx.gfui.kits.core.Swing_kit; +import gplx.gfui.layouts.GftGrid; +import gplx.gfui.layouts.GftItem; +import gplx.gfui.layouts.swts.Swt_layout_data; +import gplx.gfui.layouts.swts.Swt_layout_mgr; public class GfuiElemBase implements GfuiElem { //% Layout public Gfo_evt_mgr Evt_mgr() {if (evt_mgr == null) evt_mgr = new Gfo_evt_mgr(this); return evt_mgr;} Gfo_evt_mgr evt_mgr; @@ -55,7 +105,7 @@ public class GfuiElemBase implements GfuiElem { SizeChanged_ignore = false; } public void Zorder_front() {underMgr.Zorder_front();} public void Zorder_back() {underMgr.Zorder_back();} - @gplx.Virtual public void Zorder_front_and_focus() { + public void Zorder_front_and_focus() { this.Zorder_front(); this.Visible_set(true); this.Focus(); @@ -66,28 +116,28 @@ public class GfuiElemBase implements GfuiElem { public void Layout_data_(Swt_layout_data v) {underElem.Core().Layout_data_(v);} //% Visual - @gplx.Virtual public boolean Visible() {return underMgr.Visible();} @gplx.Virtual public void Visible_set(boolean v) {underMgr.Visible_set(v);} + public boolean Visible() {return underMgr.Visible();} public void Visible_set(boolean v) {underMgr.Visible_set(v);} public GfuiElem Visible_on_() {this.Visible_set(true); return this;} public GfuiElem Visible_off_() {this.Visible_set(false); return this;} - @gplx.Virtual public ColorAdp BackColor() {return backColor;} ColorAdp backColor = ColorAdp_.White; - @gplx.Virtual public GfuiElem BackColor_(ColorAdp v) {backColor = v; underMgr.BackColor_set(backColor); return this;} + public ColorAdp BackColor() {return backColor;} ColorAdp backColor = ColorAdp_.White; + public GfuiElem BackColor_(ColorAdp v) {backColor = v; underMgr.BackColor_set(backColor); return this;} public GfuiBorderMgr Border() {return border;} GfuiBorderMgr border = GfuiBorderMgr.new_(); public GfuiElem Border_on_() {border.All_(PenAdp_.new_(ColorAdp_.Black, 1)); return this;} public GfuiElem Border_off_() {border.All_(null); return this;} public GfxStringData TextMgr() {return textMgr;} GfxStringData textMgr; public String Text() {return textMgr.Val();} public GfuiElem Text_any_(Object obj) {return Text_(Object_.Xto_str_strict_or_null_mark(obj));} - @gplx.Virtual public GfuiElem Text_(String v) { + public GfuiElem Text_(String v) { this.TextMgr().Text_set(v); Click_key_set_(v); return this; } - @gplx.Virtual public GfuiElem ForeColor_(ColorAdp v) {textMgr.Color_(v); return this;} + public GfuiElem ForeColor_(ColorAdp v) {textMgr.Color_(v); return this;} public void TextAlignH_(GfuiAlign v) {textMgr.AlignH_(v);} public GfuiElem TextAlignH_left_() {textMgr.AlignH_(GfuiAlign_.Left); return this;} public GfuiElem TextAlignH_right_() {textMgr.AlignH_(GfuiAlign_.Right); return this;} public GfuiElem TextAlignH_center_() {textMgr.AlignH_(GfuiAlign_.Mid); return this;} public String TipText() {return underElem.Core().TipText();} public GfuiElem TipText_(String v) {underElem.Core().TipText_set(v); return this;} - @gplx.Virtual public void Redraw() {underMgr.Invalidate();} + public void Redraw() {underMgr.Invalidate();} public boolean CustomDraw() {return customDraw;} public void CustomDraw_set(boolean v) {customDraw = v;} private boolean customDraw; @@ -101,7 +151,7 @@ public class GfuiElemBase implements GfuiElem { focusKey_order_manual = val; return this; } - @gplx.Virtual public void Focus() { + public void Focus() { if (subElems.Count() == 0) // if no subs, focus self underElem.Core().Focus(); else if (defaultFocusKey != null) { // if default is specified, focus it @@ -124,10 +174,10 @@ public class GfuiElemBase implements GfuiElem { public IptBndMgr IptBnds() {return iptBnds;} IptBndMgr iptBnds = IptBndMgr.new_(); //% ActionKey - @gplx.Virtual public void Click() {} - @gplx.Virtual public boolean Click_able() {return false;} + public void Click() {} + public boolean Click_able() {return false;} public IptKey Click_key() {return clickKey;} - @gplx.Internal @gplx.Virtual protected void Click_key_set_(String v) {clickKey = GfuiWinKeyCmdMgr.ExtractKeyFromText(v);} IptKey clickKey = IptKey_.None; + @gplx.Internal protected void Click_key_set_(String v) {clickKey = GfuiWinKeyCmdMgr.ExtractKeyFromText(v);} IptKey clickKey = IptKey_.None; //% Owner public String Key_of_GfuiElem() {return keyIdf;} public GfuiElem Key_of_GfuiElem_(String val) {keyIdf = val; return this;} private String keyIdf; @@ -140,9 +190,9 @@ public class GfuiElemBase implements GfuiElem { } //% Form - @gplx.Virtual public GfuiWin OwnerWin() {return ownerForm;} public GfuiElem OwnerWin_(GfuiWin val) {ownerForm = val; return this;} GfuiWin ownerForm = null; - @gplx.Virtual public boolean Opened_done() {return ownerForm == null ? false : ownerForm.Opened_done();} - @gplx.Virtual public void Opened_cbk() { + public GfuiWin OwnerWin() {return ownerForm;} public GfuiElem OwnerWin_(GfuiWin val) {ownerForm = val; return this;} GfuiWin ownerForm = null; + public boolean Opened_done() {return ownerForm == null ? false : ownerForm.Opened_done();} + public void Opened_cbk() { for (int i = 0; i < subElems.Count(); i++) { GfuiElem elem = subElems.Get_at(i); elem.Opened_cbk(); @@ -154,23 +204,23 @@ public class GfuiElemBase implements GfuiElem { } //% Cbks - @gplx.Virtual public boolean KeyDownCbk(IptEvtDataKey data) {IptEventMgr.ExecKeyDown(this, data); return true;} - @gplx.Virtual public boolean KeyUpCbk(IptEvtDataKey data) {IptEventMgr.ExecKeyUp(this, data); return true;} - @gplx.Virtual public boolean KeyHeldCbk(IptEvtDataKeyHeld data) {IptEventMgr.ExecKeyPress(this, data); return true;} - @gplx.Virtual public boolean MouseDownCbk(IptEvtDataMouse data) {IptEventMgr.ExecMouseDown(this, data); return true;} - @gplx.Virtual public boolean MouseUpCbk(IptEvtDataMouse data) {IptEventMgr.ExecMouseUp(this, data); return true;} - @gplx.Virtual public boolean MouseMoveCbk(IptEvtDataMouse data) {IptEventMgr.ExecMouseMove(this, data); return true;} - @gplx.Virtual public boolean MouseWheelCbk(IptEvtDataMouse data) {IptEventMgr.ExecMouseWheel(this, data); return true;} - @gplx.Virtual public boolean PaintCbk(PaintArgs args) {border.DrawData(args.Graphics()); return true;} - @gplx.Virtual public boolean PaintBackgroundCbk(PaintArgs args) {return true;} - @gplx.Virtual public boolean DisposeCbk() {return true;} - @gplx.Virtual public boolean VisibleChangedCbk() {return true;} - @gplx.Virtual public boolean FocusGotCbk() { + public boolean KeyDownCbk(IptEvtDataKey data) {IptEventMgr.ExecKeyDown(this, data); return true;} + public boolean KeyUpCbk(IptEvtDataKey data) {IptEventMgr.ExecKeyUp(this, data); return true;} + public boolean KeyHeldCbk(IptEvtDataKeyHeld data) {IptEventMgr.ExecKeyPress(this, data); return true;} + public boolean MouseDownCbk(IptEvtDataMouse data) {IptEventMgr.ExecMouseDown(this, data); return true;} + public boolean MouseUpCbk(IptEvtDataMouse data) {IptEventMgr.ExecMouseUp(this, data); return true;} + public boolean MouseMoveCbk(IptEvtDataMouse data) {IptEventMgr.ExecMouseMove(this, data); return true;} + public boolean MouseWheelCbk(IptEvtDataMouse data) {IptEventMgr.ExecMouseWheel(this, data); return true;} + public boolean PaintCbk(PaintArgs args) {border.DrawData(args.Graphics()); return true;} + public boolean PaintBackgroundCbk(PaintArgs args) {return true;} + public boolean DisposeCbk() {return true;} + public boolean VisibleChangedCbk() {return true;} + public boolean FocusGotCbk() { GfuiFocusMgr.Instance.FocusedElem_set(this); return true; } - @gplx.Virtual public boolean FocusLostCbk() {return true;} - @gplx.Virtual public boolean SizeChangedCbk() { + public boolean FocusLostCbk() {return true;} + public boolean SizeChangedCbk() { this.TextMgr().OwnerSize_sync(this.Size()); this.Border().Bounds_sync(RectAdp_.size_(this.Size().Op_subtract(1))); if (SizeChanged_ignore @@ -186,8 +236,8 @@ public class GfuiElemBase implements GfuiElem { //% InjectAble public GfuiElem Inject_(InjectAble sub) {sub.Inject(this); return this;} - @gplx.Virtual public GxwElem UnderElem() {return underElem;} GxwElem underElem; - @gplx.Virtual public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) { + public GxwElem UnderElem() {return underElem;} GxwElem underElem; + public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) { if (ctx.Match(k, GfuiElemKeys.Redraw_cmd)) Redraw(); else if (ctx.Match(k, GfuiElemKeys.Key_set)) { String v = m.ReadStr("v"); @@ -241,15 +291,15 @@ public class GfuiElemBase implements GfuiElem { else if (ctx.Match(k, GfuiElemKeys.Zorder_front_cmd)) Zorder_front(); else if (ctx.Match(k, Invk_OwnerWin_cmd)) return OwnerWin(); else { - if (ctx.Help_browseMode()) { - String_bldr sb = String_bldr_.new_(); - for (int i = 0; i < this.SubElems().Count(); i++) { - GfuiElem subE = (GfuiElem)this.SubElems().Get_at(i); - sb.Add_str_w_crlf(subE.Key_of_GfuiElem()); - } - return sb.To_str(); - } - else { +// if (ctx.Help_browseMode()) { +// String_bldr sb = String_bldr_.new_(); +// for (int i = 0; i < this.SubElems().Count(); i++) { +// GfuiElem subE = (GfuiElem)this.SubElems().Get_at(i); +// sb.Add_str_w_crlf(subE.Key_of_GfuiElem()); +// } +// return sb.To_str(); +// } +// else { Object rv = this.InvkMgr().Invk(ctx, ikey, k, m, this); if (rv != Gfo_invk_.Rv_unhandled) return rv; @@ -257,7 +307,7 @@ public class GfuiElemBase implements GfuiElem { if (findObj == null) findObj = this.subElems.Get_by(k); if (findObj == null) return Gfo_invk_.Rv_unhandled; return findObj; // necessary for gplx.images - } +// } } return this; } public static final String Invk_OwnerWin_cmd = "ownerWin"; @@ -267,7 +317,7 @@ public class GfuiElemBase implements GfuiElem { } public Gfui_kit Kit() {return kit;} private Gfui_kit kit = Gfui_kit_.Mem(); - @gplx.Virtual public void ctor_GfuiBox_base(Keyval_hash ctorArgs) { + public void ctor_GfuiBox_base(Keyval_hash ctorArgs) { this.kit = Swing_kit.Instance; // NOTE: assume that callers want Swing; SWT / Mem should be calling ctor_kit_GfuiElemBase underElem = UnderElem_make(ctorArgs); underElem.Host_set(this); @@ -277,7 +327,7 @@ public class GfuiElemBase implements GfuiElem { this.Focus_able_(Bool_.Cast(ctorArgs.Get_val_or(GfuiElem_.InitKey_focusAble, true))); underMgr.Size_set(SizeAdp_.new_(20, 20)); // NOTE: CS inits to 20,20; JAVA inits to 0,0 } - @gplx.Virtual public void ctor_kit_GfuiElemBase(Gfui_kit kit, String key, GxwElem underElem, Keyval_hash ctorArgs) { + public void ctor_kit_GfuiElemBase(Gfui_kit kit, String key, GxwElem underElem, Keyval_hash ctorArgs) { this.kit = kit; this.keyIdf = key; this.underElem = underElem; @@ -288,7 +338,7 @@ public class GfuiElemBase implements GfuiElem { this.Focus_able_(Bool_.Cast(ctorArgs.Get_val_or(GfuiElem_.InitKey_focusAble, true))); // underMgr.Size_set(SizeAdp_.new_(20, 20)); // NOTE: CS inits to 20,20; JAVA inits to 0,0 } - @gplx.Virtual public GxwElem UnderElem_make(Keyval_hash ctorArgs) {return GxwElemFactory_.Instance.control_();} + public GxwElem UnderElem_make(Keyval_hash ctorArgs) {return GxwElemFactory_.Instance.control_();} public Object SubItms_getObj(String key) {return injected.Get_by(key);} public GfuiElemBase SubItms_add(String key, Object v) {injected.Add(key, v); return this;} public Ordered_hash XtnAtrs() {return xtnAtrs;} Ordered_hash xtnAtrs = Ordered_hash_.New(); diff --git a/150_gfui/src/gplx/gfui/controls/gxws/GxwCbkHost_.java b/150_gfui/src/gplx/gfui/controls/gxws/GxwCbkHost_.java index ab8cbfe6f..2a92869aa 100644 --- a/150_gfui/src/gplx/gfui/controls/gxws/GxwCbkHost_.java +++ b/150_gfui/src/gplx/gfui/controls/gxws/GxwCbkHost_.java @@ -1,25 +1,32 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ -package gplx.gfui.controls.gxws; import gplx.*; import gplx.gfui.*; import gplx.gfui.controls.*; -import java.awt.KeyboardFocusManager; +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ +package gplx.gfui.controls.gxws; +import gplx.gfui.gfxs.PaintArgs; +import gplx.gfui.ipts.IptEvtDataKey; +import gplx.gfui.ipts.IptEvtDataKeyHeld; +import gplx.gfui.ipts.IptEvtDataMouse; +import gplx.gfui.ipts.IptKey_; +import gplx.gfui.ipts.IptMouseBtn_; +import gplx.gfui.ipts.IptMouseWheel; +import gplx.gfui.ipts.IptMouseWheel_; + import java.awt.event.KeyEvent; import java.awt.event.MouseEvent; import java.awt.event.MouseWheelEvent; -import gplx.gfui.ipts.*; import gplx.gfui.gfxs.*; -public class GxwCbkHost_ { +public class GxwCbkHost_ { public static final GxwCbkHost Null = new GfuiHost_cls_null(); public static final boolean ExecKeyEvent(GxwCbkHost host, KeyEvent e) { boolean rv = true; int id = e.getID(), val = e.getKeyCode(); @@ -34,10 +41,10 @@ public class GxwCbkHost_ { } else { if (e.isShiftDown()) val |= IptKey_.Shift.Val(); - if (e.isControlDown()) val |= IptKey_.Ctrl.Val(); + if (e.isControlDown()) val |= IptKey_.Ctrl.Val(); if (e.isAltDown()) val |= IptKey_.Alt.Val(); + if (e.isMetaDown()) val |= IptKey_.Meta.Val(); IptEvtDataKey keyData = IptEvtDataKey.int_(val); -// Tfds.Write(e.getKeyChar(), e.getKeyCode(), val, id); if (id == KeyEvent.KEY_PRESSED) rv = host.KeyDownCbk(keyData); else if (id == KeyEvent.KEY_RELEASED) rv = host.KeyUpCbk(keyData); if (keyData.Handled()) rv = false; // was false diff --git a/150_gfui/src/gplx/gfui/controls/gxws/GxwElemFactory_cls_lang.java b/150_gfui/src/gplx/gfui/controls/gxws/GxwElemFactory_cls_lang.java index 7191b1123..98113a855 100644 --- a/150_gfui/src/gplx/gfui/controls/gxws/GxwElemFactory_cls_lang.java +++ b/150_gfui/src/gplx/gfui/controls/gxws/GxwElemFactory_cls_lang.java @@ -1,18 +1,18 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.gfui.controls.gxws; import gplx.*; import gplx.gfui.*; import gplx.gfui.controls.*; import gplx.gfui.controls.elems.*; import gplx.gfui.controls.windows.*; public class GxwElemFactory_cls_lang extends GxwElemFactory_base { diff --git a/150_gfui/src/gplx/gfui/controls/gxws/GxwElem_lang.java b/150_gfui/src/gplx/gfui/controls/gxws/GxwElem_lang.java index 0ffe816db..6c3189115 100644 --- a/150_gfui/src/gplx/gfui/controls/gxws/GxwElem_lang.java +++ b/150_gfui/src/gplx/gfui/controls/gxws/GxwElem_lang.java @@ -1,31 +1,35 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ -package gplx.gfui.controls.gxws; import gplx.*; import gplx.gfui.*; import gplx.gfui.controls.*; +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ +package gplx.gfui.controls.gxws; import gplx.GfoMsg; +import gplx.GfsCtx; +import gplx.gfui.RectAdp; +import gplx.gfui.gfxs.GfxAdpBase; +import gplx.gfui.gfxs.PaintArgs; +import gplx.gfui.ipts.IptEvtDataMouse; +import gplx.gfui.ipts.IptKey; +import gplx.gfui.ipts.IptMouseBtn; +import gplx.gfui.ipts.IptMouseBtn_; +import gplx.gfui.ipts.IptMouseWheel_; +import javax.swing.JComponent; import java.awt.AWTEvent; import java.awt.Graphics; import java.awt.Graphics2D; -import java.awt.event.ComponentEvent; -import java.awt.event.ComponentListener; -import java.awt.event.FocusEvent; -import java.awt.event.FocusListener; import java.awt.event.KeyEvent; import java.awt.event.MouseEvent; import java.awt.event.MouseWheelEvent; -import javax.swing.JComponent; -import gplx.gfui.ipts.*; import gplx.gfui.gfxs.*; public class GxwElem_lang extends JComponent implements GxwElem { public static final String AlignH_cmd = "AlignH"; public GxwCbkHost Host() {return host;} public void Host_set(GxwCbkHost host) {this.host = host;} GxwCbkHost host = GxwCbkHost_.Null; @@ -58,8 +62,7 @@ public class GxwElem_lang extends JComponent implements GxwElem { public GxwCore_base Core() {return ctrlMgr;} GxwCore_base ctrlMgr; public void SendKeyDown(IptKey key) {} public void SendMouseMove(int x, int y) {} - public void SendMouseDown(IptMouseBtn btn) { - } + public void SendMouseDown(IptMouseBtn btn) {} public void EnableDoubleBuffering() {} // eliminates flickering during OnPaint JComponent comp = null; public GxwElem_lang() {this.ctor_GxwElem();} diff --git a/150_gfui/src/gplx/gfui/controls/gxws/GxwTextBox_lang.java b/150_gfui/src/gplx/gfui/controls/gxws/GxwTextBox_lang.java index f6fad53b5..f25e580a8 100644 --- a/150_gfui/src/gplx/gfui/controls/gxws/GxwTextBox_lang.java +++ b/150_gfui/src/gplx/gfui/controls/gxws/GxwTextBox_lang.java @@ -1,38 +1,43 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ -package gplx.gfui.controls.gxws; import gplx.*; import gplx.gfui.*; import gplx.gfui.controls.*; -import java.awt.AWTEvent; -import java.awt.Color; -import java.awt.Graphics; -import java.awt.Graphics2D; +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ +package gplx.gfui.controls.gxws; import gplx.Err_; +import gplx.GfoMsg; +import gplx.GfsCtx; +import gplx.gfui.GfuiAlign; +import gplx.gfui.GfuiAlign_; +import gplx.gfui.RectAdp_; +import gplx.gfui.controls.elems.GfuiElem; +import gplx.gfui.draws.ColorAdp; +import gplx.gfui.gfxs.GfxAdpBase; +import gplx.gfui.gfxs.PaintArgs; +import gplx.gfui.ipts.IptEvtDataMouse; +import gplx.gfui.ipts.IptKey; +import gplx.gfui.ipts.IptMouseBtn; +import gplx.gfui.ipts.IptMouseBtn_; +import gplx.gfui.ipts.IptMouseWheel; +import gplx.gfui.ipts.IptMouseWheel_; + +import javax.swing.*; +import javax.swing.border.Border; +import javax.swing.text.JTextComponent; +import java.awt.*; import java.awt.event.ActionEvent; -import java.awt.event.FocusEvent; import java.awt.event.KeyEvent; import java.awt.event.MouseEvent; import java.awt.event.MouseWheelEvent; -import javax.swing.AbstractAction; -import javax.swing.BorderFactory; -import javax.swing.JTextArea; -import javax.swing.JTextField; -import javax.swing.KeyStroke; -import javax.swing.border.BevelBorder; -import javax.swing.border.Border; -import javax.swing.text.JTextComponent; -import gplx.gfui.draws.*; -import gplx.gfui.ipts.*; import gplx.gfui.gfxs.*; import gplx.gfui.controls.elems.*; public class GxwTextBox_lang extends JTextArea implements GxwTextFld { public Object UnderElem() {return this;} public GxwCore_base Core() {return ctrlMgr;} GxwCore_base ctrlMgr; @@ -86,7 +91,7 @@ public class GxwTextBox_lang extends JTextArea implements GxwTextFld { } public void EnableDoubleBuffering() {} // eliminates flickering during OnPaint public void CreateControlIfNeeded() {} - @gplx.Virtual public void ctor_MsTextBox_() { + public void ctor_MsTextBox_() { ctor_(); } } @@ -108,7 +113,7 @@ class GxwTextFld_cls_lang extends JTextField implements GxwTextFld { } // NOTE: sometimes fails when skipping ahead in dvd player; v = 0, and start/end = 0 } public int SelLen() {return this.getSelectionEnd() - this.getSelectionStart();} public void SelLen_set(int v) {this.setSelectionEnd(this.SelBgn() + v);} - @gplx.Virtual public void ctor_MsTextBox_() { + public void ctor_MsTextBox_() { ctor_(); } //@#if !plat_wce diff --git a/150_gfui/src/gplx/gfui/controls/standards/GfuiBtn.java b/150_gfui/src/gplx/gfui/controls/standards/GfuiBtn.java index dd89eb192..bc5400fdb 100644 --- a/150_gfui/src/gplx/gfui/controls/standards/GfuiBtn.java +++ b/150_gfui/src/gplx/gfui/controls/standards/GfuiBtn.java @@ -1,18 +1,18 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.gfui.controls.standards; import gplx.*; import gplx.gfui.*; import gplx.gfui.controls.*; import gplx.langs.gfs.*; import gplx.gfui.draws.*; import gplx.gfui.gfxs.*; import gplx.gfui.imgs.*; import gplx.gfui.kits.core.*; import gplx.gfui.controls.gxws.*; import gplx.gfui.controls.elems.*; import gplx.gfui.controls.windows.*; diff --git a/150_gfui/src/gplx/gfui/controls/standards/Gfui_html.java b/150_gfui/src/gplx/gfui/controls/standards/Gfui_html.java index 84f93c8c3..169dcfc6f 100644 --- a/150_gfui/src/gplx/gfui/controls/standards/Gfui_html.java +++ b/150_gfui/src/gplx/gfui/controls/standards/Gfui_html.java @@ -1,18 +1,18 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.gfui.controls.standards; import gplx.*; import gplx.gfui.*; import gplx.gfui.controls.*; import gplx.gfui.kits.core.*; import gplx.gfui.controls.gxws.*; import gplx.gfui.controls.elems.*; public class Gfui_html extends GfuiElemBase { @@ -22,8 +22,8 @@ public class Gfui_html extends GfuiElemBase { public byte Html_doc_html_load_tid() {return under.Html_doc_html_load_tid();} public void Html_doc_html_load_tid_(byte v) {under.Html_doc_html_load_tid_(v);} public void Html_js_enabled_(boolean v) {under.Html_js_enabled_(v);} - @gplx.Virtual public String Html_js_eval_proc_as_str(String name, Object... args) {return under.Html_js_eval_proc_as_str(name, args);} - @gplx.Virtual public boolean Html_js_eval_proc_as_bool(String name, Object... args) {return under.Html_js_eval_proc_as_bool(name, args);} + public String Html_js_eval_proc_as_str(String name, Object... args) {return under.Html_js_eval_proc_as_str(name, args);} + public boolean Html_js_eval_proc_as_bool(String name, Object... args) {return under.Html_js_eval_proc_as_bool(name, args);} public String Html_js_eval_script(String script) {return under.Html_js_eval_script(script);} public Object Html_js_eval_script_as_obj(String script) {return under.Html_js_eval_script_as_obj(script);} public String Html_js_send_json(String name, String data) {return under.Html_js_send_json(name, data);} diff --git a/150_gfui/src/gplx/gfui/controls/standards/Gfui_tab_itm_data_tst.java b/150_gfui/src/gplx/gfui/controls/standards/Gfui_tab_itm_data_tst.java index 39cd37461..a03fd7bd6 100644 --- a/150_gfui/src/gplx/gfui/controls/standards/Gfui_tab_itm_data_tst.java +++ b/150_gfui/src/gplx/gfui/controls/standards/Gfui_tab_itm_data_tst.java @@ -13,18 +13,18 @@ The terms of each license can be found in the source code repository: GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt */ -package gplx.gfui.controls.standards; import gplx.*; import gplx.gfui.*; import gplx.gfui.controls.*; -import org.junit.*; -public class Gfui_tab_itm_data_tst { - @Before public void init() {} private Gfui_tab_itm_data_fxt fxt = new Gfui_tab_itm_data_fxt(); - @Test public void Get_idx_after_closing() { - fxt.Test_Get_idx_after_closing(0, 1, -1); - fxt.Test_Get_idx_after_closing(4, 5, 3); - fxt.Test_Get_idx_after_closing(3, 5, 4); - } -} -class Gfui_tab_itm_data_fxt { - public void Test_Get_idx_after_closing(int cur, int len, int expd) { - Tfds.Eq(expd, Gfui_tab_itm_data.Get_idx_after_closing(cur, len)); - } -} +package gplx.gfui.controls.standards; import gplx.*; import gplx.gfui.*; import gplx.gfui.controls.*; +import org.junit.*; +public class Gfui_tab_itm_data_tst { + @Before public void init() {} private Gfui_tab_itm_data_fxt fxt = new Gfui_tab_itm_data_fxt(); + @Test public void Get_idx_after_closing() { + fxt.Test_Get_idx_after_closing(0, 1, -1); + fxt.Test_Get_idx_after_closing(4, 5, 3); + fxt.Test_Get_idx_after_closing(3, 5, 4); + } +} +class Gfui_tab_itm_data_fxt { + public void Test_Get_idx_after_closing(int cur, int len, int expd) { + Tfds.Eq(expd, Gfui_tab_itm_data.Get_idx_after_closing(cur, len)); + } +} diff --git a/150_gfui/src/gplx/gfui/controls/tabs/TabBnd.java b/150_gfui/src/gplx/gfui/controls/tabs/TabBnd.java index 46b365185..8ede14e28 100644 --- a/150_gfui/src/gplx/gfui/controls/tabs/TabBnd.java +++ b/150_gfui/src/gplx/gfui/controls/tabs/TabBnd.java @@ -1,21 +1,29 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ -package gplx.gfui.controls.tabs; import gplx.*; import gplx.gfui.*; import gplx.gfui.controls.*; -import gplx.core.interfaces.*; -import gplx.gfui.ipts.*; import gplx.gfui.controls.standards.*; +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ +package gplx.gfui.controls.tabs; import gplx.GfoMsg; +import gplx.Gfo_evt_mgr_; +import gplx.Gfo_invk; +import gplx.Gfo_invk_; +import gplx.GfsCtx; +import gplx.core.interfaces.InjectAble; +import gplx.gfui.controls.standards.GfuiBtn; +import gplx.gfui.controls.standards.GfuiBtn_; +import gplx.gfui.ipts.IptBnd_; +import gplx.gfui.ipts.IptCfg_; +import gplx.gfui.ipts.IptKey_; class TabBoxEvt_nameChange { public static String Key = "TabBoxEvt_nameChange"; public static void Send(TabBoxMgr mgr, TabPnlItm itm) { @@ -40,8 +48,8 @@ class TabBoxEvt_tabSelectByBtn { class TabBnd_selectTab implements InjectAble, Gfo_invk { public void Inject(Object obj) { tabBox = TabBox_.cast(obj); - IptBnd_.cmd_to_(IptCfg_.Null, tabBox, this, SelectNext_cmd, IptKey_.add_(IptKey_.Ctrl, IptKey_.Tab), IptKey_.add_(IptKey_.Ctrl, IptKey_.PageDown)); - IptBnd_.cmd_to_(IptCfg_.Null, tabBox, this, SelectPrev_cmd, IptKey_.add_(IptKey_.Ctrl, IptKey_.Tab, IptKey_.Shift), IptKey_.add_(IptKey_.Ctrl, IptKey_.PageUp)); + IptBnd_.cmd_to_(IptCfg_.Null, tabBox, this, SelectNext_cmd, IptKey_.add_(IptKey_.MOD_1ST, IptKey_.Tab), IptKey_.add_(IptKey_.MOD_1ST, IptKey_.PageDown)); + IptBnd_.cmd_to_(IptCfg_.Null, tabBox, this, SelectPrev_cmd, IptKey_.add_(IptKey_.MOD_1ST, IptKey_.Tab, IptKey_.Shift), IptKey_.add_(IptKey_.MOD_1ST, IptKey_.PageUp)); } void Select(GfoMsg msg, int delta) { TabPnlItm curTab = tabBox.Mgr().CurTab(); @@ -60,8 +68,8 @@ class TabBnd_selectTab implements InjectAble, Gfo_invk { class TabBnd_reorderTab implements InjectAble, Gfo_invk { public void Inject(Object owner) { GfuiBtn btn = GfuiBtn_.cast(owner); - IptBnd_.cmd_to_(IptCfg_.Null, btn, this, MovePrev_cmd, IptKey_.add_(IptKey_.Ctrl, IptKey_.Left)); - IptBnd_.cmd_to_(IptCfg_.Null, btn, this, MoveNext_cmd, IptKey_.add_(IptKey_.Ctrl, IptKey_.Right)); + IptBnd_.cmd_to_(IptCfg_.Null, btn, this, MovePrev_cmd, IptKey_.add_(IptKey_.MOD_1ST, IptKey_.Left)); + IptBnd_.cmd_to_(IptCfg_.Null, btn, this, MoveNext_cmd, IptKey_.add_(IptKey_.MOD_1ST, IptKey_.Right)); } @gplx.Internal protected void MoveTab(GfuiBtn curBtn, int delta) { TabPnlItm curItm = tabBox.Mgr().Get_by(curBtn.Key_of_GfuiElem()); diff --git a/150_gfui/src/gplx/gfui/controls/tabs/TabBox_tst.java b/150_gfui/src/gplx/gfui/controls/tabs/TabBox_tst.java index 916265bd7..cccbffcbf 100644 --- a/150_gfui/src/gplx/gfui/controls/tabs/TabBox_tst.java +++ b/150_gfui/src/gplx/gfui/controls/tabs/TabBox_tst.java @@ -1,29 +1,29 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.gfui.controls.tabs; import gplx.*; import gplx.gfui.*; import gplx.gfui.controls.*; import org.junit.*; import gplx.gfui.controls.tabs.*; import gplx.gfui.controls.elems.*; import gplx.gfui.controls.standards.*; public class TabBox_tst { // @Before public void setup() { // fx = TabBoxFxt.new_(); // } TabBoxFxt fx; - @Test public void Add() { + @Test public void Add() { // fx.Make(1).tst_Selected("0").FetchBtnAt(0).tst_X(0); // fx.Make(3).tst_Selected("2").FetchBtnAt(2).tst_X(160); } -// @Test public void Del_at() { +// @Test public void Del_at() { // fx.Make(2).Del_at(1).tst_Btns("0"); // fx.Make(2).Del_at(0).tst_Btns("1"); // fx.Make(3).Del_at(0).tst_Btns("1", "2"); @@ -34,17 +34,17 @@ public class TabBox_tst { // fx.Make(3).Select(1).Del_at(0).tst_Selected("1"); // 0 deleted; 1 still remains active (but will have idx of 0 // fx.Make(3).Select(2).Del_at(2).tst_Selected("1"); // 2 deleted; 1 selected // } -// @Test public void Selected_byAdd() { +// @Test public void Selected_byAdd() { // fx.Make(2).Select(0).tst_Selected("0").Select(1).tst_Selected("1"); // } -// @Test public void Selected_byBtn() { +// @Test public void Selected_byBtn() { // fx.Make(2).tst_Selected("1"); // // GfuiBtn btn = fx.TabBox().SubBtnArea().Get_at(0); // btn.Click(); // fx.tst_Selected("0"); // } -// @Test public void ReorderTab() { +// @Test public void ReorderTab() { // fx.Make(3).Reorder(0, -1).tst_Raised(false); // fx.Make(3).Reorder(2, 1).tst_Raised(false); // fx.Make(3).Reorder(0, 1).tst_Btns("1", "0", "2").tst_Raised(true).tst_FocusOrder(); diff --git a/150_gfui/src/gplx/gfui/controls/windows/GfoConsoleWin.java b/150_gfui/src/gplx/gfui/controls/windows/GfoConsoleWin.java index 3e946fedf..3387b159e 100644 --- a/150_gfui/src/gplx/gfui/controls/windows/GfoConsoleWin.java +++ b/150_gfui/src/gplx/gfui/controls/windows/GfoConsoleWin.java @@ -1,22 +1,52 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ -package gplx.gfui.controls.windows; import gplx.*; import gplx.gfui.*; import gplx.gfui.controls.*; -import gplx.gfui.draws.*; import gplx.gfui.ipts.*; import gplx.gfui.layouts.*; import gplx.gfui.envs.*; import gplx.gfui.controls.elems.*; import gplx.gfui.controls.standards.*; import gplx.gfui.controls.customs.*; -import gplx.core.envs.*; -import gplx.gfml.*; import gplx.langs.gfs.*; +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ +package gplx.gfui.controls.windows; import gplx.Err_; +import gplx.GfoMsg; +import gplx.GfoMsg_; +import gplx.Gfo_invk; +import gplx.Gfo_invk_; +import gplx.Gfo_invk_cmd; +import gplx.GfsCtx; +import gplx.Io_mgr; +import gplx.Io_url; +import gplx.Io_url_; +import gplx.Object_; +import gplx.String_; +import gplx.UsrDlg_; +import gplx.UsrMsg; +import gplx.UsrMsgWkr; +import gplx.UsrMsgWkr_; +import gplx.core.envs.System_; +import gplx.gfml.GfmlDataNde; +import gplx.gfui.PointAdp; +import gplx.gfui.PointAdp_; +import gplx.gfui.controls.customs.GfuiIoDialogUtl; +import gplx.gfui.controls.customs.GfuiStatusBarBnd; +import gplx.gfui.controls.elems.GfuiElem; +import gplx.gfui.controls.standards.GfuiTextBox; +import gplx.gfui.controls.standards.GfuiTextBox_; +import gplx.gfui.draws.FontAdp; +import gplx.gfui.draws.FontStyleAdp_; +import gplx.gfui.envs.ScreenAdp_; +import gplx.gfui.envs.TimerAdp; +import gplx.gfui.ipts.IptBnd_; +import gplx.gfui.ipts.IptCfg_; +import gplx.gfui.ipts.IptKey_; +import gplx.gfui.layouts.GftBand; +import gplx.langs.gfs.GfsCore; public class GfoConsoleWin implements Gfo_invk, UsrMsgWkr { GfuiWin win; GfoConsoleWinCmds cmds; GfuiTextBox statusBox, resultBox; GfuiTextBoxLogger logger; public boolean Enabled() {return enabled;} public GfoConsoleWin Enabled_(boolean v) {enabled = v; return this;} private boolean enabled = true; @@ -40,11 +70,11 @@ public class GfoConsoleWin implements Gfo_invk, UsrMsgWkr { cmds = new GfoConsoleWinCmds(this); cmds.Owner_set(win); cmds.Init(); IptBnd_.cmd_to_(IptCfg_.Null, win, cmds, GfoConsoleWinCmds.Invk_Hide, IptKey_.Escape); - IptBnd_.cmd_to_(IptCfg_.Null, consoleBox, cmds, GfoConsoleWinCmds.Invk_Exec, IptKey_.add_(IptKey_.Ctrl, IptKey_.E)); - IptBnd_.cmd_to_(IptCfg_.Null, consoleBox, cmds, GfoConsoleWinCmds.Invk_Save, IptKey_.add_(IptKey_.Ctrl, IptKey_.S)); - IptBnd_.cmd_to_(IptCfg_.Null, consoleBox, cmds, GfoConsoleWinCmds.Invk_Load, IptKey_.add_(IptKey_.Ctrl, IptKey_.L)); - IptBnd_.cmd_to_(IptCfg_.Null, consoleBox, cmds, GfoConsoleWinCmds.Invk_Help, IptKey_.add_(IptKey_.Ctrl, IptKey_.D)); - IptBnd_.cmd_to_(IptCfg_.Null, consoleBox, cmds, GfoConsoleWinCmds.Invk_Clear, IptKey_.add_(IptKey_.Ctrl, IptKey_.Alt, IptKey_.C)); + IptBnd_.cmd_to_(IptCfg_.Null, consoleBox, cmds, GfoConsoleWinCmds.Invk_Exec, IptKey_.add_(IptKey_.MOD_1ST, IptKey_.E)); + IptBnd_.cmd_to_(IptCfg_.Null, consoleBox, cmds, GfoConsoleWinCmds.Invk_Save, IptKey_.add_(IptKey_.MOD_1ST, IptKey_.S)); + IptBnd_.cmd_to_(IptCfg_.Null, consoleBox, cmds, GfoConsoleWinCmds.Invk_Load, IptKey_.add_(IptKey_.MOD_1ST, IptKey_.L)); + IptBnd_.cmd_to_(IptCfg_.Null, consoleBox, cmds, GfoConsoleWinCmds.Invk_Help, IptKey_.add_(IptKey_.MOD_1ST, IptKey_.D)); + IptBnd_.cmd_to_(IptCfg_.Null, consoleBox, cmds, GfoConsoleWinCmds.Invk_Clear, IptKey_.add_(IptKey_.MOD_1ST, IptKey_.MOD_2ND, IptKey_.C)); logger = new GfuiTextBoxLogger(this).Init(statusBox); // gplx.core.ios.GfioApp.InitGfs(); UsrDlg_.Instance.Reg(UsrMsgWkr_.Type_Note, this); diff --git a/150_gfui/src/gplx/gfui/controls/windows/GfuiCmdForm.java b/150_gfui/src/gplx/gfui/controls/windows/GfuiCmdForm.java index 18acb538d..439cfdeda 100644 --- a/150_gfui/src/gplx/gfui/controls/windows/GfuiCmdForm.java +++ b/150_gfui/src/gplx/gfui/controls/windows/GfuiCmdForm.java @@ -1,21 +1,28 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ -package gplx.gfui.controls.windows; import gplx.*; import gplx.gfui.*; import gplx.gfui.controls.*; -import gplx.core.interfaces.*; -import gplx.gfui.ipts.*; import gplx.gfui.controls.elems.*; +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ +package gplx.gfui.controls.windows; import gplx.GfoMsg; +import gplx.Gfo_invk; +import gplx.Gfo_invk_; +import gplx.GfsCtx; +import gplx.core.interfaces.InjectAble; +import gplx.gfui.controls.elems.GfuiElem; +import gplx.gfui.ipts.IptBnd_; +import gplx.gfui.ipts.IptCfg_; +import gplx.gfui.ipts.IptKey_; +import gplx.gfui.ipts.IptMouseBtn_; public class GfuiCmdForm implements Gfo_invk, InjectAble { public void Inject(Object ownerObj) { GfuiElem owner = (GfuiElem)ownerObj; @@ -33,7 +40,7 @@ public class GfuiCmdForm implements Gfo_invk, InjectAble { GfuiCmdForm cmd = new GfuiCmdForm(); cmd.cmdForm = rv; IptBnd_.cmd_to_(IptCfg_.Null, rv, cmd, HideMe_cmd, IptKey_.Escape); - IptBnd_.cmd_to_(IptCfg_.Null, hostElem, cmd, DoStuff, IptKey_.add_(IptKey_.Ctrl, IptKey_.Space), IptMouseBtn_.Right); + IptBnd_.cmd_to_(IptCfg_.Null, hostElem, cmd, DoStuff, IptKey_.add_(IptKey_.MOD_1ST, IptKey_.Space), IptMouseBtn_.Right); return rv; } diff --git a/150_gfui/src/gplx/gfui/controls/windows/GfuiFocusOrderer_tst.java b/150_gfui/src/gplx/gfui/controls/windows/GfuiFocusOrderer_tst.java index 30e3e27de..bdccc89d1 100644 --- a/150_gfui/src/gplx/gfui/controls/windows/GfuiFocusOrderer_tst.java +++ b/150_gfui/src/gplx/gfui/controls/windows/GfuiFocusOrderer_tst.java @@ -1,18 +1,18 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.gfui.controls.windows; import gplx.*; import gplx.gfui.*; import gplx.gfui.controls.*; import org.junit.*; import gplx.gfui.controls.elems.*; public class GfuiFocusOrderer_tst { @@ -20,28 +20,28 @@ public class GfuiFocusOrderer_tst { owner = GfuiElem_.new_(); list = List_adp_.New(); // list of all controls } - @Test public void Horizontal() { + @Test public void Horizontal() { ini_Subs(owner, list, xy_(40, 0), xy_(20, 0), xy_(0, 0)); tst_FocusIndxs(owner, list, 0, 1, 2); GfuiFocusOrderer.OrderByX(owner); tst_FocusIndxs(owner, list, 2, 1, 0); } - @Test public void Vertical() { + @Test public void Vertical() { ini_Subs(owner, list, xy_(0, 40), xy_(0, 20), xy_(0, 0)); tst_FocusIndxs(owner, list, 0, 1, 2); GfuiFocusOrderer.OrderByY(owner); tst_FocusIndxs(owner, list, 2, 1, 0); } - @Test public void Grid() { + @Test public void Grid() { ini_Subs(owner, list, xy_(20, 20), xy_(0, 20), xy_(20, 0), xy_(0, 0)); tst_FocusIndxs(owner, list, 0, 1, 2, 3); GfuiFocusOrderer.OrderByX(owner); tst_FocusIndxs(owner, list, 3, 2, 1, 0); } - @Test public void Deep() { + @Test public void Deep() { ini_Subs(owner, list, xy_(20, 0), xy_(0, 0)); GfuiElem sub0 = sub_(owner, 0), sub1 = sub_(owner, 1); ini_Subs(sub0, list, xy_(20, 0), xy_(0, 0)); @@ -51,7 +51,7 @@ public class GfuiFocusOrderer_tst { GfuiFocusOrderer.OrderByX(owner); tst_FocusIndxs(owner, list, 3, 0, 5, 4, 2, 1); } - @Test public void Manusl() { + @Test public void Manusl() { ini_Subs(owner, list, xy_(0, 0), xy_(20, 0)); tst_FocusIndxs(owner, list, 0, 1); diff --git a/150_gfui/src/gplx/gfui/controls/windows/GfuiForm_menu.java b/150_gfui/src/gplx/gfui/controls/windows/GfuiForm_menu.java index e098e6b38..e7469f309 100644 --- a/150_gfui/src/gplx/gfui/controls/windows/GfuiForm_menu.java +++ b/150_gfui/src/gplx/gfui/controls/windows/GfuiForm_menu.java @@ -1,20 +1,32 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ -package gplx.gfui.controls.windows; import gplx.*; import gplx.gfui.*; import gplx.gfui.controls.*; -import gplx.gfui.ipts.*; import gplx.gfui.controls.elems.*; +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ +package gplx.gfui.controls.windows; import gplx.GfoMsg; +import gplx.Gfo_invk; +import gplx.Gfo_invk_; +import gplx.GfsCtx; +import gplx.gfui.PointAdp; +import gplx.gfui.RectAdp; +import gplx.gfui.RectAdp_; +import gplx.gfui.SizeAdp; +import gplx.gfui.controls.elems.GfuiElem; +import gplx.gfui.ipts.IptBnd_; +import gplx.gfui.ipts.IptCfg_; +import gplx.gfui.ipts.IptEventType_; +import gplx.gfui.ipts.IptKey_; +import gplx.gfui.ipts.IptMouseBtn_; public class GfuiForm_menu implements Gfo_invk { public GfuiWin Form() {return form;} GfuiWin form; void Visible_toggle(GfoMsg msg) { @@ -45,7 +57,7 @@ public class GfuiForm_menu implements Gfo_invk { // form.CmdsA().Del(GfuiWin.Invk_Minimize); // form.CmdsA().Del(GfuiStatusBoxBnd.Invk_ShowTime); IptBnd_.cmd_to_(IptCfg_.Null, form, this, Visible_hide_cmd, IptKey_.Escape); - IptBnd_.cmd_to_(IptCfg_.Null, owner, this, Visible_toggle_cmd, IptKey_.add_(IptKey_.Ctrl, IptKey_.Space), IptMouseBtn_.Right); + IptBnd_.cmd_to_(IptCfg_.Null, owner, this, Visible_toggle_cmd, IptKey_.add_(IptKey_.MOD_1ST, IptKey_.Space), IptMouseBtn_.Right); form.TaskbarParkingWindowFix(owner.OwnerWin()); // else ContextMenu shows up as WindowsFormsParkingWindow form.QuitMode_(GfuiQuitMode.Suspend); diff --git a/150_gfui/src/gplx/gfui/controls/windows/GfuiMenuBar.java b/150_gfui/src/gplx/gfui/controls/windows/GfuiMenuBar.java index 912988990..5119bd403 100644 --- a/150_gfui/src/gplx/gfui/controls/windows/GfuiMenuBar.java +++ b/150_gfui/src/gplx/gfui/controls/windows/GfuiMenuBar.java @@ -1,34 +1,44 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ -package gplx.gfui.controls.windows; import gplx.*; import gplx.gfui.*; import gplx.gfui.controls.*; -import java.awt.Color; -import java.awt.Font; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import javax.swing.AbstractButton; -import javax.swing.BorderFactory; -import javax.swing.JComponent; -import javax.swing.JFrame; -import javax.swing.JMenu; -import javax.swing.JMenuBar; -import javax.swing.JMenuItem; -import javax.swing.JSeparator; -import javax.swing.border.EmptyBorder; -import gplx.gfui.draws.*; import gplx.gfui.ipts.*; import gplx.gfui.layouts.*; import gplx.gfui.kits.core.*; import gplx.gfui.controls.gxws.*; -import gplx.langs.gfs.*; +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ +package gplx.gfui.controls.windows; import gplx.Char_; +import gplx.Err_; +import gplx.GfoMsg; +import gplx.GfoMsgUtl; +import gplx.Gfo_invk; +import gplx.Gfo_invk_; +import gplx.GfsCtx; +import gplx.Hash_adp; +import gplx.Hash_adp_; +import gplx.Int_; +import gplx.String_; +import gplx.gfui.controls.gxws.GxwWin; +import gplx.gfui.draws.ColorAdp; +import gplx.gfui.draws.ColorAdpCache; +import gplx.gfui.draws.ColorAdp_; +import gplx.gfui.draws.FontStyleAdp; +import gplx.gfui.ipts.IptBnd_; +import gplx.gfui.ipts.IptKey; +import gplx.gfui.ipts.IptKey_; +import gplx.gfui.kits.core.GfuiEnv_; +import gplx.gfui.layouts.GftBand; +import gplx.gfui.layouts.GftGrid; +import gplx.langs.gfs.GfsCore; + +import javax.swing.*; +import java.awt.*; public class GfuiMenuBar implements Gfo_invk { public Object Under() {return winMenu;} public boolean Visible() {return visible;} private boolean visible; @@ -130,7 +140,7 @@ public class GfuiMenuBar implements Gfo_invk { root = GfuiMenuBarItm.root_(winMenu); itms.Add(root.Key(), root); this.win = win; - IptBnd_.cmd_to_(GfuiEnv_.IptBndMgr_win, win, this, Invk_visible_toggle, IptKey_.add_(IptKey_.Ctrl, IptKey_.Shift, IptKey_.F12)); + IptBnd_.cmd_to_(GfuiEnv_.IptBndMgr_win, win, this, Invk_visible_toggle, IptKey_.add_(IptKey_.MOD_1ST, IptKey_.Shift, IptKey_.F12)); win.SubItms_add(SubItms_key, this); } Hash_adp itms = Hash_adp_.New(); GfuiWin win; diff --git a/150_gfui/src/gplx/gfui/controls/windows/GfuiWin.java b/150_gfui/src/gplx/gfui/controls/windows/GfuiWin.java index fc1ef51d0..65a9ab45e 100644 --- a/150_gfui/src/gplx/gfui/controls/windows/GfuiWin.java +++ b/150_gfui/src/gplx/gfui/controls/windows/GfuiWin.java @@ -1,23 +1,51 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ -package gplx.gfui.controls.windows; import gplx.*; import gplx.gfui.*; import gplx.gfui.controls.*; -import java.awt.Window; -import gplx.gfui.ipts.*; import gplx.gfui.layouts.*; import gplx.gfui.kits.core.*; import gplx.gfui.controls.gxws.*; import gplx.gfui.controls.elems.*; import gplx.gfui.controls.customs.*; -import gplx.core.envs.*; import gplx.gfui.imgs.*; -public class GfuiWin extends GfuiElemBase { +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ +package gplx.gfui.controls.windows; import gplx.Datetime_now; +import gplx.GfoMsg; +import gplx.Gfo_evt_mgr_; +import gplx.Gfo_invk_cmd; +import gplx.Gfo_invk_cmd_mgr; +import gplx.GfsCtx; +import gplx.Keyval_hash; +import gplx.List_adp; +import gplx.List_adp_; +import gplx.String_; +import gplx.UsrDlg_; +import gplx.UsrMsg; +import gplx.core.envs.Env_; +import gplx.gfui.SizeAdp; +import gplx.gfui.SizeAdp_; +import gplx.gfui.controls.customs.GfuiStatusBoxBnd; +import gplx.gfui.controls.elems.GfuiElemBase; +import gplx.gfui.controls.elems.GfuiElemKeys; +import gplx.gfui.controls.gxws.GxwElem; +import gplx.gfui.controls.gxws.GxwElemFactory_; +import gplx.gfui.controls.gxws.GxwWin; +import gplx.gfui.imgs.IconAdp; +import gplx.gfui.ipts.IptBnd_; +import gplx.gfui.ipts.IptCfg_; +import gplx.gfui.ipts.IptEventData; +import gplx.gfui.ipts.IptKey_; +import gplx.gfui.kits.core.GfuiEnv_; +import gplx.gfui.kits.core.Gfui_kit; +import gplx.gfui.kits.core.Gfui_kit_; +import gplx.gfui.layouts.GftGrid; + +import java.awt.*; +public class GfuiWin extends GfuiElemBase { private GxwWin win; private List_adp loadList = List_adp_.New(); public void Show() {win.ShowWin();} public void Hide() {win.HideWin();} @@ -25,7 +53,7 @@ public class GfuiWin extends GfuiElemBase { public IconAdp Icon() {return win.IconWin();} public GfuiWin Icon_(IconAdp icon) {win.IconWin_set(icon); return this;} public boolean Pin() {return win.Pin();} public GfuiWin Pin_(boolean v) {win.Pin_set(v); return this;} public GfuiWin Pin_() {return Pin_(true);} public void Pin_toggle() {Pin_(!Pin());} - @gplx.Virtual public void Quit() {GfuiQuitMode.Exec(this, quitMode);} + public void Quit() {GfuiQuitMode.Exec(this, quitMode);} public boolean Maximized() {return win.Maximized();} public void Maximized_(boolean v) {win.Maximized_(v);} public boolean Minimized() {return win.Minimized();} public void Minimized_(boolean v) {win.Minimized_(v);} public GfuiQuitMode QuitMode() {return quitMode;} public GfuiWin QuitMode_(GfuiQuitMode val) {quitMode = val; return this;} private GfuiQuitMode quitMode = GfuiQuitMode.ExitApp; // easier to debug @@ -44,9 +72,9 @@ public class GfuiWin extends GfuiElemBase { win = (GxwWin)underElem; win.OpenedCmd_set(Gfo_invk_cmd.New_by_key(this, Evt_Opened)); Gfo_evt_mgr_.Sub(this, GfuiElemKeys.IptRcvd_evt, keyCmdMgr, GfuiWinKeyCmdMgr.CheckForHotKey_cmd); - IptBnd_.cmd_(IptCfg_.Null, this, StopAppByAltF4_evt, IptKey_.Alt.Add(IptKey_.F4)); -// IptBnd_.cmd_to_(IptCfg_.Null, this, GfoConsoleWin.Instance, GfoConsoleWin.Invk_Show, IptKey_.Ctrl.Add(IptKey_.Alt).Add(IptKey_.E)); - IptBnd_.cmd_(IptCfg_.Null, this, Invk_ShowFocusOwner, IptKey_.add_(IptKey_.Ctrl, IptKey_.Alt, IptKey_.F12)); + IptBnd_.cmd_(IptCfg_.Null, this, StopAppByAltF4_evt, IptKey_.MOD_2ND.Add(IptKey_.F4)); +// IptBnd_.cmd_to_(IptCfg_.Null, this, GfoConsoleWin.Instance, GfoConsoleWin.Invk_Show, IptKey_.MOD_1ST.Add(IptKey_.MOD_2ND).Add(IptKey_.E)); + IptBnd_.cmd_(IptCfg_.Null, this, Invk_ShowFocusOwner, IptKey_.add_(IptKey_.MOD_1ST, IptKey_.MOD_2ND, IptKey_.F12)); loadList.Add(keyCmdMgr); loadList.Add(GfuiTipTextMgr.Instance); focusMgr = GfuiWinFocusMgr.new_(this); } @@ -55,9 +83,9 @@ public class GfuiWin extends GfuiElemBase { win = (GxwWin)this.UnderElem(); win.OpenedCmd_set(Gfo_invk_cmd.New_by_key(this, Evt_Opened)); Gfo_evt_mgr_.Sub(this, GfuiElemKeys.IptRcvd_evt, keyCmdMgr, GfuiWinKeyCmdMgr.CheckForHotKey_cmd); - IptBnd_.cmd_(IptCfg_.Null, this, StopAppByAltF4_evt, IptKey_.Alt.Add(IptKey_.F4)); - IptBnd_.cmd_to_(IptCfg_.Null, this, GfoConsoleWin.Instance, GfoConsoleWin.Invk_Show, IptKey_.Ctrl.Add(IptKey_.Alt).Add(IptKey_.E)); - IptBnd_.cmd_(IptCfg_.Null, this, Invk_ShowFocusOwner, IptKey_.add_(IptKey_.Ctrl, IptKey_.Alt, IptKey_.F12)); + IptBnd_.cmd_(IptCfg_.Null, this, StopAppByAltF4_evt, IptKey_.MOD_2ND.Add(IptKey_.F4)); + IptBnd_.cmd_to_(IptCfg_.Null, this, GfoConsoleWin.Instance, GfoConsoleWin.Invk_Show, IptKey_.MOD_1ST.Add(IptKey_.MOD_2ND).Add(IptKey_.E)); + IptBnd_.cmd_(IptCfg_.Null, this, Invk_ShowFocusOwner, IptKey_.add_(IptKey_.MOD_1ST, IptKey_.MOD_2ND, IptKey_.F12)); loadList.Add(keyCmdMgr); loadList.Add(GfuiTipTextMgr.Instance); focusMgr = GfuiWinFocusMgr.new_(this); } diff --git a/150_gfui/src/gplx/gfui/controls/windows/GfuiWinFocusMgr.java b/150_gfui/src/gplx/gfui/controls/windows/GfuiWinFocusMgr.java index 9f32a13e6..4da1b769c 100644 --- a/150_gfui/src/gplx/gfui/controls/windows/GfuiWinFocusMgr.java +++ b/150_gfui/src/gplx/gfui/controls/windows/GfuiWinFocusMgr.java @@ -1,23 +1,27 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ -package gplx.gfui.controls.windows; import gplx.*; import gplx.gfui.*; import gplx.gfui.controls.*; +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ +package gplx.gfui.controls.windows; import gplx.Err_; +import gplx.List_adp; +import gplx.List_adp_; +import gplx.gfui.controls.elems.GfuiElem; +import gplx.gfui.controls.gxws.GxwElem; +import gplx.gfui.controls.gxws.GxwTextMemo_lang; import java.awt.Component; import java.awt.Container; import java.awt.FocusTraversalPolicy; -import gplx.gfui.controls.gxws.*; import gplx.gfui.controls.elems.*; public class GfuiWinFocusMgr { public List_adp SubElems() {return subElems;} List_adp subElems = List_adp_.New(); public void InitForm() {this.Init(win);} @@ -71,7 +75,7 @@ class FocusTraversalPolicy_cls_base extends FocusTraversalPolicy { GfuiElem elem = null; try {elem = (GfuiElem)elems.Get_at(idx);} catch (Exception e) { - System.out.println(idx); + System.out.println("getComponentAfter:" + e.getMessage() + ":" + idx); Err_.Noop(e); } if (elem == null) return c; // FIXME: why is elem null?; REP: add new tab through history and then close out @@ -107,7 +111,7 @@ class FocusTraversalPolicy_cls_base extends FocusTraversalPolicy { } } catch (Exception e) { - System.out.println(idx); + System.out.println("getComponentBefore:" + e.getMessage() + ":" + idx); Err_.Noop(e); } if (elem == null) return c; // FIXME: why is elem null?; REP: add new tab through history and then close out diff --git a/150_gfui/src/gplx/gfui/controls/windows/GfuiWinKeyCmdMgr.java b/150_gfui/src/gplx/gfui/controls/windows/GfuiWinKeyCmdMgr.java index 5fecdc673..61db87298 100644 --- a/150_gfui/src/gplx/gfui/controls/windows/GfuiWinKeyCmdMgr.java +++ b/150_gfui/src/gplx/gfui/controls/windows/GfuiWinKeyCmdMgr.java @@ -1,18 +1,18 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.gfui.controls.windows; import gplx.*; import gplx.gfui.*; import gplx.gfui.controls.*; import gplx.gfui.ipts.*; import gplx.gfui.controls.elems.*; import gplx.gfui.controls.standards.*; import gplx.core.lists.*; import gplx.core.bits.*; diff --git a/150_gfui/src/gplx/gfui/draws/ColorAdp__tst.java b/150_gfui/src/gplx/gfui/draws/ColorAdp__tst.java index f28df31bf..2f7230087 100644 --- a/150_gfui/src/gplx/gfui/draws/ColorAdp__tst.java +++ b/150_gfui/src/gplx/gfui/draws/ColorAdp__tst.java @@ -1,27 +1,27 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.gfui.draws; import gplx.*; import gplx.gfui.*; import org.junit.*; -public class ColorAdp__tst { - @Test public void parse_hex_() { +public class ColorAdp__tst { + @Test public void parse_hex_() { tst_parse_hex_("#00000000", 0, 0, 0, 0); tst_parse_hex_("#000102FF", 0, 1, 2, 255); tst_parse_hex_("#FF000102", 255, 0, 1, 2); } - @Test public void parse_int_() { + @Test public void parse_int_() { tst_parse_int_(0, 0, 0, 0, 0); tst_parse_int_(255, 0, 0, 0, 255); tst_parse_int_(65535, 0, 0, 255, 255); @@ -29,7 +29,7 @@ public class ColorAdp__tst { tst_parse_int_(Int_.Max_value, 127, 255, 255, 255); tst_parse_int_(-1, 255, 255, 255, 255); } - @Test public void parse() { + @Test public void parse() { tst_parse_("0,0,0,0", 0, 0, 0, 0); // parse all ints tst_parse_("0,0,0", 255, 0, 0, 0); // a=255, parse rest tst_parse_("255", 0, 0, 0, 255); // parse as single int diff --git a/150_gfui/src/gplx/gfui/envs/ClipboardAdp__tst.java b/150_gfui/src/gplx/gfui/envs/ClipboardAdp__tst.java index d4d745976..72a02b9bf 100644 --- a/150_gfui/src/gplx/gfui/envs/ClipboardAdp__tst.java +++ b/150_gfui/src/gplx/gfui/envs/ClipboardAdp__tst.java @@ -13,12 +13,12 @@ The terms of each license can be found in the source code repository: GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt */ -package gplx.gfui.envs; import gplx.*; import gplx.gfui.*; -import org.junit.*; import gplx.gfui.envs.*; -public class ClipboardAdp__tst { - @Test public void Basic() { - ClipboardAdp_.SetText("test"); - Tfds.Eq(true, ClipboardAdp_.IsText()); - Tfds.Eq("test", ClipboardAdp_.GetText()); - } -} +package gplx.gfui.envs; import gplx.*; import gplx.gfui.*; +import org.junit.*; import gplx.gfui.envs.*; +public class ClipboardAdp__tst { + @Test public void Basic() { + ClipboardAdp_.SetText("test"); + Tfds.Eq(true, ClipboardAdp_.IsText()); + Tfds.Eq("test", ClipboardAdp_.GetText()); + } +} diff --git a/150_gfui/src/gplx/gfui/envs/ScreenAdp_tst.java b/150_gfui/src/gplx/gfui/envs/ScreenAdp_tst.java index dea1799d5..f66cd619e 100644 --- a/150_gfui/src/gplx/gfui/envs/ScreenAdp_tst.java +++ b/150_gfui/src/gplx/gfui/envs/ScreenAdp_tst.java @@ -13,15 +13,15 @@ The terms of each license can be found in the source code repository: GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt */ -package gplx.gfui.envs; import gplx.*; import gplx.gfui.*; -import org.junit.*; import gplx.gfui.envs.*; -public class ScreenAdp_tst { - @Test public void parse() { - ScreenAdp actl = ScreenAdp_.parse("{screen{0}"); - Tfds.Eq(0, actl.Index()); - } - @Test public void opposite_() { - ScreenAdp actl = ScreenAdp_.from_point_(PointAdp_.new_(2000, 2000)); - Tfds.Eq(0, actl.Index()); - } -} +package gplx.gfui.envs; import gplx.*; import gplx.gfui.*; +import org.junit.*; import gplx.gfui.envs.*; +public class ScreenAdp_tst { + @Test public void parse() { + ScreenAdp actl = ScreenAdp_.parse("{screen{0}"); + Tfds.Eq(0, actl.Index()); + } + @Test public void opposite_() { + ScreenAdp actl = ScreenAdp_.from_point_(PointAdp_.new_(2000, 2000)); + Tfds.Eq(0, actl.Index()); + } +} diff --git a/150_gfui/src/gplx/gfui/gfxs/GfxItm_base.java b/150_gfui/src/gplx/gfui/gfxs/GfxItm_base.java index 0178709ad..14aef9dfc 100644 --- a/150_gfui/src/gplx/gfui/gfxs/GfxItm_base.java +++ b/150_gfui/src/gplx/gfui/gfxs/GfxItm_base.java @@ -1,18 +1,18 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.gfui.gfxs; import gplx.*; import gplx.gfui.*; import gplx.core.strings.*; public abstract class GfxItm_base implements GfxItm { @@ -24,7 +24,7 @@ public abstract class GfxItm_base implements GfxItm { GfxItm_base comp = GfxItm_base.as_(obj); if (comp == null) return false; return Object_.Eq(pos, comp.pos) && Object_.Eq(size, comp.size); } - @gplx.Virtual public void ctor_GfxItmBase(PointAdp posVal, SizeAdp sizeVal) { + public void ctor_GfxItmBase(PointAdp posVal, SizeAdp sizeVal) { pos = posVal; size = sizeVal; } public static GfxItm_base as_(Object obj) {return obj instanceof GfxItm_base ? (GfxItm_base)obj : null;} diff --git a/150_gfui/src/gplx/gfui/imgs/IconAdp.java b/150_gfui/src/gplx/gfui/imgs/IconAdp.java index d8245b1c0..a3d67f8bf 100644 --- a/150_gfui/src/gplx/gfui/imgs/IconAdp.java +++ b/150_gfui/src/gplx/gfui/imgs/IconAdp.java @@ -1,25 +1,27 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ -package gplx.gfui.imgs; import gplx.*; import gplx.gfui.*; +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2021 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ +package gplx.gfui.imgs; +import gplx.Err_; +import gplx.Io_url; +import gplx.Io_url_; +import gplx.core.gfo_regys.GfoRegy; +import gplx.core.gfo_regys.GfoRegyItm; import javax.swing.Icon; import javax.swing.ImageIcon; import java.awt.Image; -import java.net.MalformedURLException; -import java.net.URL; -import gplx.core.gfo_regys.*; public class IconAdp { public Icon UnderIcon() {return icon;} private final Icon icon; public Image XtoImage() {return ((ImageIcon)icon).getImage();} @@ -37,7 +39,10 @@ public class IconAdp { public static void regy_loadDir_shallow(Io_url imgDir) {GfoRegy.Instance.RegDir(imgDir, "*.png", false, "_", ".");} public static IconAdp regy_(String key) { GfoRegyItm itm = GfoRegy.Instance.FetchOrNull(key); - if (itm == null) {UsrDlg_.Instance.Warn("missing icon; key={0}", key); return null;} + if (itm == null) { +// UsrDlg_.Instance.Warn("missing icon; key={0}", key); + return null; + } if (itm.ValType() != GfoRegyItm.ValType_Url) throw Err_.new_wo_type("regyItm should be of type url", "key", key); return IconAdp.file_(itm.Url()); } diff --git a/150_gfui/src/gplx/gfui/imgs/ImageAdp_tst.java b/150_gfui/src/gplx/gfui/imgs/ImageAdp_tst.java index b9dff8198..88280096c 100644 --- a/150_gfui/src/gplx/gfui/imgs/ImageAdp_tst.java +++ b/150_gfui/src/gplx/gfui/imgs/ImageAdp_tst.java @@ -1,18 +1,18 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.gfui.imgs; import gplx.*; import gplx.gfui.*; import org.junit.*; import gplx.core.consoles.*; @@ -23,14 +23,14 @@ public class ImageAdp_tst { @Before public void setup() { load = Tfds.RscDir.GenSubFil_nest("150_gfui", "imgs", "strawberry_java.bmp"); } ImageAdp img; Io_url load; - @Test public void load_() { + @Test public void load_() { img = ImageAdp_.file_(load); Tfds.Eq(80, img.Width()); Tfds.Eq(80, img.Height()); Tfds.Eq("80,80", img.Size().toString()); Tfds.Eq(img.Url(), load); } - @Test public void SaveAsBmp() { + @Test public void SaveAsBmp() { img = ImageAdp_.file_(load); Io_url save = load.GenNewNameOnly("strawberry_temp"); DateAdp beforeModifiedTime = Io_mgr.Instance.QueryFil(save).ModifiedTime(); diff --git a/150_gfui/src/gplx/gfui/ipts/GfuiClickKeyMgr_tst.java b/150_gfui/src/gplx/gfui/ipts/GfuiClickKeyMgr_tst.java index 5b1532ebe..c692611ff 100644 --- a/150_gfui/src/gplx/gfui/ipts/GfuiClickKeyMgr_tst.java +++ b/150_gfui/src/gplx/gfui/ipts/GfuiClickKeyMgr_tst.java @@ -13,17 +13,17 @@ The terms of each license can be found in the source code repository: GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt */ -package gplx.gfui.ipts; import gplx.*; import gplx.gfui.*; -import org.junit.*; import gplx.gfui.ipts.*; import gplx.gfui.controls.windows.*; -public class GfuiClickKeyMgr_tst { - @Test public void ExtractKeyFromText() { - tst_ExtractKey("&click", IptKey_.C); - tst_ExtractKey("&", IptKey_.None); - tst_ExtractKey("trailing &", IptKey_.None); - tst_ExtractKey("me & you", IptKey_.None); - } - void tst_ExtractKey(String text, IptKey expd) { - IptKey actl = GfuiWinKeyCmdMgr.ExtractKeyFromText(text); - Tfds.Eq(expd, actl); - } -} +package gplx.gfui.ipts; import gplx.*; import gplx.gfui.*; +import org.junit.*; import gplx.gfui.ipts.*; import gplx.gfui.controls.windows.*; +public class GfuiClickKeyMgr_tst { + @Test public void ExtractKeyFromText() { + tst_ExtractKey("&click", IptKey_.C); + tst_ExtractKey("&", IptKey_.None); + tst_ExtractKey("trailing &", IptKey_.None); + tst_ExtractKey("me & you", IptKey_.None); + } + void tst_ExtractKey(String text, IptKey expd) { + IptKey actl = GfuiWinKeyCmdMgr.ExtractKeyFromText(text); + Tfds.Eq(expd, actl); + } +} diff --git a/150_gfui/src/gplx/gfui/ipts/IptArgChainMgr_tst.java b/150_gfui/src/gplx/gfui/ipts/IptArgChainMgr_tst.java index 8ecd8dfd1..b3e091cd3 100644 --- a/150_gfui/src/gplx/gfui/ipts/IptArgChainMgr_tst.java +++ b/150_gfui/src/gplx/gfui/ipts/IptArgChainMgr_tst.java @@ -1,25 +1,25 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.gfui.ipts; import gplx.*; import gplx.gfui.*; import org.junit.*; public class IptArgChainMgr_tst { @Before public void setup() { fx = new IptArgChainMgr_fx(); } IptArgChainMgr_fx fx; - @Test public void Add() { + @Test public void Add() { fx.run_Add(IptKey_.A, IptKey_.B, IptKey_.C); fx.tst_(IptKey_.A, 1); fx.tst_(IptKey_.B, 1); @@ -27,7 +27,7 @@ public class IptArgChainMgr_tst { fx.tst_(IptKey_.B, 0); fx.tst_(IptKey_.C, 0); } - @Test public void Del() { + @Test public void Del() { fx.run_Add(IptKey_.A, IptKey_.B, IptKey_.C); fx.run_Del(IptKey_.A, IptKey_.B, IptKey_.C); fx.tst_(IptKey_.A, 0); diff --git a/150_gfui/src/gplx/gfui/ipts/IptArg_.java b/150_gfui/src/gplx/gfui/ipts/IptArg_.java index 4c30b814b..524c59a5f 100644 --- a/150_gfui/src/gplx/gfui/ipts/IptArg_.java +++ b/150_gfui/src/gplx/gfui/ipts/IptArg_.java @@ -1,20 +1,25 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ -package gplx.gfui.ipts; import gplx.*; import gplx.gfui.*; -public class IptArg_ { +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ +package gplx.gfui.ipts; import gplx.Err; +import gplx.Err_; +import gplx.Int_; +import gplx.Ordered_hash; +import gplx.Ordered_hash_; +import gplx.String_; +public class IptArg_ { public static final IptArg[] Ary_empty = new IptArg[0]; public static final IptArg Null = null; public static final String Wildcard_key = "wildcard"; @@ -91,6 +96,7 @@ class IptMacro { Reg("mod", "c", IptKey_.add_(IptKey_.Ctrl)); Reg("mod", "a", IptKey_.add_(IptKey_.Alt)); Reg("mod", "s", IptKey_.add_(IptKey_.Shift)); + Reg("mod", "m", IptKey_.add_(IptKey_.Meta)); Reg("mod", "ca", IptKey_.add_(IptKey_.Ctrl, IptKey_.Alt)); Reg("mod", "cs", IptKey_.add_(IptKey_.Ctrl, IptKey_.Shift)); Reg("mod", "as", IptKey_.add_(IptKey_.Alt, IptKey_.Shift)); diff --git a/150_gfui/src/gplx/gfui/ipts/IptArg_parser_tst.java b/150_gfui/src/gplx/gfui/ipts/IptArg_parser_tst.java index d9d3f8a02..d67303919 100644 --- a/150_gfui/src/gplx/gfui/ipts/IptArg_parser_tst.java +++ b/150_gfui/src/gplx/gfui/ipts/IptArg_parser_tst.java @@ -1,22 +1,22 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ -package gplx.gfui.ipts; import gplx.*; import gplx.gfui.*; -import org.junit.*; import gplx.gfui.ipts.*; +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ +package gplx.gfui.ipts; import gplx.Tfds; +import org.junit.Test; public class IptArg_parser_tst { - @Test public void KeyBasic() { + @Test public void KeyBasic() { tst_parse_Key_("key.a", IptKey_.A); tst_parse_Key_("key.d0", IptKey_.D0); tst_parse_Key_("key.semicolon", IptKey_.Semicolon); @@ -25,34 +25,35 @@ public class IptArg_parser_tst { tst_parse_Key_("key.ctrl", IptKey_.Ctrl); tst_parse_Key_("key.none", IptKey_.None); } void tst_parse_Key_(String raw, IptKey expd) {Tfds.Eq(expd.Val(), IptKey_.parse(raw).Val());} - @Test public void KbdCmdModifiers() { + @Test public void KbdCmdModifiers() { tst_parse_Key_("key.ctrl+key.enter", IptKey_.Ctrl.Add(IptKey_.Enter)); tst_parse_Key_("key.alt+key.escape", IptKey_.Alt.Add(IptKey_.Escape)); tst_parse_Key_("key.shift+key.f1", IptKey_.Shift.Add(IptKey_.F1)); + tst_parse_Key_("key.meta+key.f1", IptKey_.Meta.Add(IptKey_.F1)); tst_parse_Key_("key.shift+key.ctrl", IptKey_.Ctrl.Add(IptKey_.Shift)); tst_parse_Key_("key.ctrl+key.alt+key.slash", IptKey_.Ctrl.Add(IptKey_.Alt).Add(IptKey_.Slash)); } - @Test public void KeyWhitespace() { + @Test public void KeyWhitespace() { tst_parse_Key_("key.ctrl + key.alt + key.slash", IptKey_.Ctrl.Add(IptKey_.Alt).Add(IptKey_.Slash)); } - @Test public void MouseBtn() { + @Test public void MouseBtn() { tst_parse_MouseBtn_("mouse.left", IptMouseBtn_.Left); tst_parse_MouseBtn_("mouse.right", IptMouseBtn_.Right); tst_parse_MouseBtn_("mouse.middle", IptMouseBtn_.Middle); tst_parse_MouseBtn_("mouse.x1", IptMouseBtn_.X1); tst_parse_MouseBtn_("mouse.x2", IptMouseBtn_.X2); } void tst_parse_MouseBtn_(String raw, IptMouseBtn expd) {Tfds.Eq(expd, IptMouseBtn_.parse(raw));} - @Test public void MouseWheel() { + @Test public void MouseWheel() { tst_parse_MouseWheel_("wheel.up", IptMouseWheel_.Up); tst_parse_MouseWheel_("wheel.down", IptMouseWheel_.Down); } void tst_parse_MouseWheel_(String raw, IptMouseWheel expd) {Tfds.Eq(expd, IptMouseWheel_.parse(raw));} - @Test public void Mod() { + @Test public void Mod() { tst_parse_("mod.c", IptKey_.Ctrl); tst_parse_("mod.cs", IptKey_.add_(IptKey_.Ctrl, IptKey_.Shift)); tst_parse_("mod.cas", IptKey_.add_(IptKey_.Ctrl, IptKey_.Alt, IptKey_.Shift)); tst_parse_("mod.c+key.c", IptKey_.add_(IptKey_.Ctrl, IptKey_.C)); } - @Test public void All() { + @Test public void All() { tst_parse_("key.c", IptKey_.C); tst_parse_("mouse.left", IptMouseBtn_.Left); tst_parse_("wheel.up", IptMouseWheel_.Up); diff --git a/150_gfui/src/gplx/gfui/ipts/IptBndMgr.java b/150_gfui/src/gplx/gfui/ipts/IptBndMgr.java index 187a7329b..48049a9b2 100644 --- a/150_gfui/src/gplx/gfui/ipts/IptBndMgr.java +++ b/150_gfui/src/gplx/gfui/ipts/IptBndMgr.java @@ -1,20 +1,32 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ -package gplx.gfui.ipts; import gplx.*; import gplx.gfui.*; -import gplx.core.interfaces.*; +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ +package gplx.gfui.ipts; import gplx.Err_; +import gplx.GfoMsg; +import gplx.GfoMsg_; +import gplx.Hash_adp; +import gplx.Hash_adp_; +import gplx.List_adp; +import gplx.List_adp_; +import gplx.Ordered_hash; +import gplx.Ordered_hash_; +import gplx.String_; +import gplx.UsrDlg_; +import gplx.UsrMsg; +import gplx.core.interfaces.SrlAble; +import gplx.core.interfaces.SrlAble_; public class IptBndMgr implements SrlAble { public IptEventType EventsToFwd() {return eventsToFwd;} public void EventsToFwd_set(IptEventType v) {eventsToFwd = v;} IptEventType eventsToFwd = IptEventType_.KeyDown; @@ -168,7 +180,7 @@ public class IptBndMgr implements SrlAble { else throw Err_.new_unhandled(v); } } -class IptBndHash implements SrlAble { +class IptBndHash implements SrlAble { private IptBndListItm wildcard_list; public IptEventType EventType() {return eventType;} IptEventType eventType; public int Count() {return hash.Count();} @@ -208,7 +220,7 @@ class IptBndHash implements SrlAble { Ordered_hash hash = Ordered_hash_.New(); public IptBndHash(IptEventType eventType) {this.eventType = eventType;} } -class IptBndListItm implements SrlAble { +class IptBndListItm implements SrlAble { public String IptKey() {return iptKey;} private String iptKey; public int Count() {return list.Count();} public IptBnd Get_at(int i) {return (IptBnd)list.Get_at(i);} diff --git a/150_gfui/src/gplx/gfui/ipts/IptBndMgr_tst.java b/150_gfui/src/gplx/gfui/ipts/IptBndMgr_tst.java index 710397632..fc51f8293 100644 --- a/150_gfui/src/gplx/gfui/ipts/IptBndMgr_tst.java +++ b/150_gfui/src/gplx/gfui/ipts/IptBndMgr_tst.java @@ -1,25 +1,25 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.gfui.ipts; import gplx.*; import gplx.gfui.*; import org.junit.*; import gplx.core.strings.*; public class IptBndMgr_tst { @Before public void setup() { fx = new IptBndMgr_fx(); } IptBndMgr_fx fx; - @Test public void Add() { + @Test public void Add() { fx.ini_Clear().run_Add("key.a").tst_Exec_same("key.a").tst_Exec_none("key.b"); fx.ini_Clear().run_Add("key.ctrl+key.a").tst_Exec_same("key.ctrl+key.a").tst_Exec_none("key.ctrl").tst_Exec_none("key.a"); fx.ini_Clear().run_Add("key.a|key.b").tst_Exec_same("key.a").tst_Exec_same("key.b").tst_Exec_none("key.c"); diff --git a/150_gfui/src/gplx/gfui/ipts/IptBnd_.java b/150_gfui/src/gplx/gfui/ipts/IptBnd_.java index d7b2998c9..8f069dc9b 100644 --- a/150_gfui/src/gplx/gfui/ipts/IptBnd_.java +++ b/150_gfui/src/gplx/gfui/ipts/IptBnd_.java @@ -1,18 +1,18 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.gfui.ipts; import gplx.*; import gplx.gfui.*; import gplx.core.strings.*; public class IptBnd_ { diff --git a/150_gfui/src/gplx/gfui/ipts/IptCfg_tst.java b/150_gfui/src/gplx/gfui/ipts/IptCfg_tst.java index 6a4329fd4..59b1b0efd 100644 --- a/150_gfui/src/gplx/gfui/ipts/IptCfg_tst.java +++ b/150_gfui/src/gplx/gfui/ipts/IptCfg_tst.java @@ -1,18 +1,18 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.gfui.ipts; import gplx.*; import gplx.gfui.*; import org.junit.*; public class IptCfg_tst { @@ -22,16 +22,16 @@ public class IptCfg_tst { cfg = new IptCfg_mok(); key = IptBndsOwner_mok.Invk_Reg; } IptBndsOwner_mok box; IptCfg_mok cfg; String key; - @Test public void Basic() { + @Test public void Basic() { cfg.run_GetOrDflt(box, key, IptKey_.A); box.tst_SendKey(IptKey_.A, 1); } - @Test public void Del() { + @Test public void Del() { cfg.run_GetOrDflt(box, key, IptKey_.A); box.IptBnds().Cfgs_delAll(); box.tst_SendKey(IptKey_.A, 0); } - @Test public void Change() { + @Test public void Change() { cfg.run_GetOrDflt(box, key, IptKey_.A); cfg.run_Set(key, IptKey_.B); box.tst_SendKey(IptKey_.B, 1); @@ -40,19 +40,19 @@ public class IptCfg_tst { box.tst_SendKey(IptKey_.C, 1); box.tst_SendKey(IptKey_.B, 0); } - @Test public void SetBeforeInit() { + @Test public void SetBeforeInit() { cfg.run_Set(key, IptKey_.B); cfg.run_GetOrDflt(box, key, IptKey_.A); box.tst_SendKey(IptKey_.B, 1); box.tst_SendKey(IptKey_.A, 0); } - @Test public void SetBeforeInit_msg() { + @Test public void SetBeforeInit_msg() { cfg.run_Set_msg(key, 2, IptKey_.B); cfg.run_GetOrDflt(box, key, IptKey_.A); // iptBnd exists; ignore Key_.A (and also msg=1) box.tst_SendKey(IptKey_.B, 2); box.tst_SendKey(IptKey_.A, 0); } - @Test public void Chained() { + @Test public void Chained() { cfg.run_GetOrDflt(box, key, IptKeyChain.parse("key.ctrl+key.a,key.b")); cfg.run_Set(key, IptKey_.A); box.tst_SendKey(IptKey_.A, 1); diff --git a/150_gfui/src/gplx/gfui/ipts/IptEventMgr.java b/150_gfui/src/gplx/gfui/ipts/IptEventMgr.java index 1c70a2ecb..daa5150b3 100644 --- a/150_gfui/src/gplx/gfui/ipts/IptEventMgr.java +++ b/150_gfui/src/gplx/gfui/ipts/IptEventMgr.java @@ -1,28 +1,32 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ -package gplx.gfui.ipts; import gplx.*; import gplx.gfui.*; -import gplx.gfui.envs.*; import gplx.gfui.controls.elems.*; +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ +package gplx.gfui.ipts; import gplx.GfoMsg; +import gplx.GfoMsg_; +import gplx.Gfo_evt_mgr_; +import gplx.Gfo_invk; +import gplx.Gfo_invk_; +import gplx.GfsCtx; +import gplx.gfui.controls.elems.GfuiElem; +import gplx.gfui.controls.elems.GfuiElemKeys; +import gplx.gfui.envs.TimerAdp; public class IptEventMgr implements Gfo_invk { public static void ExecKeyDown(GfuiElem sender, IptEvtDataKey keyState) { keyHandled = false; keyStateCur = keyState; // cache for simultaneous ipt events (ex: key.ctrl + mouse.left) IptEventData iptData = IptEventData.new_(sender, IptEventType_.KeyDown, keyState.Key(), keyState, mouseStateCur); -// if (keyState.Key().Eq(IptKey_.add_(IptKey_.F1))) { -// Tfds.Write(keyState.Key(), keyState.Key().Val()); -// } - sender.IptBnds().Process(iptData); + sender.IptBnds().Process(iptData); SendData(iptData); keyHandled = keyState.Handled(); // WORKAROUND (WinForms): cache keyHandled b/c KeyDown.Handled=true does not make KeyPress.Handled=true; } diff --git a/150_gfui/src/gplx/gfui/ipts/IptEventType_tst.java b/150_gfui/src/gplx/gfui/ipts/IptEventType_tst.java index 089f2b325..60886bb61 100644 --- a/150_gfui/src/gplx/gfui/ipts/IptEventType_tst.java +++ b/150_gfui/src/gplx/gfui/ipts/IptEventType_tst.java @@ -1,22 +1,22 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.gfui.ipts; import gplx.*; import gplx.gfui.*; import org.junit.*; import gplx.gfui.ipts.*; public class IptEventType_tst { - @Test public void Has() { + @Test public void Has() { tst_Has(IptEventType_.KeyDown, IptEventType_.KeyDown, true); tst_Has(IptEventType_.KeyUp, IptEventType_.KeyDown, false); tst_Has(IptEventType_.None, IptEventType_.KeyDown, false); @@ -25,7 +25,7 @@ public class IptEventType_tst { tst_Has(IptEventType_.MouseDown.Add(IptEventType_.MouseUp), IptEventType_.KeyDown, false); tst_Has(IptEventType_.KeyDown.Add(IptEventType_.KeyUp), IptEventType_.None, false); } void tst_Has(IptEventType val, IptEventType find, boolean expd) {Tfds.Eq(expd, IptEventType_.Has(val, find));} - @Test public void add_() { + @Test public void add_() { tst_add(IptEventType_.KeyDown, IptEventType_.KeyDown, IptEventType_.KeyDown.Val()); tst_add(IptEventType_.KeyDown, IptEventType_.KeyUp, IptEventType_.KeyDown.Val() + IptEventType_.KeyUp.Val()); } void tst_add(IptEventType lhs, IptEventType rhs, int expd) {Tfds.Eq(expd, IptEventType_.add_(lhs, rhs).Val());} diff --git a/150_gfui/src/gplx/gfui/ipts/IptKeyStrMgr_tst.java b/150_gfui/src/gplx/gfui/ipts/IptKeyStrMgr_tst.java index f7628302b..9da8426e5 100644 --- a/150_gfui/src/gplx/gfui/ipts/IptKeyStrMgr_tst.java +++ b/150_gfui/src/gplx/gfui/ipts/IptKeyStrMgr_tst.java @@ -1,22 +1,22 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.gfui.ipts; import gplx.*; import gplx.gfui.*; import org.junit.*; public class IptKeyStrMgr_tst { - @Test public void KeyBasic() { + @Test public void KeyBasic() { tst_XtoUiStr(IptKey_.A, "a"); tst_XtoUiStr(IptKey_.Z, "z"); tst_XtoUiStr(IptKey_.Shift.Add(IptKey_.A), "A"); @@ -43,7 +43,7 @@ public class IptKeyStrMgr_tst { tst_XtoUiStrShifted(IptKey_.OpenBracket, "[", "{"); tst_XtoUiStrShifted(IptKey_.CloseBracket, "]", "}"); } - @Test public void FetchByKeyPress() { + @Test public void FetchByKeyPress() { tst_FetchByKeyPress('a', IptKey_.add_(IptKey_.A)); tst_FetchByKeyPress('A', IptKey_.add_(IptKey_.A, IptKey_.Shift)); tst_FetchByKeyPress('1', IptKey_.add_(IptKey_.D1)); diff --git a/150_gfui/src/gplx/gfui/ipts/IptKey_.java b/150_gfui/src/gplx/gfui/ipts/IptKey_.java index 8f19571e5..aa3d2f422 100644 --- a/150_gfui/src/gplx/gfui/ipts/IptKey_.java +++ b/150_gfui/src/gplx/gfui/ipts/IptKey_.java @@ -1,23 +1,36 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ -package gplx.gfui.ipts; import gplx.*; import gplx.gfui.*; +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ +package gplx.gfui.ipts; +import gplx.Bool_; +import gplx.Err_; +import gplx.Int_; +import gplx.List_adp; +import gplx.List_adp_; +import gplx.Ordered_hash; +import gplx.Ordered_hash_; +import gplx.String_; +import gplx.core.bits.Bitmask_; +import gplx.core.envs.Op_sys; +import gplx.core.primitives.EnmMgr; +import gplx.core.primitives.Int_obj_ref; +import gplx.core.stores.DataRdr; import java.awt.event.KeyEvent; -import gplx.core.primitives.*; import gplx.core.stores.*; import gplx.core.bits.*; public class IptKey_ { - private static EnmMgr enm_mgr = EnmMgr.new_().BitRngBgn_(65536).BitRngEnd_(262144).Prefix_("key."); + public static final int KeyCode_Shift = 65536, KeyCode_Ctrl = 131072, KeyCode_Alt = 262144, KeyCode_Meta = 524288; + private static EnmMgr enm_mgr = EnmMgr.new_().BitRngBgn_(KeyCode_Shift).BitRngEnd_(KeyCode_Meta).Prefix_("key."); public static IptKey[] Ary(IptKey... ary) {return ary;} public static final IptKey[] Ary_empty = new IptKey[0]; public static IptKey as_(Object obj) {return obj instanceof IptKey ? (IptKey)obj : null;} @@ -75,7 +88,6 @@ public class IptKey_ { enm_mgr.RegObj(val, name, rv); return rv; } - public static final int KeyCode_Shift = 65536, KeyCode_Ctrl = 131072, KeyCode_Alt = 262144; public static final IptKey // NOTE: integer values represent .NET keycodes; NOTE: SWT keycodes are converted to SWING keycodes in Swt_core_lnrs // none @@ -179,8 +191,15 @@ public class IptKey_ { , Shift = new_(KeyCode_Shift, "shift") , Ctrl = new_(KeyCode_Ctrl, "ctrl") , Alt = new_(KeyCode_Alt, "alt") - , ShiftKey = new_(16, "shiftKey") , CtrlKey = new_(17, "ctrlKey") , AltKey = new_(18, "altKey") // NOTE: used for .NET NPI + , Meta = new_(KeyCode_Meta, "meta") + // NOTE: used for .NET NPI + , ShiftKey = new_(16, "shiftKey") + , CtrlKey = new_(17, "ctrlKey") + , AltKey = new_(18, "altKey") ; + public static final IptKey + MOD_1ST = Op_sys.Cur().Tid_is_osx() ? Meta : Ctrl, + MOD_2ND = Alt; private static Ordered_hash ui_str_hash; public static Ordered_hash Ui_str_hash() { if (ui_str_hash == null) { @@ -222,9 +241,10 @@ public class IptKey_ { public static String To_str(int orig_val) { String mod_str = "", rv = ""; int temp_val = orig_val; - boolean mod_c = Bitmask_.Has_int(temp_val, IptKey_.Ctrl.Val()); if (mod_c) {mod_str += "c"; temp_val = Bitmask_.Flip_int(Bool_.N, temp_val, IptKey_.Ctrl.Val());} - boolean mod_a = Bitmask_.Has_int(temp_val, IptKey_.Alt.Val()); if (mod_a) {mod_str += "a"; temp_val = Bitmask_.Flip_int(Bool_.N, temp_val, IptKey_.Alt.Val());} - boolean mod_s = Bitmask_.Has_int(temp_val, IptKey_.Shift.Val()); if (mod_s) {mod_str += "s"; temp_val = Bitmask_.Flip_int(Bool_.N, temp_val, IptKey_.Shift.Val());} + boolean mod_c = Bitmask_.Has_int(temp_val, IptKey_.Ctrl.Val()); if (mod_c) {mod_str += "c"; temp_val = Bitmask_.Flip_int(Bool_.N, temp_val, IptKey_.Ctrl.Val());} + boolean mod_a = Bitmask_.Has_int(temp_val, IptKey_.Alt.Val()); if (mod_a) {mod_str += "a"; temp_val = Bitmask_.Flip_int(Bool_.N, temp_val, IptKey_.Alt.Val());} + boolean mod_s = Bitmask_.Has_int(temp_val, IptKey_.Shift.Val()); if (mod_s) {mod_str += "s"; temp_val = Bitmask_.Flip_int(Bool_.N, temp_val, IptKey_.Shift.Val());} + boolean mod_m = Bitmask_.Has_int(temp_val, IptKey_.Meta.Val()); if (mod_m) {mod_str += "m"; temp_val = Bitmask_.Flip_int(Bool_.N, temp_val, IptKey_.Meta.Val());} if (String_.Len_gt_0(mod_str)) { rv = "mod." + mod_str; // handle modifiers only, like "mod.cs"; else will be "mod.cs+key.#0" diff --git a/150_gfui/src/gplx/gfui/ipts/IptKey__tst.java b/150_gfui/src/gplx/gfui/ipts/IptKey__tst.java index c447f9491..7fcc9088e 100644 --- a/150_gfui/src/gplx/gfui/ipts/IptKey__tst.java +++ b/150_gfui/src/gplx/gfui/ipts/IptKey__tst.java @@ -1,31 +1,33 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ -package gplx.gfui.ipts; import gplx.*; import gplx.gfui.*; -import org.junit.*; +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ +package gplx.gfui.ipts; +import gplx.Tfds; +import org.junit.Test; public class IptKey__tst { private final IptKey__fxt fxt = new IptKey__fxt(); - @Test public void To_str() { + @Test public void To_str() { fxt.Test_to_str(196608, "mod.cs"); } - @Test public void To_str__numeric() { + @Test public void To_str__numeric() { fxt.Test_to_str(12345, "key.#12345"); } - @Test public void Parse() { + @Test public void Parse() { fxt.Test_parse("key.#10", 10); } + // public static final int KeyCode_Shift = 65536, KeyCode_Ctrl = 131072, KeyCode_Alt = 262144; } class IptKey__fxt { public void Test_to_str(int keycode, String expd) { diff --git a/150_gfui/src/gplx/gfui/kits/core/Gfui_kit_base.java b/150_gfui/src/gplx/gfui/kits/core/Gfui_kit_base.java index 99687d193..eeac42e83 100644 --- a/150_gfui/src/gplx/gfui/kits/core/Gfui_kit_base.java +++ b/150_gfui/src/gplx/gfui/kits/core/Gfui_kit_base.java @@ -1,18 +1,18 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.gfui.kits.core; import gplx.*; import gplx.gfui.*; import gplx.gfui.kits.*; import gplx.gfui.imgs.*; import gplx.gfui.controls.gxws.*; import gplx.gfui.controls.elems.*; import gplx.gfui.controls.standards.*; import gplx.gfui.controls.customs.*; import gplx.gfui.controls.windows.*; public abstract class Gfui_kit_base implements Gfui_kit { @@ -26,9 +26,9 @@ public abstract class Gfui_kit_base implements Gfui_kit { public void Cfg_set(String type, String key, Object val) {} public boolean Kit_mode__ready() {return true;} public void Kit_init(Gfo_usr_dlg gui_wtr) {} - @gplx.Virtual public void Kit_run() {} - @gplx.Virtual public void Kit_term() {kit_term_cbk.Exec();} - @gplx.Virtual public void Ask_ok(String grp_key, String msg_key, String fmt, Object... args) {} + public void Kit_run() {} + public void Kit_term() {kit_term_cbk.Exec();} + public void Ask_ok(String grp_key, String msg_key, String fmt, Object... args) {} public boolean Ask_yes_no(String grp_key, String msg_key, String fmt, Object... args) {return false;} public int Ask_yes_no_cancel(String grp_key, String msg_key, String fmt, Object... args) {return Gfui_dlg_msg_.Btn_cancel;} public boolean Ask_ok_cancel(String grp_key, String msg_key, String fmt, Object... args) {return false;} @@ -41,7 +41,7 @@ public abstract class Gfui_kit_base implements Gfui_kit { return rv; } public GfuiWin New_win_utl(String key, GfuiWin owner, Keyval... args) {return GfuiWin_.kit_(this, key, this.Factory().win_tool_(ctor_args), ctor_args);} - @gplx.Virtual public Gfui_html New_html(String key, GfuiElem owner, Keyval... args) { + public Gfui_html New_html(String key, GfuiElem owner, Keyval... args) { Gfui_html rv = Gfui_html.kit_(this, key, this.New_html_impl(), ctor_args); owner.SubElems().Add(rv); return rv; @@ -66,22 +66,22 @@ public abstract class Gfui_kit_base implements Gfui_kit { owner.SubElems().Add(rv); return rv; } - @gplx.Virtual public GfuiBtn New_btn(String key, GfuiElem owner, Keyval... args) { + public GfuiBtn New_btn(String key, GfuiElem owner, Keyval... args) { GfuiBtn rv = GfuiBtn_.kit_(this, key, New_btn_impl(), ctor_args); owner.SubElems().Add(rv); return rv; } - @gplx.Virtual public GfuiComboBox New_combo(String key, GfuiElem owner, Keyval... args) { + public GfuiComboBox New_combo(String key, GfuiElem owner, Keyval... args) { GfuiComboBox rv = GfuiComboBox.kit_(this, key, New_combo_impl(), ctor_args); owner.SubElems().Add(rv); return rv; } - @gplx.Virtual public GfuiLbl New_lbl(String key, GfuiElem owner, Keyval... args) { + public GfuiLbl New_lbl(String key, GfuiElem owner, Keyval... args) { GfuiLbl rv = GfuiLbl_.kit_(this, key, New_btn_impl(), ctor_args); owner.SubElems().Add(rv); return rv; } - @gplx.Virtual public GfuiStatusBox New_status_box(String key, GfuiElem owner, Keyval... args) { + public GfuiStatusBox New_status_box(String key, GfuiElem owner, Keyval... args) { GfuiStatusBox rv = GfuiStatusBox_.kit_(this, key, this.Factory().text_memo_()); owner.SubElems().Add(rv); return rv; @@ -93,10 +93,10 @@ public abstract class Gfui_kit_base implements Gfui_kit { protected abstract GxwElem New_grp_impl(); protected abstract GxwElem New_btn_impl(); protected abstract GxwElem New_combo_impl(); - @gplx.Virtual public Gfui_dlg_file New_dlg_file(byte type, String msg) {return Gfui_dlg_file_.Noop;} - @gplx.Virtual public Gfui_dlg_msg New_dlg_msg(String msg) {return Gfui_dlg_msg_.Noop;} - @gplx.Virtual public Gfui_mnu_grp New_mnu_popup(String key, GfuiElem owner) {return Gfui_mnu_grp_.Noop;} - @gplx.Virtual public Gfui_mnu_grp New_mnu_bar(String key, GfuiWin owner) {return Gfui_mnu_grp_.Noop;} + public Gfui_dlg_file New_dlg_file(byte type, String msg) {return Gfui_dlg_file_.Noop;} + public Gfui_dlg_msg New_dlg_msg(String msg) {return Gfui_dlg_msg_.Noop;} + public Gfui_mnu_grp New_mnu_popup(String key, GfuiElem owner) {return Gfui_mnu_grp_.Noop;} + public Gfui_mnu_grp New_mnu_bar(String key, GfuiWin owner) {return Gfui_mnu_grp_.Noop;} public abstract ImageAdp New_img_load(Io_url url); public Object New_color(int a, int r, int g, int b) {return null;} public float Calc_font_height(GfuiElem elem, String s) {return 13;} diff --git a/150_gfui/src/gplx/gfui/layouts/GftBand_tst.java b/150_gfui/src/gplx/gfui/layouts/GftBand_tst.java index 5206b5642..c86e4c419 100644 --- a/150_gfui/src/gplx/gfui/layouts/GftBand_tst.java +++ b/150_gfui/src/gplx/gfui/layouts/GftBand_tst.java @@ -1,37 +1,37 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.gfui.layouts; import gplx.*; import gplx.gfui.*; import org.junit.*; public class GftBand_tst { @Before public void setup() { fx.Clear().ini_OwnerSize(200, 400); } GftGrid_fx fx = new GftGrid_fx(); - @Test public void Bands_1() { + @Test public void Bands_1() { fx .ini_AddItms(2) .ini_Set(0, GftBand.new_().Cells_num_(2)) .run() .tst_Filter(0, 1).tst_X(0, 100).tst_W_all(100).tst_H_all(20).tst_Y_all(0); } - @Test public void Bands_1_half() { // only add 1 to 2 cell-band + @Test public void Bands_1_half() { // only add 1 to 2 cell-band fx .ini_AddItms(1) .ini_Set(0, GftBand.new_().Cells_num_(2)) .run() .tst_Filter(0).tst_X(0).tst_W(100).tst_H(20).tst_Y(0); } - @Test public void Bands_2() { // put cells 2, 3 on band 1 + @Test public void Bands_2() { // put cells 2, 3 on band 1 fx .ini_AddItms(4) .ini_Set(0, GftBand.new_().Cells_num_(2)) .ini_Set(1, GftBand.new_().Cells_num_(2)) @@ -39,43 +39,43 @@ public class GftBand_tst { .tst_Filter(0, 1).tst_X(0, 100).tst_W_all(100).tst_H_all(20).tst_Y_all(0) .tst_Filter(2, 3).tst_X(0, 100).tst_W_all(100).tst_H_all(20).tst_Y_all(20); // put on 2nd row } - @Test public void Pct_one() { + @Test public void Pct_one() { fx .ini_AddItms(1) .ini_Set(0, GftBand.new_().Cell_pct_(50)) .run() .tst_Filter(0).tst_X(0).tst_W(100).tst_H_all(20).tst_Y_all(0); } - @Test public void Pct_many() { + @Test public void Pct_many() { fx .ini_AddItms(3) .ini_Set(0, GftBand.new_().Cell_pct_(20).Cell_pct_(70).Cell_pct_(10)) .run() .tst_Filter(0, 2).tst_W(40, 140, 20).tst_X(0, 40, 180).tst_H_all(20).tst_Y_all(0); } - @Test public void Mix_pctAtEnd() { + @Test public void Mix_pctAtEnd() { fx .ini_AddItms(2) .ini_Set(0, GftBand.new_().Cell_abs_(60).Cell_pct_(100)) .run() .tst_Filter(0, 1).tst_X(0, 60).tst_W(60, 140).tst_H_all(20).tst_Y_all(0); } - @Test public void Mix_pctAtBgn() { + @Test public void Mix_pctAtBgn() { fx .ini_AddItms(2) .ini_Set(0, GftBand.new_().Cell_pct_(100).Cell_abs_(60)) .run() .tst_Filter(0, 1).tst_X(0, 140).tst_W(140, 60).tst_H_all(20).tst_Y_all(0); } - @Test public void Mix_pctAtMid() { + @Test public void Mix_pctAtMid() { fx .ini_AddItms(3) .ini_Set(0, GftBand.new_().Cell_abs_(60).Cell_pct_(100).Cell_abs_(40)) .run() .tst_Filter(0, 2).tst_X(0, 60, 160).tst_W(60, 100, 40).tst_H_all(20).tst_Y_all(0); } - @Test public void Height_pct() { + @Test public void Height_pct() { fx .ini_AddItms(1) .ini_Set(0, GftBand.new_().Cell_pct_(100).Len1_pct_(100)) .run() .tst_Filter(0).tst_X(0).tst_W(200).tst_H_all(400).tst_Y_all(0); } - @Test public void Height_mix() { + @Test public void Height_mix() { fx .ini_AddItms(3) .ini_Set(0, GftBand.new_().Cells_num_(1).Len1_abs_( 60)) .ini_Set(1, GftBand.new_().Cells_num_(1).Len1_pct_(100)) @@ -85,14 +85,14 @@ public class GftBand_tst { .tst_Filter(1).tst_H(320).tst_Y_all( 60).tst_X(0).tst_W(200) .tst_Filter(2).tst_H( 20).tst_Y_all(380).tst_X(0).tst_W(200); } - @Test public void RevDir() { + @Test public void RevDir() { fx .ini_AddItms(2).ini_BandDir(DirInt.Bwd) .ini_Set(0, 1, GftBand.new_().Cells_num_(1).Len1_abs_(20)) .run() .tst_Filter(0).tst_W(200).tst_H(20).tst_X(0).tst_Y(380) .tst_Filter(1).tst_W(200).tst_H(20).tst_X(0).tst_Y(360); } - @Test public void SubLyts() { + @Test public void SubLyts() { fx .ini_AddItms(2).ini_AddLyts(2) .ini_Lyt(0).ini_Set(0, GftBand.new_().Cells_num_(1).Len1_pct_(100)) .ini_Lyt(1).ini_Set(0, GftBand.new_().Cells_num_(1).Len1_abs_( 20)).ini_BandDir(DirInt.Bwd) @@ -100,7 +100,7 @@ public class GftBand_tst { .tst_Filter(0).tst_W(200).tst_H(400).tst_X(0).tst_Y( 0) .tst_Filter(1).tst_W(200).tst_H( 20).tst_X(0).tst_Y(380); } - @Test public void Var() { + @Test public void Var() { fx .ini_AddItms(2) .ini_ItmWidth(0, 30).ini_ItmWidth(1, 40) .ini_Set(0, GftBand.new_().Cells_var_(2)) diff --git a/400_xowa/.classpath b/400_xowa/.classpath deleted file mode 100644 index 3e06bab74..000000000 --- a/400_xowa/.classpath +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - diff --git a/400_xowa/src/gplx/core/brys/Bit__tst.java b/400_xowa/src/gplx/core/brys/Bit__tst.java index f5aaf5638..33a9d21fc 100644 --- a/400_xowa/src/gplx/core/brys/Bit__tst.java +++ b/400_xowa/src/gplx/core/brys/Bit__tst.java @@ -1,42 +1,42 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.core.brys; import gplx.*; import gplx.core.*; import org.junit.*; public class Bit__tst { @Before public void init() {fxt.Clear();} private Bit__fxt fxt = new Bit__fxt(); - @Test public void XtoBitStr() { + @Test public void XtoBitStr() { tst_XtoBitStr( 0, "00000000"); tst_XtoBitStr( 1, "00000001"); tst_XtoBitStr( 2, "00000010"); tst_XtoBitStr( 3, "00000011"); tst_XtoBitStr(255, "11111111"); } void tst_XtoBitStr(int val, String expd) {Tfds.Eq(expd, Bit_.ToBitStr(val));} - @Test public void Shift_lhs() {// simple: shift 1 bit + @Test public void Shift_lhs() {// simple: shift 1 bit fxt.Test_shift_lhs(1, 1, 2); fxt.Test_shift_lhs(2, 1, 4); fxt.Test_shift_lhs(3, 1, 6); fxt.Test_shift_lhs(4, 1, 8); } - @Test public void Shift_rhs() { + @Test public void Shift_rhs() { fxt.Test_shift_rhs(2, 1, 1); fxt.Test_shift_rhs(4, 1, 2); fxt.Test_shift_rhs(6, 1, 3); fxt.Test_shift_rhs(8, 1, 4); } - @Test public void Shift_lhs_to_int() { + @Test public void Shift_lhs_to_int() { int[] shift_ary = Int_ary_.New(0, 3, 5); fxt.Test_shift_lhs_to_int(shift_ary, Int_ary_.New(0, 0, 0), 0); fxt.Test_shift_lhs_to_int(shift_ary, Int_ary_.New(7, 0, 0), 7); // 1st 3 bits @@ -44,7 +44,7 @@ public class Bit__tst { fxt.Test_shift_lhs_to_int(shift_ary, Int_ary_.New(0, 0, 1), 32); // 3rd 1 bit fxt.Test_shift_lhs_to_int(shift_ary, Int_ary_.New(7, 3, 1), 63); // many bits } - @Test public void Shift_rhs_to_ary() { + @Test public void Shift_rhs_to_ary() { int[] shift_ary = Int_ary_.New(0, 3, 5); fxt.Test_shift_rhs_to_ary(shift_ary, 0, Int_ary_.New(0, 0, 0)); fxt.Test_shift_rhs_to_ary(shift_ary, 7, Int_ary_.New(7, 0, 0)); // 1st 3 bits diff --git a/400_xowa/src/gplx/core/brys/Bit_heap_rdr_tst.java b/400_xowa/src/gplx/core/brys/Bit_heap_rdr_tst.java index ec8b2e071..34a9223c3 100644 --- a/400_xowa/src/gplx/core/brys/Bit_heap_rdr_tst.java +++ b/400_xowa/src/gplx/core/brys/Bit_heap_rdr_tst.java @@ -1,23 +1,23 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.core.brys; import gplx.*; import gplx.core.*; import org.junit.*; public class Bit_heap_rdr_tst { private final Bit_heap_rdr_fxt fxt = new Bit_heap_rdr_fxt(); - @Test public void Get_bool() { + @Test public void Get_bool() { fxt.Load(255); fxt.Test__get_bool(Bool_.Y).Test__cur(127, 1, 0); fxt.Test__get_bool(Bool_.Y).Test__cur( 63, 2, 0); @@ -34,7 +34,7 @@ public class Bit_heap_rdr_tst { fxt.Test__get_bool(Bool_.Y).Test__cur( 1, 2, 0); fxt.Test__get_bool(Bool_.Y).Test__cur( 0, 3, 0); } - @Test public void Get_byte() { + @Test public void Get_byte() { fxt.Load(255).Test__get_byte(2, 3).Test__cur(63, 2, 0); fxt.Load(255, 3); fxt.Test__get_byte(7, 127); @@ -43,7 +43,7 @@ public class Bit_heap_rdr_tst { fxt.Test__get_bool(false); fxt.Test__get_byte(3, 5); } - @Test public void Get_int_hzip() { + @Test public void Get_int_hzip() { fxt.Load(100).Test__get_int_hzip(1, 100).Test__cur(0, 0, 1); fxt.Load(253, 1, 44).Test__get_int_hzip(1, 300).Test__cur(0, 0, 3); fxt.Load(0, 100).Test__get_int_hzip(2, 100).Test__cur(0, 0, 2); diff --git a/400_xowa/src/gplx/core/brys/Bit_heap_wtr_tst.java b/400_xowa/src/gplx/core/brys/Bit_heap_wtr_tst.java index 4060ddfb8..7365e60fb 100644 --- a/400_xowa/src/gplx/core/brys/Bit_heap_wtr_tst.java +++ b/400_xowa/src/gplx/core/brys/Bit_heap_wtr_tst.java @@ -1,45 +1,45 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.core.brys; import gplx.*; import gplx.core.*; import org.junit.*; public class Bit_heap_wtr_tst { private final Bit_heap_wtr_fxt fxt = new Bit_heap_wtr_fxt(); - @Test public void Add_bool() { + @Test public void Add_bool() { fxt.Clear().Add_bool(Bool_.Y).Test__vals(1, 1); fxt.Clear().Add_bool(Bool_.N).Test__vals(1, 0); fxt.Clear().Add_bool(Bool_.Y, Bool_.Y, Bool_.Y, Bool_.Y).Test__vals(4, 15); fxt.Clear().Add_bool(Bool_.Y, Bool_.N, Bool_.N, Bool_.Y).Test__vals(4, 9); fxt.Clear().Add_bool(8, Bool_.Y).Test__vals(0, 0, 255); } - @Test public void Add_byte() { + @Test public void Add_byte() { fxt.Clear().Add_byte(255).Test__vals(0, 0, 255); } - @Test public void Add_bool_byte() { + @Test public void Add_bool_byte() { fxt.Clear().Add_bool(Bool_.N).Add_byte(255).Test__vals(1, 127, 254); fxt.Clear().Add_bool(Bool_.Y).Add_byte(255).Test__vals(1, 127, 255); fxt.Clear().Add_bool(Bool_.Y, Bool_.Y, Bool_.Y, Bool_.Y).Add_byte(255).Test__vals(4, 15, 255); } - @Test public void Add_byte_digits() { + @Test public void Add_byte_digits() { fxt.Clear().Add_byte(4, 15).Test__vals(4, 15); fxt.Clear().Add_byte(7, 127).Add_byte(2, 3).Test__vals(1, 1, 255); fxt.Clear().Add_byte(3, 7).Add_byte(3, 7).Test__vals(6, 63); fxt.Clear().Add_byte(6, 63).Add_byte(3, 7).Test__vals(1, 1, 255); fxt.Clear().Add_byte(3, 6).Add_byte(3, 6).Test__vals(6, 54); } - @Test public void Add_int_hzip() { + @Test public void Add_int_hzip() { fxt.Clear().Add_int_hzip(1, 100).Test__vals(0, 0, 100); fxt.Clear().Add_int_hzip(1, 300).Test__vals(0, 0, 253, 1, 44); fxt.Clear().Add_int_hzip(2, 100).Test__vals(0, 0, 0, 100); diff --git a/400_xowa/src/gplx/core/brys/Bry_diff_tst.java b/400_xowa/src/gplx/core/brys/Bry_diff_tst.java index 7d56ab3e3..48c9d0f9a 100644 --- a/400_xowa/src/gplx/core/brys/Bry_diff_tst.java +++ b/400_xowa/src/gplx/core/brys/Bry_diff_tst.java @@ -1,29 +1,29 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.core.brys; import gplx.*; import gplx.core.*; import org.junit.*; public class Bry_diff_tst { @Before public void init() {} private final Bry_diff_fxt fxt = new Bry_diff_fxt(); - @Test public void Diff_1st() { + @Test public void Diff_1st() { fxt.Test__diff_1st("a|b|c" , "a|b|c" , null , null); fxt.Test__diff_1st("a|b|c" , "a|b1|c" , "b" , "b1"); fxt.Test__diff_1st("a|b|" , "a|b|c" , "<>" , "c"); fxt.Test__diff_1st("a|b|c" , "a|b|" , "c" , "<>"); } - @Test public void Diff_1st_show() { + @Test public void Diff_1st_show() { fxt.Test__diff_1st("a|bd|e" , "a|be|e" , "d", "e"); } } diff --git a/400_xowa/src/gplx/core/brys/Int_flag_bldr__tst.java b/400_xowa/src/gplx/core/brys/Int_flag_bldr__tst.java index 22040179d..9b3680668 100644 --- a/400_xowa/src/gplx/core/brys/Int_flag_bldr__tst.java +++ b/400_xowa/src/gplx/core/brys/Int_flag_bldr__tst.java @@ -1,27 +1,27 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.core.brys; import gplx.*; import gplx.core.*; import org.junit.*; public class Int_flag_bldr__tst { private final Int_flag_bldr__fxt fxt = new Int_flag_bldr__fxt(); - @Test public void Bld_pow_ary() { + @Test public void Bld_pow_ary() { fxt.Test__bld_pow_ary(fxt.Make__ary(1, 1, 1, 1), fxt.Make__ary(8, 4, 2, 1)); fxt.Test__bld_pow_ary(fxt.Make__ary(3, 2) , fxt.Make__ary(4, 1)); } - @Test public void To_int__1_1_1() { + @Test public void To_int__1_1_1() { int[] seg_ary = fxt.Make__ary(1, 1, 1); fxt.Test__to_int(seg_ary , fxt.Make__ary(0, 0, 0), 0); fxt.Test__to_int(seg_ary , fxt.Make__ary(1, 1, 1), 7); @@ -29,22 +29,22 @@ public class Int_flag_bldr__tst { fxt.Test__to_int(seg_ary , fxt.Make__ary(1, 1, 0), 6); fxt.Test__to_int(seg_ary , fxt.Make__ary(0, 1, 1), 3); } - @Test public void To_int__2_3() { + @Test public void To_int__2_3() { fxt.Test__to_int(fxt.Make__ary(2, 3) , fxt.Make__ary(3, 7) , 31); fxt.Test__to_int(fxt.Make__ary(1, 2, 3) , fxt.Make__ary(1, 3, 7) , 63); } - @Test public void To_int__11_4_5_5_6() { + @Test public void To_int__11_4_5_5_6() { fxt.Test__to_int(fxt.Make__ary(11, 4, 5, 5, 6), fxt.Make__ary(2012, 6, 3, 23, 17), 2110135761); fxt.Test__to_int(fxt.Make__ary(11, 4, 5, 5, 6), fxt.Make__ary(2012, 6, 3, 23, 18), 2110135762); } - @Test public void To_int_ary() { + @Test public void To_int_ary() { fxt.Test__to_int_ary(fxt.Make__ary(1, 1, 1, 1) , 15, fxt.Make__ary(1, 1, 1, 1)); fxt.Test__to_int_ary(fxt.Make__ary(3, 2) , 31, fxt.Make__ary(7, 3)); fxt.Test__to_int_ary(fxt.Make__ary(3, 2, 1) , 63, fxt.Make__ary(7, 3, 1)); fxt.Test__to_int_ary(fxt.Make__ary(12, 4, 5, 5, 6), 2110135761, fxt.Make__ary(2012, 6, 3, 23, 17)); fxt.Test__to_int_ary(fxt.Make__ary(12, 4, 5, 5, 6), 2110135762, fxt.Make__ary(2012, 6, 3, 23, 18)); } - @Test public void To_int_date_short() { + @Test public void To_int_date_short() { fxt.Test__to_int_date_short("20120604 2359", 117843451); fxt.Test__to_int_date_short("20120604 2358", 117843450); fxt.Test__to_int_date_short("20120605 0000", 117843968); diff --git a/400_xowa/src/gplx/core/btries/Btrie_u8_mgr_tst.java b/400_xowa/src/gplx/core/btries/Btrie_u8_mgr_tst.java index 26973d569..d59b51e71 100644 --- a/400_xowa/src/gplx/core/btries/Btrie_u8_mgr_tst.java +++ b/400_xowa/src/gplx/core/btries/Btrie_u8_mgr_tst.java @@ -1,24 +1,24 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.core.btries; import gplx.*; import gplx.core.*; import org.junit.*; import gplx.xowa.langs.cases.*; public class Btrie_u8_mgr_tst { @Before public void init() {fxt.Clear();} private Btrie_u8_mgr_fxt fxt = new Btrie_u8_mgr_fxt(); - @Test public void Ascii() { + @Test public void Ascii() { fxt.Init_add(Bry_.new_a7("a") , "1"); fxt.Init_add(Bry_.new_a7("abc") , "123"); fxt.Test_match("a" , "1"); // single.exact @@ -28,7 +28,7 @@ public class Btrie_u8_mgr_tst { fxt.Test_match(" a" , null); // no_match fxt.Test_match("aBC" , "123"); // upper } - @Test public void Uft8() { + @Test public void Uft8() { fxt.Init_add(Bry_.new_u8("aéi") , "1"); fxt.Test_match("aéi" , "1"); // exact fxt.Test_match("aÉi" , "1"); // upper.utf8 @@ -36,12 +36,12 @@ public class Btrie_u8_mgr_tst { fxt.Test_match("AÉIo" , "1"); // trailing-char fxt.Test_match("aei" , null); // no_match } - @Test public void Uft8_match_pos() { + @Test public void Uft8_match_pos() { fxt.Init_add(Bry_.new_u8("aéi") , "1"); fxt.Test_match_pos("aAÉI" , 1, "1"); // match at 1 fxt.Test_match_pos("aAÉI" , 0, null); // no_match at 0 } - @Test public void Uft8_asymmetric() { + @Test public void Uft8_asymmetric() { fxt.Init_add(Bry_.new_u8("İ") , "1"); fxt.Test_match("İ" , "1"); // exact=y; İ = Bry_.New_by_ints(196,176) fxt.Test_match("i" , "1"); // lower=y; i = Bry_.New_by_ints(105) @@ -53,21 +53,21 @@ public class Btrie_u8_mgr_tst { fxt.Test_match("I" , "1"); // upper=y fxt.Test_match("İ" , "1"); // utf_8=y; note that "i" matches "İ" b/c hash is case-insensitive and "İ" lower-cases to "i"; DATE:2015-09-07 } - @Test public void Utf8_asymmetric_multiple() { // PURPOSE: problems in original implementation of Hash_adp_bry and uneven source / target counts; + @Test public void Utf8_asymmetric_multiple() { // PURPOSE: problems in original implementation of Hash_adp_bry and uneven source / target counts; fxt.Init_add(Bry_.new_u8("İİ") , "1"); fxt.Test_match("İİ" , "1"); // exact fxt.Test_match("ii" , "1"); // lower fxt.Test_match("İi" , "1"); // mixed fxt.Test_match("iİ" , "1"); // mixed } - @Test public void Utf8_asymmetric_upper() { // PURPOSE: "İ" and "I" should co-exist; see Btrie_u8_itm and called_by_match + @Test public void Utf8_asymmetric_upper() { // PURPOSE: "İ" and "I" should co-exist; see Btrie_u8_itm and called_by_match fxt.Init_add(Bry_.new_u8("İ") , "1"); fxt.Init_add(Bry_.new_u8("I") , "1"); fxt.Test_match("İ" , "1"); // exact fxt.Test_match("I" , "1"); // exact fxt.Test_match("i" , "1"); // lower } - @Test public void Utf8_asymmetric_symbols() { // PURPOSE: test Hash_adp_bry and multi-byte syms (chars that will never be cased) + @Test public void Utf8_asymmetric_symbols() { // PURPOSE: test Hash_adp_bry and multi-byte syms (chars that will never be cased) fxt.Init_add(Bry_.new_u8("a_b") , "1"); fxt.Test_match("a_b" , "1"); // exact: len=3 fxt.Test_match("a†b" , null); // diff : len=3 diff --git a/400_xowa/src/gplx/core/caches/Gfo_cache_mgr_tst.java b/400_xowa/src/gplx/core/caches/Gfo_cache_mgr_tst.java index a91cd39da..63c24be72 100644 --- a/400_xowa/src/gplx/core/caches/Gfo_cache_mgr_tst.java +++ b/400_xowa/src/gplx/core/caches/Gfo_cache_mgr_tst.java @@ -1,33 +1,33 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.core.caches; import gplx.*; import gplx.core.*; import org.junit.*; import gplx.core.tests.*; import gplx.core.envs.*; public class Gfo_cache_mgr_tst { @Before public void init() {fxt.Clear();} private final Gfo_cache_mgr_fxt fxt = new Gfo_cache_mgr_fxt(); - @Test public void Basic() { + @Test public void Basic() { fxt.Exec__add("a"); fxt.Test__cur_size(1); fxt.Test__itms("a"); } - @Test public void Reduce() { + @Test public void Reduce() { fxt.Exec__add("a", "b", "c", "d", "e"); fxt.Test__cur_size(2); fxt.Test__itms("a", "b"); } - @Test public void Reduce_after_get() { + @Test public void Reduce_after_get() { fxt.Exec__add("a", "b", "c", "d"); fxt.Exec__get("a", "c"); fxt.Exec__add("e"); diff --git a/400_xowa/src/gplx/core/consoles/Gfo_cmd_arg_mgr_tst.java b/400_xowa/src/gplx/core/consoles/Gfo_cmd_arg_mgr_tst.java index 6ece9f442..1a12a1364 100644 --- a/400_xowa/src/gplx/core/consoles/Gfo_cmd_arg_mgr_tst.java +++ b/400_xowa/src/gplx/core/consoles/Gfo_cmd_arg_mgr_tst.java @@ -1,65 +1,65 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.core.consoles; import gplx.*; import gplx.core.*; import org.junit.*; import gplx.core.tests.*; import gplx.core.envs.*; public class Gfo_cmd_arg_mgr_tst { @Before public void init() {fxt.Clear();} private final Gfo_cmd_arg_mgr_fxt fxt = new Gfo_cmd_arg_mgr_fxt(); - @Test public void Val__many() { + @Test public void Val__many() { fxt.Init_args(fxt.Make_arg("a"), fxt.Make_arg("b")); fxt.Exec_process("--a", "0", "--b", "1"); fxt.Test_errs_none(); fxt.Test_actl(fxt.Make_chkr("a", "0"), fxt.Make_chkr("b", "1")); } - @Test public void Val__yn() { + @Test public void Val__yn() { fxt.Init_args(fxt.Make_arg("a", Gfo_cmd_arg_itm_.Val_tid_yn), fxt.Make_arg("b", Gfo_cmd_arg_itm_.Val_tid_yn)); fxt.Exec_process("--a", "y", "--b", "n"); fxt.Test_errs_none(); fxt.Test_actl(fxt.Make_chkr("a", Bool_.Y), fxt.Make_chkr("b", Bool_.N)); } - @Test public void Dflt() { + @Test public void Dflt() { fxt.Init_args(fxt.Make_arg("a", Gfo_cmd_arg_itm_.Val_tid_yn).Dflt_(Bool_.Y)); fxt.Exec_process("--a", "n").Test_actl(fxt.Make_chkr("a", Bool_.N)); // if val, use it fxt.Exec_process() .Test_actl(fxt.Make_chkr("a", Bool_.Y)); // if no val, use default } - @Test public void Err__key__unknown() { + @Test public void Err__key__unknown() { fxt.Init_args(fxt.Make_arg("a")); fxt.Exec_process("--b"); fxt.Test_errs(Gfo_cmd_arg_mgr_.Err__key__unknown); } - @Test public void Err__key__missing() { + @Test public void Err__key__missing() { fxt.Init_args(fxt.Make_arg("a")); fxt.Exec_process("a"); fxt.Test_errs(Gfo_cmd_arg_mgr_.Err__key__missing); } - @Test public void Err__key__dupe() { + @Test public void Err__key__dupe() { fxt.Init_args(fxt.Make_arg("a")); fxt.Exec_process("--a", "0", "--a", "0"); fxt.Test_errs(Gfo_cmd_arg_mgr_.Err__key__duplicate); } - @Test public void Err__val__reqd() { + @Test public void Err__val__reqd() { fxt.Init_args(fxt.Make_arg("a", Bool_.Y), fxt.Make_arg("b", Bool_.N)); fxt.Exec_process("--b", "1"); fxt.Test_errs(Gfo_cmd_arg_mgr_.Err__val__required); } - @Test public void Err__val__parse__yn() { + @Test public void Err__val__parse__yn() { fxt.Init_args(fxt.Make_arg("a", Gfo_cmd_arg_itm_.Val_tid_yn)); fxt.Exec_process("--a", "x"); fxt.Test_errs(Gfo_cmd_arg_mgr_.Err__val__invalid__yn); } - @Test public void Val_as_url_rel_dir_or() { // PURPOSE: "/xowa" -> "/xowa/" + @Test public void Val_as_url_rel_dir_or() { // PURPOSE: "/xowa" -> "/xowa/" String root_dir = Op_sys.Cur().Tid_is_wnt() ? "C:\\" : "/", dir_spr = Op_sys.Cur().Fsys_dir_spr_str(); fxt.Test_val_as_url_rel_dir_or(root_dir, dir_spr, root_dir + "sub" , root_dir + "sub" + dir_spr); // /sub -> /sub/ fxt.Test_val_as_url_rel_dir_or(root_dir, dir_spr, root_dir + "sub" + dir_spr , root_dir + "sub" + dir_spr); // /sub/ -> /sub/ diff --git a/400_xowa/src/gplx/core/flds/Gfo_fld_rdr_tst.java b/400_xowa/src/gplx/core/flds/Gfo_fld_rdr_tst.java index 5e47e67a7..4a95aa7b7 100644 --- a/400_xowa/src/gplx/core/flds/Gfo_fld_rdr_tst.java +++ b/400_xowa/src/gplx/core/flds/Gfo_fld_rdr_tst.java @@ -1,39 +1,39 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.core.flds; import gplx.*; import gplx.core.*; import org.junit.*; import gplx.core.ios.*; public class Gfo_fld_rdr_tst { Gfo_fld_rdr_fxt fxt = new Gfo_fld_rdr_fxt(); - @Test public void Read_int() {fxt.ini_xdat().Raw_("123|") .tst_Read_int(123);} - @Test public void Read_double() {fxt.ini_xdat().Raw_("1.23|") .tst_Read_double(1.23);} - @Test public void Read_str_simple() {fxt.ini_xdat().Raw_("ab|") .tst_Read_str_simple("ab");} - @Test public void Read_str_escape_pipe() {fxt.ini_xdat().Raw_("a~pb|") .tst_Read_str_escape("a|b");} - @Test public void Read_str_escape_tilde() {fxt.ini_xdat().Raw_("a~~b|") .tst_Read_str_escape("a~b");} - @Test public void Read_str_escape_nl() {fxt.ini_xdat().Raw_("a~nb|") .tst_Read_str_escape("a\nb");} - @Test public void Read_str_escape_tab() {fxt.ini_xdat().Raw_("a~tb|") .tst_Read_str_escape("a\tb");} - @Test public void Write_str_escape_pipe() {fxt.ini_xdat().tst_Write_str_escape("a|b", "a~pb|");} - @Test public void Read_str_quoted_comma() {fxt.ini_sql ().Raw_("'a,b',") .tst_Read_str_escape("a,b");} - @Test public void Read_str_quoted_apos() {fxt.ini_sql ().Raw_("'a\\'b',") .tst_Read_str_escape("a'b");} - @Test public void Read_multiple() { + @Test public void Read_int() {fxt.ini_xdat().Raw_("123|") .tst_Read_int(123);} + @Test public void Read_double() {fxt.ini_xdat().Raw_("1.23|") .tst_Read_double(1.23);} + @Test public void Read_str_simple() {fxt.ini_xdat().Raw_("ab|") .tst_Read_str_simple("ab");} + @Test public void Read_str_escape_pipe() {fxt.ini_xdat().Raw_("a~pb|") .tst_Read_str_escape("a|b");} + @Test public void Read_str_escape_tilde() {fxt.ini_xdat().Raw_("a~~b|") .tst_Read_str_escape("a~b");} + @Test public void Read_str_escape_nl() {fxt.ini_xdat().Raw_("a~nb|") .tst_Read_str_escape("a\nb");} + @Test public void Read_str_escape_tab() {fxt.ini_xdat().Raw_("a~tb|") .tst_Read_str_escape("a\tb");} + @Test public void Write_str_escape_pipe() {fxt.ini_xdat().tst_Write_str_escape("a|b", "a~pb|");} + @Test public void Read_str_quoted_comma() {fxt.ini_sql ().Raw_("'a,b',") .tst_Read_str_escape("a,b");} + @Test public void Read_str_quoted_apos() {fxt.ini_sql ().Raw_("'a\\'b',") .tst_Read_str_escape("a'b");} + @Test public void Read_multiple() { fxt.ini_xdat().Raw_("ab|1|.9|\n") .tst_Read_str_escape("ab").tst_Read_int(1).tst_Read_double(.9) ; } - @Test public void Read_dlm_nl() {fxt.ini_xdat().Raw_("123\n") .tst_Read_int(123);} + @Test public void Read_dlm_nl() {fxt.ini_xdat().Raw_("123\n") .tst_Read_int(123);} } class Gfo_fld_rdr_fxt { Gfo_fld_rdr rdr = new Gfo_fld_rdr(); Gfo_fld_wtr wtr = Gfo_fld_wtr.xowa_(); diff --git a/400_xowa/src/gplx/core/gfobjs/Gfobj_rdr__json_tst.java b/400_xowa/src/gplx/core/gfobjs/Gfobj_rdr__json_tst.java index d19e8f40c..640b6d150 100644 --- a/400_xowa/src/gplx/core/gfobjs/Gfobj_rdr__json_tst.java +++ b/400_xowa/src/gplx/core/gfobjs/Gfobj_rdr__json_tst.java @@ -1,18 +1,18 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.core.gfobjs; import gplx.*; import gplx.core.*; import org.junit.*; import gplx.core.tests.*; import gplx.langs.jsons.*; @@ -37,7 +37,7 @@ public class Gfobj_rdr__json_tst { , fxt.Make__fld_str ("k6", "abc") )); } - @Test public void Nested() { + @Test public void Nested() { fxt.Test__parse(String_.Concat_lines_nl_skip_last ( "{ 'a1':'1a'" , ", 'a2':" @@ -59,7 +59,7 @@ public class Gfobj_rdr__json_tst { , fxt.Make__fld_ary ("a3", 1, 2, 3) )); } - @Test public void Array() { + @Test public void Array() { fxt.Test__parse(String_.Concat_lines_nl_skip_last ( "[" , " [1, 2, 3]" diff --git a/400_xowa/src/gplx/core/ios/BinaryHeap_Io_line_rdr_tst.java b/400_xowa/src/gplx/core/ios/BinaryHeap_Io_line_rdr_tst.java index a582915f6..dd14afa15 100644 --- a/400_xowa/src/gplx/core/ios/BinaryHeap_Io_line_rdr_tst.java +++ b/400_xowa/src/gplx/core/ios/BinaryHeap_Io_line_rdr_tst.java @@ -1,29 +1,29 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.core.ios; import gplx.*; import gplx.core.*; import org.junit.*; -public class BinaryHeap_Io_line_rdr_tst { +public class BinaryHeap_Io_line_rdr_tst { BinaryHeap_Io_line_rdr_fxt fxt = new BinaryHeap_Io_line_rdr_fxt(); - @Test public void Add() { + @Test public void Add() { fxt.Add("c", "a", "b").tst("a", "b", "c"); fxt.Add("b", "a", "a").tst("a", "a", "b"); fxt.Add("f", "b", "d", "c", "e", "a").tst("a", "b", "c", "d", "e", "f"); } } -class BinaryHeap_Io_line_rdr_fxt { +class BinaryHeap_Io_line_rdr_fxt { BinaryHeap_Io_line_rdr heap = new BinaryHeap_Io_line_rdr(Io_sort_split_itm_sorter.Instance); int file_total; public BinaryHeap_Io_line_rdr_fxt Add(String... ary) { file_total = ary.length; diff --git a/400_xowa/src/gplx/core/ios/Io_buffer_rdr_tst.java b/400_xowa/src/gplx/core/ios/Io_buffer_rdr_tst.java index fe5e8abd9..20aef81cd 100644 --- a/400_xowa/src/gplx/core/ios/Io_buffer_rdr_tst.java +++ b/400_xowa/src/gplx/core/ios/Io_buffer_rdr_tst.java @@ -1,21 +1,21 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.core.ios; import gplx.*; import gplx.core.*; import org.junit.*; import gplx.core.ios.*; import gplx.core.ios.streams.*; -public class Io_buffer_rdr_tst { +public class Io_buffer_rdr_tst { @Before public void init() { Io_mgr.Instance.InitEngine_mem(); fil = Io_url_.mem_fil_("mem/byteStreamRdr.txt"); @@ -23,7 +23,7 @@ public class Io_buffer_rdr_tst { rdr = Io_buffer_rdr.new_(Io_stream_rdr_.New__raw(fil), 4); } Io_buffer_rdr rdr; Io_url fil; @After public void teardown() {rdr.Rls();} - @Test public void Bfr_load_all() { + @Test public void Bfr_load_all() { tst_Bfr("0", "1", "2", "3").tst_ReadDone(false); rdr.Bfr_load_all(); @@ -34,7 +34,7 @@ public class Io_buffer_rdr_tst { rdr.Bfr_load_all(); // NOTE: change to zip_rdrs make eof detection difficult; force another load to ensure that file_pos goes past file_len tst_ReadDone(true); // NOTE: bfr truncated from 4 to 2 } - @Test public void Bfr_load_from() { + @Test public void Bfr_load_from() { tst_Bfr("0", "1", "2", "3").tst_ReadDone(false); rdr.Bfr_load_from(3); // read from pos 3 diff --git a/400_xowa/src/gplx/core/ios/Io_line_rdr_tst.java b/400_xowa/src/gplx/core/ios/Io_line_rdr_tst.java index 7f43744c1..2d6276222 100644 --- a/400_xowa/src/gplx/core/ios/Io_line_rdr_tst.java +++ b/400_xowa/src/gplx/core/ios/Io_line_rdr_tst.java @@ -1,41 +1,41 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.core.ios; import gplx.*; import gplx.core.*; import org.junit.*; import gplx.core.envs.*; -public class Io_line_rdr_tst { +public class Io_line_rdr_tst { Io_line_rdr_fxt fxt; @Before public void init() { fxt = new Io_line_rdr_fxt(Io_url_.new_fil_("mem/test.txt")); fxt.Clear(); } - @Test public void Basic() { + @Test public void Basic() { fxt.File_lines_(3).tst_Read_til_lines(3, "00", "01", "02"); fxt.tst_Read_til_lines(1); // make sure nothing more is read } - @Test public void Load_3x() { + @Test public void Load_3x() { fxt.File_lines_(9).Load_len_lines_(3).tst_Read_til_lines(9, "00", "01", "02", "03", "04", "05", "06", "07", "08"); } - @Test public void Load_irregular() { + @Test public void Load_irregular() { fxt.File_lines_(9).Load_len_(4).tst_Read_til_lines(9, "00", "01", "02", "03", "04", "05", "06", "07", "08"); } - @Test public void Load_multiple_files() { + @Test public void Load_multiple_files() { fxt = new Io_line_rdr_fxt(Io_url_.new_fil_("mem/test0.txt"), Io_url_.new_fil_("mem/test1.txt"), Io_url_.new_fil_("mem/test2.txt")); fxt.File_lines_(0, 0, 3).File_lines_(1, 3, 5).File_lines_(2, 5, 9).Load_len_(4).tst_Read_til_lines(9, "00", "01", "02", "03", "04", "05", "06", "07", "08"); } - @Test public void Match() { + @Test public void Match() { fxt.File_lines_pipe_(9).Load_len_(6); fxt.tst_Match("00", "00"); fxt.tst_Match("01", "01"); @@ -44,7 +44,7 @@ public class Io_line_rdr_tst { fxt.tst_Match("12", ""); } } -class Io_line_rdr_fxt { +class Io_line_rdr_fxt { Io_line_rdr rdr; List_adp lines = List_adp_.New(); Bry_bfr tmp = Bry_bfr_.New(); public Io_line_rdr_fxt(Io_url... urls) {rdr = new Io_line_rdr(Gfo_usr_dlg_.Test(), urls);} diff --git a/400_xowa/src/gplx/core/ios/Io_sort_misc_tst.java b/400_xowa/src/gplx/core/ios/Io_sort_misc_tst.java index 8ff23424a..086c98913 100644 --- a/400_xowa/src/gplx/core/ios/Io_sort_misc_tst.java +++ b/400_xowa/src/gplx/core/ios/Io_sort_misc_tst.java @@ -1,24 +1,24 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.core.ios; import gplx.*; import gplx.core.*; import org.junit.*; public class Io_sort_misc_tst { @Before public void init() { } - @Test public void Io_url_gen_dir() { + @Test public void Io_url_gen_dir() { tst_Io_url_gen_dir("mem/dir/", "{0}.xdat", 4, 3, "0000.xdat", "0001.xdat", "0002.xdat"); } private void tst_Io_url_gen_dir(String dir_str, String fmt, int digits, int calls, String... expd) { @@ -32,7 +32,7 @@ public class Io_sort_misc_tst { expd[i] = dir_str + expd[i]; Tfds.Eq_ary_str(expd, actl); } - @Test public void Io_line_rdr_comparer_all() { + @Test public void Io_line_rdr_comparer_all() { tst_Io_line_rdr_fld_comparer(-1, "a", "b"); tst_Io_line_rdr_fld_comparer( 0, "a", "a"); tst_Io_line_rdr_fld_comparer( 1, "b", "a"); @@ -50,7 +50,7 @@ public class Io_sort_misc_tst { rv.Read_next(); return rv; } - @Test public void ExternalSort() { + @Test public void ExternalSort() { // fxt("c", "a", "b") } } diff --git a/400_xowa/src/gplx/core/ios/Io_sort_tst.java b/400_xowa/src/gplx/core/ios/Io_sort_tst.java index cb333381a..6b847fed8 100644 --- a/400_xowa/src/gplx/core/ios/Io_sort_tst.java +++ b/400_xowa/src/gplx/core/ios/Io_sort_tst.java @@ -1,23 +1,23 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.core.ios; import gplx.*; import gplx.core.*; import org.junit.*; import gplx.core.strings.*; public class Io_sort_tst { Io_sort_fxt fxt = new Io_sort_fxt(); - @Test public void ExternalSort() { + @Test public void ExternalSort() { fxt.Clear().Memory_max_(12).Src_(fxt.GenRandom(6, 4)).Sorted_(fxt.GenOrdered(6, 4)).tst(); fxt.Clear().Memory_max_(64).Src_(fxt.GenRandom(50, 4)).Sorted_(fxt.GenOrdered(50, 4)).tst(); } diff --git a/400_xowa/src/gplx/core/lists/Binary_heap_tst.java b/400_xowa/src/gplx/core/lists/Binary_heap_tst.java index 20f84c303..0b59ca63d 100644 --- a/400_xowa/src/gplx/core/lists/Binary_heap_tst.java +++ b/400_xowa/src/gplx/core/lists/Binary_heap_tst.java @@ -1,29 +1,29 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.core.lists; import gplx.*; import gplx.core.*; import org.junit.*; import gplx.core.tests.*; import gplx.core.primitives.*; public class Binary_heap_tst { private final Binary_heap_fxt fxt = new Binary_heap_fxt(); - @Test public void Max() { + @Test public void Max() { fxt.Init(Bool_.Y); fxt.Exec__add(4, 3, 5, 7, 1, 6, 9, 8, 2); fxt.Test__pop(9, 8, 7, 6, 5, 4, 3, 2, 1); } - @Test public void Min() { + @Test public void Min() { fxt.Init(Bool_.N); fxt.Exec__add(4, 3, 5, 7, 1, 6, 9, 8, 2); fxt.Test__pop(1, 2, 3, 4, 5, 6, 7, 8, 9); diff --git a/400_xowa/src/gplx/core/lists/Queue_adp_tst.java b/400_xowa/src/gplx/core/lists/Queue_adp_tst.java index 7ddcea028..0e3d372b8 100644 --- a/400_xowa/src/gplx/core/lists/Queue_adp_tst.java +++ b/400_xowa/src/gplx/core/lists/Queue_adp_tst.java @@ -1,23 +1,23 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.core.lists; import gplx.*; import gplx.core.*; import org.junit.*; import gplx.core.tests.*; public class Queue_adp_tst { private final Queue_adp_fxt fxt = new Queue_adp_fxt(); - @Test public void Empty() { + @Test public void Empty() { boolean pass = true; try { fxt.Test__dequeue(null, -1); @@ -28,11 +28,11 @@ public class Queue_adp_tst { } if (pass) throw Err_.new_wo_type("empty should have failed"); } - @Test public void Add_1() { + @Test public void Add_1() { fxt.Exec__enqueue("a"); fxt.Test__dequeue("a", 0); } - @Test public void Add_n() { + @Test public void Add_n() { fxt.Exec__enqueue("a"); fxt.Exec__enqueue("b"); fxt.Exec__enqueue("c"); @@ -40,7 +40,7 @@ public class Queue_adp_tst { fxt.Test__dequeue("b", 1); fxt.Test__dequeue("c", 0); } - @Test public void Mix() { + @Test public void Mix() { fxt.Exec__enqueue("a"); fxt.Exec__enqueue("b"); fxt.Test__dequeue("a", 1); diff --git a/400_xowa/src/gplx/core/lists/StatRng_tst.java b/400_xowa/src/gplx/core/lists/StatRng_tst.java index 928398b1a..572e3a28f 100644 --- a/400_xowa/src/gplx/core/lists/StatRng_tst.java +++ b/400_xowa/src/gplx/core/lists/StatRng_tst.java @@ -1,24 +1,24 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.core.lists; import gplx.*; import gplx.core.*; import org.junit.*; public class StatRng_tst { // Mwl_parser_fxt fx = new Mwl_parser_fxt(); Pf_func_lang_rsc rsc = Pf_func_lang_rsc.Instance; StatRng_fxt fx = new StatRng_fxt(); - @Test public void Empty() { + @Test public void Empty() { fx.ini_(1, 1, 5); fx.Count_(7).Lo_(2).Hi_(8).Avg_(5) .Lo_ary_(2) @@ -26,9 +26,9 @@ public class StatRng_tst { .Slots_(3, 4); fx.tst_(5,7,2,8,3,4,6); } -//@Test public void Basic() {fx.Test_parse_tmpl_str_test("{{#switch:{{{1}}}|a=1|b=2|3}}", "{{test|a}}", "1");} -//@Test public void Basic() {fx.Test_parse_tmpl_str_test("{{#switch:{{{1}}}|b=2|#default=3|a=1}}", "{{test|a}}", "1");} -//@Test public void Basic() {fx.Test_parse_tmpl_str_test("{{#switch:{{{1}}}|a|b|c=1|d=2}}", "{{test|a}}", "1");} +//@Test public void Basic() {fx.Test_parse_tmpl_str_test("{{#switch:{{{1}}}|a=1|b=2|3}}", "{{test|a}}", "1");} +//@Test public void Basic() {fx.Test_parse_tmpl_str_test("{{#switch:{{{1}}}|b=2|#default=3|a=1}}", "{{test|a}}", "1");} +//@Test public void Basic() {fx.Test_parse_tmpl_str_test("{{#switch:{{{1}}}|a|b|c=1|d=2}}", "{{test|a}}", "1");} } /* public class Pf_func_switch_tst { diff --git a/400_xowa/src/gplx/core/lists/binary_searches/Binary_search__tst.java b/400_xowa/src/gplx/core/lists/binary_searches/Binary_search__tst.java index 38239e541..dfc4f9fd5 100644 --- a/400_xowa/src/gplx/core/lists/binary_searches/Binary_search__tst.java +++ b/400_xowa/src/gplx/core/lists/binary_searches/Binary_search__tst.java @@ -1,23 +1,23 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.core.lists.binary_searches; import gplx.*; import gplx.core.*; import gplx.core.lists.*; import org.junit.*; import gplx.core.primitives.*; public class Binary_search__tst { private final Binary_search__fxt fxt = new Binary_search__fxt(); - @Test public void Basic() { + @Test public void Basic() { fxt.Init__ary("", "e", "j", "o", "t", "y"); fxt.Test__binary_search("a", 0); fxt.Test__binary_search("f", 1); @@ -26,11 +26,11 @@ public class Binary_search__tst { fxt.Test__binary_search("u", 4); fxt.Test__binary_search("z", 5); } - @Test public void One() { + @Test public void One() { fxt.Init__ary(""); fxt.Test__binary_search("a", 0); } - @Test public void Catpage() { + @Test public void Catpage() { String[] ary = new String[25]; for (int i = 0; i < 25; ++i) ary[i] = Int_.To_str_pad_bgn_zero(i, 2); diff --git a/400_xowa/src/gplx/core/lists/caches/Mru_cache_mgr_tst.java b/400_xowa/src/gplx/core/lists/caches/Mru_cache_mgr_tst.java index a0e6785dd..1902654c0 100644 --- a/400_xowa/src/gplx/core/lists/caches/Mru_cache_mgr_tst.java +++ b/400_xowa/src/gplx/core/lists/caches/Mru_cache_mgr_tst.java @@ -1,18 +1,18 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.core.lists.caches; import gplx.*; import gplx.core.*; import gplx.core.lists.*; import org.junit.*; import gplx.core.tests.*; public class Mru_cache_mgr_tst { @@ -20,30 +20,30 @@ public class Mru_cache_mgr_tst { @Before public void init() { fxt.Init__New_cache_mgr(3, 3, 2); } - @Test public void Basic() { + @Test public void Basic() { fxt.Exec__Add("a", "b", "c", "d"); fxt.Test__Print("b", "c", "d"); // adding "d" pushes out "a" } - @Test public void Used() { + @Test public void Used() { fxt.Exec__Add("a", "b", "c"); fxt.Exec__Get_and_compress("a"); fxt.Test__Print("b", "c", "a"); // getting "a" pushes to back } - @Test public void Used__more_uses_at_back() { + @Test public void Used__more_uses_at_back() { fxt.Exec__Add("a", "b", "c"); fxt.Exec__Get_and_compress("a", "a", "a"); fxt.Test__Print("b", "c", "a"); fxt.Exec__Get_and_compress("b"); fxt.Test__Print("c", "b", "a"); // getting "a" multiple time still keeps towards back } - @Test public void Time() { + @Test public void Time() { fxt.Exec__Add("a", "b", "c"); fxt.Exec__Get_and_compress("a", "a", "a"); fxt.Exec__Wait(10); fxt.Exec__Get_and_compress("b"); fxt.Test__Print("c", "a", "b"); // long wait puts "b" at back } - @Test public void Compress() { + @Test public void Compress() { fxt.Init__New_cache_mgr(3, 2, 2); fxt.Exec__Add("a", "b", "c", "d"); fxt.Test__Print("c", "d"); diff --git a/400_xowa/src/gplx/core/net/Gfo_url_parser_tst.java b/400_xowa/src/gplx/core/net/Gfo_url_parser_tst.java index dcc8f0736..2ad24d463 100644 --- a/400_xowa/src/gplx/core/net/Gfo_url_parser_tst.java +++ b/400_xowa/src/gplx/core/net/Gfo_url_parser_tst.java @@ -1,129 +1,129 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.core.net; import gplx.*; import gplx.core.*; import org.junit.*; public class Gfo_url_parser_tst { private final Gfo_url_parser_fxt tstr = new Gfo_url_parser_fxt(); - @Test public void Protocol__relative() { + @Test public void Protocol__relative() { tstr.Exec__parse("//en.wikipedia.org").Test__protocol_tid(Gfo_protocol_itm.Tid_relative_1).Test__protocol_bry("//").Test__site("en.wikipedia.org"); } - @Test public void Protocol__none() { + @Test public void Protocol__none() { tstr.Exec__parse("en.wikipedia.org/wiki/A").Test__protocol_tid(Gfo_protocol_itm.Tid_unknown).Test__segs("en.wikipedia.org", "wiki", "A"); } - @Test public void Site__parts__3() { + @Test public void Site__parts__3() { tstr.Exec__parse("https://en.wikipedia.org").Test__protocol_tid(Gfo_protocol_itm.Tid_https).Test__protocol_bry("https://").Test__segs("en.wikipedia.org"); } - @Test public void Site__parts__2() { + @Test public void Site__parts__2() { tstr.Exec__parse("https://wikipedia.org").Test__protocol_tid(Gfo_protocol_itm.Tid_https).Test__segs("wikipedia.org"); } - @Test public void Site__parts__1() { + @Test public void Site__parts__1() { tstr.Exec__parse("https://wikipedia").Test__protocol_tid(Gfo_protocol_itm.Tid_https).Test__segs("wikipedia"); } - @Test public void Site__slash__none() { + @Test public void Site__slash__none() { tstr.Exec__parse("https:site").Test__protocol_tid(Gfo_protocol_itm.Tid_https).Test__site("site"); } - @Test public void Site__slash__eos() { + @Test public void Site__slash__eos() { tstr.Exec__parse("https://en.wikipedia.org/").Test__protocol_tid(Gfo_protocol_itm.Tid_https).Test__site("en.wikipedia.org"); } - @Test public void Paths__1() { + @Test public void Paths__1() { tstr.Exec__parse("https://site/A").Test__segs("site", "A"); } - @Test public void Paths__2() { + @Test public void Paths__2() { tstr.Exec__parse("https://site/wiki/A").Test__segs("site", "wiki", "A"); } - @Test public void Paths__n() { + @Test public void Paths__n() { tstr.Exec__parse("https://site/wiki/A/B/C/D").Test__segs("site", "wiki", "A", "B", "C", "D"); } - @Test public void Qargs__1() { + @Test public void Qargs__1() { tstr.Exec__parse("https://site/A?B=C").Test__page("A").Test__qargs("B", "C"); } - @Test public void Qargs__2() { + @Test public void Qargs__2() { tstr.Exec__parse("https://site/A?B=C&D=E").Test__page("A").Test__qargs("B", "C", "D", "E"); } - @Test public void Qargs__3() { + @Test public void Qargs__3() { tstr.Exec__parse("https://site/A?B=C&D=E&F=G").Test__page("A").Test__qargs("B", "C", "D", "E", "F", "G"); } - @Test public void Qargs__ques__dupe__ques() { + @Test public void Qargs__ques__dupe__ques() { tstr.Exec__parse("https://site/A?B?Y=Z").Test__page("A?B").Test__qargs("Y", "Z"); } - @Test public void Qargs__ques__dupe__amp() { + @Test public void Qargs__ques__dupe__amp() { tstr.Exec__parse("https://site/A?B=C&D?Y=Z").Test__page("A?B=C&D").Test__qargs("Y", "Z"); } - @Test public void Qargs__ques__dupe__eq() { + @Test public void Qargs__ques__dupe__eq() { tstr.Exec__parse("https://site/A?B=C?Y=Z").Test__page("A?B=C").Test__qargs("Y", "Z"); } - @Test public void Qargs__amp__dupe__ques() { + @Test public void Qargs__amp__dupe__ques() { tstr.Exec__parse("https://site/A?B&Y=Z").Test__page("A").Test__qargs("B", null, "Y", "Z"); } - @Test public void Qargs__amp__dupe__amp() { + @Test public void Qargs__amp__dupe__amp() { tstr.Exec__parse("https://site/A?B=C&D&Y=Z").Test__page("A").Test__qargs("B", "C", "D", null, "Y", "Z"); } - @Test public void Qargs__missing_val__0() { + @Test public void Qargs__missing_val__0() { tstr.Exec__parse("https://site/A?").Test__page("A?").Test__qargs(); } - @Test public void Qargs__missing_val__2() { + @Test public void Qargs__missing_val__2() { tstr.Exec__parse("https://site/A?B=C&D&F=G").Test__page("A").Test__qargs("B", "C", "D", null, "F", "G"); } - @Test public void Qargs__missing_val__n() { + @Test public void Qargs__missing_val__n() { tstr.Exec__parse("https://site/A?B=C&D=E&F").Test__page("A").Test__qargs("B", "C", "D", "E", "F", null); } - @Test public void Qargs__site_less__missing__0() { + @Test public void Qargs__site_less__missing__0() { tstr.Exec__parse("A?B").Test__segs("A?B").Test__qargs(); } - @Test public void Qargs__site_less() { + @Test public void Qargs__site_less() { tstr.Exec__parse("A?B=C&D=E").Test__site("A").Test__qargs("B", "C", "D", "E"); } - @Test public void Anch__basic() { + @Test public void Anch__basic() { tstr.Exec__parse("https://site/A#B").Test__page("A").Test__anch("B"); } - @Test public void Anch__repeat__2() { + @Test public void Anch__repeat__2() { tstr.Exec__parse("https://site/A#B#C").Test__page("A").Test__anch("B#C"); } - @Test public void Anch__repeat__3() { + @Test public void Anch__repeat__3() { tstr.Exec__parse("https://site/A#B#C#D").Test__page("A").Test__anch("B#C#D"); } - @Test public void Anch__missing() { + @Test public void Anch__missing() { tstr.Exec__parse("https://site/A#").Test__page("A#").Test__anch(null); } - @Test public void Anch__missing__eos() { + @Test public void Anch__missing__eos() { tstr.Exec__parse("https://site/A#B#").Test__page("A").Test__anch("B#"); } - @Test public void Anch__qargs__basic() { + @Test public void Anch__qargs__basic() { tstr.Exec__parse("https://site/A?B=C&D=E#F").Test__page("A").Test__qargs("B", "C", "D", "E").Test__anch("F"); } - @Test public void Anch__site_less() { + @Test public void Anch__site_less() { tstr.Exec__parse("A#B").Test__site("A").Test__anch("B"); } - @Test public void Encode__page() { + @Test public void Encode__page() { tstr.Exec__parse("http://site/A%27s").Test__site("site").Test__page("A's"); } - @Test public void Protocol_less__qargs() { + @Test public void Protocol_less__qargs() { tstr.Exec__parse("Special:Search/Earth?fulltext=yes").Test__segs("Special:Search", "Earth").Test__page("Earth").Test__qargs("fulltext", "yes"); } - @Test public void Http_server() { + @Test public void Http_server() { tstr.Exec__parse("/wiki/Page?A=B").Test__segs("wiki", "Page").Test__page("Page").Test__qargs("A", "B"); } - @Test public void Parse_site_fast() { + @Test public void Parse_site_fast() { tstr.Test_Parse_site_fast("http://a.org/B" , "a.org"); tstr.Test_Parse_site_fast("http://a.org" , "a.org"); tstr.Test_Parse_site_fast("//a.org/B" , "a.org"); tstr.Test_Parse_site_fast("//a.org/B:C" , "a.org"); } // DELETED: logic isn't right; anch is first # not last; EX: https://en.wikipedia.org/w/index.php?title=Category:2001_albums&pagefrom=Beautiful+#View#mw-pages; DATE:2016-10-10 - // @Test public void Anch__qargs__repeat() { + // @Test public void Anch__qargs__repeat() { // tstr.Exec__parse("https://site/A?B=C#&D=E#F").Test__page("A").Test__qargs("B", "C#", "D", "E").Test__anch("F"); // } } diff --git a/400_xowa/src/gplx/core/net/Http_request_parser_tst.java b/400_xowa/src/gplx/core/net/Http_request_parser_tst.java index b031af312..9e8c4832a 100644 --- a/400_xowa/src/gplx/core/net/Http_request_parser_tst.java +++ b/400_xowa/src/gplx/core/net/Http_request_parser_tst.java @@ -1,32 +1,32 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.core.net; import gplx.*; import gplx.core.*; import org.junit.*; import gplx.core.tests.*; public class Http_request_parser_tst { @Before public void init() {fxt.Clear();} private final Http_request_parser_fxt fxt = new Http_request_parser_fxt(); - @Test public void Type_post() { + @Test public void Type_post() { fxt.Test_type_post("POST /url HTTP/1.1", Http_request_itm.Type_post, "/url", "HTTP/1.1"); } - @Test public void Type_content_type() { + @Test public void Type_content_type() { fxt.Test_content_type("Content-Type: multipart/form-data; boundary=---------------------------72432484930026", "multipart/form-data", "-----------------------------72432484930026"); } - @Test public void Type_content_type__x_www_form_url_encoded() { // PURPOSE: ignore content-type for GET calls like by Mathematica server; DATE:2015-08-04 + @Test public void Type_content_type__x_www_form_url_encoded() { // PURPOSE: ignore content-type for GET calls like by Mathematica server; DATE:2015-08-04 fxt.Test_content_type("Content-Type: application/x-www-form-urlencoded", null, null); } - @Test public void Type_form_data() { + @Test public void Type_form_data() { fxt.Test_form_data(String_.Ary ( "POST /url HTTP/1.1" , "Content-Type: multipart/form-data; boundary=---------------------------12345678901234" @@ -45,10 +45,10 @@ public class Http_request_parser_tst { , fxt.Make_post_data_itm("key1", "val1") ); } - @Test public void Type_accept_charset() { + @Test public void Type_accept_charset() { fxt.Test_ignore("Accept-Charset: ISO-8859-1,utf-8;q=0.7"); } - @Test public void Nginx() {// PURPOSE: support http headers from nginx; ISSUE#:255 + @Test public void Nginx() {// PURPOSE: support http headers from nginx; ISSUE#:255 fxt.Test_ignore("Upgrade-Insecure-Requests: test1; X-Host: test2; X-Real-IP: test3;"); } } diff --git a/400_xowa/src/gplx/core/primitives/Int_ary_parser_tst.java b/400_xowa/src/gplx/core/primitives/Int_ary_parser_tst.java index e2ba168cc..0a5f4b1c4 100644 --- a/400_xowa/src/gplx/core/primitives/Int_ary_parser_tst.java +++ b/400_xowa/src/gplx/core/primitives/Int_ary_parser_tst.java @@ -13,16 +13,16 @@ The terms of each license can be found in the source code repository: GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt */ -package gplx.core.primitives; import gplx.*; import gplx.core.*; -import org.junit.*; import gplx.core.tests.*; -public class Int_ary_parser_tst { - private final Int_ary_parser_fxt fxt = new Int_ary_parser_fxt(); - @Test public void Many() {fxt.Test__Parse_ary("1,2,3,4,5" , 0, 9, Int_ary_.New(1, 2, 3, 4, 5));} - @Test public void One() {fxt.Test__Parse_ary("1" , 0, 1, Int_ary_.New(1));} - @Test public void None() {fxt.Test__Parse_ary("" , 0, 0, Int_ary_.New());} -} -class Int_ary_parser_fxt { - public void Test__Parse_ary(String raw, int bgn, int end, int[] expd) { - Gftest.Eq__ary(expd, new Int_ary_parser().Parse_ary(Bry_.new_a7(raw), bgn, end, Byte_ascii.Comma), "parse_ary failed"); - } -} +package gplx.core.primitives; import gplx.*; import gplx.core.*; +import org.junit.*; import gplx.core.tests.*; +public class Int_ary_parser_tst { + private final Int_ary_parser_fxt fxt = new Int_ary_parser_fxt(); + @Test public void Many() {fxt.Test__Parse_ary("1,2,3,4,5" , 0, 9, Int_ary_.New(1, 2, 3, 4, 5));} + @Test public void One() {fxt.Test__Parse_ary("1" , 0, 1, Int_ary_.New(1));} + @Test public void None() {fxt.Test__Parse_ary("" , 0, 0, Int_ary_.New());} +} +class Int_ary_parser_fxt { + public void Test__Parse_ary(String raw, int bgn, int end, int[] expd) { + Gftest.Eq__ary(expd, new Int_ary_parser().Parse_ary(Bry_.new_a7(raw), bgn, end, Byte_ascii.Comma), "parse_ary failed"); + } +} diff --git a/400_xowa/src/gplx/core/primitives/Int_pool_tst.java b/400_xowa/src/gplx/core/primitives/Int_pool_tst.java index 1a7699bee..21d04210c 100644 --- a/400_xowa/src/gplx/core/primitives/Int_pool_tst.java +++ b/400_xowa/src/gplx/core/primitives/Int_pool_tst.java @@ -1,37 +1,37 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.core.primitives; import gplx.*; import gplx.core.*; import org.junit.*; public class Int_pool_tst { private final Int_pool_tstr tstr = new Int_pool_tstr(); @Before public void init() {tstr.Clear();} - @Test public void Get__one() { + @Test public void Get__one() { tstr.Test_get(0); } - @Test public void Get__many() { + @Test public void Get__many() { tstr.Test_get(0); tstr.Test_get(1); tstr.Test_get(2); } - @Test public void Del__one() { + @Test public void Del__one() { tstr.Test_get(0); tstr.Exec_del(0); tstr.Test_get(0); } - @Test public void Del__sequential() { + @Test public void Del__sequential() { tstr.Test_get(0); tstr.Test_get(1); tstr.Test_get(2); @@ -40,7 +40,7 @@ public class Int_pool_tst { tstr.Exec_del(1); tstr.Exec_del(0).Test_get(0); } - @Test public void Del__out_of_order() { + @Test public void Del__out_of_order() { tstr.Test_get(0); tstr.Test_get(1); tstr.Test_get(2); @@ -50,7 +50,7 @@ public class Int_pool_tst { tstr.Exec_del(2); tstr.Test_get(0); } - @Test public void Del__out_of_order_2() { + @Test public void Del__out_of_order_2() { tstr.Test_get(0); tstr.Test_get(1); tstr.Test_get(2); diff --git a/400_xowa/src/gplx/core/threads/Gfo_thread_cmd_base.java b/400_xowa/src/gplx/core/threads/Gfo_thread_cmd_base.java index 534fee79b..25ae98aad 100644 --- a/400_xowa/src/gplx/core/threads/Gfo_thread_cmd_base.java +++ b/400_xowa/src/gplx/core/threads/Gfo_thread_cmd_base.java @@ -1,37 +1,41 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ -package gplx.core.threads; import gplx.*; import gplx.core.*; -import gplx.core.brys.fmtrs.*; -import gplx.gfui.*; import gplx.gfui.kits.core.*; +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ +package gplx.core.threads; import gplx.GfoMsg; +import gplx.Gfo_invk; +import gplx.Gfo_invk_; +import gplx.Gfo_usr_dlg; +import gplx.GfsCtx; +import gplx.core.brys.fmtrs.Bry_fmtr_eval_mgr; +import gplx.gfui.kits.core.Gfui_kit; public class Gfo_thread_cmd_base implements Gfo_thread_cmd { - @gplx.Virtual public String Async_key() {return "undefined";} + public String Async_key() {return "undefined";} public void Cmd_ctor() {} public Gfo_thread_cmd_base Ctor(Gfo_usr_dlg usr_dlg, Gfui_kit kit) {this.usr_dlg = usr_dlg; this.kit = kit; return this;} protected Gfo_usr_dlg usr_dlg; protected Gfui_kit kit; public Gfo_invk Owner() {return owner;} public Gfo_thread_cmd_base Owner_(Gfo_invk v) {owner = v; return this;} Gfo_invk owner; public Bry_fmtr_eval_mgr Url_eval_mgr() {return url_eval_mgr;} public Gfo_thread_cmd_base Url_eval_mgr_(Bry_fmtr_eval_mgr v) {url_eval_mgr = v; return this;} Bry_fmtr_eval_mgr url_eval_mgr; public Gfo_thread_cmd Async_next_cmd() {return next_cmd;} public void Async_next_cmd_(Gfo_thread_cmd v) {next_cmd = v;} Gfo_thread_cmd next_cmd; - @gplx.Virtual public int Async_sleep_interval() {return Gfo_thread_cmd_.Async_sleep_interval_1_second;} - @gplx.Virtual public boolean Async_prog_enabled() {return false;} - @gplx.Virtual public byte Async_init() {return Gfo_thread_cmd_.Init_ok;} - @gplx.Virtual public boolean Async_term() {return true;} - @gplx.Virtual public void Async_prog_run(int async_sleep_sum) {} - @gplx.Virtual public void Async_bgn() {} - @gplx.Virtual public boolean Async_running() {return false;} - @gplx.Virtual public void Async_run() {} - @gplx.Virtual public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) { + public int Async_sleep_interval() {return Gfo_thread_cmd_.Async_sleep_interval_1_second;} + public boolean Async_prog_enabled() {return false;} + public byte Async_init() {return Gfo_thread_cmd_.Init_ok;} + public boolean Async_term() {return true;} + public void Async_prog_run(int async_sleep_sum) {} + public void Async_bgn() {} + public boolean Async_running() {return false;} + public void Async_run() {} + public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) { if (ctx.Match(k, Invk_owner)) return owner; else if (ctx.Match(k, Invk_async_bgn)) Async_bgn(); else return Gfo_invk_.Rv_unhandled; diff --git a/400_xowa/src/gplx/core/threads/Gfo_thread_cmd_download.java b/400_xowa/src/gplx/core/threads/Gfo_thread_cmd_download.java index aa9ca5e4c..7a7942468 100644 --- a/400_xowa/src/gplx/core/threads/Gfo_thread_cmd_download.java +++ b/400_xowa/src/gplx/core/threads/Gfo_thread_cmd_download.java @@ -1,18 +1,18 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.core.threads; import gplx.*; import gplx.core.*; import gplx.core.brys.fmtrs.*; import gplx.gfui.*; import gplx.gfui.kits.core.*; @@ -27,10 +27,10 @@ public class Gfo_thread_cmd_download implements Gfo_thread_cmd { public Bry_fmtr_eval_mgr Url_eval_mgr() {return url_eval_mgr;} public Gfo_thread_cmd_download Url_eval_mgr_(Bry_fmtr_eval_mgr v) {url_eval_mgr = v; return this;} Bry_fmtr_eval_mgr url_eval_mgr; public void Cmd_ctor() {} public Gfo_thread_cmd Async_next_cmd() {return next_cmd;} public void Async_next_cmd_(Gfo_thread_cmd v) {next_cmd = v;} Gfo_thread_cmd next_cmd; - @gplx.Virtual public String Async_key() {return KEY;} + public String Async_key() {return KEY;} public int Async_sleep_interval() {return Gfo_thread_cmd_.Async_sleep_interval_1_second;} public boolean Async_prog_enabled() {return false;} - @gplx.Virtual public byte Async_init() { + public byte Async_init() { if (Io_mgr.Instance.ExistsFil(trg)) { int rslt = kit.Ask_yes_no_cancel(GRP_KEY, "target_exists", "Target file already exists: '~{0}'.\nDo you want to delete it?", trg.Raw()); switch (rslt) { diff --git a/400_xowa/src/gplx/core/threads/Gfo_thread_cmd_replace.java b/400_xowa/src/gplx/core/threads/Gfo_thread_cmd_replace.java index c5ac8720c..295761b77 100644 --- a/400_xowa/src/gplx/core/threads/Gfo_thread_cmd_replace.java +++ b/400_xowa/src/gplx/core/threads/Gfo_thread_cmd_replace.java @@ -1,18 +1,18 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.core.threads; import gplx.*; import gplx.core.*; import gplx.core.brys.fmtrs.*; import gplx.gfui.*; import gplx.gfui.kits.core.*; @@ -28,14 +28,14 @@ public class Gfo_thread_cmd_replace implements Gfo_thread_cmd { public Gfo_thread_cmd Async_next_cmd() {return next_cmd;} public void Async_next_cmd_(Gfo_thread_cmd v) {next_cmd = v;} Gfo_thread_cmd next_cmd; public int Async_sleep_interval() {return Gfo_thread_cmd_.Async_sleep_interval_1_second;} public boolean Async_prog_enabled() {return false;} - @gplx.Virtual public byte Async_init() { + public byte Async_init() { if (!Io_mgr.Instance.ExistsFil(fil)) {kit.Ask_ok(GRP_KEY, "file_missing", "File does not exist: '~{0}'", fil.Raw()); return Gfo_thread_cmd_.Init_cancel_step;} return Gfo_thread_cmd_.Init_ok; } public boolean Async_term() {return true;} public void Async_prog_run(int async_sleep_sum) {} public boolean Async_running() {return false;} - @gplx.Virtual public void Async_run() {Exec_find_replace();} // NOTE: do not run async; if multiple commands for same file then they will not always work + public void Async_run() {Exec_find_replace();} // NOTE: do not run async; if multiple commands for same file then they will not always work public void Exec_find_replace() { String raw = Io_mgr.Instance.LoadFilStr(fil); int pairs_len = pairs.Count(); @@ -47,7 +47,7 @@ public class Gfo_thread_cmd_replace implements Gfo_thread_cmd { usr_dlg.Prog_many(GRP_KEY, "done", "replace completed: ~{0} ~{1}", fil.Raw(), pairs_len); } public List_adp pairs = List_adp_.New(); - @gplx.Virtual public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) { + public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) { if (ctx.Match(k, Invk_async_bgn)) Exec_find_replace(); else if (ctx.Match(k, Invk_owner)) return owner; else if (ctx.Match(k, Invk_fil_)) fil = Bry_fmtr_eval_mgr_.Eval_url(url_eval_mgr, m.ReadBry("v")); diff --git a/400_xowa/src/gplx/core/threads/Gfo_thread_cmd_unzip.java b/400_xowa/src/gplx/core/threads/Gfo_thread_cmd_unzip.java index 89ecaa775..f2fbca101 100644 --- a/400_xowa/src/gplx/core/threads/Gfo_thread_cmd_unzip.java +++ b/400_xowa/src/gplx/core/threads/Gfo_thread_cmd_unzip.java @@ -1,18 +1,18 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.core.threads; import gplx.*; import gplx.core.*; import gplx.core.brys.fmtrs.*; import gplx.core.envs.*; import gplx.gfui.*; import gplx.gfui.kits.core.*; import gplx.xowa.bldrs.cmds.utils.*; @@ -24,7 +24,7 @@ public class Gfo_thread_cmd_unzip implements Gfo_thread_cmd { } private Io_url src, trg; private Gfui_kit kit; private Gfo_usr_dlg usr_dlg; private Xob_unzip_wkr unzip_wkr; public Gfo_invk Owner() {return owner;} public Gfo_thread_cmd_unzip Owner_(Gfo_invk v) {owner = v; return this;} Gfo_invk owner; public void Cmd_ctor() {} - @gplx.Virtual public String Async_key() {return KEY;} + public String Async_key() {return KEY;} public Gfo_thread_cmd Async_next_cmd() {return next_cmd;} public void Async_next_cmd_(Gfo_thread_cmd v) {next_cmd = v;} Gfo_thread_cmd next_cmd; public Bry_fmtr_eval_mgr Url_eval_mgr() {return url_eval_mgr;} public Gfo_thread_cmd_unzip Url_eval_mgr_(Bry_fmtr_eval_mgr v) {url_eval_mgr = v; return this;} Bry_fmtr_eval_mgr url_eval_mgr; public int Async_sleep_interval() {return Gfo_thread_cmd_.Async_sleep_interval_1_second;} @@ -34,7 +34,7 @@ public class Gfo_thread_cmd_unzip implements Gfo_thread_cmd { if (trg.Type_fil()) size_str = gplx.core.ios.Io_size_.To_str(Io_mgr.Instance.QueryFil(trg).Size()); usr_dlg.Prog_many(GRP_KEY, "unzip", "unzipping: ~{0}", size_str); } - @gplx.Virtual public byte Async_init() { + public byte Async_init() { if (!Io_mgr.Instance.ExistsFil(src)) { kit.Ask_ok(GRP_KEY, "source_missing", "Source file does not exist: '~{0}'", src.Raw()); return Gfo_thread_cmd_.Init_cancel_step; diff --git a/400_xowa/src/gplx/dbs/bulks/Db_tbl_copy_tst.java b/400_xowa/src/gplx/dbs/bulks/Db_tbl_copy_tst.java index 71f80030b..50a91904a 100644 --- a/400_xowa/src/gplx/dbs/bulks/Db_tbl_copy_tst.java +++ b/400_xowa/src/gplx/dbs/bulks/Db_tbl_copy_tst.java @@ -1,23 +1,23 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.dbs.bulks; import gplx.*; import gplx.dbs.*; import org.junit.*; import gplx.core.tests.*; import gplx.dbs.metas.*; public class Db_tbl_copy_tst { private final Db_tbl_copy_fxt fxt = new Db_tbl_copy_fxt(); - @Test public void Basic() { + @Test public void Basic() { fxt.Test__bld_sql(fxt.Make_tbl("tbl_1", Dbmeta_fld_itm.new_int("fld_1"), Dbmeta_fld_itm.new_int("fld_2")), String_.Concat_lines_nl_skip_last ( "INSERT INTO trg" diff --git a/400_xowa/src/gplx/dbs/metas/updates/Schema_update_mgr_tst.java b/400_xowa/src/gplx/dbs/metas/updates/Schema_update_mgr_tst.java index 2b1ce4f4d..c61f1b830 100644 --- a/400_xowa/src/gplx/dbs/metas/updates/Schema_update_mgr_tst.java +++ b/400_xowa/src/gplx/dbs/metas/updates/Schema_update_mgr_tst.java @@ -1,26 +1,26 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.dbs.metas.updates; import gplx.*; import gplx.dbs.*; import gplx.dbs.metas.*; import org.junit.*; import gplx.dbs.*; public class Schema_update_mgr_tst { @Before public void init() {fxt.Clear();} private Schema_update_mgr_fxt fxt = new Schema_update_mgr_fxt(); - @Test public void Create() { + @Test public void Create() { fxt.Test_exec_y(new Schema_update_cmd__mock()); } - @Test public void Delete() { + @Test public void Delete() { fxt.Init_itm(Dbmeta_itm_tid.Tid_table, Schema_update_cmd__mock.Tbl_name); fxt.Test_exec_n(new Schema_update_cmd__mock()); } diff --git a/400_xowa/src/gplx/dbs/percentiles/Percentile_rng_tst.java b/400_xowa/src/gplx/dbs/percentiles/Percentile_rng_tst.java index 05396d203..5558520ef 100644 --- a/400_xowa/src/gplx/dbs/percentiles/Percentile_rng_tst.java +++ b/400_xowa/src/gplx/dbs/percentiles/Percentile_rng_tst.java @@ -1,36 +1,36 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.dbs.percentiles; import gplx.*; import gplx.dbs.*; import org.junit.*; public class Percentile_rng_tst { private final Percentile_rng_fxt fxt = new Percentile_rng_fxt(); @Before public void init() {fxt.Clear();} - @Test public void Found__000() { + @Test public void Found__000() { fxt.Test__rng(999994, 1000001); fxt.Exec__update( 0).Test__rng(999966, 999994); fxt.Exec__update( 0).Test__rng(999854, 999966); } - @Test public void Found__025() { + @Test public void Found__025() { fxt.Test__rng(999994, 1000001); fxt.Exec__update( 25).Test__rng(999973, 999994); fxt.Exec__update( 25).Test__rng(999931, 999973); fxt.Exec__update( 25).Test__rng(999889, 999931); fxt.Exec__update( 25).Test__rng(999847, 999889); } - @Test public void Calc_score_unit() { + @Test public void Calc_score_unit() { fxt.Test__calc_score_unit(50, 16000000, 1000000, 4); // to fill 50 -> 16 pages per point -> read every 4 points to get 64 pages fxt.Test__calc_score_unit(50, 1000, 1000000, 50000); // to fill 50 -> 1000 points per page -> read every 50k points to get 50 pages fxt.Test__calc_score_unit(50, 25, 1000000, 1000000); // range bounds check; to fill 50, always read full amount diff --git a/400_xowa/src/gplx/dbs/percentiles/Percentile_select_base.java b/400_xowa/src/gplx/dbs/percentiles/Percentile_select_base.java index 707129844..6122e70b3 100644 --- a/400_xowa/src/gplx/dbs/percentiles/Percentile_select_base.java +++ b/400_xowa/src/gplx/dbs/percentiles/Percentile_select_base.java @@ -1,18 +1,18 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.dbs.percentiles; import gplx.*; import gplx.dbs.*; public abstract class Percentile_select_base { // SELECT * FROM x ORDER BY y LIMIT 10; protected Cancelable cxl; @@ -53,13 +53,13 @@ public abstract class Percentile_select_base { // SELECT * FROM x ORDER BY y LIM } } protected abstract Db_rdr Rdr__init(); - @gplx.Virtual protected void Rdr__done(boolean found_enough, boolean none_left) {} - @gplx.Virtual protected Db_rdr Rdr__term(Db_rdr rdr) { + protected void Rdr__done(boolean found_enough, boolean none_left) {} + protected Db_rdr Rdr__term(Db_rdr rdr) { if (rdr != null) rdr.Rls(); return null; } - @gplx.Virtual protected void Rng__update(int rdr_found) {rng.Update(rdr_found);} - @gplx.Virtual protected boolean Row__read(Db_rdr rdr) {return true;} - @gplx.Virtual protected boolean Row__eval() {return true;} // NOTE: return true by default; DEPENDENCY: Srch_word_count_wkr - @gplx.Virtual protected boolean Found_enough() {return false;} + protected void Rng__update(int rdr_found) {rng.Update(rdr_found);} + protected boolean Row__read(Db_rdr rdr) {return true;} + protected boolean Row__eval() {return true;} // NOTE: return true by default; DEPENDENCY: Srch_word_count_wkr + protected boolean Found_enough() {return false;} } diff --git a/400_xowa/src/gplx/fsdb/data/Fsd_bin_tbl.java b/400_xowa/src/gplx/fsdb/data/Fsd_bin_tbl.java index ea914d419..3b8e8fb65 100644 --- a/400_xowa/src/gplx/fsdb/data/Fsd_bin_tbl.java +++ b/400_xowa/src/gplx/fsdb/data/Fsd_bin_tbl.java @@ -1,23 +1,24 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ -package gplx.fsdb.data; import gplx.*; import gplx.fsdb.*; +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ +package gplx.fsdb.data; import gplx.*; import gplx.core.primitives.*; import gplx.core.envs.*; -import gplx.dbs.*; import gplx.core.ios.*; import gplx.core.ios.streams.*; -import gplx.dbs.engines.sqlite.*; -public class Fsd_bin_tbl implements Rls_able { +import gplx.dbs.*; +import gplx.core.ios.streams.*; + +public class Fsd_bin_tbl implements Rls_able { public final String fld__owner_id, fld__owner_tid, fld__part_id, fld__data_url, fld__data; private Db_conn conn; private Db_stmt stmt_insert, stmt_select, stmt_select_itm; private Bry_bfr tmp_bfr; private final Bool_obj_ref saved_in_parts = Bool_obj_ref.n_(); @@ -26,7 +27,7 @@ public class Fsd_bin_tbl implements Rls_able { fld__owner_id = flds.Add_int_pkey ("bin_owner_id"); fld__owner_tid = flds.Add_byte ("bin_owner_tid"); fld__part_id = flds.Add_int ("bin_part_id"); - fld__data_url = flds.Add_str ("bin_data_url", 255); + fld__data_url = flds.Add_str ("bin_data_url", 255); // for items which are > 2 GB, just store it on disc, with a path to it; EX: 120 GB file fld__data = flds.Add_bry ("bin_data"); // mediumblob conn.Rls_reg(this); } diff --git a/400_xowa/src/gplx/fsdb/data/Fsd_thm_tbl_tst.java b/400_xowa/src/gplx/fsdb/data/Fsd_thm_tbl_tst.java index 4a98d1984..ae69f1641 100644 --- a/400_xowa/src/gplx/fsdb/data/Fsd_thm_tbl_tst.java +++ b/400_xowa/src/gplx/fsdb/data/Fsd_thm_tbl_tst.java @@ -1,23 +1,23 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.fsdb.data; import gplx.*; import gplx.fsdb.*; import org.junit.*; public class Fsd_thm_tbl_tst { @Before public void init() {fxt.Clear();} private Fsd_thm_tbl_fxt fxt = new Fsd_thm_tbl_fxt(); - @Test public void Basic() { + @Test public void Basic() { fxt.Init_list(fxt.Make(100), fxt.Make(200), fxt.Make(400)); fxt.Test_match_nearest_itm(fxt.Make(400), fxt.Make(400)); fxt.Test_match_nearest_itm(fxt.Make(200), fxt.Make(200)); @@ -26,7 +26,7 @@ public class Fsd_thm_tbl_tst { fxt.Test_match_nearest_itm(fxt.Make(150), fxt.Make(200)); fxt.Test_match_nearest_itm(fxt.Make(999), fxt.Make(400)); } - @Test public void Empty() { + @Test public void Empty() { fxt.Init_list(); // no items fxt.Test_match_nearest_itm(fxt.Make(100), Fsd_thm_itm.Null); } diff --git a/400_xowa/src/gplx/gfui/Gfui_bnd_parser_tst.java b/400_xowa/src/gplx/gfui/Gfui_bnd_parser_tst.java index 31cb8d57e..a3585c13b 100644 --- a/400_xowa/src/gplx/gfui/Gfui_bnd_parser_tst.java +++ b/400_xowa/src/gplx/gfui/Gfui_bnd_parser_tst.java @@ -1,49 +1,49 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.gfui; import gplx.*; import org.junit.*; public class Gfui_bnd_parser_tst { @Before public void init() {fxt.Clear();} private Gfui_bnd_parser_fxt fxt = new Gfui_bnd_parser_fxt(); - @Test public void Norm_one() { + @Test public void Norm_one() { fxt.Test__to_norm("mod.c" , "Ctrl"); fxt.Test__to_norm("key.ctrl" , "Ctrl"); fxt.Test__to_norm("key.a" , "A"); fxt.Test__to_norm("key.left" , "Left"); } - @Test public void Norm_add() { + @Test public void Norm_add() { fxt.Test__to_norm("mod.c+key.a" , "Ctrl + A"); fxt.Test__to_norm("mod.ca+key.a" , "Ctrl + Alt + A"); fxt.Test__to_norm("mod.cas+key.a" , "Ctrl + Alt + Shift + A"); } - @Test public void Norm_chord() { + @Test public void Norm_chord() { fxt.Test__to_norm("key.a,key.b" , "A, B"); } - @Test public void Norm_add_and_chord() { + @Test public void Norm_add_and_chord() { fxt.Test__to_norm("mod.c+key.a,mod.a+key.b" , "Ctrl + A, Alt + B"); } - @Test public void Gfui_add() { + @Test public void Gfui_add() { fxt.Test__to_gfui("Ctrl + A" , "mod.c+key.a"); fxt.Test__to_gfui("Ctrl + Shift + A" , "mod.cs+key.a"); fxt.Test__to_gfui("Ctrl + Alt + Shift + A" , "mod.cas+key.a"); } - @Test public void Keypad_enter() { + @Test public void Keypad_enter() { fxt.Test__to_norm("key.numpad_enter" , "Numpad Enter"); fxt.Test__to_norm("mod.c+key.numpad_enter" , "Ctrl + Numpad Enter"); } - @Test public void None() { + @Test public void None() { fxt.Test__to_gfui("None" , "key.none"); fxt.Test__to_norm("key.none" , "None"); } diff --git a/400_xowa/src/gplx/langs/dsvs/Dsv_tbl_parser_int_tst.java b/400_xowa/src/gplx/langs/dsvs/Dsv_tbl_parser_int_tst.java index eea30e700..0de1f5120 100644 --- a/400_xowa/src/gplx/langs/dsvs/Dsv_tbl_parser_int_tst.java +++ b/400_xowa/src/gplx/langs/dsvs/Dsv_tbl_parser_int_tst.java @@ -1,23 +1,23 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.langs.dsvs; import gplx.*; import gplx.langs.*; import org.junit.*; public class Dsv_tbl_parser_int_tst { private Dsv_mok_fxt fxt = new Dsv_mok_fxt(); - @Test public void Basic() { + @Test public void Basic() { fxt .Test_load(String_.Concat_lines_nl_skip_last ( "a|1|3" , "b|2|4" diff --git a/400_xowa/src/gplx/langs/dsvs/Dsv_tbl_parser_str_tst.java b/400_xowa/src/gplx/langs/dsvs/Dsv_tbl_parser_str_tst.java index 2f9b1fd32..7296b8d3d 100644 --- a/400_xowa/src/gplx/langs/dsvs/Dsv_tbl_parser_str_tst.java +++ b/400_xowa/src/gplx/langs/dsvs/Dsv_tbl_parser_str_tst.java @@ -1,23 +1,23 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.langs.dsvs; import gplx.*; import gplx.langs.*; import org.junit.*; public class Dsv_tbl_parser_str_tst { private Dsv_mok_fxt fxt = new Dsv_mok_fxt(); - @Test public void Basic() { + @Test public void Basic() { fxt .Test_load(String_.Concat_lines_nl_skip_last ( "a|A" , "b|B" @@ -27,7 +27,7 @@ public class Dsv_tbl_parser_str_tst { , fxt.itm_str_("b", "B") ); } - @Test public void Blank_lines() { + @Test public void Blank_lines() { fxt .Test_load(String_.Concat_lines_nl_skip_last ( "" , "a|A" @@ -40,7 +40,7 @@ public class Dsv_tbl_parser_str_tst { , fxt.itm_str_("b", "B") ); } - @Test public void Incomplete_row() { + @Test public void Incomplete_row() { fxt .Test_load(String_.Concat_lines_nl_skip_last ( "a" , "b" @@ -51,7 +51,7 @@ public class Dsv_tbl_parser_str_tst { , fxt.itm_str_("b") ); } - @Test public void Incomplete_row_2() { // PURPOSE: handle multiple incomplete cells + @Test public void Incomplete_row_2() { // PURPOSE: handle multiple incomplete cells fxt .Test_load(String_.Concat_lines_nl_skip_last ( "a|") , fxt.mgr_str_(3) diff --git a/400_xowa/src/gplx/langs/dsvs/Dsv_wkr_base.java b/400_xowa/src/gplx/langs/dsvs/Dsv_wkr_base.java index 103bf4636..1d090f1b8 100644 --- a/400_xowa/src/gplx/langs/dsvs/Dsv_wkr_base.java +++ b/400_xowa/src/gplx/langs/dsvs/Dsv_wkr_base.java @@ -1,25 +1,25 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.langs.dsvs; import gplx.*; import gplx.langs.*; public abstract class Dsv_wkr_base implements Gfo_invk { public abstract Dsv_fld_parser[] Fld_parsers(); public byte[] Src() {return src;} private byte[] src; public abstract void Commit_itm(Dsv_tbl_parser parser, int pos); - @gplx.Virtual public boolean Write_bry(Dsv_tbl_parser parser, int fld_idx, byte[] src, int bgn, int end) {return false;} - @gplx.Virtual public boolean Write_int(Dsv_tbl_parser parser, int fld_idx, int pos, int val_int) {return false;} + public boolean Write_bry(Dsv_tbl_parser parser, int fld_idx, byte[] src, int bgn, int end) {return false;} + public boolean Write_int(Dsv_tbl_parser parser, int fld_idx, int pos, int val_int) {return false;} public void Load_by_bry(byte[] src) { this.src = src; Dsv_tbl_parser tbl_parser = new Dsv_tbl_parser(); // NOTE: this proc should only be called once, so don't bother caching tbl_parser @@ -29,8 +29,8 @@ public abstract class Dsv_wkr_base implements Gfo_invk { tbl_parser.Rls(); Load_by_bry_end(); } - @gplx.Virtual public void Load_by_bry_bgn() {} - @gplx.Virtual public void Load_by_bry_end() {} + public void Load_by_bry_bgn() {} + public void Load_by_bry_end() {} public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) { if (ctx.Match(k, Invk_load_by_str)) Load_by_bry(m.ReadBry("v")); else return Gfo_invk_.Rv_unhandled; diff --git a/400_xowa/src/gplx/langs/gfs/Gfs_msg_bldr_tst.java b/400_xowa/src/gplx/langs/gfs/Gfs_msg_bldr_tst.java index 8196ac652..7b34aefcb 100644 --- a/400_xowa/src/gplx/langs/gfs/Gfs_msg_bldr_tst.java +++ b/400_xowa/src/gplx/langs/gfs/Gfs_msg_bldr_tst.java @@ -1,42 +1,42 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.langs.gfs; import gplx.*; import gplx.langs.*; import org.junit.*; import gplx.core.strings.*; public class Gfs_msg_bldr_tst { @Before public void init() {fxt.Clear();} Gfs_msg_bldr_fxt fxt = new Gfs_msg_bldr_fxt(); - @Test public void Basic() { + @Test public void Basic() { fxt.Test_build("a;", fxt.msg_("a")); } - @Test public void Dot() { + @Test public void Dot() { fxt.Test_build("a.b.c;" , fxt.msg_("a").Subs_ ( fxt.msg_("b").Subs_ ( fxt.msg_("c") ))); } - @Test public void Args() { + @Test public void Args() { fxt.Test_build("a('b', 'c');", fxt.msg_("a", fxt.kv_("", "b"), fxt.kv_("", "c"))); } - @Test public void Args_num() { + @Test public void Args_num() { fxt.Test_build("a(1);", fxt.msg_("a", fxt.kv_("", "1"))); } - @Test public void Assign() { + @Test public void Assign() { fxt.Test_build("a = 'b';", fxt.msg_("a_", fxt.kv_("", "b"))); } - @Test public void Assign_num() { + @Test public void Assign_num() { fxt.Test_build("a = 1;", fxt.msg_("a_", fxt.kv_("", "1"))); } } diff --git a/400_xowa/src/gplx/langs/gfs/Gfs_parser_tst.java b/400_xowa/src/gplx/langs/gfs/Gfs_parser_tst.java index 712a78551..c7fc471a7 100644 --- a/400_xowa/src/gplx/langs/gfs/Gfs_parser_tst.java +++ b/400_xowa/src/gplx/langs/gfs/Gfs_parser_tst.java @@ -1,66 +1,66 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.langs.gfs; import gplx.*; import gplx.langs.*; import org.junit.*; public class Gfs_parser_tst { @Before public void init() {fxt.Clear();} Gfs_parser_fxt fxt = new Gfs_parser_fxt(); - @Test public void Semicolon() { + @Test public void Semicolon() { fxt .Test_parse("a;", fxt.nde_("a")); fxt .Test_parse("a;b;c;", fxt.nde_("a"), fxt.nde_("b"), fxt.nde_("c")); fxt .Test_parse("a_0;", fxt.nde_("a_0")); } - @Test public void Dot() { + @Test public void Dot() { fxt .Test_parse("a.b;", fxt.nde_("a").Subs_add(fxt.nde_("b"))); fxt .Test_parse("a.b;c.d;", fxt.nde_("a").Subs_add(fxt.nde_("b")), fxt.nde_("c").Subs_add(fxt.nde_("d"))); } - @Test public void Parens() { + @Test public void Parens() { fxt .Test_parse("a();b();", fxt.nde_("a"), fxt.nde_("b")); fxt .Test_parse("a().b();c().d();", fxt.nde_("a").Subs_add(fxt.nde_("b")), fxt.nde_("c").Subs_add(fxt.nde_("d"))); } - @Test public void Num() { + @Test public void Num() { fxt .Test_parse("a(1,2);", fxt.nde_("a").Atrs_add_many(fxt.val_("1"), fxt.val_("2"))); } - @Test public void Quote() { + @Test public void Quote() { fxt .Test_parse("a('b');", fxt.nde_("a").Atrs_add(fxt.val_("b"))); } - @Test public void Quote_escaped() { + @Test public void Quote_escaped() { fxt .Test_parse("a('b''c''d');", fxt.nde_("a").Atrs_add(fxt.val_("b'c'd"))); } - @Test public void Quote_escaped_2() { + @Test public void Quote_escaped_2() { fxt .Test_parse("a('a''''b');", fxt.nde_("a").Atrs_add(fxt.val_("a''b"))); } - @Test public void Quote_mixed() { + @Test public void Quote_mixed() { fxt .Test_parse("a('b\"c');", fxt.nde_("a").Atrs_add(fxt.val_("b\"c"))); } - @Test public void Comma() { + @Test public void Comma() { fxt .Test_parse("a('b','c','d');", fxt.nde_("a").Atrs_add_many(fxt.val_("b"), fxt.val_("c"), fxt.val_("d"))); } - @Test public void Ws() { + @Test public void Ws() { fxt .Test_parse(" a ( 'b' , 'c' ) ; ", fxt.nde_("a").Atrs_add_many(fxt.val_("b"), fxt.val_("c"))); } - @Test public void Comment_slash_slash() { + @Test public void Comment_slash_slash() { fxt .Test_parse("//z\na;//y\n", fxt.nde_("a")); } - @Test public void Comment_slash_star() { + @Test public void Comment_slash_star() { fxt .Test_parse("/*z*/a;/*y*/", fxt.nde_("a")); } - @Test public void Curly() { + @Test public void Curly() { fxt .Test_parse("a{b;}", fxt.nde_("a").Subs_add(fxt.nde_("b"))); } - @Test public void Curly_nest() { + @Test public void Curly_nest() { fxt .Test_parse("a{b{c{d;}}}" , fxt.nde_("a").Subs_add ( fxt.nde_("b").Subs_add @@ -68,7 +68,7 @@ public class Gfs_parser_tst { ( fxt.nde_("d") )))); } - @Test public void Curly_nest_peers() { + @Test public void Curly_nest_peers() { fxt .Test_parse(String_.Concat_lines_nl ( "a{" , " a0{" @@ -90,14 +90,14 @@ public class Gfs_parser_tst { , fxt.nde_("a1") )); } - @Test public void Curly_dot() { + @Test public void Curly_dot() { fxt .Test_parse("a{a0.a00;a1.a10;}" , fxt.nde_("a").Subs_add_many ( fxt.nde_("a0").Subs_add_many(fxt.nde_("a00")) , fxt.nde_("a1").Subs_add_many(fxt.nde_("a10")) )); } - @Test public void Eq() { + @Test public void Eq() { fxt .Test_parse("a='b';", fxt.nde_("a").Atrs_add(fxt.val_("b"))); fxt .Test_parse("a.b.c='d';" , fxt.nde_("a").Subs_add @@ -111,7 +111,7 @@ public class Gfs_parser_tst { , fxt.nde_("e").Atrs_add(fxt.val_("f")) ))); } - @Test public void Curly_nest_peers2() { + @Test public void Curly_nest_peers2() { fxt .Test_parse(String_.Concat_lines_nl ( "a() {" , " k1 = 'v1';" @@ -122,7 +122,7 @@ public class Gfs_parser_tst { ) ); } - @Test public void Fail() { + @Test public void Fail() { fxt .Test_parse_fail("a(.);", Gfs_err_mgr.Fail_msg_invalid_lxr); // (.) fxt .Test_parse_fail("a..b;", Gfs_err_mgr.Fail_msg_invalid_lxr); // .. fxt .Test_parse_fail("a.;", Gfs_err_mgr.Fail_msg_invalid_lxr); // .; diff --git a/400_xowa/src/gplx/langs/htmls/Gfh_parser_tst.java b/400_xowa/src/gplx/langs/htmls/Gfh_parser_tst.java index 71e8a03fb..4e67ceb34 100644 --- a/400_xowa/src/gplx/langs/htmls/Gfh_parser_tst.java +++ b/400_xowa/src/gplx/langs/htmls/Gfh_parser_tst.java @@ -1,28 +1,28 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.langs.htmls; import gplx.*; import gplx.langs.*; import org.junit.*; public class Gfh_parser_tst { @Before public void init() {fxt.Clear();} private Gfh_parser_fxt fxt = new Gfh_parser_fxt(); - @Test public void One() {fxt.Test_parse_find_all("", "id0");} - @Test public void Many() {fxt.Test_parse_find_all("", "id0", "id1", "id2");} - @Test public void Inline() {fxt.Test_parse_find_all("", "id0");} - @Test public void Mix() {fxt.Test_parse_find_all("012id=id2345abc", "id0", "id1", "id2");} - @Test public void Quote_double() {fxt.Test_parse_find_all("", "id'0");} - @Test public void Quote_escape() {fxt.Test_parse_find_all("", "id'0");} + @Test public void One() {fxt.Test_parse_find_all("", "id0");} + @Test public void Many() {fxt.Test_parse_find_all("", "id0", "id1", "id2");} + @Test public void Inline() {fxt.Test_parse_find_all("", "id0");} + @Test public void Mix() {fxt.Test_parse_find_all("012id=id2345abc", "id0", "id1", "id2");} + @Test public void Quote_double() {fxt.Test_parse_find_all("", "id'0");} + @Test public void Quote_escape() {fxt.Test_parse_find_all("", "id'0");} } class Gfh_parser_fxt { public void Clear() { diff --git a/400_xowa/src/gplx/langs/htmls/Gfh_utl__basic__tst.java b/400_xowa/src/gplx/langs/htmls/Gfh_utl__basic__tst.java index 6e5367f42..c4f339808 100644 --- a/400_xowa/src/gplx/langs/htmls/Gfh_utl__basic__tst.java +++ b/400_xowa/src/gplx/langs/htmls/Gfh_utl__basic__tst.java @@ -1,33 +1,33 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.langs.htmls; import gplx.*; import gplx.langs.*; import org.junit.*; public class Gfh_utl__basic__tst { @Before public void init() {fxt.Clear();} private Gfh_class_fxt fxt = new Gfh_class_fxt(); - @Test public void Escape() { + @Test public void Escape() { fxt.Test_escape_html(Bool_.Y, Bool_.Y, Bool_.Y, Bool_.Y, Bool_.Y, "a present fxt.Test_escape_html(Bool_.Y, Bool_.Y, Bool_.Y, Bool_.Y, Bool_.Y, "a<>'&\"b" , "a<>'&"b"); } - @Test public void Escape_for_atr_val() { + @Test public void Escape_for_atr_val() { fxt.Test_escape_for_atr("abc" , Bool_.N, "abc"); // basic fxt.Test_escape_for_atr("a'\"b" , Bool_.Y, "a'\"b"); // quote is ' fxt.Test_escape_for_atr("a'\"b" , Bool_.N, "a'"b"); // quote is " } - @Test public void Unescape() { + @Test public void Unescape() { fxt.Test_unescape_html(Bool_.Y, Bool_.Y, Bool_.Y, Bool_.Y, Bool_.Y, "a<>'&"b" , "a<>'&\"b"); // basic } } diff --git a/400_xowa/src/gplx/langs/htmls/Gfh_utl__comments__tst.java b/400_xowa/src/gplx/langs/htmls/Gfh_utl__comments__tst.java index 35eca35c6..6a6241b58 100644 --- a/400_xowa/src/gplx/langs/htmls/Gfh_utl__comments__tst.java +++ b/400_xowa/src/gplx/langs/htmls/Gfh_utl__comments__tst.java @@ -13,12 +13,12 @@ The terms of each license can be found in the source code repository: GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt */ -package gplx.langs.htmls; import gplx.*; import gplx.langs.*; -import org.junit.*; -public class Gfh_utl__comments__tst { - @Before public void init() {fxt.Clear();} private final Gfh_class_fxt fxt = new Gfh_class_fxt(); - @Test public void Basic() {fxt.Test_del_comments("ac" , "ac");} - @Test public void Bgn_missing() {fxt.Test_del_comments("a b c" , "a b c");} - @Test public void End_missing() {fxt.Test_del_comments("ace" , "ace");} -} +package gplx.langs.htmls; import gplx.*; import gplx.langs.*; +import org.junit.*; +public class Gfh_utl__comments__tst { + @Before public void init() {fxt.Clear();} private final Gfh_class_fxt fxt = new Gfh_class_fxt(); + @Test public void Basic() {fxt.Test_del_comments("ac" , "ac");} + @Test public void Bgn_missing() {fxt.Test_del_comments("a b c" , "a b c");} + @Test public void End_missing() {fxt.Test_del_comments("ace" , "ace");} +} diff --git a/400_xowa/src/gplx/langs/htmls/clses/Gfh_class__tst.java b/400_xowa/src/gplx/langs/htmls/clses/Gfh_class__tst.java index 357d21500..6ca22ee04 100644 --- a/400_xowa/src/gplx/langs/htmls/clses/Gfh_class__tst.java +++ b/400_xowa/src/gplx/langs/htmls/clses/Gfh_class__tst.java @@ -1,28 +1,28 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.langs.htmls.clses; import gplx.*; import gplx.langs.*; import gplx.langs.htmls.*; import org.junit.*; public class Gfh_class__tst { private final Gfh_class__fxt fxt = new Gfh_class__fxt(); - @Test public void Has() { + @Test public void Has() { fxt.Test__has__y("a b c", "a", "b", "c"); fxt.Test__has__n("a b c", "d"); fxt.Test__has__n("ab", "a"); } - @Test public void Cls__has__hash() { + @Test public void Cls__has__hash() { Hash_adp_bry hash = fxt.Make_hash("x", "y", "z"); fxt.Test__find_1st(hash, 0, "x"); fxt.Test__find_1st(hash, 2, "z"); diff --git a/400_xowa/src/gplx/langs/htmls/clses/Gfh_class_parser__tst.java b/400_xowa/src/gplx/langs/htmls/clses/Gfh_class_parser__tst.java index baf24b949..7ae2bdd7e 100644 --- a/400_xowa/src/gplx/langs/htmls/clses/Gfh_class_parser__tst.java +++ b/400_xowa/src/gplx/langs/htmls/clses/Gfh_class_parser__tst.java @@ -1,24 +1,24 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.langs.htmls.clses; import gplx.*; import gplx.langs.*; import gplx.langs.htmls.*; import org.junit.*; public class Gfh_class_parser__tst { private final Gfh_class_parser__fxt fxt = new Gfh_class_parser__fxt(); - @Test public void Basic() {fxt.Test__parse("v1" , "v1");} - @Test public void Many() {fxt.Test__parse("v1 v2" , "v1", "v2");} + @Test public void Basic() {fxt.Test__parse("v1" , "v1");} + @Test public void Many() {fxt.Test__parse("v1 v2" , "v1", "v2");} } class Gfh_class_parser__fxt { private final Gfh_class_wkr__list wkr = new Gfh_class_wkr__list(); diff --git a/400_xowa/src/gplx/langs/htmls/docs/Gfh_tag_rdr_tst.java b/400_xowa/src/gplx/langs/htmls/docs/Gfh_tag_rdr_tst.java index 9d60046c3..2f4daa0e3 100644 --- a/400_xowa/src/gplx/langs/htmls/docs/Gfh_tag_rdr_tst.java +++ b/400_xowa/src/gplx/langs/htmls/docs/Gfh_tag_rdr_tst.java @@ -1,48 +1,48 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.langs.htmls.docs; import gplx.*; import gplx.langs.*; import gplx.langs.htmls.*; import org.junit.*; public class Gfh_tag_rdr_tst { private final Gfh_tag_rdr_fxt fxt = new Gfh_tag_rdr_fxt(); - @Test public void Basic() { + @Test public void Basic() { fxt.Init("1
2
3
4
5
6
7"); fxt.Test__move_fwd_head("
"); fxt.Test__pos("2"); fxt.Test__peek_fwd_head("
"); fxt.Test__pos("2"); fxt.Test__move_fwd_head("
"); fxt.Test__pos("4"); fxt.Test__peek_bwd_tail("
3") ; fxt.Test__pos("4"); } - @Test public void Comment() { + @Test public void Comment() { fxt.Init("135
6
"); fxt.Test__move_fwd_head(Gfh_tag_.Id__any , "
") ; fxt.Test__pos("6"); } - @Test public void Meta() { + @Test public void Meta() { fxt.Init("1
2
3"); fxt.Test__move_fwd_head(Gfh_tag_.Id__div , "
") ; fxt.Test__pos("2"); } - @Test public void Recursive__same_tags() { + @Test public void Recursive__same_tags() { fxt.Init("12345"); fxt.Test__move_fwd_head(Gfh_tag_.Id__a , "") ; fxt.Test__pos("2"); fxt.Test__move_fwd_tail(Gfh_tag_.Id__a , "") ; fxt.Test__pos("5"); } - @Test public void Recursive__diff_tags() { + @Test public void Recursive__diff_tags() { fxt.Init("1
2345
6"); fxt.Test__move_fwd_head(Gfh_tag_.Id__div , "
") ; fxt.Test__pos("2"); fxt.Test__move_fwd_tail(Gfh_tag_.Id__div , "
") ; fxt.Test__pos("6"); } - @Test public void Inline() { + @Test public void Inline() { fxt.Init("1
2"); fxt.Test__move_fwd_head(Gfh_tag_.Id__br , "
") ; fxt.Test__pos("2"); } diff --git a/400_xowa/src/gplx/langs/htmls/encoders/Gfo_url_encoder_tst.java b/400_xowa/src/gplx/langs/htmls/encoders/Gfo_url_encoder_tst.java index 7046c0bf9..7a9013da7 100644 --- a/400_xowa/src/gplx/langs/htmls/encoders/Gfo_url_encoder_tst.java +++ b/400_xowa/src/gplx/langs/htmls/encoders/Gfo_url_encoder_tst.java @@ -1,67 +1,67 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.langs.htmls.encoders; import gplx.*; import gplx.langs.*; import gplx.langs.htmls.*; import org.junit.*; public class Gfo_url_encoder_tst { private final Gfo_url_encoder_fxt fxt = new Gfo_url_encoder_fxt(); - @Test public void Id__nums() {fxt.Encoder_id().Test__bicode("0123456789");} - @Test public void Id__ltrs_lower() {fxt.Encoder_id().Test__bicode("abcdefghijklmnopqrstuvwxyz");} - @Test public void Id__ltrs_upper() {fxt.Encoder_id().Test__bicode("ABCDEFGHIJKLMNOPQRSTUVWXYZ");} - @Test public void Id__syms_0() {fxt.Encoder_id().Test__bicode("!\"#$%&'()*+,-./");} // ISSUE#:462; DATE:2019-05-12 - @Test public void Id__syms_1() {fxt.Encoder_id().Test__bicode(":;=?@");} // ISSUE#:462; DATE:2019-05-12 - @Test public void Id__syms_2() {fxt.Encoder_id().Test__bicode("[\\]^`");} // ISSUE#:462; DATE:2019-05-12 - @Test public void Id__syms_3() {fxt.Encoder_id().Test__bicode("{|}~");}// ISSUE#:462; DATE:2019-05-12 - @Test public void Id__foreign() {fxt.Encoder_id().Test__bicode("aéb");} - @Test public void Id__space() {fxt.Encoder_id().Test__bicode("a b", "a_b");} - @Test public void Id__syms_1_angles() { // NOTE:should not be encoded, but will break existings tests; EX:{{#tag:pre|a|id='
'}}; DATE:2019-05-12; + @Test public void Id__nums() {fxt.Encoder_id().Test__bicode("0123456789");} + @Test public void Id__ltrs_lower() {fxt.Encoder_id().Test__bicode("abcdefghijklmnopqrstuvwxyz");} + @Test public void Id__ltrs_upper() {fxt.Encoder_id().Test__bicode("ABCDEFGHIJKLMNOPQRSTUVWXYZ");} + @Test public void Id__syms_0() {fxt.Encoder_id().Test__bicode("!\"#$%&'()*+,-./");} // ISSUE#:462; DATE:2019-05-12 + @Test public void Id__syms_1() {fxt.Encoder_id().Test__bicode(":;=?@");} // ISSUE#:462; DATE:2019-05-12 + @Test public void Id__syms_2() {fxt.Encoder_id().Test__bicode("[\\]^`");} // ISSUE#:462; DATE:2019-05-12 + @Test public void Id__syms_3() {fxt.Encoder_id().Test__bicode("{|}~");}// ISSUE#:462; DATE:2019-05-12 + @Test public void Id__foreign() {fxt.Encoder_id().Test__bicode("aéb");} + @Test public void Id__space() {fxt.Encoder_id().Test__bicode("a b", "a_b");} + @Test public void Id__syms_1_angles() { // NOTE:should not be encoded, but will break existings tests; EX:{{#tag:pre|a|id='
'}}; DATE:2019-05-12; fxt.Encoder_id().Test__encode("<", ".3C"); fxt.Encoder_id().Test__decode(".3C", "<"); fxt.Encoder_id().Test__encode(">", ".3E"); fxt.Encoder_id().Test__decode(".3E", ">"); } - @Test public void Id__syms_2_lodash() { // ISSUE#:462; DATE:2019-05-12 + @Test public void Id__syms_2_lodash() { // ISSUE#:462; DATE:2019-05-12 fxt.Encoder_id().Test__encode("_", "_"); fxt.Encoder_id().Test__decode("_", " "); } - @Test public void Id__nbsp() { + @Test public void Id__nbsp() { fxt.Encoder_id().Test__encode("a b", "a.C2.A0b"); // NOTE: not just .A0 (160) but utf8-encoded .C2.A0 fxt.Encoder_id().Test__decode("a.C2.A0b", "a b"); // WS is nbsp } - @Test public void Id__err() { + @Test public void Id__err() { byte[] raw = Bry_.new_a7("0%.jpg"); Bry_bfr tmp_bfr = Bry_bfr_.New(); fxt.Encoder_id().Encoder().Decode(tmp_bfr, Bool_.N, raw, 0, raw.length); Tfds.Eq("0%.jpg", tmp_bfr.To_str_and_clear()); } - @Test public void Ttl__syms__diff() {fxt.Encoder_ttl().Test__encode(" &'=+", "_%26%27%3D%2B");} - @Test public void Ttl__syms__same() {fxt.Encoder_ttl().Test__encode("!\"#$%()*,-./:;<>?@[\\]^_`{|}~", "!\"#$%()*,-./:;<>?@[\\]^_`{|}~");} - @Test public void Url__syms() {fxt.Encoder_url().Test__bicode("!?^~", "%21%3F%5E%7E");} - @Test public void Url__foreign() {fxt.Encoder_url().Test__bicode("aéb", "a%C3%A9b");} - @Test public void Url__space() {fxt.Encoder_url().Test__bicode("a b", "a+b");} - @Test public void Href__space() { + @Test public void Ttl__syms__diff() {fxt.Encoder_ttl().Test__encode(" &'=+", "_%26%27%3D%2B");} + @Test public void Ttl__syms__same() {fxt.Encoder_ttl().Test__encode("!\"#$%()*,-./:;<>?@[\\]^_`{|}~", "!\"#$%()*,-./:;<>?@[\\]^_`{|}~");} + @Test public void Url__syms() {fxt.Encoder_url().Test__bicode("!?^~", "%21%3F%5E%7E");} + @Test public void Url__foreign() {fxt.Encoder_url().Test__bicode("aéb", "a%C3%A9b");} + @Test public void Url__space() {fxt.Encoder_url().Test__bicode("a b", "a+b");} + @Test public void Href__space() { fxt.Encoder_href().Test__encode("a b", "a_b"); } - @Test public void Href__special_and_anchor() { // PURPOSE: MediaWiki encodes with % for ttls, but . for anchors; REF:Title.php!(before-anchor)getLocalUrl;wfUrlencode (after-anchor)escapeFragmentForURL + @Test public void Href__special_and_anchor() { // PURPOSE: MediaWiki encodes with % for ttls, but . for anchors; REF:Title.php!(before-anchor)getLocalUrl;wfUrlencode (after-anchor)escapeFragmentForURL fxt.Encoder_href().Test__bicode("^#^", "%5E#^"); fxt.Encoder_href().Test__encode("A#", "A#"); } - @Test public void Href__invalid() { // PURPOSE: check that invalid url decodings are rendered literally; DATE:2014-04-10 + @Test public void Href__invalid() { // PURPOSE: check that invalid url decodings are rendered literally; DATE:2014-04-10 fxt.Encoder_href().Test__encode("%GC", "%25GC"); } - @Test public void Fsys__wnt() { + @Test public void Fsys__wnt() { fxt.Encoder_fsys_safe().Test__encode("Options/HTML", "Options%2FHTML"); } } diff --git a/400_xowa/src/gplx/langs/htmls/styles/Gfh_style_parser__tst.java b/400_xowa/src/gplx/langs/htmls/styles/Gfh_style_parser__tst.java index a464ab249..d920847ed 100644 --- a/400_xowa/src/gplx/langs/htmls/styles/Gfh_style_parser__tst.java +++ b/400_xowa/src/gplx/langs/htmls/styles/Gfh_style_parser__tst.java @@ -1,40 +1,40 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.langs.htmls.styles; import gplx.*; import gplx.langs.*; import gplx.langs.htmls.*; import org.junit.*; public class Gfh_style_parser__tst { private final Gfh_style_parser__fxt fxt = new Gfh_style_parser__fxt(); - @Test public void Basic() { + @Test public void Basic() { fxt.Test__parse("k_0:v_0" , fxt.Make("k_0", "v_0")); fxt.Test__parse("k_0:v_0;" , fxt.Make("k_0", "v_0")); fxt.Test__parse("k_0:v_0;k_1:v_1" , fxt.Make("k_0", "v_0"), fxt.Make("k_1", "v_1")); } - @Test public void Ws() { + @Test public void Ws() { fxt.Test__parse(" k_0 : v_0 ;" , fxt.Make("k_0", "v_0")); fxt.Test__parse(" k_0 : v_0 ; k_1 : v_1 " , fxt.Make("k_0", "v_0"), fxt.Make("k_1", "v_1")); fxt.Test__parse(" k_0 : v 0 ;" , fxt.Make("k_0", "v 0")); } - @Test public void Empty() { + @Test public void Empty() { fxt.Test__parse("k_0:v_0;;" , fxt.Make("k_0", "v_0")); fxt.Test__parse("k_0:v_0; ; " , fxt.Make("k_0", "v_0")); } - @Test public void Invalid__no_semic() { + @Test public void Invalid__no_semic() { fxt.Test__parse("k_0" , fxt.Make("k_0", "")); } - @Test public void Invalid__dupe_colon() { + @Test public void Invalid__dupe_colon() { fxt.Test__parse("a:b:c:d;" , fxt.Make("a", "b:c:d")); } } diff --git a/400_xowa/src/gplx/langs/jsons/Json_doc_tst.java b/400_xowa/src/gplx/langs/jsons/Json_doc_tst.java index cf12db714..f44db1d8a 100644 --- a/400_xowa/src/gplx/langs/jsons/Json_doc_tst.java +++ b/400_xowa/src/gplx/langs/jsons/Json_doc_tst.java @@ -1,23 +1,23 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.langs.jsons; import gplx.*; import gplx.langs.*; import org.junit.*; public class Json_doc_tst { private final Json_qry_mgr_fxt fxt = new Json_qry_mgr_fxt(); - @Test public void Select() { + @Test public void Select() { Json_doc doc = fxt.Make_json ( "{'0':" , " {'0_0':" diff --git a/400_xowa/src/gplx/langs/jsons/Json_doc_wtr_tst.java b/400_xowa/src/gplx/langs/jsons/Json_doc_wtr_tst.java index c15465b55..7d28584b1 100644 --- a/400_xowa/src/gplx/langs/jsons/Json_doc_wtr_tst.java +++ b/400_xowa/src/gplx/langs/jsons/Json_doc_wtr_tst.java @@ -1,23 +1,23 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.langs.jsons; import gplx.*; import gplx.langs.*; import org.junit.*; import gplx.core.tests.*; public class Json_doc_wtr_tst { private final Json_doc_wtr_fxt fxt = new Json_doc_wtr_fxt(); - @Test public void Basic() { + @Test public void Basic() { fxt.Test__Bld_as_str ( fxt.Exec__Kv_simple("k1", "v\"1") , fxt.Exec__Concat_apos @@ -25,7 +25,7 @@ public class Json_doc_wtr_tst { , " 'k1':'v\\\"1'" , "}")); } - @Test public void Quotes() { + @Test public void Quotes() { fxt.Test__string__quotes("a\"z" , "a\\\"z"); fxt.Test__string__quotes("a\u0008z" , "a\\bz"); fxt.Test__string__quotes("a\fz" , "a\\fz"); diff --git a/400_xowa/src/gplx/langs/jsons/Json_itm_base.java b/400_xowa/src/gplx/langs/jsons/Json_itm_base.java index 17032ffc5..42b3a3812 100644 --- a/400_xowa/src/gplx/langs/jsons/Json_itm_base.java +++ b/400_xowa/src/gplx/langs/jsons/Json_itm_base.java @@ -28,5 +28,5 @@ public abstract class Json_itm_base implements Json_itm { return bfr.To_str_and_clear(); } public abstract void Print_as_json(Bry_bfr bfr, int depth); - @gplx.Virtual public boolean Data_eq(byte[] comp) {return false;} + public boolean Data_eq(byte[] comp) {return false;} } diff --git a/400_xowa/src/gplx/langs/jsons/Json_parser__list_nde__base.java b/400_xowa/src/gplx/langs/jsons/Json_parser__list_nde__base.java index 1ad877ef0..dc013e5d3 100644 --- a/400_xowa/src/gplx/langs/jsons/Json_parser__list_nde__base.java +++ b/400_xowa/src/gplx/langs/jsons/Json_parser__list_nde__base.java @@ -68,6 +68,6 @@ public class Json_parser__list_nde__base extends Json_parser__itm__base { list.Add(key, Keyval_.new_(String_.new_u8(key), String_.new_u8(val))); } } - @gplx.Virtual protected byte[] Parse_to_list_as_kv__get_val(Json_kv sub, byte[] key) {return sub.Val_as_bry();} + protected byte[] Parse_to_list_as_kv__get_val(Json_kv sub, byte[] key) {return sub.Val_as_bry();} @Override protected void Parse_hook_nde(Json_nde sub, Json_kv[] atrs) {} } diff --git a/400_xowa/src/gplx/langs/jsons/Json_printer_tst.java b/400_xowa/src/gplx/langs/jsons/Json_printer_tst.java index a24c54a3e..89188acc0 100644 --- a/400_xowa/src/gplx/langs/jsons/Json_printer_tst.java +++ b/400_xowa/src/gplx/langs/jsons/Json_printer_tst.java @@ -1,30 +1,30 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.langs.jsons; import gplx.*; import gplx.langs.*; import org.junit.*; public class Json_printer_tst { private final Json_printer_fxt fxt = new Json_printer_fxt(); - @Test public void Root_nde() { + @Test public void Root_nde() { fxt.Test_print(Json_doc.Make_str_by_apos("{'k1':'v1','k2':'v2'}"), String_.Concat_lines_nl ( "{ 'k1':'v1'" , ", 'k2':'v2'" , "}" )); } - @Test public void Root_ary() { + @Test public void Root_ary() { fxt.Test_print(Json_doc.Make_str_by_apos("[1,2,3]"), String_.Concat_lines_nl ( "[ 1" , ", 2" @@ -32,7 +32,7 @@ public class Json_printer_tst { , "]" )); } - @Test public void Ary_w_ary() { + @Test public void Ary_w_ary() { fxt.Test_print(Json_doc.Make_str_by_apos("[[1,2],[3,4]]"), String_.Concat_lines_nl ( "[ " , " [ 1" @@ -45,7 +45,7 @@ public class Json_printer_tst { , "]" )); } - @Test public void Ary_w_nde() { + @Test public void Ary_w_nde() { fxt.Test_print(Json_doc.Make_str_by_apos("[{'k1':'v1','k2':'v2'},{'k3':'v3','k4':'v4'}]"), String_.Concat_lines_nl ( "[ " , " { 'k1':'v1'" @@ -58,7 +58,7 @@ public class Json_printer_tst { , "]" )); } - @Test public void Nde_w_ary() { + @Test public void Nde_w_ary() { fxt.Test_print(Json_doc.Make_str_by_apos("{'k1':[1,2],'k2':[3,4]}"), String_.Concat_lines_nl ( "{ 'k1':" , " [ 1" @@ -71,7 +71,7 @@ public class Json_printer_tst { , "}" )); } -// @Test public void Smoke() { +// @Test public void Smoke() { // Json_printer printer = new Json_printer(); // String url = "C:\\temp.json"; // String s = printer.Pretty_print_as_str(Bry_.new_u8(Io_mgr.Instance.LoadFilStr(url))); diff --git a/400_xowa/src/gplx/langs/jsons/Json_wtr_tst.java b/400_xowa/src/gplx/langs/jsons/Json_wtr_tst.java index a5f630ff6..d2473511e 100644 --- a/400_xowa/src/gplx/langs/jsons/Json_wtr_tst.java +++ b/400_xowa/src/gplx/langs/jsons/Json_wtr_tst.java @@ -1,30 +1,30 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.langs.jsons; import gplx.*; import gplx.langs.*; import org.junit.*; public class Json_wtr_tst { @Before public void init() {fxt.Clear();} private final Json_wtr_fxt fxt = new Json_wtr_fxt(); - @Test public void Root() { + @Test public void Root() { fxt.Wtr().Doc_nde_bgn().Doc_nde_end(); fxt.Test ( "{" , "}" ); } - @Test public void Kv() { + @Test public void Kv() { fxt.Wtr() .Doc_nde_bgn() .Kv_str("k0", "v0") @@ -36,7 +36,7 @@ public class Json_wtr_tst { , "}" ); } - @Test public void Escaped() { + @Test public void Escaped() { fxt.Wtr() .Doc_nde_bgn() .Kv_str("backslash", "\\") @@ -56,7 +56,7 @@ public class Json_wtr_tst { , "}" ); } - @Test public void Nde() { + @Test public void Nde() { fxt.Wtr() .Doc_nde_bgn() .Nde_bgn("s0") @@ -82,7 +82,7 @@ public class Json_wtr_tst { , "}" ); } - @Test public void Ary() { + @Test public void Ary() { fxt.Wtr() .Doc_nde_bgn() .Ary_bgn("a0") @@ -98,7 +98,7 @@ public class Json_wtr_tst { , "}" ); } - @Test public void Nde__nested() { + @Test public void Nde__nested() { fxt.Wtr() .Doc_nde_bgn() .Ary_bgn("a0") diff --git a/400_xowa/src/gplx/langs/mustaches/Mustache_itm_render_tst.java b/400_xowa/src/gplx/langs/mustaches/Mustache_itm_render_tst.java index 166437f75..5fc76201c 100644 --- a/400_xowa/src/gplx/langs/mustaches/Mustache_itm_render_tst.java +++ b/400_xowa/src/gplx/langs/mustaches/Mustache_itm_render_tst.java @@ -1,189 +1,189 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2020 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ -package gplx.langs.mustaches; - -import gplx.Bry_; -import gplx.Hash_adp; -import gplx.Hash_adp_; -import gplx.Tfds; -import gplx.core.primitives.Bool_obj_ref; -import gplx.langs.jsons.Json_doc; -import gplx.langs.jsons.Json_nde; -import gplx.langs.jsons.Json_parser; -import org.junit.Test; - -public class Mustache_itm_render_tst { - private final Mustache_itm_render_fxt fxt = new Mustache_itm_render_fxt(); - @Test public void Text() { - fxt.Test__parse("a b c", "a b c"); - } - @Test public void Variable() { - fxt.Init__root(fxt.Make_mock(0).Add_prop("prop1", "1").Add_prop("prop2", "2")); - fxt.Test__parse("{{prop1}}", "1"); - fxt.Test__parse("a{{prop1}}b{{prop2}}c", "a1b2c"); - } - @Test public void Escape() { - fxt.Init__root(fxt.Make_mock(0).Add_prop("prop1", "<")); - fxt.Test__parse("{{{prop1}}}", "<"); - fxt.Test__parse("{{prop1}}", "<"); - } - @Test public void Section_bool() { - fxt.Init__root(fxt.Make_mock(0).Add_bool_y("bool_y").Add_bool_n("bool_n")); - fxt.Test__parse("a{{#bool_y}}b{{/bool_y}}c", "abc"); - fxt.Test__parse("a{{#bool_n}}b{{/bool_n}}c", "ac"); - fxt.Test__parse("a{{#bool_y}}b{{/bool_y}}c{{#bool_n}}d{{/bool_n}}e", "abce"); - } - @Test public void Section_not() { - fxt.Init__root(fxt.Make_mock(0).Add_bool_y("bool_y").Add_bool_n("bool_n")); - fxt.Test__parse("a{{^bool_y}}b{{/bool_y}}c", "ac"); - fxt.Test__parse("a{{^bool_n}}b{{/bool_n}}c", "abc"); - fxt.Test__parse("a{{^bool_y}}b{{/bool_y}}c{{^bool_n}}d{{/bool_n}}e", "acde"); - } - @Test public void Section_ws() { - fxt.Init__root(fxt.Make_mock(0).Add_bool_y("bool_y")); - fxt.Test__parse("a\n {{#bool_y}} \nb\n {{/bool_y}} \nc", "a\nb\nc"); - } - @Test public void Section_subs_flat() { - fxt.Init__root(fxt.Make_mock(0).Add_subs("subs1" - , fxt.Make_mock(1).Add_prop("prop1", "1").Add_subs("subs2") - , fxt.Make_mock(2).Add_prop("prop1", "2").Add_subs("subs2") - )); - fxt.Test__parse("a{{#subs1}}({{prop1}}){{/subs1}}d", "a(1)(2)d"); - } - @Test public void Section_subs_nest_1() { - fxt.Init__root - ( fxt.Make_mock(0).Add_subs("subs1" - , fxt.Make_mock(1).Add_prop("prop1", "a").Add_subs("subs2" - , fxt.Make_mock(11).Add_prop("prop2", "1") - , fxt.Make_mock(12).Add_prop("prop2", "2")) - )); - fxt.Test__parse - ( "{{#subs1}}{{prop1}}{{#subs2}}{{prop2}}{{/subs2}}{{/subs1}}" - , "a12" - ); - } - @Test public void Section_subs_nest_2() { - fxt.Init__root - ( fxt.Make_mock(0).Add_subs("subs1" - , fxt.Make_mock(1).Add_prop("prop1", "a").Add_subs("subs2" - , fxt.Make_mock(11).Add_prop("prop2", "1") - , fxt.Make_mock(12).Add_prop("prop2", "2") - ) - , fxt.Make_mock(2).Add_prop("prop1", "b") - ) - ); - fxt.Test__parse - ( "{{#subs1}}{{prop1}}{{#subs2}}{{prop2}}{{/subs2}}{{/subs1}}" - , "a12b" - ); - } - @Test public void Section_subs_nest_3() { - fxt.Init__root - ( fxt.Make_mock(0).Add_subs("subs1" - , fxt.Make_mock(1).Add_prop("prop1", "a").Add_subs("subs2" - , fxt.Make_mock(11).Add_prop("prop2", "1") - , fxt.Make_mock(12).Add_prop("prop2", "2") - ) - , fxt.Make_mock(2).Add_prop("prop1", "b").Add_subs("subs2" - , fxt.Make_mock(21).Add_prop("prop2", "3") - , fxt.Make_mock(22).Add_prop("prop2", "4") - ) - ) - ); - fxt.Test__parse - ( "{{#subs1}}{{prop1}}{{#subs2}}{{prop2}}{{/subs2}}{{prop1}}{{/subs1}}" - , "a12ab34b" - ); - } - @Test public void Section_bool_subs() { // handle prop written after boolean; should not pick up inner prop - fxt.Init__root - ( fxt.Make_mock(0).Add_bool_y("bool1").Add_prop("prop2", "2").Add_subs("subs1" - , fxt.Make_mock(1).Add_prop("prop1", "11") - , fxt.Make_mock(2).Add_prop("prop1", "12") - )); - fxt.Test__parse - ( "a{{#bool1}}b{{#subs1}}c{{prop1}}d{{/subs1}}e{{/bool1}}f{{prop2}}g" - , "abc11dc12def2g" - ); - } - @Test public void Section_owner() { - fxt.Init__root - ( fxt.Make_mock(0).Add_subs("subs1" - , fxt.Make_mock(1).Add_prop("prop1", "a").Add_subs("subs2" - , fxt.Make_mock(11).Add_prop("prop2", "1") - ) - )); - fxt.Test__parse - ( "{{#subs1}}{{#subs2}}{{prop1}}{{prop2}}{{/subs2}}{{/subs1}}" // prop1 is cited in subs2, but value belongs to subs1 - , "a1" - ); - } - @Test public void Dot() { - fxt.Test__parse - ( "{'subs':['a', 'b', 'c', 'd']}" - , "{{#subs}}{{.}},{{/subs}}" - , "a,b,c,d," - ); - } -} -class Mustache_itm_render_fxt { - private final Mustache_tkn_parser parser = new Mustache_tkn_parser(); - private final Mustache_render_ctx ctx = new Mustache_render_ctx(); - private final Mustache_bfr bfr = Mustache_bfr.New(); - private Mustache_doc_itm__mock root; - public Mustache_doc_itm__mock Make_mock(int id) {return new Mustache_doc_itm__mock(id);} - public void Init__root(Mustache_doc_itm__mock v) {this.root = v;} - public void Test__parse(String src_str, String expd) { - byte[] src_bry = Bry_.new_a7(src_str); - Mustache_tkn_itm actl_itm = parser.Parse(src_bry, 0, src_bry.length); - ctx.Init(root); - actl_itm.Render(bfr, ctx); - Tfds.Eq_str_lines(expd, bfr.To_str_and_clear()); - } - public void Test__parse(String jdoc, String src_str, String expd) { - Json_nde jnde = Json_parser.ParseToJdoc(Json_doc.Make_str_by_apos(jdoc)).Root_nde(); - JsonMustacheNde nde = new JsonMustacheNde(jnde); - - byte[] src_bry = Bry_.new_a7(src_str); - Mustache_tkn_itm actl_itm = parser.Parse(src_bry, 0, src_bry.length); - ctx.Init(nde); - actl_itm.Render(bfr, ctx); - Tfds.Eq_str_lines(expd, bfr.To_str_and_clear()); - } -} -class Mustache_doc_itm__mock implements Mustache_doc_itm { - private final Hash_adp hash_prop = Hash_adp_.New(), hash_bool = Hash_adp_.New(), hash_subs = Hash_adp_.New(); - public Mustache_doc_itm__mock(int id) {this.id = id;} - public int id; - public Mustache_doc_itm__mock Add_prop(String key, String val) {hash_prop.Add(key, Bry_.new_u8(val)); return this;} - public Mustache_doc_itm__mock Add_bool_y(String key) {hash_bool.Add(key, Bool_obj_ref.y_()); return this;} - public Mustache_doc_itm__mock Add_bool_n(String key) {hash_bool.Add(key, Bool_obj_ref.n_()); return this;} - public Mustache_doc_itm__mock Add_subs(String key, Mustache_doc_itm__mock... ary) {hash_subs.Add(key, ary); return this;} - public boolean Mustache__write(String key, Mustache_bfr bfr) { - byte[] rv = (byte[])hash_prop.Get_by(key); - if (rv == null) return false; - bfr.Add_bry(rv); - return true; - } - public Mustache_doc_itm[] Mustache__subs(String key) { - Object rv = hash_bool.Get_by(key); - if (rv != null) { - boolean bool_val = ((Bool_obj_ref)rv).Val(); - return bool_val ? Mustache_doc_itm_.Ary__bool__y : Mustache_doc_itm_.Ary__bool__n; - } - return (Mustache_doc_itm__mock[])hash_subs.Get_by(key); - } -} +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2020 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ +package gplx.langs.mustaches; + +import gplx.Bry_; +import gplx.Hash_adp; +import gplx.Hash_adp_; +import gplx.Tfds; +import gplx.core.primitives.Bool_obj_ref; +import gplx.langs.jsons.Json_doc; +import gplx.langs.jsons.Json_nde; +import gplx.langs.jsons.Json_parser; +import org.junit.Test; + +public class Mustache_itm_render_tst { + private final Mustache_itm_render_fxt fxt = new Mustache_itm_render_fxt(); + @Test public void Text() { + fxt.Test__parse("a b c", "a b c"); + } + @Test public void Variable() { + fxt.Init__root(fxt.Make_mock(0).Add_prop("prop1", "1").Add_prop("prop2", "2")); + fxt.Test__parse("{{prop1}}", "1"); + fxt.Test__parse("a{{prop1}}b{{prop2}}c", "a1b2c"); + } + @Test public void Escape() { + fxt.Init__root(fxt.Make_mock(0).Add_prop("prop1", "<")); + fxt.Test__parse("{{{prop1}}}", "<"); + fxt.Test__parse("{{prop1}}", "<"); + } + @Test public void Section_bool() { + fxt.Init__root(fxt.Make_mock(0).Add_bool_y("bool_y").Add_bool_n("bool_n")); + fxt.Test__parse("a{{#bool_y}}b{{/bool_y}}c", "abc"); + fxt.Test__parse("a{{#bool_n}}b{{/bool_n}}c", "ac"); + fxt.Test__parse("a{{#bool_y}}b{{/bool_y}}c{{#bool_n}}d{{/bool_n}}e", "abce"); + } + @Test public void Section_not() { + fxt.Init__root(fxt.Make_mock(0).Add_bool_y("bool_y").Add_bool_n("bool_n")); + fxt.Test__parse("a{{^bool_y}}b{{/bool_y}}c", "ac"); + fxt.Test__parse("a{{^bool_n}}b{{/bool_n}}c", "abc"); + fxt.Test__parse("a{{^bool_y}}b{{/bool_y}}c{{^bool_n}}d{{/bool_n}}e", "acde"); + } + @Test public void Section_ws() { + fxt.Init__root(fxt.Make_mock(0).Add_bool_y("bool_y")); + fxt.Test__parse("a\n {{#bool_y}} \nb\n {{/bool_y}} \nc", "a\nb\nc"); + } + @Test public void Section_subs_flat() { + fxt.Init__root(fxt.Make_mock(0).Add_subs("subs1" + , fxt.Make_mock(1).Add_prop("prop1", "1").Add_subs("subs2") + , fxt.Make_mock(2).Add_prop("prop1", "2").Add_subs("subs2") + )); + fxt.Test__parse("a{{#subs1}}({{prop1}}){{/subs1}}d", "a(1)(2)d"); + } + @Test public void Section_subs_nest_1() { + fxt.Init__root + ( fxt.Make_mock(0).Add_subs("subs1" + , fxt.Make_mock(1).Add_prop("prop1", "a").Add_subs("subs2" + , fxt.Make_mock(11).Add_prop("prop2", "1") + , fxt.Make_mock(12).Add_prop("prop2", "2")) + )); + fxt.Test__parse + ( "{{#subs1}}{{prop1}}{{#subs2}}{{prop2}}{{/subs2}}{{/subs1}}" + , "a12" + ); + } + @Test public void Section_subs_nest_2() { + fxt.Init__root + ( fxt.Make_mock(0).Add_subs("subs1" + , fxt.Make_mock(1).Add_prop("prop1", "a").Add_subs("subs2" + , fxt.Make_mock(11).Add_prop("prop2", "1") + , fxt.Make_mock(12).Add_prop("prop2", "2") + ) + , fxt.Make_mock(2).Add_prop("prop1", "b") + ) + ); + fxt.Test__parse + ( "{{#subs1}}{{prop1}}{{#subs2}}{{prop2}}{{/subs2}}{{/subs1}}" + , "a12b" + ); + } + @Test public void Section_subs_nest_3() { + fxt.Init__root + ( fxt.Make_mock(0).Add_subs("subs1" + , fxt.Make_mock(1).Add_prop("prop1", "a").Add_subs("subs2" + , fxt.Make_mock(11).Add_prop("prop2", "1") + , fxt.Make_mock(12).Add_prop("prop2", "2") + ) + , fxt.Make_mock(2).Add_prop("prop1", "b").Add_subs("subs2" + , fxt.Make_mock(21).Add_prop("prop2", "3") + , fxt.Make_mock(22).Add_prop("prop2", "4") + ) + ) + ); + fxt.Test__parse + ( "{{#subs1}}{{prop1}}{{#subs2}}{{prop2}}{{/subs2}}{{prop1}}{{/subs1}}" + , "a12ab34b" + ); + } + @Test public void Section_bool_subs() { // handle prop written after boolean; should not pick up inner prop + fxt.Init__root + ( fxt.Make_mock(0).Add_bool_y("bool1").Add_prop("prop2", "2").Add_subs("subs1" + , fxt.Make_mock(1).Add_prop("prop1", "11") + , fxt.Make_mock(2).Add_prop("prop1", "12") + )); + fxt.Test__parse + ( "a{{#bool1}}b{{#subs1}}c{{prop1}}d{{/subs1}}e{{/bool1}}f{{prop2}}g" + , "abc11dc12def2g" + ); + } + @Test public void Section_owner() { + fxt.Init__root + ( fxt.Make_mock(0).Add_subs("subs1" + , fxt.Make_mock(1).Add_prop("prop1", "a").Add_subs("subs2" + , fxt.Make_mock(11).Add_prop("prop2", "1") + ) + )); + fxt.Test__parse + ( "{{#subs1}}{{#subs2}}{{prop1}}{{prop2}}{{/subs2}}{{/subs1}}" // prop1 is cited in subs2, but value belongs to subs1 + , "a1" + ); + } + @Test public void Dot() { + fxt.Test__parse + ( "{'subs':['a', 'b', 'c', 'd']}" + , "{{#subs}}{{.}},{{/subs}}" + , "a,b,c,d," + ); + } +} +class Mustache_itm_render_fxt { + private final Mustache_tkn_parser parser = new Mustache_tkn_parser(); + private final Mustache_render_ctx ctx = new Mustache_render_ctx(); + private final Mustache_bfr bfr = Mustache_bfr.New(); + private Mustache_doc_itm__mock root; + public Mustache_doc_itm__mock Make_mock(int id) {return new Mustache_doc_itm__mock(id);} + public void Init__root(Mustache_doc_itm__mock v) {this.root = v;} + public void Test__parse(String src_str, String expd) { + byte[] src_bry = Bry_.new_a7(src_str); + Mustache_tkn_itm actl_itm = parser.Parse(src_bry, 0, src_bry.length); + ctx.Init(root); + actl_itm.Render(bfr, ctx); + Tfds.Eq_str_lines(expd, bfr.To_str_and_clear()); + } + public void Test__parse(String jdoc, String src_str, String expd) { + Json_nde jnde = Json_parser.ParseToJdoc(Json_doc.Make_str_by_apos(jdoc)).Root_nde(); + JsonMustacheNde nde = new JsonMustacheNde(jnde); + + byte[] src_bry = Bry_.new_a7(src_str); + Mustache_tkn_itm actl_itm = parser.Parse(src_bry, 0, src_bry.length); + ctx.Init(nde); + actl_itm.Render(bfr, ctx); + Tfds.Eq_str_lines(expd, bfr.To_str_and_clear()); + } +} +class Mustache_doc_itm__mock implements Mustache_doc_itm { + private final Hash_adp hash_prop = Hash_adp_.New(), hash_bool = Hash_adp_.New(), hash_subs = Hash_adp_.New(); + public Mustache_doc_itm__mock(int id) {this.id = id;} + public int id; + public Mustache_doc_itm__mock Add_prop(String key, String val) {hash_prop.Add(key, Bry_.new_u8(val)); return this;} + public Mustache_doc_itm__mock Add_bool_y(String key) {hash_bool.Add(key, Bool_obj_ref.y_()); return this;} + public Mustache_doc_itm__mock Add_bool_n(String key) {hash_bool.Add(key, Bool_obj_ref.n_()); return this;} + public Mustache_doc_itm__mock Add_subs(String key, Mustache_doc_itm__mock... ary) {hash_subs.Add(key, ary); return this;} + public boolean Mustache__write(String key, Mustache_bfr bfr) { + byte[] rv = (byte[])hash_prop.Get_by(key); + if (rv == null) return false; + bfr.Add_bry(rv); + return true; + } + public Mustache_doc_itm[] Mustache__subs(String key) { + Object rv = hash_bool.Get_by(key); + if (rv != null) { + boolean bool_val = ((Bool_obj_ref)rv).Val(); + return bool_val ? Mustache_doc_itm_.Ary__bool__y : Mustache_doc_itm_.Ary__bool__n; + } + return (Mustache_doc_itm__mock[])hash_subs.Get_by(key); + } +} diff --git a/400_xowa/src/gplx/langs/mustaches/Mustache_tkn_itm.java b/400_xowa/src/gplx/langs/mustaches/Mustache_tkn_itm.java index 762f145b2..aa44ffd74 100644 --- a/400_xowa/src/gplx/langs/mustaches/Mustache_tkn_itm.java +++ b/400_xowa/src/gplx/langs/mustaches/Mustache_tkn_itm.java @@ -1,126 +1,126 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2020 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ -package gplx.langs.mustaches; - -import gplx.Bool_; -import gplx.Bry_; -import gplx.Byte_ascii; -import gplx.Err_; -import gplx.Io_url; -import gplx.String_; - -public interface Mustache_tkn_itm { - int Tid(); - String Key(); - Mustache_tkn_itm[] Subs_ary(); - void Subs_ary_(Mustache_tkn_itm[] v); - void Render(Mustache_bfr bfr, Mustache_render_ctx ctx); -} -class Mustache_tkn_itm_ {// for types, see http://mustache.github.io/mustache.5.html - public static final int Tid__root = 0, Tid__text = 1, Tid__variable = 2, Tid__escape = 3, Tid__section = 4, Tid__inverted = 5, Tid__comment = 6, Tid__partial = 7, Tid__delimiter = 8; - public static final Mustache_tkn_itm[] Ary_empty = new Mustache_tkn_itm[0]; -} -abstract class Mustache_tkn_base implements Mustache_tkn_itm { - public Mustache_tkn_base(int tid, byte[] key_bry) {this.tid = tid; this.key = String_.new_u8(key_bry);} - public int Tid() {return tid;} private final int tid; - public String Key() {return key;} private final String key; - @gplx.Virtual public Mustache_tkn_itm[] Subs_ary() {return Mustache_tkn_itm_.Ary_empty;} - @gplx.Virtual public void Subs_ary_(Mustache_tkn_itm[] v) {throw Err_.new_unsupported();} // fail if trying to set and not overridden - @gplx.Virtual public void Render(Mustache_bfr bfr, Mustache_render_ctx ctx) {throw Err_.new_unsupported();} // should be abstract -} -class Mustache_tkn_root extends Mustache_tkn_base { // EX: {{variable}} -> <a> - private Mustache_tkn_itm[] subs_ary; - public Mustache_tkn_root() {super(Mustache_tkn_itm_.Tid__root, Bry_.Empty);} - @Override public Mustache_tkn_itm[] Subs_ary() {return subs_ary;} - @Override public void Subs_ary_(Mustache_tkn_itm[] v) {subs_ary = v;} - @Override public void Render(Mustache_bfr bfr, Mustache_render_ctx ctx) { - int subs_len = subs_ary.length; - for (int i = 0; i < subs_len; ++i) { - Mustache_tkn_itm sub = subs_ary[i]; - sub.Render(bfr, ctx); - } - } -} -class Mustache_tkn_text extends Mustache_tkn_base { // EX: text -> text - private final byte[] src; private final int src_bgn, src_end; - public Mustache_tkn_text(byte[] src, int src_bgn, int src_end) {super(Mustache_tkn_itm_.Tid__text, Bry_.Empty); - this.src = src; - this.src_bgn = src_bgn; - this.src_end = src_end; - } - @Override public void Render(Mustache_bfr bfr, Mustache_render_ctx ctx) { - bfr.Add_mid(src, src_bgn, src_end); - } -} -class Mustache_tkn_comment extends Mustache_tkn_base { // EX: {{!section}}comment{{/section}} -> - public Mustache_tkn_comment() {super(Mustache_tkn_itm_.Tid__comment, Bry_.Empty);} - @Override public void Render(Mustache_bfr bfr, Mustache_render_ctx ctx) {} -} -class Mustache_tkn_variable extends Mustache_tkn_base { // EX: {{variable}} -> <a> - public Mustache_tkn_variable(byte[] key) {super(Mustache_tkn_itm_.Tid__variable, key);} - @Override public void Render(Mustache_bfr bfr, Mustache_render_ctx ctx) { - String key = this.Key(); - ctx.Render_variable(bfr.Escape_(Bool_.Y), key); - } -} -class Mustache_tkn_escape extends Mustache_tkn_base { // EX: {{{variable}}} -> - public Mustache_tkn_escape(byte[] key) {super(Mustache_tkn_itm_.Tid__escape, key);} - @Override public void Render(Mustache_bfr bfr, Mustache_render_ctx ctx) { - String key = this.Key(); - ctx.Render_variable(bfr.Escape_(Bool_.N), key); - } -} -class Mustache_tkn_section extends Mustache_tkn_base { // EX: {{#section}}val{{/section}} -> val (if boolean) or valvalval (if list) - private Mustache_tkn_itm[] subs_ary; - public Mustache_tkn_section(byte[] key) {super(Mustache_tkn_itm_.Tid__section, key);} - @Override public Mustache_tkn_itm[] Subs_ary() {return subs_ary;} - @Override public void Subs_ary_(Mustache_tkn_itm[] v) {subs_ary = v;} - @Override public void Render(Mustache_bfr bfr, Mustache_render_ctx ctx) {Render_static(Bool_.N, this, bfr, ctx);} - public static void Render_static(boolean inverted, Mustache_tkn_base tkn, Mustache_bfr bfr, Mustache_render_ctx ctx) { - String key = tkn.Key(); - Mustache_tkn_itm[] subs_ary = tkn.Subs_ary(); - ctx.Section_bgn(key); - while (ctx.Section_do(inverted)) { - int subs_len = subs_ary.length; - for (int i = 0; i < subs_len; ++i) { - Mustache_tkn_itm sub = subs_ary[i]; - sub.Render(bfr, ctx); - } - } - ctx.Section_end(); - } -} -class Mustache_tkn_inverted extends Mustache_tkn_base { // EX: {{^section}}missing{{/section}} -> missing - private Mustache_tkn_itm[] subs_ary; - public Mustache_tkn_inverted(byte[] key) {super(Mustache_tkn_itm_.Tid__inverted, key);} - @Override public Mustache_tkn_itm[] Subs_ary() {return subs_ary;} - @Override public void Subs_ary_(Mustache_tkn_itm[] v) {subs_ary = v;} - @Override public void Render(Mustache_bfr bfr, Mustache_render_ctx ctx) {Mustache_tkn_section.Render_static(Bool_.Y, this, bfr, ctx);} -} -class Mustache_tkn_partial extends Mustache_tkn_base { // EX: {{>a}} -> abc (deferred eval) - private Mustache_tkn_itm template_root; - public Mustache_tkn_partial(byte[] key, Io_url dir) { - super(Mustache_tkn_itm_.Tid__partial, key); - Mustache_tkn_parser parser = new Mustache_tkn_parser(dir); - template_root = parser.Parse(String_.new_a7(Bry_.Trim_bgn(key, Byte_ascii.Space, 0))); - } - @Override public void Render(Mustache_bfr bfr, Mustache_render_ctx ctx) { - template_root.Render(bfr, ctx); - } -} -class Mustache_tkn_delimiter extends Mustache_tkn_base { // EX: {{=<% %>=}} -> <% variable %> - public Mustache_tkn_delimiter(byte[] key) {super(Mustache_tkn_itm_.Tid__delimiter, key);} -} +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2020 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ +package gplx.langs.mustaches; + +import gplx.Bool_; +import gplx.Bry_; +import gplx.Byte_ascii; +import gplx.Err_; +import gplx.Io_url; +import gplx.String_; + +public interface Mustache_tkn_itm { + int Tid(); + String Key(); + Mustache_tkn_itm[] Subs_ary(); + void Subs_ary_(Mustache_tkn_itm[] v); + void Render(Mustache_bfr bfr, Mustache_render_ctx ctx); +} +class Mustache_tkn_itm_ {// for types, see http://mustache.github.io/mustache.5.html + public static final int Tid__root = 0, Tid__text = 1, Tid__variable = 2, Tid__escape = 3, Tid__section = 4, Tid__inverted = 5, Tid__comment = 6, Tid__partial = 7, Tid__delimiter = 8; + public static final Mustache_tkn_itm[] Ary_empty = new Mustache_tkn_itm[0]; +} +abstract class Mustache_tkn_base implements Mustache_tkn_itm { + public Mustache_tkn_base(int tid, byte[] key_bry) {this.tid = tid; this.key = String_.new_u8(key_bry);} + public int Tid() {return tid;} private final int tid; + public String Key() {return key;} private final String key; + public Mustache_tkn_itm[] Subs_ary() {return Mustache_tkn_itm_.Ary_empty;} + public void Subs_ary_(Mustache_tkn_itm[] v) {throw Err_.new_unsupported();} // fail if trying to set and not overridden + public void Render(Mustache_bfr bfr, Mustache_render_ctx ctx) {throw Err_.new_unsupported();} // should be abstract +} +class Mustache_tkn_root extends Mustache_tkn_base { // EX: {{variable}} -> <a> + private Mustache_tkn_itm[] subs_ary; + public Mustache_tkn_root() {super(Mustache_tkn_itm_.Tid__root, Bry_.Empty);} + @Override public Mustache_tkn_itm[] Subs_ary() {return subs_ary;} + @Override public void Subs_ary_(Mustache_tkn_itm[] v) {subs_ary = v;} + @Override public void Render(Mustache_bfr bfr, Mustache_render_ctx ctx) { + int subs_len = subs_ary.length; + for (int i = 0; i < subs_len; ++i) { + Mustache_tkn_itm sub = subs_ary[i]; + sub.Render(bfr, ctx); + } + } +} +class Mustache_tkn_text extends Mustache_tkn_base { // EX: text -> text + private final byte[] src; private final int src_bgn, src_end; + public Mustache_tkn_text(byte[] src, int src_bgn, int src_end) {super(Mustache_tkn_itm_.Tid__text, Bry_.Empty); + this.src = src; + this.src_bgn = src_bgn; + this.src_end = src_end; + } + @Override public void Render(Mustache_bfr bfr, Mustache_render_ctx ctx) { + bfr.Add_mid(src, src_bgn, src_end); + } +} +class Mustache_tkn_comment extends Mustache_tkn_base { // EX: {{!section}}comment{{/section}} -> + public Mustache_tkn_comment() {super(Mustache_tkn_itm_.Tid__comment, Bry_.Empty);} + @Override public void Render(Mustache_bfr bfr, Mustache_render_ctx ctx) {} +} +class Mustache_tkn_variable extends Mustache_tkn_base { // EX: {{variable}} -> <a> + public Mustache_tkn_variable(byte[] key) {super(Mustache_tkn_itm_.Tid__variable, key);} + @Override public void Render(Mustache_bfr bfr, Mustache_render_ctx ctx) { + String key = this.Key(); + ctx.Render_variable(bfr.Escape_(Bool_.Y), key); + } +} +class Mustache_tkn_escape extends Mustache_tkn_base { // EX: {{{variable}}} -> + public Mustache_tkn_escape(byte[] key) {super(Mustache_tkn_itm_.Tid__escape, key);} + @Override public void Render(Mustache_bfr bfr, Mustache_render_ctx ctx) { + String key = this.Key(); + ctx.Render_variable(bfr.Escape_(Bool_.N), key); + } +} +class Mustache_tkn_section extends Mustache_tkn_base { // EX: {{#section}}val{{/section}} -> val (if boolean) or valvalval (if list) + private Mustache_tkn_itm[] subs_ary; + public Mustache_tkn_section(byte[] key) {super(Mustache_tkn_itm_.Tid__section, key);} + @Override public Mustache_tkn_itm[] Subs_ary() {return subs_ary;} + @Override public void Subs_ary_(Mustache_tkn_itm[] v) {subs_ary = v;} + @Override public void Render(Mustache_bfr bfr, Mustache_render_ctx ctx) {Render_static(Bool_.N, this, bfr, ctx);} + public static void Render_static(boolean inverted, Mustache_tkn_base tkn, Mustache_bfr bfr, Mustache_render_ctx ctx) { + String key = tkn.Key(); + Mustache_tkn_itm[] subs_ary = tkn.Subs_ary(); + ctx.Section_bgn(key); + while (ctx.Section_do(inverted)) { + int subs_len = subs_ary.length; + for (int i = 0; i < subs_len; ++i) { + Mustache_tkn_itm sub = subs_ary[i]; + sub.Render(bfr, ctx); + } + } + ctx.Section_end(); + } +} +class Mustache_tkn_inverted extends Mustache_tkn_base { // EX: {{^section}}missing{{/section}} -> missing + private Mustache_tkn_itm[] subs_ary; + public Mustache_tkn_inverted(byte[] key) {super(Mustache_tkn_itm_.Tid__inverted, key);} + @Override public Mustache_tkn_itm[] Subs_ary() {return subs_ary;} + @Override public void Subs_ary_(Mustache_tkn_itm[] v) {subs_ary = v;} + @Override public void Render(Mustache_bfr bfr, Mustache_render_ctx ctx) {Mustache_tkn_section.Render_static(Bool_.Y, this, bfr, ctx);} +} +class Mustache_tkn_partial extends Mustache_tkn_base { // EX: {{>a}} -> abc (deferred eval) + private Mustache_tkn_itm template_root; + public Mustache_tkn_partial(byte[] key, Io_url dir) { + super(Mustache_tkn_itm_.Tid__partial, key); + Mustache_tkn_parser parser = new Mustache_tkn_parser(dir); + template_root = parser.Parse(String_.new_a7(Bry_.Trim_bgn(key, Byte_ascii.Space, 0))); + } + @Override public void Render(Mustache_bfr bfr, Mustache_render_ctx ctx) { + template_root.Render(bfr, ctx); + } +} +class Mustache_tkn_delimiter extends Mustache_tkn_base { // EX: {{=<% %>=}} -> <% variable %> + public Mustache_tkn_delimiter(byte[] key) {super(Mustache_tkn_itm_.Tid__delimiter, key);} +} diff --git a/400_xowa/src/gplx/langs/mustaches/Mustache_tkn_parser_tst.java b/400_xowa/src/gplx/langs/mustaches/Mustache_tkn_parser_tst.java index 8649051f8..cab17fce8 100644 --- a/400_xowa/src/gplx/langs/mustaches/Mustache_tkn_parser_tst.java +++ b/400_xowa/src/gplx/langs/mustaches/Mustache_tkn_parser_tst.java @@ -1,26 +1,26 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.langs.mustaches; import gplx.*; import gplx.langs.*; import org.junit.*; public class Mustache_tkn_parser_tst { private final Mustache_tkn_parser_fxt fxt = new Mustache_tkn_parser_fxt(); - @Test public void Basic() { + @Test public void Basic() { fxt.Test_parse("a{{b}}c", "ac"); } - @Test public void Comment() { + @Test public void Comment() { fxt.Test_parse("a{{!b}}c", "ac"); } } diff --git a/400_xowa/src/gplx/langs/phps/Php_parser_fxt.java b/400_xowa/src/gplx/langs/phps/Php_parser_fxt.java index 50853f5dc..7512c50c0 100644 --- a/400_xowa/src/gplx/langs/phps/Php_parser_fxt.java +++ b/400_xowa/src/gplx/langs/phps/Php_parser_fxt.java @@ -1,18 +1,18 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.langs.phps; import gplx.*; import gplx.langs.*; import gplx.core.tests.*; import gplx.core.log_msgs.*; class Php_parser_fxt { @@ -92,7 +92,7 @@ abstract class Php_tkn_chkr_base implements Tst_chkr { rv += Chk_tkn(mgr, path, actl); return rv; } - @gplx.Virtual public int Chk_tkn(Tst_mgr mgr, String path, Php_tkn actl_obj) {return 0;} + public int Chk_tkn(Tst_mgr mgr, String path, Php_tkn actl_obj) {return 0;} } class Php_tkn_declaration_chkr extends Php_tkn_chkr_base { @Override public Class TypeOf() {return Php_tkn_declaration.class;} @@ -194,7 +194,7 @@ abstract class Php_itm_chkr_base implements Tst_chkr { rv += Chk_itm(mgr, path, actl); return rv; } - @gplx.Virtual public int Chk_itm(Tst_mgr mgr, String path, Php_itm actl_obj) {return 0;} + public int Chk_itm(Tst_mgr mgr, String path, Php_itm actl_obj) {return 0;} public static final Php_itm_chkr_base[] Ary_empty = new Php_itm_chkr_base[0]; } class Php_itm_generic_chkr extends Php_itm_chkr_base { diff --git a/400_xowa/src/gplx/langs/phps/Php_parser_tst.java b/400_xowa/src/gplx/langs/phps/Php_parser_tst.java index e3d9300d2..3d5b9fa58 100644 --- a/400_xowa/src/gplx/langs/phps/Php_parser_tst.java +++ b/400_xowa/src/gplx/langs/phps/Php_parser_tst.java @@ -1,65 +1,65 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.langs.phps; import gplx.*; import gplx.langs.*; import org.junit.*; public class Php_parser_tst { @Before public void init() {fxt.Clear();} private final Php_parser_fxt fxt = new Php_parser_fxt(); - @Test public void Text() {fxt.tst_tkns("text", fxt.tkn_txt(0, 4)); } - @Test public void Declaration_pass() {fxt.tst_tkns(",()", fxt.tkn_generic(0, 1, Php_tkn_.Tid_semic), fxt.tkn_generic(1, 2, Php_tkn_.Tid_eq), fxt.tkn_generic(2, 4, Php_tkn_.Tid_eq_kv), fxt.tkn_generic(4, 5, Php_tkn_.Tid_comma), fxt.tkn_generic(5, 6, Php_tkn_.Tid_paren_bgn), fxt.tkn_generic(6, 7, Php_tkn_.Tid_paren_end));} - @Test public void Keyword() {fxt.tst_tkns("null=nulla", fxt.tkn_generic(0, 4, Php_tkn_.Tid_null), fxt.tkn_generic(4, 5, Php_tkn_.Tid_eq), fxt.tkn_txt(5, 10));} - @Test public void Num() {fxt.tst_tkns("0=123", fxt.tkn_num(0, 1, 0), fxt.tkn_generic(1, 2, Php_tkn_.Tid_eq), fxt.tkn_num(2, 5, 123));} - @Test public void Quote_apos() {fxt.tst_tkns("'a\"b'", fxt.tkn_quote_apos(0, 5));} - @Test public void Quote_quote() {fxt.tst_tkns("\"a'b\"", fxt.tkn_quote_quote(0, 5));} - @Test public void Quote_escape() {fxt.tst_tkns("'a\\'b'", fxt.tkn_quote_apos(0, 6));} - @Test public void Brack() {fxt.tst_tkns("['a']", fxt.tkn_generic(0, 1, Php_tkn_.Tid_brack_bgn), fxt.tkn_quote_apos(1, 4), fxt.tkn_generic(4, 5, Php_tkn_.Tid_brack_end));} - @Test public void Line_ws() {fxt.tst_lines("\r\n$a = false;", fxt.line_assign("a", fxt.itm_bool_false()));} - @Test public void Line_brack() {fxt.tst_lines("$a['b'] = 'c';", fxt.line_assign_subs("a", String_.Ary("b"), fxt.itm_quote("c")));} - @Test public void Line_assign_false() {fxt.tst_lines("$a = false;", fxt.line_assign("a", fxt.itm_bool_false()));} - @Test public void Line_assign_quote_charcode() {fxt.tst_lines("$a = 'bc';", fxt.line_assign("a", fxt.itm_quote("bc")));} - @Test public void Line_assign_mult() {fxt.tst_lines("$a = 'b';\n$c='d';", fxt.line_assign("a", fxt.itm_quote("b")), fxt.line_assign("c", fxt.itm_quote("d")));} - @Test public void Empty_usr_array() { + @Test public void Text() {fxt.tst_tkns("text", fxt.tkn_txt(0, 4)); } + @Test public void Declaration_pass() {fxt.tst_tkns(",()", fxt.tkn_generic(0, 1, Php_tkn_.Tid_semic), fxt.tkn_generic(1, 2, Php_tkn_.Tid_eq), fxt.tkn_generic(2, 4, Php_tkn_.Tid_eq_kv), fxt.tkn_generic(4, 5, Php_tkn_.Tid_comma), fxt.tkn_generic(5, 6, Php_tkn_.Tid_paren_bgn), fxt.tkn_generic(6, 7, Php_tkn_.Tid_paren_end));} + @Test public void Keyword() {fxt.tst_tkns("null=nulla", fxt.tkn_generic(0, 4, Php_tkn_.Tid_null), fxt.tkn_generic(4, 5, Php_tkn_.Tid_eq), fxt.tkn_txt(5, 10));} + @Test public void Num() {fxt.tst_tkns("0=123", fxt.tkn_num(0, 1, 0), fxt.tkn_generic(1, 2, Php_tkn_.Tid_eq), fxt.tkn_num(2, 5, 123));} + @Test public void Quote_apos() {fxt.tst_tkns("'a\"b'", fxt.tkn_quote_apos(0, 5));} + @Test public void Quote_quote() {fxt.tst_tkns("\"a'b\"", fxt.tkn_quote_quote(0, 5));} + @Test public void Quote_escape() {fxt.tst_tkns("'a\\'b'", fxt.tkn_quote_apos(0, 6));} + @Test public void Brack() {fxt.tst_tkns("['a']", fxt.tkn_generic(0, 1, Php_tkn_.Tid_brack_bgn), fxt.tkn_quote_apos(1, 4), fxt.tkn_generic(4, 5, Php_tkn_.Tid_brack_end));} + @Test public void Line_ws() {fxt.tst_lines("\r\n$a = false;", fxt.line_assign("a", fxt.itm_bool_false()));} + @Test public void Line_brack() {fxt.tst_lines("$a['b'] = 'c';", fxt.line_assign_subs("a", String_.Ary("b"), fxt.itm_quote("c")));} + @Test public void Line_assign_false() {fxt.tst_lines("$a = false;", fxt.line_assign("a", fxt.itm_bool_false()));} + @Test public void Line_assign_quote_charcode() {fxt.tst_lines("$a = 'bc';", fxt.line_assign("a", fxt.itm_quote("bc")));} + @Test public void Line_assign_mult() {fxt.tst_lines("$a = 'b';\n$c='d';", fxt.line_assign("a", fxt.itm_quote("b")), fxt.line_assign("c", fxt.itm_quote("d")));} + @Test public void Empty_usr_array() { fxt.tst_lines("$a = array();\n$b = array();" , fxt.line_assign("a", fxt.itm_ary()) , fxt.line_assign("b", fxt.itm_ary()) ); } - @Test public void Ary_flat() {fxt.tst_lines("$a = array('b', 'c', 'd');" , fxt.line_assign("a", fxt.itm_ary().Subs_(fxt.itm_quote("b"), fxt.itm_quote("c"), fxt.itm_quote("d"))));} - @Test public void Brack_flat() {fxt.tst_lines("$a = ['b', 'c', 'd'];" , fxt.line_assign("a", fxt.itm_ary().Subs_(fxt.itm_quote("b"), fxt.itm_quote("c"), fxt.itm_quote("d"))));} - @Test public void Ary_flat_escape() { // PURPOSE.fix: \\' was being interpreted incorrectly; \\ should escape \, but somehow \' was being escaped + @Test public void Ary_flat() {fxt.tst_lines("$a = array('b', 'c', 'd');" , fxt.line_assign("a", fxt.itm_ary().Subs_(fxt.itm_quote("b"), fxt.itm_quote("c"), fxt.itm_quote("d"))));} + @Test public void Brack_flat() {fxt.tst_lines("$a = ['b', 'c', 'd'];" , fxt.line_assign("a", fxt.itm_ary().Subs_(fxt.itm_quote("b"), fxt.itm_quote("c"), fxt.itm_quote("d"))));} + @Test public void Ary_flat_escape() { // PURPOSE.fix: \\' was being interpreted incorrectly; \\ should escape \, but somehow \' was being escaped fxt.tst_lines("$a = array('b\\\\', 'c');", fxt.line_assign("a", fxt.itm_ary().Subs_(fxt.itm_quote("b\\"), fxt.itm_quote("c")))); } - @Test public void Ary_flat_escape2() { // PURPOSE.fix: \\' was being interpreted incorrectly; \\ should escape \, but somehow \' was being escaped + @Test public void Ary_flat_escape2() { // PURPOSE.fix: \\' was being interpreted incorrectly; \\ should escape \, but somehow \' was being escaped fxt.tst_lines("$a = array('b\\\\\\'c', 'd');", fxt.line_assign("a", fxt.itm_ary().Subs_(fxt.itm_quote("b\\'c"), fxt.itm_quote("d")))); } - @Test public void Ary_kv() {fxt.tst_lines("$a = array(k0 => 'v0', k1 => 'v1', k2 => 'v2');", fxt.line_assign("a", fxt.itm_ary().Subs_(fxt.itm_kv_quote("k0", "v0"), fxt.itm_kv_quote("k1", "v1"), fxt.itm_kv_quote("k2", "v2"))));} - @Test public void Brack_kv() {fxt.tst_lines("$a = [k0 => 'v0', k1 => 'v1', k2 => 'v2'];" , fxt.line_assign("a", fxt.itm_ary().Subs_(fxt.itm_kv_quote("k0", "v0"), fxt.itm_kv_quote("k1", "v1"), fxt.itm_kv_quote("k2", "v2"))));} - @Test public void Ary_kv_num() {fxt.tst_lines("$a = array(k0 => 0, k1 => 1);", fxt.line_assign("a", fxt.itm_ary().Subs_(fxt.itm_kv_int("k0", 0), fxt.itm_kv_int("k1", 1))));} - @Test public void Ary_kv_txt() {fxt.tst_lines("$a = array('k0' => a, 'k1' => b);", fxt.line_assign("a", fxt.itm_ary().Subs_(fxt.itm_kv_txt("k0", "a"), fxt.itm_kv_txt("k1", "b"))));} - @Test public void Ary_nest() {fxt.tst_lines("$a = array('b', array('c', 'd'), 'e');" , fxt.line_assign("a", fxt.itm_ary().Subs_(fxt.itm_quote("b"), fxt.itm_ary().Subs_(fxt.itm_quote("c"), fxt.itm_quote("d")), fxt.itm_quote("e"))));} - @Test public void Brack_nest() {fxt.tst_lines("$a = ['b', ['c', 'd'], 'e'];" , fxt.line_assign("a", fxt.itm_ary().Subs_(fxt.itm_quote("b"), fxt.itm_ary().Subs_(fxt.itm_quote("c"), fxt.itm_quote("d")), fxt.itm_quote("e"))));} - @Test public void Ary_nest_kv() { + @Test public void Ary_kv() {fxt.tst_lines("$a = array(k0 => 'v0', k1 => 'v1', k2 => 'v2');", fxt.line_assign("a", fxt.itm_ary().Subs_(fxt.itm_kv_quote("k0", "v0"), fxt.itm_kv_quote("k1", "v1"), fxt.itm_kv_quote("k2", "v2"))));} + @Test public void Brack_kv() {fxt.tst_lines("$a = [k0 => 'v0', k1 => 'v1', k2 => 'v2'];" , fxt.line_assign("a", fxt.itm_ary().Subs_(fxt.itm_kv_quote("k0", "v0"), fxt.itm_kv_quote("k1", "v1"), fxt.itm_kv_quote("k2", "v2"))));} + @Test public void Ary_kv_num() {fxt.tst_lines("$a = array(k0 => 0, k1 => 1);", fxt.line_assign("a", fxt.itm_ary().Subs_(fxt.itm_kv_int("k0", 0), fxt.itm_kv_int("k1", 1))));} + @Test public void Ary_kv_txt() {fxt.tst_lines("$a = array('k0' => a, 'k1' => b);", fxt.line_assign("a", fxt.itm_ary().Subs_(fxt.itm_kv_txt("k0", "a"), fxt.itm_kv_txt("k1", "b"))));} + @Test public void Ary_nest() {fxt.tst_lines("$a = array('b', array('c', 'd'), 'e');" , fxt.line_assign("a", fxt.itm_ary().Subs_(fxt.itm_quote("b"), fxt.itm_ary().Subs_(fxt.itm_quote("c"), fxt.itm_quote("d")), fxt.itm_quote("e"))));} + @Test public void Brack_nest() {fxt.tst_lines("$a = ['b', ['c', 'd'], 'e'];" , fxt.line_assign("a", fxt.itm_ary().Subs_(fxt.itm_quote("b"), fxt.itm_ary().Subs_(fxt.itm_quote("c"), fxt.itm_quote("d")), fxt.itm_quote("e"))));} + @Test public void Ary_nest_kv() { fxt.tst_lines("$a = array('i00' => array('01', '02'), 'i10' => array('11', '12'), 'i20' => array('21', '22'));" , fxt.line_assign ( "a" @@ -69,7 +69,7 @@ public class Php_parser_tst { , fxt.itm_kv_itm("i20", fxt.itm_ary().Subs_(fxt.itm_quote("21"), fxt.itm_quote("22"))) ))); } - @Test public void Brack_nest_kv() { + @Test public void Brack_nest_kv() { fxt.tst_lines("$a = ['i00' => ['01', '02'], 'i10' => ['11', '12'], 'i20' => ['21', '22']];" , fxt.line_assign ( "a" @@ -79,7 +79,7 @@ public class Php_parser_tst { , fxt.itm_kv_itm("i20", fxt.itm_ary().Subs_(fxt.itm_quote("21"), fxt.itm_quote("22"))) ))); } - @Test public void Quoted() { + @Test public void Quoted() { fxt.Test__string__quotes("a\\\"z" , "a\"z"); fxt.Test__string__quotes("a\\\\z" , "a\\z"); fxt.Test__string__quotes("a\\u0008z" , "a\bz"); diff --git a/400_xowa/src/gplx/langs/phps/Php_srl_itm.java b/400_xowa/src/gplx/langs/phps/Php_srl_itm.java index 87a3617fc..215dbadf5 100644 --- a/400_xowa/src/gplx/langs/phps/Php_srl_itm.java +++ b/400_xowa/src/gplx/langs/phps/Php_srl_itm.java @@ -1,18 +1,18 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.langs.phps; import gplx.*; import gplx.langs.*; interface Php_srl_itm { byte Tid(); @@ -34,7 +34,7 @@ abstract class Php_srl_itm_base implements Php_srl_itm { public int Src_bgn() {return src_bgn;} private int src_bgn; public int Src_end() {return src_end;} private int src_end; public Object Val() {return val;} Object val; - @gplx.Virtual public void Xto_bfr(Bry_bfr bfr, int depth) { + public void Xto_bfr(Bry_bfr bfr, int depth) { Php_srl_wtr.Indent(bfr, depth); bfr.Add(Php_srl_itm_.Names[this.Tid()]).Add_byte(Byte_ascii.Colon); bfr.Add_str_u8(Object_.Xto_str_strict_or_null_mark(this.Val())).Add_byte(Byte_ascii.Semic).Add_byte_nl(); diff --git a/400_xowa/src/gplx/langs/phps/Php_srl_parser_tst.java b/400_xowa/src/gplx/langs/phps/Php_srl_parser_tst.java index 13d0eb330..5155d898f 100644 --- a/400_xowa/src/gplx/langs/phps/Php_srl_parser_tst.java +++ b/400_xowa/src/gplx/langs/phps/Php_srl_parser_tst.java @@ -1,38 +1,38 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.langs.phps; import gplx.*; import gplx.langs.*; import org.junit.*; public class Php_srl_parser_tst { Php_srl_parser_fxt fxt = new Php_srl_parser_fxt(); @Before public void init() {fxt.Clear();} - @Test public void Nil() {fxt.Test_parse("N;", fxt.itm_nil_());} - @Test public void Bool_y() {fxt.Test_parse("b:1;", fxt.itm_bool_y_());} - @Test public void Bool_n() {fxt.Test_parse("b:0;", fxt.itm_bool_n_());} - @Test public void Num_int() {fxt.Test_parse("i:123;", fxt.itm_int_(123));} - @Test public void Num_int_neg() {fxt.Test_parse("i:-123;", fxt.itm_int_(-123));} - @Test public void Num_double() {fxt.Test_parse("d:1.23;", fxt.itm_double_(1.23d));} - @Test public void Num_double_inf_pos(){fxt.Test_parse("d:INF;", fxt.itm_double_(Double_.Inf_pos));} - @Test public void Num_double_exp() {fxt.Test_parse("d:1.2e+2;", fxt.itm_double_(120));} - @Test public void Num_double_nan() {fxt.Test_parse("d:NAN;", fxt.itm_double_(Double_.NaN));} - @Test public void Str_len_3() {fxt.Test_parse("s:3:\"abc\";", fxt.itm_str_("abc"));} - @Test public void Str_len_4() {fxt.Test_parse("s:4:\"abcd\";", fxt.itm_str_("abcd"));} - @Test public void Str_len_0() {fxt.Test_parse("s:0:\"\";", fxt.itm_str_(""));} - @Test public void Ary_empty() {fxt.Test_parse("a:0:{}", fxt.itm_ary_());} - @Test public void Ary_flat_one() {fxt.Test_parse("a:1:{i:1;i:9;}", fxt.itm_ary_().Subs_add(fxt.itm_kvi_(1, fxt.itm_int_(9))));} - @Test public void Ary_flat_many() { + @Test public void Nil() {fxt.Test_parse("N;", fxt.itm_nil_());} + @Test public void Bool_y() {fxt.Test_parse("b:1;", fxt.itm_bool_y_());} + @Test public void Bool_n() {fxt.Test_parse("b:0;", fxt.itm_bool_n_());} + @Test public void Num_int() {fxt.Test_parse("i:123;", fxt.itm_int_(123));} + @Test public void Num_int_neg() {fxt.Test_parse("i:-123;", fxt.itm_int_(-123));} + @Test public void Num_double() {fxt.Test_parse("d:1.23;", fxt.itm_double_(1.23d));} + @Test public void Num_double_inf_pos(){fxt.Test_parse("d:INF;", fxt.itm_double_(Double_.Inf_pos));} + @Test public void Num_double_exp() {fxt.Test_parse("d:1.2e+2;", fxt.itm_double_(120));} + @Test public void Num_double_nan() {fxt.Test_parse("d:NAN;", fxt.itm_double_(Double_.NaN));} + @Test public void Str_len_3() {fxt.Test_parse("s:3:\"abc\";", fxt.itm_str_("abc"));} + @Test public void Str_len_4() {fxt.Test_parse("s:4:\"abcd\";", fxt.itm_str_("abcd"));} + @Test public void Str_len_0() {fxt.Test_parse("s:0:\"\";", fxt.itm_str_(""));} + @Test public void Ary_empty() {fxt.Test_parse("a:0:{}", fxt.itm_ary_());} + @Test public void Ary_flat_one() {fxt.Test_parse("a:1:{i:1;i:9;}", fxt.itm_ary_().Subs_add(fxt.itm_kvi_(1, fxt.itm_int_(9))));} + @Test public void Ary_flat_many() { fxt.Test_parse(String_.Concat ( "a:3:{" , "i:1;i:9;" @@ -44,7 +44,7 @@ public class Php_srl_parser_tst { , fxt.itm_kvi_(3, fxt.itm_int_(7)) )); } - @Test public void Ary_nest_one() { + @Test public void Ary_nest_one() { fxt.Test_parse(String_.Concat ( "a:1:{" , "i:1;" @@ -60,7 +60,7 @@ public class Php_srl_parser_tst { , fxt.itm_kvi_(2, fxt.itm_int_(8)) )))); } - @Test public void Ary_key_str() { + @Test public void Ary_key_str() { fxt.Test_parse(String_.Concat ( "a:1:{" , "s:3:\"abc\";" @@ -69,10 +69,10 @@ public class Php_srl_parser_tst { ( fxt.itm_kvs_("abc", fxt.itm_int_(987)) )); } - @Test public void Func() { + @Test public void Func() { fxt.Test_parse("O:42:\"Scribunto_LuaStandaloneInterpreterFunction\":1:{s:2:\"id\";i:123;}", fxt.itm_func_(123)); } - @Test public void Smoke() { + @Test public void Smoke() { // fxt.Test_parse("a:2:{s:6:\"values\";a:1:{i:1;a:9:{s:21:\"makeProt"+"ectedEnvFuncs\";O:42:\"Scribunto_LuaStandaloneInterpreterFunction\":1:{s:2:\"id\";i:2;}s:3:\"log\";O:42:\"Scribunto_LuaStandaloneInterpreterFunction\":1:{s:2:\"id\";i:3;}s:14:\"clearLogBuffer\";O:42:\"Scribunto_LuaStandaloneInterpreterFunction\":1:{s:2:\"id\";i:4;}s:5:\"setup\";O:42:\"Scribunto_LuaStandaloneInterpreterFunction\":1:{s:2:\"id\";i:5;}s:5:\"clone\";O:42:\"Scribunto_LuaStandaloneInterpreterFunction\":1:{s:2:\"id\";i:6;}s:15:\"getCurrentFrame\";O:42:\"Scribunto_LuaStandaloneInterpreterFunction\":1:{s:2:\"id\";i:7;}s:13:\"executeModule\";O:42:\"Scribunto_LuaStandaloneInterpreterFunction\":1:{s:2:\"id\";i:8;}s:15:\"executeFunction\";O:42:\"Scribunto_LuaStandaloneInterpreterFunction\":1:{s:2:\"id\";i:9;}s:12:\"getLogBuffer\";O:42:\"Scribunto_LuaStandaloneInterpreterFunction\":1:{s:2:\"id\";i:10;}}}s:2:\"op\";s:6:\"return\";}"); } } diff --git a/400_xowa/src/gplx/langs/phps/Php_text_itm_tst.java b/400_xowa/src/gplx/langs/phps/Php_text_itm_tst.java index 75c000ce1..93ec02500 100644 --- a/400_xowa/src/gplx/langs/phps/Php_text_itm_tst.java +++ b/400_xowa/src/gplx/langs/phps/Php_text_itm_tst.java @@ -1,35 +1,35 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.langs.phps; import gplx.*; import gplx.langs.*; import org.junit.*; public class Php_text_itm_tst { @Before public void init() {fxt.Clear();} private Php_text_itm_fxt fxt = new Php_text_itm_fxt(); - @Test public void Q1_basic() {fxt.Init_q1().Test_parse("abcde" , "abcde");} - @Test public void Q1_apos() {fxt.Init_q1().Test_parse("a\\'b" , "a'b");} - @Test public void Q1_backslash() {fxt.Init_q1().Test_parse("a\\\\b" , "a\\b");} - @Test public void Q1_backslash_eos() {fxt.Init_q1().Test_parse("a\\" , "a\\");} // PURPOSE: allow single trailing backslash; DATE:2014-08-06 - @Test public void Q1_noop() {fxt.Init_q1().Test_parse("a\\$\\nb" , "a\\$\\nb");} - @Test public void Q2_basic() {fxt.Init_q2().Test_parse("abcde" , "abcde");} - @Test public void Q2_quote() {fxt.Init_q2().Test_parse("a\\\"b" , "a\"b");} - @Test public void Q2_backslash() {fxt.Init_q2().Test_parse("a\\\\b" , "a\\b");} - @Test public void Q2_noop() {fxt.Init_q2().Test_parse("a\\%\\cb" , "a\\%\\cb");} - @Test public void Q2_ws() {fxt.Init_q2().Test_parse("a\\tb\\nc" , "a\tb\nc");} - @Test public void Q2_fmt() {fxt.Init_q2().Test_parse("a$1b$2c" , "a~{0}b~{1}c");} - @Test public void Q2_utf_pipe() {fxt.Init_q2().Test_parse("a\\u007Cd" , "a|d");} - @Test public void Q2_hex_nbsp() {fxt.Init_q2().Test_parse("a\\xc2\\xa0d" , "a\\u00c2\\u00a0d");} + @Test public void Q1_basic() {fxt.Init_q1().Test_parse("abcde" , "abcde");} + @Test public void Q1_apos() {fxt.Init_q1().Test_parse("a\\'b" , "a'b");} + @Test public void Q1_backslash() {fxt.Init_q1().Test_parse("a\\\\b" , "a\\b");} + @Test public void Q1_backslash_eos() {fxt.Init_q1().Test_parse("a\\" , "a\\");} // PURPOSE: allow single trailing backslash; DATE:2014-08-06 + @Test public void Q1_noop() {fxt.Init_q1().Test_parse("a\\$\\nb" , "a\\$\\nb");} + @Test public void Q2_basic() {fxt.Init_q2().Test_parse("abcde" , "abcde");} + @Test public void Q2_quote() {fxt.Init_q2().Test_parse("a\\\"b" , "a\"b");} + @Test public void Q2_backslash() {fxt.Init_q2().Test_parse("a\\\\b" , "a\\b");} + @Test public void Q2_noop() {fxt.Init_q2().Test_parse("a\\%\\cb" , "a\\%\\cb");} + @Test public void Q2_ws() {fxt.Init_q2().Test_parse("a\\tb\\nc" , "a\tb\nc");} + @Test public void Q2_fmt() {fxt.Init_q2().Test_parse("a$1b$2c" , "a~{0}b~{1}c");} + @Test public void Q2_utf_pipe() {fxt.Init_q2().Test_parse("a\\u007Cd" , "a|d");} + @Test public void Q2_hex_nbsp() {fxt.Init_q2().Test_parse("a\\xc2\\xa0d" , "a\\u00c2\\u00a0d");} } class Php_text_itm_fxt { private Php_text_itm_parser parser; diff --git a/400_xowa/src/gplx/langs/regxs/Gfo_pattern_tst.java b/400_xowa/src/gplx/langs/regxs/Gfo_pattern_tst.java index a00972dc6..ce636939b 100644 --- a/400_xowa/src/gplx/langs/regxs/Gfo_pattern_tst.java +++ b/400_xowa/src/gplx/langs/regxs/Gfo_pattern_tst.java @@ -1,23 +1,23 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.langs.regxs; import gplx.*; import gplx.langs.*; import org.junit.*; import gplx.core.strings.*; public class Gfo_pattern_tst { @Before public void init() {fxt.Clear();} private Gfo_pattern_itm_fxt fxt = new Gfo_pattern_itm_fxt(); - @Test public void Compile() { + @Test public void Compile() { fxt.Test_Compile("a" , fxt.itm_text_("a")); fxt.Test_Compile("*" , fxt.itm_wild_()); fxt.Test_Compile("a*" , fxt.itm_text_("a"), fxt.itm_wild_()); @@ -25,31 +25,31 @@ public class Gfo_pattern_tst { fxt.Test_Compile("*ab*" , fxt.itm_wild_(), fxt.itm_text_("ab"), fxt.itm_wild_()); fxt.Test_Compile("" ); } - @Test public void Match() { + @Test public void Match() { Gfo_pattern pattern = fxt.pattern_("abc"); fxt.Test_Match_y(pattern, "abc"); fxt.Test_Match_n(pattern, "ab", "a", "bc", "Abc", ""); } - @Test public void Match_all() { + @Test public void Match_all() { Gfo_pattern pattern = fxt.pattern_("*"); fxt.Test_Match_y(pattern, "a", "abc", ""); } - @Test public void Match_bgn() { + @Test public void Match_bgn() { Gfo_pattern pattern = fxt.pattern_("abc*"); fxt.Test_Match_y(pattern, "abc", "abcdef"); fxt.Test_Match_n(pattern, "abd", "aabc", ""); } - @Test public void Match_end() { + @Test public void Match_end() { Gfo_pattern pattern = fxt.pattern_("*abc"); fxt.Test_Match_y(pattern, "abc", "xyzabc"); fxt.Test_Match_n(pattern, "abcd", ""); } - @Test public void Match_mid() { + @Test public void Match_mid() { Gfo_pattern pattern = fxt.pattern_("a*c*e"); fxt.Test_Match_y(pattern, "ace", "abcde"); fxt.Test_Match_n(pattern, "abc", ""); } - @Test public void Bug_ctx() { // PURPOSE.fix: cb was true b/c ctx was not reset correctly + @Test public void Bug_ctx() { // PURPOSE.fix: cb was true b/c ctx was not reset correctly Gfo_pattern pattern = fxt.pattern_("b*"); fxt.Test_Match_y(pattern, "bc"); fxt.Test_Match_n(pattern, "cb"); diff --git a/400_xowa/src/gplx/langs/xmls/Gfo_xml_wtr_tst.java b/400_xowa/src/gplx/langs/xmls/Gfo_xml_wtr_tst.java index c06191b3b..752b931d0 100644 --- a/400_xowa/src/gplx/langs/xmls/Gfo_xml_wtr_tst.java +++ b/400_xowa/src/gplx/langs/xmls/Gfo_xml_wtr_tst.java @@ -1,28 +1,28 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.langs.xmls; import gplx.*; import gplx.langs.*; import org.junit.*; public class Gfo_xml_wtr_tst { private final Gfo_xml_wtr_fxt fxt = new Gfo_xml_wtr_fxt(); @Before public void init() {} - @Test public void Root() { + @Test public void Root() { fxt.Wtr().Nde_lhs("a").Nde_rhs(); fxt.Test_bld("", ""); } - @Test public void Nest() { + @Test public void Nest() { fxt.Wtr() .Nde_lhs("a") . Nde_lhs("a_a") @@ -40,7 +40,7 @@ public class Gfo_xml_wtr_tst { , "" ); } - @Test public void Atrs() { + @Test public void Atrs() { fxt.Wtr() .Nde_lhs_bgn_itm("a") .Atr_kv_str_a7("b", "b1") @@ -49,7 +49,7 @@ public class Gfo_xml_wtr_tst { ; fxt.Test_bld(""); } - @Test public void Atrs_escape() { + @Test public void Atrs_escape() { fxt.Wtr() .Nde_lhs_bgn_itm("a") .Atr_kv_str_a7("b", "'\"<>&") @@ -58,13 +58,13 @@ public class Gfo_xml_wtr_tst { ; fxt.Test_bld(""); } - @Test public void Nde_txt() { + @Test public void Nde_txt() { fxt.Wtr() .Nde_txt_str("a", "a123") ; fxt.Test_bld("a123"); } - @Test public void Nde_txt_escape() { + @Test public void Nde_txt_escape() { fxt.Wtr() .Nde_txt_str("a", "'\"<>&x") ; diff --git a/400_xowa/src/gplx/xowa/Xoae_page__tst.java b/400_xowa/src/gplx/xowa/Xoae_page__tst.java index 1e06c2abd..ca547a25c 100644 --- a/400_xowa/src/gplx/xowa/Xoae_page__tst.java +++ b/400_xowa/src/gplx/xowa/Xoae_page__tst.java @@ -1,23 +1,23 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa; import gplx.*; import org.junit.*; import gplx.core.tests.*; public class Xoae_page__tst { private final Xoae_page__fxt fxt = new Xoae_page__fxt(); - @Test public void Ttl() { + @Test public void Ttl() { fxt.Init__page("Abc"); fxt.Exec__ttl("Заглавная_страница"); fxt.Test__url("en.wikipedia.org/wiki/Заглавная_страница"); // fails if "%D0%97%D0%B0%D0%B3%D0%BB%D0%B0%D0%B2%D0%BD%D0%B0%D1%8F_%D1%81%D1%82%D1%80%D0%B0%D0%BD%D0%B8%D1%86%D0%B0"; DATE:2016-11-25 diff --git a/400_xowa/src/gplx/xowa/addons/apps/cfgs/mgrs/caches/Xocfg_cache_mgr__tst.java b/400_xowa/src/gplx/xowa/addons/apps/cfgs/mgrs/caches/Xocfg_cache_mgr__tst.java index e154c12ea..2b821804a 100644 --- a/400_xowa/src/gplx/xowa/addons/apps/cfgs/mgrs/caches/Xocfg_cache_mgr__tst.java +++ b/400_xowa/src/gplx/xowa/addons/apps/cfgs/mgrs/caches/Xocfg_cache_mgr__tst.java @@ -1,37 +1,37 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.addons.apps.cfgs.mgrs.caches; import gplx.*; import gplx.xowa.*; import gplx.xowa.addons.*; import gplx.xowa.addons.apps.*; import gplx.xowa.addons.apps.cfgs.*; import gplx.xowa.addons.apps.cfgs.mgrs.*; import org.junit.*; import gplx.core.tests.*; import gplx.dbs.*; import gplx.xowa.addons.apps.cfgs.dbs.*; import gplx.xowa.addons.apps.cfgs.specials.maints.services.*; public class Xocfg_cache_mgr__tst { private final Xocfg_cache_mgr__fxt fxt = new Xocfg_cache_mgr__fxt(); @Before public void init() {fxt.Clear();} - @Test public void Get__wiki() { + @Test public void Get__wiki() { fxt.Init__db_add("en.w", "key_1", "val_1"); fxt.Test__get("en.w", "key_1", "val_1"); fxt.Test__get("en.d", "key_1", "dflt"); } - @Test public void Get__app() { + @Test public void Get__app() { String ctx = Xocfg_mgr.Ctx__app; fxt.Init__db_add(ctx, "key_1", "val_1"); fxt.Test__get(ctx, "key_1", "val_1"); fxt.Test__get("en.w", "key_1", "val_1"); fxt.Test__get("en.d", "key_1", "val_1"); } - @Test public void Set__app() { + @Test public void Set__app() { String ctx = Xocfg_mgr.Ctx__app; fxt.Init__db_add(ctx, "key_1", "123"); fxt.Init__sub(ctx, "key_1", "key_1"); diff --git a/400_xowa/src/gplx/xowa/addons/apps/cfgs/specials/edits/objs/Xoedit_itm_html_tst.java b/400_xowa/src/gplx/xowa/addons/apps/cfgs/specials/edits/objs/Xoedit_itm_html_tst.java index deccdb63c..78f0ef3c1 100644 --- a/400_xowa/src/gplx/xowa/addons/apps/cfgs/specials/edits/objs/Xoedit_itm_html_tst.java +++ b/400_xowa/src/gplx/xowa/addons/apps/cfgs/specials/edits/objs/Xoedit_itm_html_tst.java @@ -1,24 +1,24 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.addons.apps.cfgs.specials.edits.objs; import gplx.*; import gplx.xowa.*; import gplx.xowa.addons.*; import gplx.xowa.addons.apps.*; import gplx.xowa.addons.apps.cfgs.*; import gplx.xowa.addons.apps.cfgs.specials.*; import gplx.xowa.addons.apps.cfgs.specials.edits.*; import org.junit.*; import gplx.core.tests.*; import gplx.xowa.addons.apps.cfgs.mgrs.types.*; public class Xoedit_itm_html_tst { private final Xoedit_itm_html_fxt fxt = new Xoedit_itm_html_fxt(); - @Test public void Build_html__memo() { + @Test public void Build_html__memo() { fxt.Type_("memo").Key_("key1").Name_("name1").Html_cls_("html_cls1").Html_atrs_("key1=val1"); // normal diff --git a/400_xowa/src/gplx/xowa/addons/apps/cfgs/specials/maints/services/Xocfg_maint_parser__tst.java b/400_xowa/src/gplx/xowa/addons/apps/cfgs/specials/maints/services/Xocfg_maint_parser__tst.java index b184bc185..76fbb9eec 100644 --- a/400_xowa/src/gplx/xowa/addons/apps/cfgs/specials/maints/services/Xocfg_maint_parser__tst.java +++ b/400_xowa/src/gplx/xowa/addons/apps/cfgs/specials/maints/services/Xocfg_maint_parser__tst.java @@ -1,28 +1,28 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.addons.apps.cfgs.specials.maints.services; import gplx.*; import gplx.xowa.*; import gplx.xowa.addons.*; import gplx.xowa.addons.apps.*; import gplx.xowa.addons.apps.cfgs.*; import gplx.xowa.addons.apps.cfgs.specials.*; import gplx.xowa.addons.apps.cfgs.specials.maints.*; import org.junit.*; import gplx.core.tests.*; public class Xocfg_maint_parser__tst { private final Xocfg_maint_parser__fxt fxt = new Xocfg_maint_parser__fxt(); - @Test public void Parse_grp() { + @Test public void Parse_grp() { fxt.Exec__parse("grp {id='123'; key='key_1'; owner='owner_1'; name='name_1'; help='help_1'}" , fxt.Make__grp("owner_1", 123, "key_1", "name_1", "help_1") ); } - @Test public void Parse_itm() { + @Test public void Parse_itm() { fxt.Exec__parse("itm {id='123'; key='key_1'; owner='owner_1'; name='name_1'; help='help_1'; scope='scope_1'; type='type_1'; dflt='dflt_1'; html_atrs='html_atrs_1'; html_cls='html_cls_1'}" , fxt.Make__itm("owner_1", 123, "key_1", "name_1", "help_1", "scope_1", "type_1", "dflt_1", "html_atrs_1", "html_cls_1") ); diff --git a/400_xowa/src/gplx/xowa/addons/apps/cfgs/upgrades/Xocfg_upgrade_mgr__tst.java b/400_xowa/src/gplx/xowa/addons/apps/cfgs/upgrades/Xocfg_upgrade_mgr__tst.java index 9ad15c544..01dfe0b50 100644 --- a/400_xowa/src/gplx/xowa/addons/apps/cfgs/upgrades/Xocfg_upgrade_mgr__tst.java +++ b/400_xowa/src/gplx/xowa/addons/apps/cfgs/upgrades/Xocfg_upgrade_mgr__tst.java @@ -1,48 +1,48 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.addons.apps.cfgs.upgrades; import gplx.*; import gplx.xowa.*; import gplx.xowa.addons.*; import gplx.xowa.addons.apps.*; import gplx.xowa.addons.apps.cfgs.*; import org.junit.*; import gplx.core.tests.*; public class Xocfg_upgrade_mgr__tst { private final Xocfg_upgrade_mgr__fxt fxt = new Xocfg_upgrade_mgr__fxt(); - @Test public void Parse__one() { + @Test public void Parse__one() { fxt.Test__parse("app.cfgs.get('k_1', 'app').val = 'v_1';\n", Keyval_.new_("k_1", "v_1")); } - @Test public void Parse__apos() { + @Test public void Parse__apos() { fxt.Test__parse("app.cfgs.get('k_1(''k_1a'')', 'app').val = 'v_1';\n", Keyval_.new_("k_1('k_1a')", "v_1")); } - @Test public void Parse__many() { + @Test public void Parse__many() { fxt.Test__parse ( "app.cfgs.get('k_1', 'app').val = 'v_1';\n" + "app.cfgs.get('k_2', 'app').val = 'v_2';\n" , Keyval_.new_("k_1", "v_1"), Keyval_.new_("k_2", "v_2")); } - @Test public void Parse__multi_line() { + @Test public void Parse__multi_line() { fxt.Test__parse ( "app.cfgs.get('k_1', 'app').val = '''v_1'';\n" + "v_2\n" + "v_3';\n" , Keyval_.new_("k_1", "'v_1';\nv_2\nv_3")); } - @Test public void Parse__io_cmd() { + @Test public void Parse__io_cmd() { fxt.Test__parse ( "app.cfgs.get('a.cmd', 'app').val = 'cmd_1';\n" + "app.cfgs.get('a.args', 'app').val = 'args_1';\n" , Keyval_.new_("a.cmd", "cmd_1|args_1")); } - @Test public void Parse__gui_binding() { + @Test public void Parse__gui_binding() { fxt.Test__parse ( "app.cfgs.get('app.cfg.get.gui.bnds.init(''xowa.app.exit-1'').src', 'app').val = 'box=''browser'';ipt=''key.none'';';\n" , Keyval_.new_("xowa.gui.shortcuts.xowa.app.exit-1", "browser|key.none")); diff --git a/400_xowa/src/gplx/xowa/addons/apps/scripts/apis/Xoscript_doc_head__tst.java b/400_xowa/src/gplx/xowa/addons/apps/scripts/apis/Xoscript_doc_head__tst.java index a9ef53981..ebb191093 100644 --- a/400_xowa/src/gplx/xowa/addons/apps/scripts/apis/Xoscript_doc_head__tst.java +++ b/400_xowa/src/gplx/xowa/addons/apps/scripts/apis/Xoscript_doc_head__tst.java @@ -1,18 +1,18 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.addons.apps.scripts.apis; import gplx.*; import gplx.xowa.*; import gplx.xowa.addons.*; import gplx.xowa.addons.apps.*; import gplx.xowa.addons.apps.scripts.*; import org.junit.*; import gplx.core.tests.*; public class Xoscript_doc_head__tst { @@ -23,22 +23,22 @@ public class Xoscript_doc_head__tst { fxt.Exec__reg_marker("", "bot"); fxt.Exec__doc__html("abc"); } - @Test public void Add_html() { + @Test public void Add_html() { fxt.Exec__add_html("top", "add_1"); fxt.Exec__add_html("top", "add_2"); fxt.Test__html("aadd_1add_2bc"); } - @Test public void Add_html__default() { + @Test public void Add_html__default() { fxt.Exec__add_html("add_1"); fxt.Test__html("aadd_1bc"); } - @Test public void Add_tag() { + @Test public void Add_tag() { fxt.Exec__add_tag("top", "div", "div_body", "k0", "v0", "k1", "v1"); fxt.Test__html ( "a
div_body
" , "bc"); } - @Test public void Add_js_file() { + @Test public void Add_js_file() { fxt.Exec__add_js_file("top", "./a.js"); fxt.Test__html ( "a" diff --git a/400_xowa/src/gplx/xowa/addons/apps/updates/js/Xojs_wkr__base.java b/400_xowa/src/gplx/xowa/addons/apps/updates/js/Xojs_wkr__base.java index 0d737fb38..3ec750f5c 100644 --- a/400_xowa/src/gplx/xowa/addons/apps/updates/js/Xojs_wkr__base.java +++ b/400_xowa/src/gplx/xowa/addons/apps/updates/js/Xojs_wkr__base.java @@ -1,21 +1,34 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ -package gplx.xowa.addons.apps.updates.js; import gplx.*; import gplx.xowa.*; import gplx.xowa.addons.*; import gplx.xowa.addons.apps.*; import gplx.xowa.addons.apps.updates.*; -import gplx.core.gfobjs.*; import gplx.core.progs.*; import gplx.core.progs.rates.*; -import gplx.xowa.guis.cbks.*; +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ +package gplx.xowa.addons.apps.updates.js; import gplx.Err_; +import gplx.GfoMsg; +import gplx.GfoMsg_; +import gplx.Gfo_invk; +import gplx.Gfo_invk_; +import gplx.Gfo_invk_cmd; +import gplx.Gfo_usr_dlg_; +import gplx.GfsCtx; +import gplx.Math_; +import gplx.String_; +import gplx.core.gfobjs.Gfobj_nde; +import gplx.core.progs.Gfo_prog_ui; +import gplx.core.progs.Gfo_prog_ui_; +import gplx.core.progs.rates.Gfo_rate_list; +import gplx.xowa.guis.cbks.Xog_cbk_mgr; +import gplx.xowa.guis.cbks.Xog_cbk_trg; public class Xojs_wkr__base implements Gfo_prog_ui, Gfo_invk { private final Gfo_invk_cmd done_cbk; private final Gfo_invk_cmd fail_cbk; @@ -46,7 +59,7 @@ public class Xojs_wkr__base implements Gfo_prog_ui, Gfo_invk { fail_cbk.Exec(); } } - @gplx.Virtual protected void Exec_run() {} + protected void Exec_run() {} public void Exec_async(String thread_name) { gplx.core.threads.Thread_adp_.Start_by_key(thread_name + ".download", this, Invk__exec); } diff --git a/400_xowa/src/gplx/xowa/addons/apps/updates/specials/Xoa_update_itm__leaf.java b/400_xowa/src/gplx/xowa/addons/apps/updates/specials/Xoa_update_itm__leaf.java index d1177670a..ceed9a584 100644 --- a/400_xowa/src/gplx/xowa/addons/apps/updates/specials/Xoa_update_itm__leaf.java +++ b/400_xowa/src/gplx/xowa/addons/apps/updates/specials/Xoa_update_itm__leaf.java @@ -1,18 +1,18 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.addons.apps.updates.specials; import gplx.*; import gplx.xowa.*; import gplx.xowa.addons.*; import gplx.xowa.addons.apps.*; import gplx.xowa.addons.apps.updates.*; import gplx.langs.mustaches.*; import gplx.xowa.addons.apps.updates.dbs.*; @@ -27,7 +27,7 @@ class Xoa_update_itm__leaf implements Mustache_doc_itm { this.details = details; this.package_url = package_url; } - @gplx.Virtual public boolean Mustache__write(String k, Mustache_bfr bfr) { + public boolean Mustache__write(String k, Mustache_bfr bfr) { if (String_.Eq(k, "version")) bfr.Add_str_u8(version); else if (String_.Eq(k, "date")) bfr.Add_str_u8(date); else if (String_.Eq(k, "priority")) bfr.Add_str_u8(Xoa_app_version_itm.Priority__to_name(priority)); @@ -36,7 +36,7 @@ class Xoa_update_itm__leaf implements Mustache_doc_itm { else if (String_.Eq(k, "package_url")) bfr.Add_str_u8(package_url); return true; } - @gplx.Virtual public Mustache_doc_itm[] Mustache__subs(String key) { + public Mustache_doc_itm[] Mustache__subs(String key) { if (String_.Eq(key, "priority_is_major")) return Mustache_doc_itm_.Ary__bool(priority >= Xoa_app_version_itm.Priority__major); return Mustache_doc_itm_.Ary__empty; } diff --git a/400_xowa/src/gplx/xowa/addons/bldrs/app_cfgs/Xob_wiki_cfg_bldr_tst.java b/400_xowa/src/gplx/xowa/addons/bldrs/app_cfgs/Xob_wiki_cfg_bldr_tst.java index 475408e43..a40860c2b 100644 --- a/400_xowa/src/gplx/xowa/addons/bldrs/app_cfgs/Xob_wiki_cfg_bldr_tst.java +++ b/400_xowa/src/gplx/xowa/addons/bldrs/app_cfgs/Xob_wiki_cfg_bldr_tst.java @@ -1,24 +1,24 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.addons.bldrs.app_cfgs; import gplx.*; import gplx.xowa.*; import gplx.xowa.addons.*; import gplx.xowa.addons.bldrs.*; import org.junit.*; import gplx.core.strings.*; public class Xob_wiki_cfg_bldr_tst { Xob_wiki_cfg_bldr_fxt fxt = new Xob_wiki_cfg_bldr_fxt(); @Before public void init() {fxt.Clear();} - @Test public void Exec() { + @Test public void Exec() { fxt .Init_cmd("en.wikipedia.org", "key0", "en.val0") .Init_cmd("en.wikipedia.org", "key1", "en.val1") .Init_cmd("fr.wikipedia.org", "key0", "fr.val0") @@ -55,7 +55,7 @@ public class Xob_wiki_cfg_bldr_tst { , "// key2.end" )); } -// @Test public void Lang_names_run() { +// @Test public void Lang_names_run() { // Io_url dir = Io_url_.new_dir_("/var/www/mediawiki/languages/messages/"); // Io_url[] fils = Io_mgr.Instance.QueryDir_args(dir).ExecAsUrlAry(); // int fils_len = fils.length; @@ -89,7 +89,7 @@ public class Xob_wiki_cfg_bldr_tst { // } // Tfds.Dbg(sb.To_str_and_clear()); // } - @Test public void Ns_aliases() { + @Test public void Ns_aliases() { Io_mgr.Instance.InitEngine_mem(); Io_mgr.Instance.SaveFilStr("mem/en.wikipedia.org/w/api.php?action=query&format=xml&meta=siteinfo&siprop=namespacealiases", String_.Concat_lines_nl ( "" diff --git a/400_xowa/src/gplx/xowa/addons/bldrs/app_cfgs/wm_server_cfgs/Xowm_server_cfg_mgr.java b/400_xowa/src/gplx/xowa/addons/bldrs/app_cfgs/wm_server_cfgs/Xowm_server_cfg_mgr.java index 73f1b87b1..f679d4a06 100644 --- a/400_xowa/src/gplx/xowa/addons/bldrs/app_cfgs/wm_server_cfgs/Xowm_server_cfg_mgr.java +++ b/400_xowa/src/gplx/xowa/addons/bldrs/app_cfgs/wm_server_cfgs/Xowm_server_cfg_mgr.java @@ -1,23 +1,39 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ -package gplx.xowa.addons.bldrs.app_cfgs.wm_server_cfgs; import gplx.*; import gplx.xowa.*; import gplx.xowa.addons.*; import gplx.xowa.addons.bldrs.*; import gplx.xowa.addons.bldrs.app_cfgs.*; -import gplx.core.ios.*; -import gplx.xowa.bldrs.*; import gplx.xowa.bldrs.wkrs.*; -import gplx.langs.phps.*; -import gplx.xowa.wikis.domains.*; +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ +package gplx.xowa.addons.bldrs.app_cfgs.wm_server_cfgs; import gplx.Bry_; +import gplx.Bry_bfr; +import gplx.Bry_bfr_; +import gplx.Bry_find_; +import gplx.Byte_ascii; +import gplx.DateAdp; +import gplx.Datetime_now; +import gplx.Err_; +import gplx.Io_mgr; +import gplx.Io_url; +import gplx.core.ios.IoItmFil; +import gplx.langs.phps.Php_evaluator; +import gplx.langs.phps.Php_itm_ary; +import gplx.langs.phps.Php_itm_kv; +import gplx.langs.phps.Php_line; +import gplx.langs.phps.Php_line_assign; +import gplx.langs.phps.Php_parser; +import gplx.xowa.Xoa_app; +import gplx.xowa.wikis.domains.Xow_abrv_wm_; +import gplx.xowa.wikis.domains.Xow_domain_itm; +import gplx.xowa.wikis.domains.Xow_domain_itm_; public class Xowm_server_cfg_mgr { public void Exec(Xoa_app app) { // get local file @@ -63,7 +79,7 @@ public class Xowm_server_cfg_mgr { bfr.Add_str_u8_fmt("app.bldr.wiki_cfg_bldr.get('{0}').new_cmd_('wiki.ctgs.collations', \"catpage_mgr.collation_('{1}');\");\n", itm.Domain_bry(), collation); } catch (Exception e) {throw Err_.new_("failed to parse line", "wiki", wiki_abrv, "collation", collation, "err", Err_.Message_lang(e));} } - Tfds.Write(bfr.To_str_and_clear()); + // Tfds.Write(bfr.To_str_and_clear()); } private static void Assert_recent_or_download(Io_url trg, String src, int min) { // get file diff --git a/400_xowa/src/gplx/xowa/addons/bldrs/centrals/cmds/Xobc_cmd__base.java b/400_xowa/src/gplx/xowa/addons/bldrs/centrals/cmds/Xobc_cmd__base.java index cb41ad79b..713ddfe98 100644 --- a/400_xowa/src/gplx/xowa/addons/bldrs/centrals/cmds/Xobc_cmd__base.java +++ b/400_xowa/src/gplx/xowa/addons/bldrs/centrals/cmds/Xobc_cmd__base.java @@ -1,18 +1,18 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.addons.bldrs.centrals.cmds; import gplx.*; import gplx.xowa.*; import gplx.xowa.addons.*; import gplx.xowa.addons.bldrs.*; import gplx.xowa.addons.bldrs.centrals.*; import gplx.core.gfobjs.*; import gplx.core.progs.*; import gplx.core.progs.rates.*; import gplx.xowa.apps.apis.*; @@ -40,10 +40,10 @@ public abstract class Xobc_cmd__base implements Xobc_cmd_itm { public int Cmd_id() {return cmd_id;} private final int cmd_id; public abstract String Cmd_type(); public abstract String Cmd_name(); - @gplx.Virtual public boolean Cmd_suspendable() {return false;} + public boolean Cmd_suspendable() {return false;} public String Cmd_uid() {return cmd_uid;} private final String cmd_uid; - @gplx.Virtual public String Cmd_fallback() {return this.Cmd_type();} - @gplx.Virtual public void Cmd_clear() {// called when restarting failed task + public String Cmd_fallback() {return this.Cmd_type();} + public void Cmd_clear() {// called when restarting failed task this.status = Gfo_prog_ui_.Status__init; this.cmd_exec_err = null; // reset error this.data_cur = 0; // reset progress else bad progress updates; DATE:2016-06-29 @@ -79,13 +79,13 @@ public abstract class Xobc_cmd__base implements Xobc_cmd_itm { } } protected abstract void Cmd_exec_hook(Xobc_cmd_ctx ctx); - @gplx.Virtual protected boolean Cmd_fail_resumes() {return false;} + protected boolean Cmd_fail_resumes() {return false;} protected void Cmd_exec_err_(String v) { Gfo_log_.Instance.Warn("xobc_cmd task err", "task_id", task_id, "step_id", step_id, "cmd_id", cmd_id, "err", v); this.status = Gfo_prog_ui_.Status__fail; this.cmd_exec_err = v; } private String cmd_exec_err; - @gplx.Virtual public void Cmd_cleanup() {} + public void Cmd_cleanup() {} public Gfobj_nde Save_to(Gfobj_nde nde) { nde.Add_int ("task_id" , task_id); @@ -106,7 +106,7 @@ public abstract class Xobc_cmd__base implements Xobc_cmd_itm { if (data_cur > 0) this.Prog_status_(Gfo_prog_ui_.Status__suspended); // set status to suspended, else js won't warn about accidental removal } - @gplx.Virtual protected long Load_checkpoint_hook() {return 0;} + protected long Load_checkpoint_hook() {return 0;} public boolean Prog_notify_and_chk_if_suspended(long new_data_cur, long new_data_end) { if (status == Gfo_prog_ui_.Status__suspended) return true; // task paused by ui; exit now; diff --git a/400_xowa/src/gplx/xowa/addons/bldrs/exports/packs/files/Pack_zip_name_bldr__tst.java b/400_xowa/src/gplx/xowa/addons/bldrs/exports/packs/files/Pack_zip_name_bldr__tst.java index 12db35412..edc97317a 100644 --- a/400_xowa/src/gplx/xowa/addons/bldrs/exports/packs/files/Pack_zip_name_bldr__tst.java +++ b/400_xowa/src/gplx/xowa/addons/bldrs/exports/packs/files/Pack_zip_name_bldr__tst.java @@ -1,26 +1,26 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.addons.bldrs.exports.packs.files; import gplx.*; import gplx.xowa.*; import gplx.xowa.addons.*; import gplx.xowa.addons.bldrs.*; import gplx.xowa.addons.bldrs.exports.*; import gplx.xowa.addons.bldrs.exports.packs.*; import org.junit.*; import gplx.core.tests.*; public class Pack_zip_name_bldr__tst { private Pack_zip_name_bldr__fxt fxt = new Pack_zip_name_bldr__fxt(); - @Test public void Basic() { + @Test public void Basic() { fxt.Test__to_wiki_url("mem/wiki/en.wikipedia.org/", "mem/wiki/en.wikipedia.org/tmp/Xowa_enwiki_2016-09_file_deletion_2016.09/", "mem/wiki/en.wikipedia.org/en.wikipedia.org-file-deletion-2016.09.xowa"); } - @Test public void Bld_by_suffix() { + @Test public void Bld_by_suffix() { Pack_zip_name_bldr bldr = fxt.Make__bldr("mem/wiki/en.wikipedia.org/tmp/pack/", "en.wikipedia.org", "enwiki", "2017-03", null); fxt.Test__bld_by_suffix(bldr, "xtn.fulltext_search", 1, "mem/wiki/en.wikipedia.org/tmp/pack/Xowa_enwiki_2017-03_xtn.fulltext_search.002.zip"); } diff --git a/400_xowa/src/gplx/xowa/addons/bldrs/files/cmds/Xobldr__image__create_tst.java b/400_xowa/src/gplx/xowa/addons/bldrs/files/cmds/Xobldr__image__create_tst.java index 31c66308e..4f5953f94 100644 --- a/400_xowa/src/gplx/xowa/addons/bldrs/files/cmds/Xobldr__image__create_tst.java +++ b/400_xowa/src/gplx/xowa/addons/bldrs/files/cmds/Xobldr__image__create_tst.java @@ -1,27 +1,27 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.addons.bldrs.files.cmds; import gplx.*; import gplx.xowa.*; import gplx.xowa.addons.*; import gplx.xowa.addons.bldrs.*; import gplx.xowa.addons.bldrs.files.*; import org.junit.*; import gplx.core.ios.*; import gplx.xowa.files.*; public class Xobldr__image__create_tst { private Xobldr__image__create_fxt fxt = new Xobldr__image__create_fxt(); - @Test public void Basic() {fxt.Init_("A.png" , Xof_media_type.Name_bitmap , Xof_ext_.Bry_png, 220, 110) .Test(Xof_ext_.Id_png);} // A.png -> png - @Test public void Ogg_VIDEO() {fxt.Init_("A.ogg" , Xof_media_type.Name_video , Xof_ext_.Bry_ogg, 220, 110) .Test(Xof_ext_.Id_ogv);} // A.ogg and VIDEO -> ogv - @Test public void Ogg_VIDEO_null_size() {fxt.Init_("A.ogg" , Xof_media_type.Name_video , Xof_ext_.Bry_ogg, 0, 0) .Test(Xof_ext_.Id_ogg);} // A.ogg but 0,0 -> ogg (not ogv) - @Test public void Png_is_jpg() {fxt.Init_("A.png" , Xof_media_type.Name_bitmap , Xof_ext_.Bry_jpg, 220, 110) .Test(Xof_ext_.Id_jpg);} // A.png and jpg -> jpg - @Test public void Jpeg_is_jpeg() {fxt.Init_("A.jpeg" , Xof_media_type.Name_bitmap , Xof_ext_.Bry_jpg, 220, 110) .Test(Xof_ext_.Id_jpeg);} // A.jpeg and jpg -> jpeg (unchanged) + @Test public void Basic() {fxt.Init_("A.png" , Xof_media_type.Name_bitmap , Xof_ext_.Bry_png, 220, 110) .Test(Xof_ext_.Id_png);} // A.png -> png + @Test public void Ogg_VIDEO() {fxt.Init_("A.ogg" , Xof_media_type.Name_video , Xof_ext_.Bry_ogg, 220, 110) .Test(Xof_ext_.Id_ogv);} // A.ogg and VIDEO -> ogv + @Test public void Ogg_VIDEO_null_size() {fxt.Init_("A.ogg" , Xof_media_type.Name_video , Xof_ext_.Bry_ogg, 0, 0) .Test(Xof_ext_.Id_ogg);} // A.ogg but 0,0 -> ogg (not ogv) + @Test public void Png_is_jpg() {fxt.Init_("A.png" , Xof_media_type.Name_bitmap , Xof_ext_.Bry_jpg, 220, 110) .Test(Xof_ext_.Id_jpg);} // A.png and jpg -> jpg + @Test public void Jpeg_is_jpeg() {fxt.Init_("A.jpeg" , Xof_media_type.Name_bitmap , Xof_ext_.Bry_jpg, 220, 110) .Test(Xof_ext_.Id_jpeg);} // A.jpeg and jpg -> jpeg (unchanged) } class Xobldr__image__create_fxt { private byte[] name, media_type, minor_mime; int w, h; diff --git a/400_xowa/src/gplx/xowa/addons/bldrs/files/cmds/Xobldr__lnki_temp__create__tst.java b/400_xowa/src/gplx/xowa/addons/bldrs/files/cmds/Xobldr__lnki_temp__create__tst.java index f948e8c0c..cb7bf44a4 100644 --- a/400_xowa/src/gplx/xowa/addons/bldrs/files/cmds/Xobldr__lnki_temp__create__tst.java +++ b/400_xowa/src/gplx/xowa/addons/bldrs/files/cmds/Xobldr__lnki_temp__create__tst.java @@ -1,23 +1,23 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.addons.bldrs.files.cmds; import gplx.*; import gplx.xowa.*; import gplx.xowa.addons.*; import gplx.xowa.addons.bldrs.*; import gplx.xowa.addons.bldrs.files.*; import org.junit.*; public class Xobldr__lnki_temp__create__tst { private Xobldr__lnki_temp__create__fxt fxt = new Xobldr__lnki_temp__create__fxt(); - @Test public void Xto_commons() { + @Test public void Xto_commons() { fxt.Init__to_commons(true); fxt.Test__to_commons("a", "A"); fxt.Test__to_commons("A", null); diff --git a/400_xowa/src/gplx/xowa/addons/bldrs/files/missing_origs/apis/Xowmf_imageinfo_item__tst.java b/400_xowa/src/gplx/xowa/addons/bldrs/files/missing_origs/apis/Xowmf_imageinfo_item__tst.java index ac39b0dbf..52d3fbb26 100644 --- a/400_xowa/src/gplx/xowa/addons/bldrs/files/missing_origs/apis/Xowmf_imageinfo_item__tst.java +++ b/400_xowa/src/gplx/xowa/addons/bldrs/files/missing_origs/apis/Xowmf_imageinfo_item__tst.java @@ -1,30 +1,30 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.addons.bldrs.files.missing_origs.apis; import gplx.*; import gplx.xowa.*; import gplx.xowa.addons.*; import gplx.xowa.addons.bldrs.*; import gplx.xowa.addons.bldrs.files.*; import gplx.xowa.addons.bldrs.files.missing_origs.*; import org.junit.*; import gplx.core.tests.*; public class Xowmf_imageinfo_item__tst { private final Xowmf_imageinfo_item__fxt fxt = new Xowmf_imageinfo_item__fxt(); - @Test public void Normalize_ttl() { + @Test public void Normalize_ttl() { fxt.Test__Normalize_ttl("File:A b.png", "A_b.png"); } - @Test public void Normalize_minor_mime() { + @Test public void Normalize_minor_mime() { fxt.Test__Normalize_minor_mime("image/svg+xml", "svg+xml"); } - @Test public void Normalize_timestamp() { + @Test public void Normalize_timestamp() { fxt.Test__Normalize_timestamp("2017-03-06T08:09:10Z", "20170306080910"); } } diff --git a/400_xowa/src/gplx/xowa/addons/bldrs/files/utls/Xob_xfer_temp_itm_tst.java b/400_xowa/src/gplx/xowa/addons/bldrs/files/utls/Xob_xfer_temp_itm_tst.java index 789707cd9..e2538a519 100644 --- a/400_xowa/src/gplx/xowa/addons/bldrs/files/utls/Xob_xfer_temp_itm_tst.java +++ b/400_xowa/src/gplx/xowa/addons/bldrs/files/utls/Xob_xfer_temp_itm_tst.java @@ -1,18 +1,18 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.addons.bldrs.files.utls; import gplx.*; import gplx.xowa.*; import gplx.xowa.addons.*; import gplx.xowa.addons.bldrs.*; import gplx.xowa.addons.bldrs.files.*; import org.junit.*; import gplx.core.gfo_ndes.*; @@ -22,27 +22,27 @@ import gplx.xowa.addons.bldrs.files.dbs.*; public class Xob_xfer_temp_itm_tst { private Xob_xfer_temp_itm_fxt fxt = new Xob_xfer_temp_itm_fxt(); @Before public void init() {fxt.Reset();} - @Test public void Pass() {fxt.Test_pass().Test_itm_chk_fail_id_none();} - @Test public void Missing_orig() {fxt.Test_fail(Xob_xfer_temp_itm.Chk_tid_orig_page_id_is_null , Keyval_.new_(Xob_orig_regy_tbl.Fld_orig_page_id, null));} - @Test public void File_is_audio() {fxt.Test_fail(Xob_xfer_temp_itm.Chk_tid_orig_media_type_is_audio , Keyval_.new_(Xob_orig_regy_tbl.Fld_orig_media_type, Xof_media_type.Name_audio));} - @Test public void File_is_mid() { + @Test public void Pass() {fxt.Test_pass().Test_itm_chk_fail_id_none();} + @Test public void Missing_orig() {fxt.Test_fail(Xob_xfer_temp_itm.Chk_tid_orig_page_id_is_null , Keyval_.new_(Xob_orig_regy_tbl.Fld_orig_page_id, null));} + @Test public void File_is_audio() {fxt.Test_fail(Xob_xfer_temp_itm.Chk_tid_orig_media_type_is_audio , Keyval_.new_(Xob_orig_regy_tbl.Fld_orig_media_type, Xof_media_type.Name_audio));} + @Test public void File_is_mid() { fxt.Test_fail(Xob_xfer_temp_itm.Chk_tid_orig_media_type_is_audio , Keyval_.new_(Xob_orig_regy_tbl.Fld_orig_file_ext, Xof_ext_.Id_mid)); } - @Test public void Redirect_src_is_empty() { // orig_cmd sets all direct files to have "orig_join" == "lnki_ttl" + @Test public void Redirect_src_is_empty() { // orig_cmd sets all direct files to have "orig_join" == "lnki_ttl" fxt.Test_bgn ( Keyval_.new_(Xob_orig_regy_tbl.Fld_orig_file_ttl , "A.png") , Keyval_.new_(Xob_orig_regy_tbl.Fld_lnki_ttl , "A.png") ); fxt.Test_lnki_redirect_src(""); // confirm redirect_src set to "" } - @Test public void Redirect_src_has_val() { // orig_cmd sets all redirect files to have "orig_join" = redirect and "lnki_ttl" as orig; EX: A.png redirects to B.png; orig_join will be B.png (the actual image) and redirect_src will be A.png (the original lnki) + @Test public void Redirect_src_has_val() { // orig_cmd sets all redirect files to have "orig_join" = redirect and "lnki_ttl" as orig; EX: A.png redirects to B.png; orig_join will be B.png (the actual image) and redirect_src will be A.png (the original lnki) fxt.Test_bgn ( Keyval_.new_(Xob_orig_regy_tbl.Fld_orig_file_ttl , "B.png") , Keyval_.new_(Xob_orig_regy_tbl.Fld_lnki_ttl , "A.png") ); fxt.Test_lnki_redirect_src("A.png"); // confirm redirect_src set to "" } - @Test public void Redirect_should_take_trg_ext() {// if "A.png" redirects to "B.jpg", ext_id should be ".jpg" (the actual file) not ".png (lnki_ext_id) + @Test public void Redirect_should_take_trg_ext() {// if "A.png" redirects to "B.jpg", ext_id should be ".jpg" (the actual file) not ".png (lnki_ext_id) fxt.Test_bgn ( Keyval_.new_(Xob_orig_regy_tbl.Fld_orig_file_ttl , "B.jpg") , Keyval_.new_(Xob_orig_regy_tbl.Fld_lnki_ttl , "A.png") @@ -50,7 +50,7 @@ public class Xob_xfer_temp_itm_tst { ); fxt.Test_lnki_ext_id(Xof_ext_.Id_jpg); // confirm ext changed to .jpg } - @Test public void Thumbtime_check() {// PURPOSE: one image actually had a thumbtime defined; EX: General_Dynamics_F-16_Fighting_Falcon; [[File:Crash.arp.600pix.jpg|thumb|thumbtime=2]] + @Test public void Thumbtime_check() {// PURPOSE: one image actually had a thumbtime defined; EX: General_Dynamics_F-16_Fighting_Falcon; [[File:Crash.arp.600pix.jpg|thumb|thumbtime=2]] fxt.Test_bgn ( Keyval_.new_(Xob_orig_regy_tbl.Fld_orig_file_ext , Xof_ext_.Id_jpg) , Keyval_.new_(Xob_lnki_regy_tbl.Fld_lnki_time , (double)3) @@ -62,7 +62,7 @@ public class Xob_xfer_temp_itm_tst { ); fxt.Test_lnki_thumbtime(3); } - @Test public void Page_check() { + @Test public void Page_check() { fxt.Test_bgn ( Keyval_.new_(Xob_orig_regy_tbl.Fld_orig_file_ext , Xof_ext_.Id_jpg) , Keyval_.new_(Xob_lnki_regy_tbl.Fld_lnki_page , 3) @@ -79,14 +79,14 @@ public class Xob_xfer_temp_itm_tst { ); fxt.Test_lnki_page(3); } - @Test public void Media_should_be_ignored() {// ignore [[Media:]] for xfer_thumb (needed for xfer_orig) + @Test public void Media_should_be_ignored() {// ignore [[Media:]] for xfer_thumb (needed for xfer_orig) fxt.Test_bgn ( Keyval_.new_(Xob_orig_regy_tbl.Fld_lnki_ttl , "A.png") , Keyval_.new_(Xob_lnki_regy_tbl.Fld_lnki_src_tid , Xop_file_logger_.Tid__media) ); fxt.Test_itm_chk_fail_id(Xob_xfer_temp_itm.Chk_tid_ns_is_media); } - @Test public void Orig_width_is_0() {// PURPOSE: ignore files with an orig width of 0; note that ogg files that are sometimes flagged as VIDEO; EX:2009_10_08_Marc_Randazza_interview.ogg; DATE:2014-08-20 + @Test public void Orig_width_is_0() {// PURPOSE: ignore files with an orig width of 0; note that ogg files that are sometimes flagged as VIDEO; EX:2009_10_08_Marc_Randazza_interview.ogg; DATE:2014-08-20 fxt.Test_bgn ( Keyval_.new_(Xob_orig_regy_tbl.Fld_lnki_ttl , "A.ogg") , Keyval_.new_(Xob_orig_regy_tbl.Fld_orig_media_type , Xof_media_type.Name_video) // VIDEO diff --git a/400_xowa/src/gplx/xowa/addons/bldrs/mass_parses/makes/Xomp_make_merger__base.java b/400_xowa/src/gplx/xowa/addons/bldrs/mass_parses/makes/Xomp_make_merger__base.java index eb869230c..c468f7b2b 100644 --- a/400_xowa/src/gplx/xowa/addons/bldrs/mass_parses/makes/Xomp_make_merger__base.java +++ b/400_xowa/src/gplx/xowa/addons/bldrs/mass_parses/makes/Xomp_make_merger__base.java @@ -1,18 +1,18 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.addons.bldrs.mass_parses.makes; import gplx.*; import gplx.xowa.*; import gplx.xowa.addons.*; import gplx.xowa.addons.bldrs.*; import gplx.xowa.addons.bldrs.mass_parses.*; import gplx.dbs.*; import gplx.xowa.bldrs.*; import gplx.xowa.addons.bldrs.mass_parses.dbs.*; @@ -45,7 +45,7 @@ abstract class Xomp_make_merger__base implements Xomp_make_merger, gplx.core.lis } protected abstract Db_tbl Init__trg_tbl(Xob_db_file trg_db); protected abstract String Init__src_fld__page_id(); - @gplx.Virtual protected void Init__trg_bgn() {} + protected void Init__trg_bgn() {} public int Merger__load(Xomp_mgr_db src_mgr_db, Xomp_wkr_db src_wkr_db, int uid_bgn, int uid_end) { // build sql diff --git a/400_xowa/src/gplx/xowa/addons/htmls/tocs/Xoh_toc_htmlr__basic__tst.java b/400_xowa/src/gplx/xowa/addons/htmls/tocs/Xoh_toc_htmlr__basic__tst.java index 7cf813e5f..215ba9b65 100644 --- a/400_xowa/src/gplx/xowa/addons/htmls/tocs/Xoh_toc_htmlr__basic__tst.java +++ b/400_xowa/src/gplx/xowa/addons/htmls/tocs/Xoh_toc_htmlr__basic__tst.java @@ -1,23 +1,23 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.addons.htmls.tocs; import gplx.*; import gplx.xowa.*; import gplx.xowa.addons.*; import gplx.xowa.addons.htmls.*; import org.junit.*; import gplx.core.tests.*; public class Xoh_toc_htmlr__basic__tst { @Before public void init() {fxt.Clear();} private final Xoh_toc_htmlr__basic__fxt fxt = new Xoh_toc_htmlr__basic__fxt(); - @Test public void D1_S0_S0() { + @Test public void D1_S0_S0() { fxt.Init__add(2, "a"); fxt.Init__add(2, "b"); fxt.Init__add(2, "c"); @@ -32,7 +32,7 @@ public class Xoh_toc_htmlr__basic__tst { , " " ); } - @Test public void D1_D1_D1() { + @Test public void D1_D1_D1() { fxt.Init__add(2, "a"); fxt.Init__add(3, "a_a"); fxt.Init__add(4, "a_a_a"); @@ -51,7 +51,7 @@ public class Xoh_toc_htmlr__basic__tst { , " " ); } - @Test public void D1_D1_S0_U1() { + @Test public void D1_D1_S0_U1() { fxt.Init__add(2, "a"); fxt.Init__add(3, "a_a"); fxt.Init__add(3, "a_b"); @@ -71,7 +71,7 @@ public class Xoh_toc_htmlr__basic__tst { , " " ); } - @Test public void D1_D1_U1_D1() { + @Test public void D1_D1_U1_D1() { fxt.Init__add(2, "a"); fxt.Init__add(3, "a_a"); fxt.Init__add(2, "b"); @@ -93,7 +93,7 @@ public class Xoh_toc_htmlr__basic__tst { , " " ); } - @Test public void D1_D1_D1_U2() { + @Test public void D1_D1_D1_U2() { fxt.Init__add(2, "a"); fxt.Init__add(3, "a_a"); fxt.Init__add(4, "a_a_a"); @@ -115,7 +115,7 @@ public class Xoh_toc_htmlr__basic__tst { , " " ); } - @Test public void D1_D2_U1_D1() { + @Test public void D1_D2_U1_D1() { fxt.Init__add(2, "a"); fxt.Init__add(4, "a_a_a_a"); fxt.Init__add(3, "a_a_a"); @@ -137,7 +137,7 @@ public class Xoh_toc_htmlr__basic__tst { , " " ); } - @Test public void Div() { + @Test public void Div() { fxt.Init__init_page("Table of contents", false); fxt.Init__add(2, "a"); fxt.Init__add(2, "b"); diff --git a/400_xowa/src/gplx/xowa/addons/htmls/tocs/Xoh_toc_wkr__lvl__basic__tst.java b/400_xowa/src/gplx/xowa/addons/htmls/tocs/Xoh_toc_wkr__lvl__basic__tst.java index 86491c836..f6590edcc 100644 --- a/400_xowa/src/gplx/xowa/addons/htmls/tocs/Xoh_toc_wkr__lvl__basic__tst.java +++ b/400_xowa/src/gplx/xowa/addons/htmls/tocs/Xoh_toc_wkr__lvl__basic__tst.java @@ -1,45 +1,45 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.addons.htmls.tocs; import gplx.*; import gplx.xowa.*; import gplx.xowa.addons.*; import gplx.xowa.addons.htmls.*; import org.junit.*; import gplx.core.tests.*; public class Xoh_toc_wkr__lvl__basic__tst { @Before public void init() {fxt.Clear();} private final Xoh_toc_wkr__lvl__fxt fxt = new Xoh_toc_wkr__lvl__fxt(); - @Test public void D1_S0_S0() { + @Test public void D1_S0_S0() { fxt.Test__calc(2, fxt.Make(1, 1, Int_ary_.New(1))); fxt.Test__calc(2, fxt.Make(2, 1, Int_ary_.New(2))); fxt.Test__calc(2, fxt.Make(3, 1, Int_ary_.New(3))); } - @Test public void D1_D1_D1() { + @Test public void D1_D1_D1() { fxt.Test__calc(2, fxt.Make(1, 1, Int_ary_.New(1))); fxt.Test__calc(3, fxt.Make(2, 2, Int_ary_.New(1, 1))); fxt.Test__calc(4, fxt.Make(3, 3, Int_ary_.New(1, 1, 1))); } - @Test public void D1_D1_S0_U1() { + @Test public void D1_D1_S0_U1() { fxt.Test__calc(2, fxt.Make(1, 1, Int_ary_.New(1))); fxt.Test__calc(3, fxt.Make(2, 2, Int_ary_.New(1, 1))); fxt.Test__calc(3, fxt.Make(3, 2, Int_ary_.New(1, 2))); fxt.Test__calc(2, fxt.Make(4, 1, Int_ary_.New(2))); } - @Test public void D1_D1_U1_D1() { + @Test public void D1_D1_U1_D1() { fxt.Test__calc(2, fxt.Make(1, 1, Int_ary_.New(1))); fxt.Test__calc(3, fxt.Make(2, 2, Int_ary_.New(1, 1))); fxt.Test__calc(2, fxt.Make(3, 1, Int_ary_.New(2))); fxt.Test__calc(3, fxt.Make(4, 2, Int_ary_.New(2, 1))); } - @Test public void D1_D1_D1_U2() { + @Test public void D1_D1_D1_U2() { fxt.Test__calc(2, fxt.Make(1, 1, Int_ary_.New(1))); fxt.Test__calc(3, fxt.Make(2, 2, Int_ary_.New(1, 1))); fxt.Test__calc(4, fxt.Make(3, 3, Int_ary_.New(1, 1, 1))); diff --git a/400_xowa/src/gplx/xowa/addons/htmls/tocs/Xoh_toc_wkr__txt__basic__tst.java b/400_xowa/src/gplx/xowa/addons/htmls/tocs/Xoh_toc_wkr__txt__basic__tst.java index fa185cd17..25e8fd76e 100644 --- a/400_xowa/src/gplx/xowa/addons/htmls/tocs/Xoh_toc_wkr__txt__basic__tst.java +++ b/400_xowa/src/gplx/xowa/addons/htmls/tocs/Xoh_toc_wkr__txt__basic__tst.java @@ -1,50 +1,50 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.addons.htmls.tocs; import gplx.*; import gplx.xowa.*; import gplx.xowa.addons.*; import gplx.xowa.addons.htmls.*; import org.junit.*; import gplx.core.tests.*; import gplx.langs.htmls.*; public class Xoh_toc_wkr__txt__basic__tst { @Before public void init() {fxt.Clear();} private final Xoh_toc_wkr__txt__fxt fxt = new Xoh_toc_wkr__txt__fxt(); - @Test public void Basic() { + @Test public void Basic() { fxt.Test__both("a b c", "a_b_c", "a b c"); } - @Test public void Ws() { + @Test public void Ws() { fxt.Test__both(" a b ", "a_b", "a b"); } - @Test public void Nl() { + @Test public void Nl() { fxt.Test__both("\na b\n", "a_b", "a b"); } - @Test public void Empty() { // PAGE:s.w:Colac,_Victoria DATE:2016-07-17 + @Test public void Empty() { // PAGE:s.w:Colac,_Victoria DATE:2016-07-17 fxt.Test__both("", "", ""); } - @Test public void Amp__ncr() { + @Test public void Amp__ncr() { fxt.Test__both("[a]", "[a]", "[a]");// ISSUE#:462; DATE:2019-05-12 } - @Test public void Encode() { + @Test public void Encode() { fxt.Test__both("a+b", "a+b", "a+b");// ISSUE#:462; DATE:2019-05-12 } - @Test public void Comment() { + @Test public void Comment() { fxt.Test__text("ac", "ac"); } - @Test public void Remove_comment__one() { + @Test public void Remove_comment__one() { fxt.Test__remove_comment("ac", "ac"); } - @Test public void Remove_comment__many() { + @Test public void Remove_comment__many() { fxt.Test__remove_comment("135", "135"); } - @Test public void Remove_comment__dangling() { + @Test public void Remove_comment__dangling() { fxt.Test__remove_comment("133ac==" @@ -461,7 +461,7 @@ public class Xowe_hdr_bldr__tst { , " " )); } - @Test public void Ref() { // PURPOSE: ref contents should not print in TOC; DATE:2013-07-23 + @Test public void Ref() { // PURPOSE: ref contents should not print in TOC; DATE:2013-07-23 fxt.Test_html_all(String_.Concat_lines_nl_skip_last ( "__FORCETOC__" , "==ab==" @@ -476,7 +476,7 @@ public class Xowe_hdr_bldr__tst { , "

a[1]

"// ISSUE#:462; DATE:2019-05-12 )); } - @Test public void Category() { // PURPOSE: Category should not show in in TOC; DATE:2013-12-09 + @Test public void Category() { // PURPOSE: Category should not show in in TOC; DATE:2013-12-09 fxt.Test_html_all(String_.Concat_lines_nl_skip_last ( "__FORCETOC__" , "==A[[Category:B]]==" @@ -491,7 +491,7 @@ public class Xowe_hdr_bldr__tst { , "

A

" )); } - @Test public void Category_literal() { // PURPOSE: literal Category should show in in TOC; EX: de.w:1234; DATE:2014-01-21 + @Test public void Category_literal() { // PURPOSE: literal Category should show in in TOC; EX: de.w:1234; DATE:2014-01-21 fxt.Test_html_all(String_.Concat_lines_nl_skip_last ( "__FORCETOC__" , "==A[[:Category:B]]==" @@ -506,7 +506,7 @@ public class Xowe_hdr_bldr__tst { , "

ACategory:B

" )); } - @Test public void File() { // PURPOSE: file should show in in TOC; EX: tr.w:D�nya_Miraslari; DATE:2014-06-06 + @Test public void File() { // PURPOSE: file should show in in TOC; EX: tr.w:D�nya_Miraslari; DATE:2014-06-06 fxt.Test_html_all(String_.Concat_lines_nl_skip_last ( "__FORCETOC__" , "==[[File:A.png]] b==" @@ -521,7 +521,7 @@ public class Xowe_hdr_bldr__tst { , "

\"\" b

" )); } - @Test public void Lnki_invalid() { // PURPOSE: invalid lnki was causing null ref; DATE:2014-02-07 + @Test public void Lnki_invalid() { // PURPOSE: invalid lnki was causing null ref; DATE:2014-02-07 fxt.Test_html_all(String_.Concat_lines_nl_skip_last ( "__FORCETOC__" , "==[[]]==" @@ -536,7 +536,7 @@ public class Xowe_hdr_bldr__tst { , "

[[]]

" // ISSUE#:462; DATE:2019-05-12 )); } - @Test public void File_in_tbl() { // PURPOSE: two issues (a) don't show file if in tbl; (b) if v2, file inside tbl fails; PAGE:en.w:Holmes County,_Mississippi; DATE:2014-06-22 + @Test public void File_in_tbl() { // PURPOSE: two issues (a) don't show file if in tbl; (b) if v2, file inside tbl fails; PAGE:en.w:Holmes County,_Mississippi; DATE:2014-06-22 fxt.Test_html_frag(String_.Concat_lines_nl_skip_last ( "__FORCETOC__" , "==a
[[File:A.png]]b
c==" diff --git a/400_xowa/src/gplx/xowa/addons/wikis/ctgs/bldrs/Xob_catlink_mgr__tst.java b/400_xowa/src/gplx/xowa/addons/wikis/ctgs/bldrs/Xob_catlink_mgr__tst.java index 21484a400..da0ef56aa 100644 --- a/400_xowa/src/gplx/xowa/addons/wikis/ctgs/bldrs/Xob_catlink_mgr__tst.java +++ b/400_xowa/src/gplx/xowa/addons/wikis/ctgs/bldrs/Xob_catlink_mgr__tst.java @@ -1,23 +1,23 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.addons.wikis.ctgs.bldrs; import gplx.*; import gplx.xowa.*; import gplx.xowa.addons.*; import gplx.xowa.addons.wikis.*; import gplx.xowa.addons.wikis.ctgs.*; import org.junit.*; import gplx.core.tests.*; public class Xob_catlink_mgr__tst { private final Xob_catlink_mgr__fxt fxt = new Xob_catlink_mgr__fxt(); - @Test public void Parse_timestamp() {// fix bad parsing b/c of "YYYY" instead of "yyyy"; ISSUE#:664; DATE:2020-02-05 + @Test public void Parse_timestamp() {// fix bad parsing b/c of "YYYY" instead of "yyyy"; ISSUE#:664; DATE:2020-02-05 fxt.Test__Parse_timestamp("2016-02-01 18:34:08", 1454351648); // fails if 1451241248 } } diff --git a/400_xowa/src/gplx/xowa/addons/wikis/ctgs/htmls/catpages/Xoctg_catpage_mgr__basic__tst.java b/400_xowa/src/gplx/xowa/addons/wikis/ctgs/htmls/catpages/Xoctg_catpage_mgr__basic__tst.java index afc3ffb8f..efa833c26 100644 --- a/400_xowa/src/gplx/xowa/addons/wikis/ctgs/htmls/catpages/Xoctg_catpage_mgr__basic__tst.java +++ b/400_xowa/src/gplx/xowa/addons/wikis/ctgs/htmls/catpages/Xoctg_catpage_mgr__basic__tst.java @@ -1,35 +1,35 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.addons.wikis.ctgs.htmls.catpages; import gplx.*; import gplx.xowa.*; import gplx.xowa.addons.*; import gplx.xowa.addons.wikis.*; import gplx.xowa.addons.wikis.ctgs.*; import gplx.xowa.addons.wikis.ctgs.htmls.*; import org.junit.*; import gplx.xowa.htmls.core.htmls.*; import gplx.core.intls.ucas.*; import gplx.xowa.addons.wikis.ctgs.htmls.catpages.doms.*; import gplx.xowa.addons.wikis.ctgs.htmls.catpages.fmts.*; public class Xoctg_catpage_mgr__basic__tst { @Before public void init() {fxt.Clear();} private Xoctg_catpage_mgr_fxt fxt = new Xoctg_catpage_mgr_fxt(); - @Test public void Page_itm() { + @Test public void Page_itm() { fxt .Init_itms__pages("A1") .Test__html__page(Xoa_ctg_mgr.Tid__page, Byte_ascii.Ltr_A, "\n
  • A1
  • "); } - @Test public void Page_itm_missing() { + @Test public void Page_itm_missing() { fxt.Init_itms__pages("A1"); Xoctg_catpage_itm itm = fxt.Ctg().Grp_by_tid(Xoa_ctg_mgr.Tid__page).Itms__get_at(0); itm.Page_ttl_(Xoa_ttl.Null); itm.Sortkey_handle_make(Bry_bfr_.New(), fxt.Wiki(), Bry_.Empty); fxt.Test__html__page(Xoa_ctg_mgr.Tid__page, Byte_ascii.Ltr_A, "\n
  • missing page (0)
  • "); } - @Test public void Visited_doesnt_work_for_space() {// PURPOSE: xowa-visited not inserted for pages with space + @Test public void Visited_doesnt_work_for_space() {// PURPOSE: xowa-visited not inserted for pages with space byte[] page_bry = Bry_.new_a7("A 1"); Xoa_url url = Xoa_url.New(Bry_.new_a7("en.wikipedia.org"), page_bry); Xoa_ttl ttl = Xoa_ttl.Parse(fxt.Wiki(), page_bry); @@ -55,7 +55,7 @@ public class Xoctg_catpage_mgr__basic__tst { , "
    " )); } - @Test public void Page_all() { + @Test public void Page_all() { fxt .Init_itms__pages("A1") .Test__html__all(Xoa_ctg_mgr.Tid__page, String_.Concat_lines_nl_skip_last ( "" @@ -77,7 +77,7 @@ public class Xoctg_catpage_mgr__basic__tst { , "
    " )); } - @Test public void File_all() { + @Test public void File_all() { fxt .Init_itms__files("File:A1.png") .Test__html__all(Xoa_ctg_mgr.Tid__file, String_.Concat_lines_nl_skip_last ( "" @@ -99,7 +99,7 @@ public class Xoctg_catpage_mgr__basic__tst { , "
    " )); } - @Test public void Subc_all() { + @Test public void Subc_all() { fxt .Init_itms__subcs("Category:Subc_1") .Test__html__all(Xoa_ctg_mgr.Tid__subc, String_.Concat_lines_nl_skip_last ( "" @@ -135,7 +135,7 @@ public class Xoctg_catpage_mgr__basic__tst { , "
    " )); } - @Test public void Page_all_cols() { + @Test public void Page_all_cols() { fxt.Init_itms__pages("A1", "A2", "A3", "B1", "C1"); fxt.Init__grp_max_(6); // SEE:FOOTNOTE:LT_NOT_LTE DATE:2019-12-14 fxt.Test__html__all(Xoa_ctg_mgr.Tid__page, String_.Concat_lines_nl_skip_last @@ -175,7 +175,7 @@ public class Xoctg_catpage_mgr__basic__tst { , "" )); } - @Test public void Page__numeric() { // PURPOSE: check numeric sorting; 0, 2, 3, 10; not 0, 10, 2, 3; DATE:2016-10-09 + @Test public void Page__numeric() { // PURPOSE: check numeric sorting; 0, 2, 3, 10; not 0, 10, 2, 3; DATE:2016-10-09 fxt.Init_itms__pages("0", "2", "3", "10"); fxt.Init__grp_max_(5); // SEE:FOOTNOTE:LT_NOT_LTE DATE:2019-12-14 fxt.Test__html__all(Xoa_ctg_mgr.Tid__page, String_.Concat_lines_nl_skip_last @@ -211,7 +211,7 @@ public class Xoctg_catpage_mgr__basic__tst { , "" )); } - @Test public void Title__escape_quotes() {// PURPOSE: quotes in title should be escaped; DATE:2015-12-28 + @Test public void Title__escape_quotes() {// PURPOSE: quotes in title should be escaped; DATE:2015-12-28 fxt .Init_itms__pages("A\"1") .Test__html__all(Xoa_ctg_mgr.Tid__page, String_.Concat_lines_nl_skip_last ( "" @@ -233,7 +233,7 @@ public class Xoctg_catpage_mgr__basic__tst { , "" )); } - @Test public void Mixed_case_titles() {// PURPOSE: titles in mixed-case should sort under same upper-case letter; ISSUE#:637 DATE:2019-12-14 + @Test public void Mixed_case_titles() {// PURPOSE: titles in mixed-case should sort under same upper-case letter; ISSUE#:637 DATE:2019-12-14 // init main ns to be case-sensitive, so that "A1" and "a2" get sorted into different groups (fr.wikisource) fxt.Wiki().Ns_mgr().Ns_main().Case_match_(gplx.xowa.wikis.nss.Xow_ns_case_.Tid__all); @@ -266,7 +266,7 @@ public class Xoctg_catpage_mgr__basic__tst { , "" )); } - @Test public void Calc_col_len() { + @Test public void Calc_col_len() { fxt.Test__calc_col_len(10, 0, 4); // for 10 items, col 0 has 4 items fxt.Test__calc_col_len(10, 1, 3); // for 10 items, col 1 has 3 items fxt.Test__calc_col_len(10, 2, 3); // for 10 items, col 2 has 3 items diff --git a/400_xowa/src/gplx/xowa/addons/wikis/ctgs/htmls/catpages/Xoctg_catpage_mgr__navlink__tst.java b/400_xowa/src/gplx/xowa/addons/wikis/ctgs/htmls/catpages/Xoctg_catpage_mgr__navlink__tst.java index 4a730634b..8174a0c02 100644 --- a/400_xowa/src/gplx/xowa/addons/wikis/ctgs/htmls/catpages/Xoctg_catpage_mgr__navlink__tst.java +++ b/400_xowa/src/gplx/xowa/addons/wikis/ctgs/htmls/catpages/Xoctg_catpage_mgr__navlink__tst.java @@ -1,24 +1,24 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.addons.wikis.ctgs.htmls.catpages; import gplx.*; import gplx.xowa.*; import gplx.xowa.addons.*; import gplx.xowa.addons.wikis.*; import gplx.xowa.addons.wikis.ctgs.*; import gplx.xowa.addons.wikis.ctgs.htmls.*; import org.junit.*; import gplx.xowa.htmls.core.htmls.*; import gplx.xowa.addons.wikis.ctgs.htmls.catpages.doms.*; import gplx.xowa.addons.wikis.ctgs.htmls.catpages.fmts.*; public class Xoctg_catpage_mgr__navlink__tst { @Before public void init() {fxt.Clear();} private Xoctg_catpage_mgr_fxt fxt = new Xoctg_catpage_mgr_fxt(); - @Test public void Navlink__basic() { + @Test public void Navlink__basic() { fxt.Init_itms__pages("A2", "A3", "A4"); fxt.Init__next_sortkey_(Xoa_ctg_mgr.Tid__page, "A5"); fxt.Test__navlink(Bool_.Y, "Category:Ctg_1", String_.Concat_lines_nl @@ -27,7 +27,7 @@ public class Xoctg_catpage_mgr__navlink__tst { , "(next 3)" )); } - @Test public void Navlink__encoded() { // escape quotes and spaces; DATE:2016-01-11 + @Test public void Navlink__encoded() { // escape quotes and spaces; DATE:2016-01-11 fxt.Init_itms__pages("A\" 2", "A\" 3", "A\" 4"); fxt.Init__next_sortkey_(Xoa_ctg_mgr.Tid__page, "A\" 5"); fxt.Test__navlink(Bool_.Y, "Category:Ctg_1", String_.Concat_lines_nl @@ -36,7 +36,7 @@ public class Xoctg_catpage_mgr__navlink__tst { , "(next 3)" )); } - @Test public void Navlink__bos() { + @Test public void Navlink__bos() { fxt.Init_itms__pages("A2", "A3", "A4"); fxt.Init__prev_hide_y_(Xoa_ctg_mgr.Tid__page); fxt.Init__next_sortkey_(Xoa_ctg_mgr.Tid__page, "A5"); @@ -46,7 +46,7 @@ public class Xoctg_catpage_mgr__navlink__tst { , "(next 3)" )); } - @Test public void Navlink__eos() { + @Test public void Navlink__eos() { fxt.Init_itms__pages("A2", "A3", "A4"); fxt.Test__navlink(Bool_.Y, "Category:Ctg_1", String_.Concat_lines_nl ( "" diff --git a/400_xowa/src/gplx/xowa/addons/wikis/ctgs/htmls/catpages/dbs/Xoctg_catlink_loader__tst.java b/400_xowa/src/gplx/xowa/addons/wikis/ctgs/htmls/catpages/dbs/Xoctg_catlink_loader__tst.java index bb2d86bb6..5ebe4e443 100644 --- a/400_xowa/src/gplx/xowa/addons/wikis/ctgs/htmls/catpages/dbs/Xoctg_catlink_loader__tst.java +++ b/400_xowa/src/gplx/xowa/addons/wikis/ctgs/htmls/catpages/dbs/Xoctg_catlink_loader__tst.java @@ -1,27 +1,27 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.addons.wikis.ctgs.htmls.catpages.dbs; import gplx.*; import gplx.xowa.*; import gplx.xowa.addons.*; import gplx.xowa.addons.wikis.*; import gplx.xowa.addons.wikis.ctgs.*; import gplx.xowa.addons.wikis.ctgs.htmls.*; import gplx.xowa.addons.wikis.ctgs.htmls.catpages.*; import org.junit.*; import gplx.core.tests.*; import gplx.xowa.apps.urls.*; import gplx.xowa.langs.*; import gplx.xowa.addons.wikis.ctgs.htmls.catpages.langs.*; public class Xoctg_catlink_loader__tst { private final Xoctg_catlink_loader__fxt fxt = new Xoctg_catlink_loader__fxt(); - @Test public void Build_sortkey_val__v4() { // PURPOSE: remove "\n" and afterwards else will omit 1 record + @Test public void Build_sortkey_val__v4() { // PURPOSE: remove "\n" and afterwards else will omit 1 record fxt.Test__build_sortkey_sql(4, "A\nA", "x'41'"); // fails if "x'410a41'" } - @Test public void Build_sortkey_val__v2() { // PURPOSE: remove "\n" and afterwards else SQL will be malformed + @Test public void Build_sortkey_val__v2() { // PURPOSE: remove "\n" and afterwards else SQL will be malformed fxt.Test__build_sortkey_sql(2, "A\nA", "'A'"); // fails if "'A\nA'" } } diff --git a/400_xowa/src/gplx/xowa/addons/wikis/ctgs/htmls/catpages/fmts/Xoctg_fmt_itm_base.java b/400_xowa/src/gplx/xowa/addons/wikis/ctgs/htmls/catpages/fmts/Xoctg_fmt_itm_base.java index 29fbb8ed9..841043d83 100644 --- a/400_xowa/src/gplx/xowa/addons/wikis/ctgs/htmls/catpages/fmts/Xoctg_fmt_itm_base.java +++ b/400_xowa/src/gplx/xowa/addons/wikis/ctgs/htmls/catpages/fmts/Xoctg_fmt_itm_base.java @@ -1,18 +1,18 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.addons.wikis.ctgs.htmls.catpages.fmts; import gplx.*; import gplx.xowa.*; import gplx.xowa.addons.*; import gplx.xowa.addons.wikis.*; import gplx.xowa.addons.wikis.ctgs.*; import gplx.xowa.addons.wikis.ctgs.htmls.*; import gplx.xowa.addons.wikis.ctgs.htmls.catpages.*; import gplx.langs.htmls.*; import gplx.xowa.htmls.*; import gplx.xowa.htmls.hrefs.*; import gplx.xowa.htmls.core.wkrs.lnkis.htmls.*; import gplx.xowa.htmls.core.htmls.*; import gplx.xowa.langs.*; import gplx.xowa.langs.msgs.*; import gplx.core.intls.ucas.*; @@ -72,7 +72,7 @@ public abstract class Xoctg_fmt_itm_base implements gplx.core.brys.Bfr_arg { loop_end_idx = grp_end; loop_ends_at_col = true; } - @gplx.Virtual public void Bld_html(Bry_bfr bfr, Xow_wiki wiki, Xou_history_mgr history_mgr, Xoh_href_parser href_parser, Xoctg_catpage_itm itm, Xoa_ttl ttl) { + public void Bld_html(Bry_bfr bfr, Xow_wiki wiki, Xou_history_mgr history_mgr, Xoh_href_parser href_parser, Xoctg_catpage_itm itm, Xoa_ttl ttl) { byte[] itm_full_ttl = Gfh_utl.Escape_html_as_bry(tmp_bfr, ttl.Full_txt());// NOTE: ttl.Full_txt() to get full ns; EX: Template:A instead of just "A" byte[] itm_href = wiki.Html__href_wtr().Build_to_bry(wiki, ttl); byte[] itm_atr_cls = Xoh_lnki_wtr.Lnki_cls_visited(history_mgr, wiki.Domain_bry(), ttl.Page_txt()); // NOTE: must be ttl.Page_txt() in order to match Xou_history_mgr.Add diff --git a/400_xowa/src/gplx/xowa/addons/wikis/ctgs/htmls/catpages/langs/Xoctg_collation_wkr___tst.java b/400_xowa/src/gplx/xowa/addons/wikis/ctgs/htmls/catpages/langs/Xoctg_collation_wkr___tst.java index d788cfe78..20233aecb 100644 --- a/400_xowa/src/gplx/xowa/addons/wikis/ctgs/htmls/catpages/langs/Xoctg_collation_wkr___tst.java +++ b/400_xowa/src/gplx/xowa/addons/wikis/ctgs/htmls/catpages/langs/Xoctg_collation_wkr___tst.java @@ -1,30 +1,30 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.addons.wikis.ctgs.htmls.catpages.langs; import gplx.*; import gplx.xowa.*; import gplx.xowa.addons.*; import gplx.xowa.addons.wikis.*; import gplx.xowa.addons.wikis.ctgs.*; import gplx.xowa.addons.wikis.ctgs.htmls.*; import gplx.xowa.addons.wikis.ctgs.htmls.catpages.*; import org.junit.*; import gplx.core.tests.*; public class Xoctg_collation_wkr___tst { private final Xoctg_collation_wkr___fxt fxt = new Xoctg_collation_wkr___fxt(); - @Test public void Uppercase() {fxt.Test__make("uppercase" , "uppercase");} - @Test public void Identity() {fxt.Test__make("identity" , "identity");} - @Test public void Unknown() {fxt.Test__make("unknown" , "uppercase");} - @Test public void Uca__uca_default() {fxt.Test__make__uca("uca-default" , "en", false);} - @Test public void Uca__xx_uca_ckb() {fxt.Test__make__uca("xx-uca-ckb" , "fa", false);} - @Test public void Uca__xx_uca_et() {fxt.Test__make__uca("xx-uca-et" , "et", false);} - @Test public void Uca__uca_default_u_kn() {fxt.Test__make__uca("uca-default-u-kn" , "en", true);} - @Test public void Uca__uca_at_logic() {fxt.Test__make__uca("uca-sv@collation=standard" , "sv", false);} + @Test public void Uppercase() {fxt.Test__make("uppercase" , "uppercase");} + @Test public void Identity() {fxt.Test__make("identity" , "identity");} + @Test public void Unknown() {fxt.Test__make("unknown" , "uppercase");} + @Test public void Uca__uca_default() {fxt.Test__make__uca("uca-default" , "en", false);} + @Test public void Uca__xx_uca_ckb() {fxt.Test__make__uca("xx-uca-ckb" , "fa", false);} + @Test public void Uca__xx_uca_et() {fxt.Test__make__uca("xx-uca-et" , "et", false);} + @Test public void Uca__uca_default_u_kn() {fxt.Test__make__uca("uca-default-u-kn" , "en", true);} + @Test public void Uca__uca_at_logic() {fxt.Test__make__uca("uca-sv@collation=standard" , "sv", false);} } class Xoctg_collation_wkr___fxt { public void Test__make(String wm_name, String expd_type) { diff --git a/400_xowa/src/gplx/xowa/addons/wikis/ctgs/htmls/catpages/urls/Xoctg_catpage_url__tst.java b/400_xowa/src/gplx/xowa/addons/wikis/ctgs/htmls/catpages/urls/Xoctg_catpage_url__tst.java index 1c5ec4d5d..55313a38e 100644 --- a/400_xowa/src/gplx/xowa/addons/wikis/ctgs/htmls/catpages/urls/Xoctg_catpage_url__tst.java +++ b/400_xowa/src/gplx/xowa/addons/wikis/ctgs/htmls/catpages/urls/Xoctg_catpage_url__tst.java @@ -1,31 +1,31 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.addons.wikis.ctgs.htmls.catpages.urls; import gplx.*; import gplx.xowa.*; import gplx.xowa.addons.*; import gplx.xowa.addons.wikis.*; import gplx.xowa.addons.wikis.ctgs.*; import gplx.xowa.addons.wikis.ctgs.htmls.*; import gplx.xowa.addons.wikis.ctgs.htmls.catpages.*; import org.junit.*; import gplx.core.tests.*; import gplx.xowa.apps.urls.*; public class Xoctg_catpage_url__tst { @Before public void init() {fxt.Clear();} private Xoctg_catpage_url__fxt fxt = new Xoctg_catpage_url__fxt(); - @Test public void Specific() { + @Test public void Specific() { fxt.Exec__parse("A?subcatfrom=B&filefrom=C&pagefrom=D" ).Test__keys("B", "C", "D").Test__fwds(Bool_.Y, Bool_.Y, Bool_.Y); fxt.Exec__parse("A?subcatuntil=B&fileuntil=C&pageuntil=D" ).Test__keys("B", "C", "D").Test__fwds(Bool_.N, Bool_.N, Bool_.N); } - @Test public void General() { + @Test public void General() { fxt.Exec__parse("A?from=B" ).Test__keys("B", "B", "B").Test__fwds(Bool_.Y, Bool_.Y, Bool_.Y); fxt.Exec__parse("A?until=B" ).Test__keys("B", "B", "B").Test__fwds(Bool_.N, Bool_.N, Bool_.N); } - @Test public void Url_encoded() { + @Test public void Url_encoded() { fxt.Exec__parse("A?from=B+C").Test__keys("B C", "B C", "B C").Test__fwds(Bool_.Y, Bool_.Y, Bool_.Y); } } diff --git a/400_xowa/src/gplx/xowa/addons/wikis/ctgs/htmls/pageboxs/doubles/Xoctg_double_box__tst.java b/400_xowa/src/gplx/xowa/addons/wikis/ctgs/htmls/pageboxs/doubles/Xoctg_double_box__tst.java index c015f3f7b..27fef7c3a 100644 --- a/400_xowa/src/gplx/xowa/addons/wikis/ctgs/htmls/pageboxs/doubles/Xoctg_double_box__tst.java +++ b/400_xowa/src/gplx/xowa/addons/wikis/ctgs/htmls/pageboxs/doubles/Xoctg_double_box__tst.java @@ -1,24 +1,24 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.addons.wikis.ctgs.htmls.pageboxs.doubles; import gplx.*; import gplx.xowa.*; import gplx.xowa.addons.*; import gplx.xowa.addons.wikis.*; import gplx.xowa.addons.wikis.ctgs.*; import gplx.xowa.addons.wikis.ctgs.htmls.*; import gplx.xowa.addons.wikis.ctgs.htmls.pageboxs.*; import org.junit.*; import gplx.xowa.wikis.data.tbls.*; public class Xoctg_double_box__tst { @Before public void init() {fxt.Clear();} private Xoctg_double_box__fxt fxt = new Xoctg_double_box__fxt(); - @Test public void Single() { + @Test public void Single() { fxt.Init_ctg_hidden("Category:A"); fxt.Init_ctg_normal("Category:D"); fxt.Test_print_hidden(String_.Concat_lines_nl @@ -41,7 +41,7 @@ public class Xoctg_double_box__tst { , "" )); } - @Test public void Plural() { + @Test public void Plural() { fxt.Init_ctg_hidden("Category:A", "Category:B", "Category:C"); fxt.Init_ctg_normal("Category:D", "Category:E", "Category:F"); fxt.Test_print_hidden(String_.Concat_lines_nl diff --git a/400_xowa/src/gplx/xowa/addons/wikis/ctgs/htmls/pageboxs/singles/Xoctg_single_box__tst.java b/400_xowa/src/gplx/xowa/addons/wikis/ctgs/htmls/pageboxs/singles/Xoctg_single_box__tst.java index 847a7e55a..39433f175 100644 --- a/400_xowa/src/gplx/xowa/addons/wikis/ctgs/htmls/pageboxs/singles/Xoctg_single_box__tst.java +++ b/400_xowa/src/gplx/xowa/addons/wikis/ctgs/htmls/pageboxs/singles/Xoctg_single_box__tst.java @@ -1,24 +1,24 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.addons.wikis.ctgs.htmls.pageboxs.singles; import gplx.*; import gplx.xowa.*; import gplx.xowa.addons.*; import gplx.xowa.addons.wikis.*; import gplx.xowa.addons.wikis.ctgs.*; import gplx.xowa.addons.wikis.ctgs.htmls.*; import gplx.xowa.addons.wikis.ctgs.htmls.pageboxs.*; import org.junit.*; import gplx.xowa.htmls.core.htmls.*; public class Xoctg_single_box__tst { @Before public void init() {fxt.Clear();} private final Xoh_ctg_mgr_fxt fxt = new Xoh_ctg_mgr_fxt(); - @Test public void Basic() { + @Test public void Basic() { fxt.Init__ctgs("Category:A", "Category:B").Test_html(String_.Concat_lines_nl ( "
    " , "
    " diff --git a/400_xowa/src/gplx/xowa/addons/wikis/directorys/dbs/Xowdir_wiki_props_mgr__tst.java b/400_xowa/src/gplx/xowa/addons/wikis/directorys/dbs/Xowdir_wiki_props_mgr__tst.java index d709b4e36..4d9031b78 100644 --- a/400_xowa/src/gplx/xowa/addons/wikis/directorys/dbs/Xowdir_wiki_props_mgr__tst.java +++ b/400_xowa/src/gplx/xowa/addons/wikis/directorys/dbs/Xowdir_wiki_props_mgr__tst.java @@ -1,18 +1,18 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.addons.wikis.directorys.dbs; import gplx.*; import gplx.xowa.*; import gplx.xowa.addons.*; import gplx.xowa.addons.wikis.*; import gplx.xowa.addons.wikis.directorys.*; import org.junit.*; import gplx.core.tests.*; import gplx.langs.jsons.*; @@ -20,27 +20,27 @@ import gplx.xowa.wikis.data.*; public class Xowdir_wiki_props_mgr__tst { private final Xowdir_wiki_props_mgr__fxt fxt = new Xowdir_wiki_props_mgr__fxt(); - @Test public void Import__wiki__missing_all() { + @Test public void Import__wiki__missing_all() { // handle all imported .xowa wikis pre v4.3 fxt.Init__wiki_props(null, null, null); fxt.Test__verify(Bool_.Y, "/dir/test.xowa", Bool_.Y, fxt.Make__json("test", "test", "Main_Page")); } - @Test public void Import__wiki__missing_domain() { + @Test public void Import__wiki__missing_domain() { // handle personal wikis from v4.2 fxt.Init__wiki_props(null, null, "Main_Page"); fxt.Test__verify(Bool_.Y, "/dir/test.xowa", Bool_.Y, fxt.Make__json("test", "test", "Main_Page")); } - @Test public void Import__wiki__wmf_domain() { + @Test public void Import__wiki__wmf_domain() { // handle wmf wikis with a core-file of "test-core.xowa" fxt.Init__wiki_props(null, null, "Main_Page"); fxt.Test__verify(Bool_.Y, "/dir/test-core.xowa", Bool_.Y, fxt.Make__json("test", "test", "Main_Page")); } - @Test public void Import__wiki__clean() { + @Test public void Import__wiki__clean() { // handle clean wiki fxt.Init__wiki_props("test", "test", "Main_Page"); fxt.Test__verify(Bool_.Y, "/dir/test.xowa", Bool_.N, fxt.Make__json("test", "test", "Main_Page")); } - @Test public void Open__wiki__missing_name() { + @Test public void Open__wiki__missing_name() { // handle missing name fxt.Init__user_json("test", "my test", "Main_Page"); fxt.Init__wiki_props(null, null, "Main_Page"); diff --git a/400_xowa/src/gplx/xowa/addons/wikis/fulltexts/core/Xofulltext_extractor__tst.java b/400_xowa/src/gplx/xowa/addons/wikis/fulltexts/core/Xofulltext_extractor__tst.java index 2bca75e26..06f84f44b 100644 --- a/400_xowa/src/gplx/xowa/addons/wikis/fulltexts/core/Xofulltext_extractor__tst.java +++ b/400_xowa/src/gplx/xowa/addons/wikis/fulltexts/core/Xofulltext_extractor__tst.java @@ -1,23 +1,23 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.addons.wikis.fulltexts.core; import gplx.*; import gplx.xowa.*; import gplx.xowa.addons.*; import gplx.xowa.addons.wikis.*; import gplx.xowa.addons.wikis.fulltexts.*; import org.junit.*; import gplx.core.tests.*; public class Xofulltext_extractor__tst { private final Xofulltext_extractor__fxt fxt = new Xofulltext_extractor__fxt(); - @Test public void Basic() { + @Test public void Basic() { // simple node fxt.Test__extract("a b c", "a b c"); diff --git a/400_xowa/src/gplx/xowa/addons/wikis/fulltexts/searchers/mgrs/brutes/finders/Xofulltext_finder_cbk__eval__tst.java b/400_xowa/src/gplx/xowa/addons/wikis/fulltexts/searchers/mgrs/brutes/finders/Xofulltext_finder_cbk__eval__tst.java index 0133743a9..bac621d4d 100644 --- a/400_xowa/src/gplx/xowa/addons/wikis/fulltexts/searchers/mgrs/brutes/finders/Xofulltext_finder_cbk__eval__tst.java +++ b/400_xowa/src/gplx/xowa/addons/wikis/fulltexts/searchers/mgrs/brutes/finders/Xofulltext_finder_cbk__eval__tst.java @@ -1,23 +1,23 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.addons.wikis.fulltexts.searchers.mgrs.brutes.finders; import gplx.*; import gplx.xowa.*; import gplx.xowa.addons.*; import gplx.xowa.addons.wikis.*; import gplx.xowa.addons.wikis.fulltexts.*; import gplx.xowa.addons.wikis.fulltexts.searchers.*; import gplx.xowa.addons.wikis.fulltexts.searchers.mgrs.*; import gplx.xowa.addons.wikis.fulltexts.searchers.mgrs.brutes.*; import org.junit.*; import gplx.core.tests.*; public class Xofulltext_finder_cbk__eval__tst { private final Xofulltext_finder_cbk__eval__fxt fxt = new Xofulltext_finder_cbk__eval__fxt(); - @Test public void Exact() { + @Test public void Exact() { fxt.Init__search("a"); // y: basic match fxt.Test__eval_y("a"); @@ -26,7 +26,7 @@ public class Xofulltext_finder_cbk__eval__tst { // n: wildcard_bgn not enabled fxt.Test__eval_n("az"); } - @Test public void Or() { + @Test public void Or() { fxt.Init__search("a, c"); // y: lone char fxt.Test__eval_y("a" , "c"); @@ -37,54 +37,54 @@ public class Xofulltext_finder_cbk__eval__tst { // n: no chars fxt.Test__eval_n("b"); } - @Test public void And() { + @Test public void And() { fxt.Init__search("a + c"); // y: both chars fxt.Test__eval_y("a c", "a b c"); // n: one char only fxt.Test__eval_n("a", "c", "a b", "b c"); } - @Test public void And__shorthand() { + @Test public void And__shorthand() { fxt.Init__search("a c"); // y: both chars fxt.Test__eval_y("a b c"); // n: one char only fxt.Test__eval_n("a", "c"); } - @Test public void Not() { + @Test public void Not() { fxt.Init__search("-a"); // y: no chars fxt.Test__eval_y("b"); // n: char exists fxt.Test__eval_n("a"); } - @Test public void Trim_end() { + @Test public void Trim_end() { fxt.Init__search("a"); // y: single fxt.Test__eval_y("a!"); // y: many fxt.Test__eval_y("a!!!"); } - @Test public void Trim_bgn() { + @Test public void Trim_bgn() { fxt.Init__search("a"); // y: single fxt.Test__eval_y("!a"); // y: many fxt.Test__eval_y("!!!a"); } - @Test public void Trim_both() { + @Test public void Trim_both() { fxt.Init__search("a"); // y: single fxt.Test__eval_y("'a'"); // y: many fxt.Test__eval_y("'''a'''"); } - @Test public void Slash() { + @Test public void Slash() { fxt.Init__search("a"); // y: slash before, after fxt.Test__eval_y("a/b/c", "b/a/c", "b/c/a"); } - @Test public void Brack() { + @Test public void Brack() { fxt.Init__search("a"); // y fxt.Test__eval_y("[[a]]"); diff --git a/400_xowa/src/gplx/xowa/addons/wikis/htmls/css/mgrs/Xowd_css_core_mgr_tst.java b/400_xowa/src/gplx/xowa/addons/wikis/htmls/css/mgrs/Xowd_css_core_mgr_tst.java index 606ca28f5..c4760e831 100644 --- a/400_xowa/src/gplx/xowa/addons/wikis/htmls/css/mgrs/Xowd_css_core_mgr_tst.java +++ b/400_xowa/src/gplx/xowa/addons/wikis/htmls/css/mgrs/Xowd_css_core_mgr_tst.java @@ -1,23 +1,23 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.addons.wikis.htmls.css.mgrs; import gplx.*; import gplx.xowa.*; import gplx.xowa.addons.*; import gplx.xowa.addons.wikis.*; import gplx.xowa.addons.wikis.htmls.*; import gplx.xowa.addons.wikis.htmls.css.*; import org.junit.*; import gplx.core.ios.*; import gplx.dbs.*; import gplx.xowa.wikis.data.tbls.*; import gplx.xowa.addons.wikis.htmls.css.dbs.*; public class Xowd_css_core_mgr_tst { @Before public void init() {fxt.Clear();} private Xowd_css_core_mgr_fxt fxt = new Xowd_css_core_mgr_fxt(); - @Test public void Basic() { + @Test public void Basic() { Xowd_css_core_itm[] skin_ary = fxt.Make_skin_ary ( fxt.Make_skin_itm(1, "desktop", "20010101_050200") ); @@ -35,7 +35,7 @@ public class Xowd_css_core_mgr_tst { fxt.Exec_get(trg_dir, "desktop"); fxt.Test_fs(trg_dir, file_ary); } - @Test public void Update() { // update css files; keep same skin_id; insert new files + @Test public void Update() { // update css files; keep same skin_id; insert new files Xowd_css_core_itm[] skin_ary = fxt.Make_skin_ary ( fxt.Make_skin_itm(1, "desktop", "20010101_050500") ); diff --git a/400_xowa/src/gplx/xowa/addons/wikis/pages/syncs/core/loaders/Xosync_page_loader__tst.java b/400_xowa/src/gplx/xowa/addons/wikis/pages/syncs/core/loaders/Xosync_page_loader__tst.java index ec9e111ed..49cab3e41 100644 --- a/400_xowa/src/gplx/xowa/addons/wikis/pages/syncs/core/loaders/Xosync_page_loader__tst.java +++ b/400_xowa/src/gplx/xowa/addons/wikis/pages/syncs/core/loaders/Xosync_page_loader__tst.java @@ -1,36 +1,36 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.addons.wikis.pages.syncs.core.loaders; import gplx.*; import gplx.xowa.*; import gplx.xowa.addons.*; import gplx.xowa.addons.wikis.*; import gplx.xowa.addons.wikis.pages.*; import gplx.xowa.addons.wikis.pages.syncs.*; import gplx.xowa.addons.wikis.pages.syncs.core.*; import org.junit.*; import gplx.langs.htmls.*; public class Xosync_page_loader__tst { @Before public void init() {fxt.Clear();} private final Xosync_page_loader__fxt fxt = new Xosync_page_loader__fxt(); - @Test public void File() { + @Test public void File() { fxt.Exec__parse(Gfh_utl.Replace_apos("ab")) .Test__html(Gfh_utl.Replace_apos("ab")) .Test__fsdb(fxt.Make__fsdb(Bool_.Y, Bool_.N, "Commons-logo.svg", "svg", 12, -1, -1)) ; } - @Test public void Math() { + @Test public void Math() { fxt.Exec__parse(Gfh_utl.Replace_apos("ab")) .Test__html(Gfh_utl.Replace_apos("ab")) .Test__fsdb(fxt.Make__fsdb(Bool_.Y, Bool_.Y, "596f8baf206a81478afd4194b44138715dc1a05c", "svg", -1, -1, -1)) ; } - @Test public void Ogg() { + @Test public void Ogg() { fxt.Exec__parse(Gfh_utl.Replace_apos("ab")) .Test__html(Gfh_utl.Replace_apos("ab")) .Test__fsdb(fxt.Make__fsdb(Bool_.Y, Bool_.N, "A.ogg", "ogv", 320, -1, -1)) diff --git a/400_xowa/src/gplx/xowa/addons/wikis/pages/syncs/core/parsers/Xosync_hdoc_parser__err__tst.java b/400_xowa/src/gplx/xowa/addons/wikis/pages/syncs/core/parsers/Xosync_hdoc_parser__err__tst.java index a8837a794..695488cbc 100644 --- a/400_xowa/src/gplx/xowa/addons/wikis/pages/syncs/core/parsers/Xosync_hdoc_parser__err__tst.java +++ b/400_xowa/src/gplx/xowa/addons/wikis/pages/syncs/core/parsers/Xosync_hdoc_parser__err__tst.java @@ -1,18 +1,18 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.addons.wikis.pages.syncs.core.parsers; import gplx.*; import gplx.xowa.*; import gplx.xowa.addons.*; import gplx.xowa.addons.wikis.*; import gplx.xowa.addons.wikis.pages.*; import gplx.xowa.addons.wikis.pages.syncs.*; import gplx.xowa.addons.wikis.pages.syncs.core.*; import org.junit.*; import gplx.langs.htmls.*; @@ -20,27 +20,27 @@ public class Xosync_hdoc_parser__err__tst { private final Xosync_hdoc_parser__fxt fxt = new Xosync_hdoc_parser__fxt(); @Before public void init() {fxt.Init(false);} @After public void term() {fxt.Term();} - @Test public void Url_does_not_start_with_upload_wikimedia_org() { + @Test public void Url_does_not_start_with_upload_wikimedia_org() { fxt.Exec__parse(Gfh_utl.Replace_apos("")) .Test__html(Gfh_utl.Replace_apos("")); } - @Test public void Unknown_repo() { + @Test public void Unknown_repo() { fxt.Exec__parse(Gfh_utl.Replace_apos("")) .Test__html(Gfh_utl.Replace_apos("")); } - @Test public void Bad_md5() { + @Test public void Bad_md5() { fxt.Exec__parse(Gfh_utl.Replace_apos("")) .Test__html(Gfh_utl.Replace_apos("")); } - @Test public void Missing_px() { + @Test public void Missing_px() { fxt.Exec__parse(Gfh_utl.Replace_apos("")) .Test__html(Gfh_utl.Replace_apos("")); } - @Test public void Bad_file_w() { + @Test public void Bad_file_w() { fxt.Exec__parse(Gfh_utl.Replace_apos("")) .Test__html(Gfh_utl.Replace_apos("")); } - @Test public void Comment() { + @Test public void Comment() { fxt.Exec__parse(Gfh_utl.Replace_apos("abc")) .Test__html(Gfh_utl.Replace_apos("abc")); } diff --git a/400_xowa/src/gplx/xowa/addons/wikis/pages/syncs/core/parsers/Xosync_hdoc_parser__file__tst.java b/400_xowa/src/gplx/xowa/addons/wikis/pages/syncs/core/parsers/Xosync_hdoc_parser__file__tst.java index 54a13c66e..9a4536c2f 100644 --- a/400_xowa/src/gplx/xowa/addons/wikis/pages/syncs/core/parsers/Xosync_hdoc_parser__file__tst.java +++ b/400_xowa/src/gplx/xowa/addons/wikis/pages/syncs/core/parsers/Xosync_hdoc_parser__file__tst.java @@ -1,18 +1,18 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.addons.wikis.pages.syncs.core.parsers; import gplx.*; import gplx.xowa.*; import gplx.xowa.addons.*; import gplx.xowa.addons.wikis.*; import gplx.xowa.addons.wikis.pages.*; import gplx.xowa.addons.wikis.pages.syncs.*; import gplx.xowa.addons.wikis.pages.syncs.core.*; import org.junit.*; import gplx.langs.htmls.*; @@ -20,42 +20,42 @@ public class Xosync_hdoc_parser__file__tst { private final Xosync_hdoc_parser__fxt fxt = new Xosync_hdoc_parser__fxt(); @Before public void init() {fxt.Init(true);} @After public void term() {fxt.Term();} - @Test public void Commons__thumb() { + @Test public void Commons__thumb() { fxt.Exec__parse(Gfh_utl.Replace_apos("")) .Test__html(Gfh_utl.Replace_apos("")) .Test__fsdb(fxt.Make__fsdb(Bool_.Y, Bool_.N, "A.png", 320, -1, -1)); } - @Test public void Url_encoded() { + @Test public void Url_encoded() { fxt.Exec__parse(Gfh_utl.Replace_apos("")) .Test__html(Gfh_utl.Replace_apos("")) .Test__fsdb(fxt.Make__fsdb(Bool_.Y, Bool_.N, "A,B.png", 320, -1, -1)); } - @Test public void Local__orig() { + @Test public void Local__orig() { fxt.Exec__parse(Gfh_utl.Replace_apos("")) .Test__html(Gfh_utl.Replace_apos("")) .Test__fsdb(fxt.Make__fsdb(Bool_.N, Bool_.Y, "A.png", -1, -1, -1)); } - @Test public void Svg() { + @Test public void Svg() { fxt.Exec__parse(Gfh_utl.Replace_apos("")) .Test__html(Gfh_utl.Replace_apos("")) .Test__fsdb(fxt.Make__fsdb(Bool_.Y, Bool_.N, "A.svg", 12, -1, -1)); } - @Test public void Ogg() { + @Test public void Ogg() { fxt.Exec__parse(Gfh_utl.Replace_apos("")) .Test__html(Gfh_utl.Replace_apos("")) .Test__fsdb(fxt.Make__fsdb(Bool_.Y, Bool_.N, "A.ogg", "ogv", 320, -1, -1)); } - @Test public void Ogg__time() { + @Test public void Ogg__time() { fxt.Exec__parse(Gfh_utl.Replace_apos("")) .Test__html(Gfh_utl.Replace_apos("")) .Test__fsdb(fxt.Make__fsdb(Bool_.Y, Bool_.N, "A.ogg", "ogv", 320, 1.2, -1)); } - @Test public void Pdf__page() { + @Test public void Pdf__page() { fxt.Exec__parse(Gfh_utl.Replace_apos("")) .Test__html(Gfh_utl.Replace_apos("")) .Test__fsdb(fxt.Make__fsdb(Bool_.Y, Bool_.N, "A.djvu", 320, -1, 1)); } - @Test public void Xo() { + @Test public void Xo() { fxt.Exec__parse(Gfh_utl.Replace_apos("")) .Test__html(Gfh_utl.Replace_apos("")) .Test__fsdb(fxt.Make__fsdb(Bool_.Y, Bool_.N, "A.png", 320, -1, -1)); diff --git a/400_xowa/src/gplx/xowa/addons/wikis/pages/syncs/core/parsers/Xosync_hdoc_parser__misc__tst.java b/400_xowa/src/gplx/xowa/addons/wikis/pages/syncs/core/parsers/Xosync_hdoc_parser__misc__tst.java index 1183f453e..99088732b 100644 --- a/400_xowa/src/gplx/xowa/addons/wikis/pages/syncs/core/parsers/Xosync_hdoc_parser__misc__tst.java +++ b/400_xowa/src/gplx/xowa/addons/wikis/pages/syncs/core/parsers/Xosync_hdoc_parser__misc__tst.java @@ -13,16 +13,16 @@ The terms of each license can be found in the source code repository: GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt */ -package gplx.xowa.addons.wikis.pages.syncs.core.parsers; import gplx.*; import gplx.xowa.*; import gplx.xowa.addons.*; import gplx.xowa.addons.wikis.*; import gplx.xowa.addons.wikis.pages.*; import gplx.xowa.addons.wikis.pages.syncs.*; import gplx.xowa.addons.wikis.pages.syncs.core.*; -import org.junit.*; -import gplx.langs.htmls.*; -public class Xosync_hdoc_parser__misc__tst { - private final Xosync_hdoc_parser__fxt fxt = new Xosync_hdoc_parser__fxt(); - @Before public void init() {fxt.Init(true);} - @After public void term() {fxt.Term();} - @Test public void Math() { - fxt.Exec__parse(Gfh_utl.Replace_apos("")) - .Test__html(Gfh_utl.Replace_apos("")) - .Test__fsdb(fxt.Make__fsdb(Bool_.Y, Bool_.Y, "596f8baf206a81478afd4194b44138715dc1a05c.svg", -1, -1, -1)); - } -} +package gplx.xowa.addons.wikis.pages.syncs.core.parsers; import gplx.*; import gplx.xowa.*; import gplx.xowa.addons.*; import gplx.xowa.addons.wikis.*; import gplx.xowa.addons.wikis.pages.*; import gplx.xowa.addons.wikis.pages.syncs.*; import gplx.xowa.addons.wikis.pages.syncs.core.*; +import org.junit.*; +import gplx.langs.htmls.*; +public class Xosync_hdoc_parser__misc__tst { + private final Xosync_hdoc_parser__fxt fxt = new Xosync_hdoc_parser__fxt(); + @Before public void init() {fxt.Init(true);} + @After public void term() {fxt.Term();} + @Test public void Math() { + fxt.Exec__parse(Gfh_utl.Replace_apos("")) + .Test__html(Gfh_utl.Replace_apos("")) + .Test__fsdb(fxt.Make__fsdb(Bool_.Y, Bool_.Y, "596f8baf206a81478afd4194b44138715dc1a05c.svg", -1, -1, -1)); + } +} diff --git a/400_xowa/src/gplx/xowa/addons/wikis/pages/syncs/core/parsers/Xosync_hdoc_parser__tst.java b/400_xowa/src/gplx/xowa/addons/wikis/pages/syncs/core/parsers/Xosync_hdoc_parser__tst.java index 6a939e157..1264b6b5a 100644 --- a/400_xowa/src/gplx/xowa/addons/wikis/pages/syncs/core/parsers/Xosync_hdoc_parser__tst.java +++ b/400_xowa/src/gplx/xowa/addons/wikis/pages/syncs/core/parsers/Xosync_hdoc_parser__tst.java @@ -1,18 +1,18 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.addons.wikis.pages.syncs.core.parsers; import gplx.*; import gplx.xowa.*; import gplx.xowa.addons.*; import gplx.xowa.addons.wikis.*; import gplx.xowa.addons.wikis.pages.*; import gplx.xowa.addons.wikis.pages.syncs.*; import gplx.xowa.addons.wikis.pages.syncs.core.*; import org.junit.*; import gplx.langs.htmls.*; @@ -20,7 +20,7 @@ public class Xosync_hdoc_parser__tst { private final Xosync_hdoc_parser__fxt fxt = new Xosync_hdoc_parser__fxt(); @Before public void init() {fxt.Init(true);} @After public void term() {fxt.Term();} - @Test public void Remove_edit() { + @Test public void Remove_edit() { fxt.Exec__parse(Gfh_utl.Replace_apos_concat_lines ( "

    Section_1" , "" @@ -34,7 +34,7 @@ public class Xosync_hdoc_parser__tst { , "

    " )); } -// @Test public void Smoke() { +// @Test public void Smoke() { // fxt.Exec__parse(Io_mgr.Instance.LoadFilStr("C:\\xowa\\dev\\wm.updater.src.html")); // Io_mgr.Instance.SaveFilBry("C:\\xowa\\dev\\wm.updater.trg.html", fxt.Hdoc().Converted()); // } diff --git a/400_xowa/src/gplx/xowa/addons/wikis/searchs/gui/htmlbars/Srch_rslt_cbk__js.java b/400_xowa/src/gplx/xowa/addons/wikis/searchs/gui/htmlbars/Srch_rslt_cbk__js.java index 1cef713fe..486062540 100644 --- a/400_xowa/src/gplx/xowa/addons/wikis/searchs/gui/htmlbars/Srch_rslt_cbk__js.java +++ b/400_xowa/src/gplx/xowa/addons/wikis/searchs/gui/htmlbars/Srch_rslt_cbk__js.java @@ -1,18 +1,18 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.addons.wikis.searchs.gui.htmlbars; import gplx.*; import gplx.xowa.*; import gplx.xowa.addons.*; import gplx.xowa.addons.wikis.*; import gplx.xowa.addons.wikis.searchs.*; import gplx.xowa.addons.wikis.searchs.gui.*; import gplx.core.js.*; import gplx.xowa.addons.wikis.searchs.searchers.*; import gplx.xowa.addons.wikis.searchs.searchers.rslts.*; @@ -25,7 +25,7 @@ class Srch_rslt_cbk__js implements Srch_rslt_cbk { } public String To_str_and_clear() {return js_wtr.To_str_and_clear();} public void On_cancel() {} - @gplx.Virtual public void On_rslts_found(Srch_search_ctx ctx, Srch_search_qry qry, Srch_rslt_list rslts_list, int rslts_bgn, int rslts_end) { + public void On_rslts_found(Srch_search_ctx ctx, Srch_search_qry qry, Srch_rslt_list rslts_list, int rslts_bgn, int rslts_end) { // exit if done if (!rslts_list.Rslts_are_enough && !rslts_list.Rslts_are_done) return; diff --git a/400_xowa/src/gplx/xowa/addons/wikis/searchs/parsers/Srch_highlight_mgr_tst.java b/400_xowa/src/gplx/xowa/addons/wikis/searchs/parsers/Srch_highlight_mgr_tst.java index 72fd4468f..24248775f 100644 --- a/400_xowa/src/gplx/xowa/addons/wikis/searchs/parsers/Srch_highlight_mgr_tst.java +++ b/400_xowa/src/gplx/xowa/addons/wikis/searchs/parsers/Srch_highlight_mgr_tst.java @@ -1,37 +1,37 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.addons.wikis.searchs.parsers; import gplx.*; import gplx.xowa.*; import gplx.xowa.addons.*; import gplx.xowa.addons.wikis.*; import gplx.xowa.addons.wikis.searchs.*; import org.junit.*; import gplx.xowa.langs.cases.*; public class Srch_highlight_mgr_tst { private final Srch_highlight_mgr_tstr tstr = new Srch_highlight_mgr_tstr(); - @Test public void Full__one() {tstr.Test("a" , "A" , "A");} - @Test public void Full__many() {tstr.Test("a b" , "A B" , "A B");} - @Test public void Part__one() {tstr.Test("a" , "A1" , "A1");} - @Test public void Part__many() {tstr.Test("a b" , "A1 B1" , "A1 B1");} - @Test public void Unordered() {tstr.Test("b a" , "A1 B1" , "A1 B1");} - @Test public void Repeat__part() {tstr.Test("a ab" , "Ab A" , "Ab A");} - @Test public void Repeat__full() {tstr.Test("a" , "A A" , "A A");} - @Test public void Close() {tstr.Test("a" , "Ba Aa" , "Ba Aa");} - @Test public void Comma() {tstr.Test("a" , "A, b" , "A, b");} - @Test public void Dash() {tstr.Test("b" , "A-B c" , "A-B c");} - @Test public void Parens() {tstr.Test("a" , "(A)" , "(A)");} - @Test public void Strong() {tstr.Test("strong" , "strong strong" , "strong strong");} - @Test public void Dash_w_mixed_cases() {tstr.Test("b" , "A-a B" , "A-a B");} // search_parser treats A-a separately from a-a - @Test public void Acronymn() {tstr.Test("ab" , "A.B." , "A.B.");} - // @Test public void Slash() {tstr.Test("b" , "A/B/C" , "A/B/C");} + @Test public void Full__one() {tstr.Test("a" , "A" , "A");} + @Test public void Full__many() {tstr.Test("a b" , "A B" , "A B");} + @Test public void Part__one() {tstr.Test("a" , "A1" , "A1");} + @Test public void Part__many() {tstr.Test("a b" , "A1 B1" , "A1 B1");} + @Test public void Unordered() {tstr.Test("b a" , "A1 B1" , "A1 B1");} + @Test public void Repeat__part() {tstr.Test("a ab" , "Ab A" , "Ab A");} + @Test public void Repeat__full() {tstr.Test("a" , "A A" , "A A");} + @Test public void Close() {tstr.Test("a" , "Ba Aa" , "Ba Aa");} + @Test public void Comma() {tstr.Test("a" , "A, b" , "A, b");} + @Test public void Dash() {tstr.Test("b" , "A-B c" , "A-B c");} + @Test public void Parens() {tstr.Test("a" , "(A)" , "(A)");} + @Test public void Strong() {tstr.Test("strong" , "strong strong" , "strong strong");} + @Test public void Dash_w_mixed_cases() {tstr.Test("b" , "A-a B" , "A-a B");} // search_parser treats A-a separately from a-a + @Test public void Acronymn() {tstr.Test("ab" , "A.B." , "A.B.");} + // @Test public void Slash() {tstr.Test("b" , "A/B/C" , "A/B/C");} } class Srch_highlight_mgr_tstr { private final Srch_highlight_mgr mgr; diff --git a/400_xowa/src/gplx/xowa/addons/wikis/searchs/parsers/Srch_text_parser_tst.java b/400_xowa/src/gplx/xowa/addons/wikis/searchs/parsers/Srch_text_parser_tst.java index 7c07f16f5..b2c01d596 100644 --- a/400_xowa/src/gplx/xowa/addons/wikis/searchs/parsers/Srch_text_parser_tst.java +++ b/400_xowa/src/gplx/xowa/addons/wikis/searchs/parsers/Srch_text_parser_tst.java @@ -1,103 +1,103 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.addons.wikis.searchs.parsers; import gplx.*; import gplx.xowa.*; import gplx.xowa.addons.*; import gplx.xowa.addons.wikis.*; import gplx.xowa.addons.wikis.searchs.*; import org.junit.*; import gplx.xowa.langs.cases.*; public class Srch_text_parser_tst { private final Srch_text_parser_fxt fxt = new Srch_text_parser_fxt(); @Before public void init() {fxt.Init();} - @Test public void Word__one() {fxt.Clear().Test__split("abcd" , "abcd");} - @Test public void Word__many() {fxt.Clear().Test__split("abc d ef" , "abc", "d", "ef");} - @Test public void Ws__many() {fxt.Clear().Test__split("a b" , "a", "b");} - @Test public void Ws__bgn() {fxt.Clear().Test__split(" a" , "a");} - @Test public void Ws__end() {fxt.Clear().Test__split("a " , "a");} - @Test public void Under() {fxt.Clear().Test__split("a_b" , "a", "b");} // NOTE: same as space - @Test public void Lowercase() {fxt.Clear().Test__split("A B C" , "a", "b", "c");} - @Test public void Dupe() {fxt.Clear().Test__split("a a a" , fxt.Make_word("a", 3));} - @Test public void Dupe__lowercase() {fxt.Clear().Test__split("a A" , fxt.Make_word("a", 2));} - @Test public void Comma__end() {fxt.Clear().Test__split("a, b" , "a", "b");} // EX: "Henry VI, Part 3"; "Bergen County, New Jersey" - @Test public void Comma__mid() {fxt.Clear().Test__split("a,b" , "a,b");} // EX: "20,000 Leagues Under the Sea" - @Test public void Comma__bgn() {fxt.Clear().Test__split(",a b" , "a", "b");} // EX: skip bad usages; EX: "Little Harbour,Pictou ,Nova Scotia"; "The Hindu Succession Act ,1956" - @Test public void Colon__end() {fxt.Clear().Test__split("a: b" , "a", "b");} - @Test public void Colon__mid() {fxt.Clear().Test__split("a:b" , "a:b");} // EX: "3:10 to Yuma (2007 film)"; "6:02 AM EST"; "24:7 Theatre Festival"; "Library of Congress Classification:Class P -- Language and Literature" - @Test public void Colon__bgn() {fxt.Clear().Test__split(":a b" , "a", "b");} - @Test public void Semic__end() {fxt.Clear().Test__split("a; b" , "a", "b");} - @Test public void Semic__mid() {fxt.Clear().Test__split("a;b" , "a;b");} - @Test public void Semic__bgn() {fxt.Clear().Test__split(";a b" , "a", "b");} - @Test public void Bang__end() {fxt.Clear().Test__split("a! b" , "a", "b");} - @Test public void Bang__mid() {fxt.Clear().Test__split("a!b" , "a!b");} - @Test public void Bang__bgn() {fxt.Clear().Test__split("!a b" , "a", "b");} - @Test public void Question__end() {fxt.Clear().Test__split("a? b" , "a", "b");} - @Test public void Question__mid() {fxt.Clear().Test__split("a?b" , "a?b");} - @Test public void Question__bgn() {fxt.Clear().Test__split("?a b" , "a", "b");} - @Test public void Question__sentence() {fxt.Clear().Test__split("a?" , "a");} - @Test public void Multiple__1() {fxt.Clear().Test__split("a?!" , "a");} - @Test public void Multiple__2() {fxt.Clear().Test__split("a!?" , "a");} - @Test public void Dot__word() {fxt.Clear().Test__split("a.org" , "a.org");} // EX: "en.wikipedia.org"; "Earth.png"; "IEEE_802.15" - @Test public void Dot__abrv() {fxt.Clear().Test__split("a vs. b" , "a", "vs.", "vs", "b");} // EX: "vs.", "no.", "dr.", "st.", "inc." - @Test public void Dot__initials() {fxt.Clear().Test__split("a. b. cde" , "a.", "a", "b.", "b", "cde");} // EX: "H. G. Wells" - @Test public void Dot__acronym() {fxt.Clear().Test__split("abc D.E.F. ghi" , "abc", "d.e.f.", "def", "ghi");} // EX: "History of U.S.A. Science", "G.I. Bill", "Washington, D.C."; "Barcelona F.C."; "The Office (U.S.)"; "Agents of S.H.I.E.L.D."; "Gunfight at the O.K. Corral"; "H.M.S. Pinafore"; "R.E.M. discography" - @Test public void Dot__bgn() {fxt.Clear().Test__split("a .bcd e" , "a", ".bcd", "bcd", "e");} // EX: "Colt .45", "List of organizations with .int domain names" - @Test public void Dot__bgn__end() {fxt.Clear().Test__split("a .b. c" , "a", ".b.", "c");} - @Test public void Dot__ellipsis_like() {fxt.Clear().Test__split("a . . . b" , "a", "b");} // EX: "Did you know . . ." - @Test public void Ellipsis__len_3() {fxt.Clear().Test__split("a... bc d" , "a", "...", "bc", "d");} // EX: "Nights into Dreams..." - @Test public void Ellipsis__len_3__bgn() {fxt.Clear().Test__split("a ...b" , "a", "...", "b"); ;} // NOTE: make sure "dot_bgn" code doesn't break this - @Test public void Ellipsis__len_2() {fxt.Clear().Test__split("a.. b" , "a", "..", "b");} // EX: "3.. 6.. 9 Seconds of Light" - @Test public void Ellipsis__bgn() {fxt.Clear().Test__split("...a" , "...", "a");} - @Test public void Ellipsis__end() {fxt.Clear().Test__split("a..." , "a", "...");} - @Test public void Ellipsis__no_ws() {fxt.Clear().Test__split("a...b" , "a", "...", "b");} - @Test public void Ellipsis__term() {fxt.Clear().Test__split("a...?!" , "a", "...");} // EX: "Wetten, dass..?" - @Test public void Apos__merge__end__eos() {fxt.Clear().Test__split("ab's" , "ab's", "abs");} // EX: "A Midsummer Night's Dream"; "Director's cut" - @Test public void Apos__merge__end__word() {fxt.Clear().Test__split("ab's c" , "ab's", "abs", "c");} // EX: "Director's cut"; "Cap'n Crunch"; - @Test public void Apos__merge__bgn() {fxt.Clear().Test__split("a o'bc" , "a", "o'bc", "obc");} // EX: "Twelve O'Clock High"; "Shaqille O'Neal"; "Banca d'Italia" - @Test public void Apos__merge__mid() {fxt.Clear().Test__split("i'm" , "i'm", "im");} - @Test public void Apos__bgn__long() {fxt.Clear().Test__split("a 'tis b" , "a", "'tis", "tis", "b");} // EX: "My Country, 'Tis of Thee"; "Omaha hold 'em"; "Slash'EM"; "Expo '92" - @Test public void Apos__end__eos() {fxt.Clear().Test__split("a'" , "a");} - @Test public void Apos__end__short() {fxt.Clear().Test__split("a' b" , "a", "b");} // EX: "Will-o'-the-wisp"; "Portuguese man o' war"; - @Test public void Apos__end__long() {fxt.Clear().Test__split("ab' c" , "ab", "c");} // EX: "Dunkin' Donuts"; "'Allo 'Allo!"; "Catherine de' Medici" - @Test public void Apos__both__n() {fxt.Clear().Test__split("a 'n' b" , "a", "'n'", "n", "b");} // EX: "Rock 'n' Roll"; "Town 'n' Country, Florida"; "Hill 'n Dale, Florida"; "Chip 'n Dale Rescue Rangers" - @Test public void Apos__multiple() {fxt.Clear().Test__split("ab''cd" , "ab''cd");} - @Test public void Apos__lone() {fxt.Clear().Test__split("' a" , "'", "a");} // EX: "' (disambiguation)" - @Test public void Dash__one() {fxt.Clear().Test__split("a-b" , "a", "b", "a-b");} // EX: "The Amazing Spider-Man"; "On-super percentage"; "Basic Role-Playing"; "Context-sensitive"; "Cross-country skiing"; "Double-barreled shotgun"; "Dot-com bubble"; "Many-worlds interpretation"; "Faster-than-light"; "Gram-positive bacteria"; "Half-life", "Jean-Paul Sartre"; "Austria-Hungary" - @Test public void Dash__many() {fxt.Clear().Test__split("a-b-c" , "a", "b", "c", "a-b-c");} - @Test public void Dash__ws() {fxt.Clear().Test__split("a - b" , "a", "-", "b");} - @Test public void Dash__eos() {fxt.Clear().Test__split("a-" , "a", "a-");} - @Test public void Dash__bos() {fxt.Clear().Test__split("-a" , "a", "-a");} - @Test public void Dash__mult__2() {fxt.Clear().Test__split("--" , "--");} - @Test public void Dash__mult__3() {fxt.Clear().Test__split("---" , "---");} - @Test public void Dash__mult__2__words() {fxt.Clear().Test__split("a--b" , "a", "b", "a--b");} - @Test public void Dash__w_comma() {fxt.Clear().Test__split("a-, b" , "a", "a-", "b");} - @Test public void Slash__one() {fxt.Clear().Test__split("a/b" , "a", "b");} // EX: "Good cop/bad cop"; "Snooker world rankings 2004/2005"; "Debian GNU/Hurd"; "HIV/AIDS in the United States"; "List of minor planets/1�100" - @Test public void Slash__many() {fxt.Clear().Test__split("a/b/c" , "a", "b", "c");} // EX: "Age/sex/location"; - @Test public void Slash__ws() {fxt.Clear().Test__split("a / b" , "a", "b");} - @Test public void Dash__slash() {fxt.Clear().Test__split("a-b/c-d-e/f-g" , "a", "b", "a-b", "c", "d", "e", "c-d-e", "f", "g", "f-g");} - @Test public void Paren__both__one() {fxt.Clear().Test__split("a (b) c" , "a", "b", "c");} // EX: "A (letter)" - @Test public void Paren__both__many() {fxt.Clear().Test__split("a (b c) d" , "a", "b", "c", "d");} // EX: "A (2016 film)" - @Test public void Paren__bgn__multiple() {fxt.Clear().Test__split("a (((b)))" , "a", "b");} - @Test public void Paren__unmatched() {fxt.Clear().Test__split("a(b" , "a(b");} - @Test public void Paren__unmatched__bgn() {fxt.Clear().Test__split("a (b" , "a", "b");} - @Test public void Paren__mid() {fxt.Clear().Test__split("a(b)c" , "a(b)c");} // EX: "Chloro(pyridine)cobaloxime"; "Exi(s)t" - @Test public void Paren__end() {fxt.Clear().Test__split("a(b)" , "a(b)", "a");} // EX: "Come What(ever) May"; "501(c) organization"; "Reindeer(s) Are Better Than People"; "(Miss)understood"; "Chromium(III) picolinate" - @Test public void Paren__bgn() {fxt.Clear().Test__split("(a)b" , "(a)b", "b");} // EX: "International Student Congress of (bio)Medical Sciences" - @Test public void Paren__end__dash() {fxt.Clear().Test__split("a(b-c) d" , "a(b-c)", "a", "d");} // EX: "Bis(2-ethylhexyl) phthalate" - @Test public void Paren__end__comma() {fxt.Clear().Test__split("a(b,c) d" , "a(b,c)", "a", "d");} // EX: "Iron(II,III) oxide" - @Test public void Paren__comma() {fxt.Clear().Test__split("a (b), c" , "a", "b", "c");} // EX: "Corning (city), New York" - @Test public void Paren__multiple() {fxt.Clear().Test__split("(a) (b)" , "a", "b");} - @Test public void Quote__both() {fxt.Clear().Test__split("a \"b\" c" , "a", "b", "c");} - @Test public void Word_bgn__at() {fxt.Clear().Test__split("@a" , "@a", "a");} - @Test public void Word_bgn__tilde() {fxt.Clear().Test__split("~a~" , "a");} // EX: "Phantom ~Requiem for the Phantom~" + @Test public void Word__one() {fxt.Clear().Test__split("abcd" , "abcd");} + @Test public void Word__many() {fxt.Clear().Test__split("abc d ef" , "abc", "d", "ef");} + @Test public void Ws__many() {fxt.Clear().Test__split("a b" , "a", "b");} + @Test public void Ws__bgn() {fxt.Clear().Test__split(" a" , "a");} + @Test public void Ws__end() {fxt.Clear().Test__split("a " , "a");} + @Test public void Under() {fxt.Clear().Test__split("a_b" , "a", "b");} // NOTE: same as space + @Test public void Lowercase() {fxt.Clear().Test__split("A B C" , "a", "b", "c");} + @Test public void Dupe() {fxt.Clear().Test__split("a a a" , fxt.Make_word("a", 3));} + @Test public void Dupe__lowercase() {fxt.Clear().Test__split("a A" , fxt.Make_word("a", 2));} + @Test public void Comma__end() {fxt.Clear().Test__split("a, b" , "a", "b");} // EX: "Henry VI, Part 3"; "Bergen County, New Jersey" + @Test public void Comma__mid() {fxt.Clear().Test__split("a,b" , "a,b");} // EX: "20,000 Leagues Under the Sea" + @Test public void Comma__bgn() {fxt.Clear().Test__split(",a b" , "a", "b");} // EX: skip bad usages; EX: "Little Harbour,Pictou ,Nova Scotia"; "The Hindu Succession Act ,1956" + @Test public void Colon__end() {fxt.Clear().Test__split("a: b" , "a", "b");} + @Test public void Colon__mid() {fxt.Clear().Test__split("a:b" , "a:b");} // EX: "3:10 to Yuma (2007 film)"; "6:02 AM EST"; "24:7 Theatre Festival"; "Library of Congress Classification:Class P -- Language and Literature" + @Test public void Colon__bgn() {fxt.Clear().Test__split(":a b" , "a", "b");} + @Test public void Semic__end() {fxt.Clear().Test__split("a; b" , "a", "b");} + @Test public void Semic__mid() {fxt.Clear().Test__split("a;b" , "a;b");} + @Test public void Semic__bgn() {fxt.Clear().Test__split(";a b" , "a", "b");} + @Test public void Bang__end() {fxt.Clear().Test__split("a! b" , "a", "b");} + @Test public void Bang__mid() {fxt.Clear().Test__split("a!b" , "a!b");} + @Test public void Bang__bgn() {fxt.Clear().Test__split("!a b" , "a", "b");} + @Test public void Question__end() {fxt.Clear().Test__split("a? b" , "a", "b");} + @Test public void Question__mid() {fxt.Clear().Test__split("a?b" , "a?b");} + @Test public void Question__bgn() {fxt.Clear().Test__split("?a b" , "a", "b");} + @Test public void Question__sentence() {fxt.Clear().Test__split("a?" , "a");} + @Test public void Multiple__1() {fxt.Clear().Test__split("a?!" , "a");} + @Test public void Multiple__2() {fxt.Clear().Test__split("a!?" , "a");} + @Test public void Dot__word() {fxt.Clear().Test__split("a.org" , "a.org");} // EX: "en.wikipedia.org"; "Earth.png"; "IEEE_802.15" + @Test public void Dot__abrv() {fxt.Clear().Test__split("a vs. b" , "a", "vs.", "vs", "b");} // EX: "vs.", "no.", "dr.", "st.", "inc." + @Test public void Dot__initials() {fxt.Clear().Test__split("a. b. cde" , "a.", "a", "b.", "b", "cde");} // EX: "H. G. Wells" + @Test public void Dot__acronym() {fxt.Clear().Test__split("abc D.E.F. ghi" , "abc", "d.e.f.", "def", "ghi");} // EX: "History of U.S.A. Science", "G.I. Bill", "Washington, D.C."; "Barcelona F.C."; "The Office (U.S.)"; "Agents of S.H.I.E.L.D."; "Gunfight at the O.K. Corral"; "H.M.S. Pinafore"; "R.E.M. discography" + @Test public void Dot__bgn() {fxt.Clear().Test__split("a .bcd e" , "a", ".bcd", "bcd", "e");} // EX: "Colt .45", "List of organizations with .int domain names" + @Test public void Dot__bgn__end() {fxt.Clear().Test__split("a .b. c" , "a", ".b.", "c");} + @Test public void Dot__ellipsis_like() {fxt.Clear().Test__split("a . . . b" , "a", "b");} // EX: "Did you know . . ." + @Test public void Ellipsis__len_3() {fxt.Clear().Test__split("a... bc d" , "a", "...", "bc", "d");} // EX: "Nights into Dreams..." + @Test public void Ellipsis__len_3__bgn() {fxt.Clear().Test__split("a ...b" , "a", "...", "b"); ;} // NOTE: make sure "dot_bgn" code doesn't break this + @Test public void Ellipsis__len_2() {fxt.Clear().Test__split("a.. b" , "a", "..", "b");} // EX: "3.. 6.. 9 Seconds of Light" + @Test public void Ellipsis__bgn() {fxt.Clear().Test__split("...a" , "...", "a");} + @Test public void Ellipsis__end() {fxt.Clear().Test__split("a..." , "a", "...");} + @Test public void Ellipsis__no_ws() {fxt.Clear().Test__split("a...b" , "a", "...", "b");} + @Test public void Ellipsis__term() {fxt.Clear().Test__split("a...?!" , "a", "...");} // EX: "Wetten, dass..?" + @Test public void Apos__merge__end__eos() {fxt.Clear().Test__split("ab's" , "ab's", "abs");} // EX: "A Midsummer Night's Dream"; "Director's cut" + @Test public void Apos__merge__end__word() {fxt.Clear().Test__split("ab's c" , "ab's", "abs", "c");} // EX: "Director's cut"; "Cap'n Crunch"; + @Test public void Apos__merge__bgn() {fxt.Clear().Test__split("a o'bc" , "a", "o'bc", "obc");} // EX: "Twelve O'Clock High"; "Shaqille O'Neal"; "Banca d'Italia" + @Test public void Apos__merge__mid() {fxt.Clear().Test__split("i'm" , "i'm", "im");} + @Test public void Apos__bgn__long() {fxt.Clear().Test__split("a 'tis b" , "a", "'tis", "tis", "b");} // EX: "My Country, 'Tis of Thee"; "Omaha hold 'em"; "Slash'EM"; "Expo '92" + @Test public void Apos__end__eos() {fxt.Clear().Test__split("a'" , "a");} + @Test public void Apos__end__short() {fxt.Clear().Test__split("a' b" , "a", "b");} // EX: "Will-o'-the-wisp"; "Portuguese man o' war"; + @Test public void Apos__end__long() {fxt.Clear().Test__split("ab' c" , "ab", "c");} // EX: "Dunkin' Donuts"; "'Allo 'Allo!"; "Catherine de' Medici" + @Test public void Apos__both__n() {fxt.Clear().Test__split("a 'n' b" , "a", "'n'", "n", "b");} // EX: "Rock 'n' Roll"; "Town 'n' Country, Florida"; "Hill 'n Dale, Florida"; "Chip 'n Dale Rescue Rangers" + @Test public void Apos__multiple() {fxt.Clear().Test__split("ab''cd" , "ab''cd");} + @Test public void Apos__lone() {fxt.Clear().Test__split("' a" , "'", "a");} // EX: "' (disambiguation)" + @Test public void Dash__one() {fxt.Clear().Test__split("a-b" , "a", "b", "a-b");} // EX: "The Amazing Spider-Man"; "On-super percentage"; "Basic Role-Playing"; "Context-sensitive"; "Cross-country skiing"; "Double-barreled shotgun"; "Dot-com bubble"; "Many-worlds interpretation"; "Faster-than-light"; "Gram-positive bacteria"; "Half-life", "Jean-Paul Sartre"; "Austria-Hungary" + @Test public void Dash__many() {fxt.Clear().Test__split("a-b-c" , "a", "b", "c", "a-b-c");} + @Test public void Dash__ws() {fxt.Clear().Test__split("a - b" , "a", "-", "b");} + @Test public void Dash__eos() {fxt.Clear().Test__split("a-" , "a", "a-");} + @Test public void Dash__bos() {fxt.Clear().Test__split("-a" , "a", "-a");} + @Test public void Dash__mult__2() {fxt.Clear().Test__split("--" , "--");} + @Test public void Dash__mult__3() {fxt.Clear().Test__split("---" , "---");} + @Test public void Dash__mult__2__words() {fxt.Clear().Test__split("a--b" , "a", "b", "a--b");} + @Test public void Dash__w_comma() {fxt.Clear().Test__split("a-, b" , "a", "a-", "b");} + @Test public void Slash__one() {fxt.Clear().Test__split("a/b" , "a", "b");} // EX: "Good cop/bad cop"; "Snooker world rankings 2004/2005"; "Debian GNU/Hurd"; "HIV/AIDS in the United States"; "List of minor planets/1�100" + @Test public void Slash__many() {fxt.Clear().Test__split("a/b/c" , "a", "b", "c");} // EX: "Age/sex/location"; + @Test public void Slash__ws() {fxt.Clear().Test__split("a / b" , "a", "b");} + @Test public void Dash__slash() {fxt.Clear().Test__split("a-b/c-d-e/f-g" , "a", "b", "a-b", "c", "d", "e", "c-d-e", "f", "g", "f-g");} + @Test public void Paren__both__one() {fxt.Clear().Test__split("a (b) c" , "a", "b", "c");} // EX: "A (letter)" + @Test public void Paren__both__many() {fxt.Clear().Test__split("a (b c) d" , "a", "b", "c", "d");} // EX: "A (2016 film)" + @Test public void Paren__bgn__multiple() {fxt.Clear().Test__split("a (((b)))" , "a", "b");} + @Test public void Paren__unmatched() {fxt.Clear().Test__split("a(b" , "a(b");} + @Test public void Paren__unmatched__bgn() {fxt.Clear().Test__split("a (b" , "a", "b");} + @Test public void Paren__mid() {fxt.Clear().Test__split("a(b)c" , "a(b)c");} // EX: "Chloro(pyridine)cobaloxime"; "Exi(s)t" + @Test public void Paren__end() {fxt.Clear().Test__split("a(b)" , "a(b)", "a");} // EX: "Come What(ever) May"; "501(c) organization"; "Reindeer(s) Are Better Than People"; "(Miss)understood"; "Chromium(III) picolinate" + @Test public void Paren__bgn() {fxt.Clear().Test__split("(a)b" , "(a)b", "b");} // EX: "International Student Congress of (bio)Medical Sciences" + @Test public void Paren__end__dash() {fxt.Clear().Test__split("a(b-c) d" , "a(b-c)", "a", "d");} // EX: "Bis(2-ethylhexyl) phthalate" + @Test public void Paren__end__comma() {fxt.Clear().Test__split("a(b,c) d" , "a(b,c)", "a", "d");} // EX: "Iron(II,III) oxide" + @Test public void Paren__comma() {fxt.Clear().Test__split("a (b), c" , "a", "b", "c");} // EX: "Corning (city), New York" + @Test public void Paren__multiple() {fxt.Clear().Test__split("(a) (b)" , "a", "b");} + @Test public void Quote__both() {fxt.Clear().Test__split("a \"b\" c" , "a", "b", "c");} + @Test public void Word_bgn__at() {fxt.Clear().Test__split("@a" , "@a", "a");} + @Test public void Word_bgn__tilde() {fxt.Clear().Test__split("~a~" , "a");} // EX: "Phantom ~Requiem for the Phantom~" } class Srch_text_parser_fxt { private final Srch_text_parser word_parser = new Srch_text_parser(); diff --git a/400_xowa/src/gplx/xowa/addons/wikis/searchs/searchers/Srch_search_phrase_tst.java b/400_xowa/src/gplx/xowa/addons/wikis/searchs/searchers/Srch_search_phrase_tst.java index 064ccb09f..62049d010 100644 --- a/400_xowa/src/gplx/xowa/addons/wikis/searchs/searchers/Srch_search_phrase_tst.java +++ b/400_xowa/src/gplx/xowa/addons/wikis/searchs/searchers/Srch_search_phrase_tst.java @@ -1,38 +1,38 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.addons.wikis.searchs.searchers; import gplx.*; import gplx.xowa.*; import gplx.xowa.addons.*; import gplx.xowa.addons.wikis.*; import gplx.xowa.addons.wikis.searchs.*; import org.junit.*; import gplx.xowa.addons.wikis.searchs.parsers.*; import gplx.xowa.addons.wikis.searchs.searchers.crts.*; public class Srch_search_phrase_tst { private final Srch_search_phrase_fxt fxt = new Srch_search_phrase_fxt(); - @Test public void Word() {fxt.Test__auto_wildcard("a" , "a*");} - @Test public void Paren_end() {fxt.Test__auto_wildcard("(a)" , "(a*)");} - @Test public void Quoted() {fxt.Test__auto_wildcard("\"a\"" , "\"a\"");} - @Test public void Space() {fxt.Test__auto_wildcard(" " , " ");} - @Test public void Not() {fxt.Test__auto_wildcard("-" , "-");} - @Test public void And() {fxt.Test__auto_wildcard("+" , "+");} - @Test public void Or() {fxt.Test__auto_wildcard("," , ",");} - @Test public void Paren_bgn() {fxt.Test__auto_wildcard("(" , "(");} - @Test public void Star() {fxt.Test__auto_wildcard("*" , "*");} - @Test public void Wildcard__exists__y() {fxt.Test__auto_wildcard("a*b" , "a*b");} - @Test public void Wildcard__exists__escaped() {fxt.Test__auto_wildcard("a\\*b" , "a\\*b*");} - @Test public void Wildcard__exists__n() {fxt.Test__auto_wildcard("a* bc" , "a* bc*");} - @Test public void Escape() {fxt.Test__auto_wildcard("\\*" , "\\**");} - @Test public void Escape__incomplete() {fxt.Test__auto_wildcard("a\\" , "a\\");} - @Test public void Escape__escaped() {fxt.Test__auto_wildcard("a\\\\" , "a\\\\*");} - @Test public void Auto_wildcard_n() {fxt.Init__auto_wildcard_n_().Test__auto_wildcard("a", "a");} + @Test public void Word() {fxt.Test__auto_wildcard("a" , "a*");} + @Test public void Paren_end() {fxt.Test__auto_wildcard("(a)" , "(a*)");} + @Test public void Quoted() {fxt.Test__auto_wildcard("\"a\"" , "\"a\"");} + @Test public void Space() {fxt.Test__auto_wildcard(" " , " ");} + @Test public void Not() {fxt.Test__auto_wildcard("-" , "-");} + @Test public void And() {fxt.Test__auto_wildcard("+" , "+");} + @Test public void Or() {fxt.Test__auto_wildcard("," , ",");} + @Test public void Paren_bgn() {fxt.Test__auto_wildcard("(" , "(");} + @Test public void Star() {fxt.Test__auto_wildcard("*" , "*");} + @Test public void Wildcard__exists__y() {fxt.Test__auto_wildcard("a*b" , "a*b");} + @Test public void Wildcard__exists__escaped() {fxt.Test__auto_wildcard("a\\*b" , "a\\*b*");} + @Test public void Wildcard__exists__n() {fxt.Test__auto_wildcard("a* bc" , "a* bc*");} + @Test public void Escape() {fxt.Test__auto_wildcard("\\*" , "\\**");} + @Test public void Escape__incomplete() {fxt.Test__auto_wildcard("a\\" , "a\\");} + @Test public void Escape__escaped() {fxt.Test__auto_wildcard("a\\\\" , "a\\\\*");} + @Test public void Auto_wildcard_n() {fxt.Init__auto_wildcard_n_().Test__auto_wildcard("a", "a");} } class Srch_search_phrase_fxt { private final Srch_crt_scanner_syms syms = Srch_crt_scanner_syms.Dflt; diff --git a/400_xowa/src/gplx/xowa/addons/wikis/searchs/searchers/crts/Srch_crt_parser_tst.java b/400_xowa/src/gplx/xowa/addons/wikis/searchs/searchers/crts/Srch_crt_parser_tst.java index 9f2be3a02..77a17bc95 100644 --- a/400_xowa/src/gplx/xowa/addons/wikis/searchs/searchers/crts/Srch_crt_parser_tst.java +++ b/400_xowa/src/gplx/xowa/addons/wikis/searchs/searchers/crts/Srch_crt_parser_tst.java @@ -1,54 +1,54 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.addons.wikis.searchs.searchers.crts; import gplx.*; import gplx.xowa.*; import gplx.xowa.addons.*; import gplx.xowa.addons.wikis.*; import gplx.xowa.addons.wikis.searchs.*; import gplx.xowa.addons.wikis.searchs.searchers.*; import org.junit.*; import gplx.xowa.addons.wikis.searchs.parsers.*; import gplx.xowa.addons.wikis.searchs.searchers.crts.visitors.*; public class Srch_crt_parser_tst { private final Srch_crt_parser_fxt fxt = new Srch_crt_parser_fxt(); - @Test public void Word__one() {fxt.Test__parse("a" , "a");} - @Test public void And__one() {fxt.Test__parse("a + b" , "(a AND b)");} - @Test public void And__many() {fxt.Test__parse("a + b + c" , "(a AND b AND c)");} - @Test public void And__dangling() {fxt.Test__parse("a +" , "a");} - @Test public void And__dupe() {fxt.Test__parse("a + + b" , "(a AND b)");} - @Test public void Quote() {fxt.Test__parse("\"a b\"" , "\"a b\"");} - @Test public void Auto__word() {fxt.Test__parse("a b" , "(a AND b)");} - @Test public void Auto__quote() {fxt.Test__parse("a \"b\"" , "(a AND \"b\")");} - @Test public void Auto__parens() {fxt.Test__parse("a (b , c)" , "(a AND (b OR c))");} - @Test public void Or__one() {fxt.Test__parse("a , b" , "(a OR b)");} - @Test public void Or__many() {fxt.Test__parse("a , b , c" , "(a OR b OR c)");} - @Test public void Mixed__3() {fxt.Test__parse("a + b , c" , "((a AND b) OR c)");} - @Test public void Mixed__5() {fxt.Test__parse("a + b , c + d , e" , "((((a AND b) OR c) AND d) OR e)");} - @Test public void Parens__basic() {fxt.Test__parse("a + (b , c)" , "(a AND (b OR c))");} - @Test public void Parens__nest() {fxt.Test__parse("a + (b , (c + d))" , "(a AND (b OR (c AND d)))");} - @Test public void Parens__mid() {fxt.Test__parse("a + (b , c) + d)" , "(a AND (b OR c) AND d)");} - @Test public void Parens__mixed() {fxt.Test__parse("a + (b , c) , d)" , "((a AND (b OR c)) OR d)");} - @Test public void Parens__dupe() {fxt.Test__parse("((a))" , "a");} - @Test public void Parens__dangling__lhs() {fxt.Test__parse("(a" , "a");} - @Test public void Parens__dangling__rhs() {fxt.Test__parse("a)" , "a");} - @Test public void Parens__empty__bos() {fxt.Test__parse("()" , "");} - @Test public void Parens__empty__mid() {fxt.Test__parse("a () b" , "(a AND b)");} - @Test public void Not__bos() {fxt.Test__parse("-abc" , "NOT abc");} - @Test public void Not__mid() {fxt.Test__parse("a -b" , "(a AND NOT b)");} - @Test public void Not__2() {fxt.Test__parse("a -b -c" , "(a AND NOT b AND NOT c)");} - @Test public void Not__dangling__eos() {fxt.Test__parse("a -" , "a");} - @Test public void Not__dangling__mid() {fxt.Test__parse("a -- b" , "(a AND b)");} // NOTE: scanner will remove spaces and convert to "a", "--", "b" - @Test public void Not__dupe__2() {fxt.Test__parse("a --b" , "(a AND b)");} - @Test public void Not__dupe__3() {fxt.Test__parse("a ---b" , "(a AND NOT b)");} - @Test public void Not__parens() {fxt.Test__parse("a -(b + c)" , "(a AND NOT (b AND c))");} - @Test public void Escape__eos() {fxt.Test__parse("\\" , "");} - @Test public void Escape__escaped() {fxt.Test__parse("\\\\*" , "\\*");} // '\\' -> '\*' + @Test public void Word__one() {fxt.Test__parse("a" , "a");} + @Test public void And__one() {fxt.Test__parse("a + b" , "(a AND b)");} + @Test public void And__many() {fxt.Test__parse("a + b + c" , "(a AND b AND c)");} + @Test public void And__dangling() {fxt.Test__parse("a +" , "a");} + @Test public void And__dupe() {fxt.Test__parse("a + + b" , "(a AND b)");} + @Test public void Quote() {fxt.Test__parse("\"a b\"" , "\"a b\"");} + @Test public void Auto__word() {fxt.Test__parse("a b" , "(a AND b)");} + @Test public void Auto__quote() {fxt.Test__parse("a \"b\"" , "(a AND \"b\")");} + @Test public void Auto__parens() {fxt.Test__parse("a (b , c)" , "(a AND (b OR c))");} + @Test public void Or__one() {fxt.Test__parse("a , b" , "(a OR b)");} + @Test public void Or__many() {fxt.Test__parse("a , b , c" , "(a OR b OR c)");} + @Test public void Mixed__3() {fxt.Test__parse("a + b , c" , "((a AND b) OR c)");} + @Test public void Mixed__5() {fxt.Test__parse("a + b , c + d , e" , "((((a AND b) OR c) AND d) OR e)");} + @Test public void Parens__basic() {fxt.Test__parse("a + (b , c)" , "(a AND (b OR c))");} + @Test public void Parens__nest() {fxt.Test__parse("a + (b , (c + d))" , "(a AND (b OR (c AND d)))");} + @Test public void Parens__mid() {fxt.Test__parse("a + (b , c) + d)" , "(a AND (b OR c) AND d)");} + @Test public void Parens__mixed() {fxt.Test__parse("a + (b , c) , d)" , "((a AND (b OR c)) OR d)");} + @Test public void Parens__dupe() {fxt.Test__parse("((a))" , "a");} + @Test public void Parens__dangling__lhs() {fxt.Test__parse("(a" , "a");} + @Test public void Parens__dangling__rhs() {fxt.Test__parse("a)" , "a");} + @Test public void Parens__empty__bos() {fxt.Test__parse("()" , "");} + @Test public void Parens__empty__mid() {fxt.Test__parse("a () b" , "(a AND b)");} + @Test public void Not__bos() {fxt.Test__parse("-abc" , "NOT abc");} + @Test public void Not__mid() {fxt.Test__parse("a -b" , "(a AND NOT b)");} + @Test public void Not__2() {fxt.Test__parse("a -b -c" , "(a AND NOT b AND NOT c)");} + @Test public void Not__dangling__eos() {fxt.Test__parse("a -" , "a");} + @Test public void Not__dangling__mid() {fxt.Test__parse("a -- b" , "(a AND b)");} // NOTE: scanner will remove spaces and convert to "a", "--", "b" + @Test public void Not__dupe__2() {fxt.Test__parse("a --b" , "(a AND b)");} + @Test public void Not__dupe__3() {fxt.Test__parse("a ---b" , "(a AND NOT b)");} + @Test public void Not__parens() {fxt.Test__parse("a -(b + c)" , "(a AND NOT (b AND c))");} + @Test public void Escape__eos() {fxt.Test__parse("\\" , "");} + @Test public void Escape__escaped() {fxt.Test__parse("\\\\*" , "\\*");} // '\\' -> '\*' } class Srch_crt_parser_fxt { private final Srch_crt_parser crt_parser; diff --git a/400_xowa/src/gplx/xowa/addons/wikis/searchs/searchers/crts/Srch_crt_scanner_tst.java b/400_xowa/src/gplx/xowa/addons/wikis/searchs/searchers/crts/Srch_crt_scanner_tst.java index b64426b31..31c91c7bf 100644 --- a/400_xowa/src/gplx/xowa/addons/wikis/searchs/searchers/crts/Srch_crt_scanner_tst.java +++ b/400_xowa/src/gplx/xowa/addons/wikis/searchs/searchers/crts/Srch_crt_scanner_tst.java @@ -1,49 +1,49 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.addons.wikis.searchs.searchers.crts; import gplx.*; import gplx.xowa.*; import gplx.xowa.addons.*; import gplx.xowa.addons.wikis.*; import gplx.xowa.addons.wikis.searchs.*; import gplx.xowa.addons.wikis.searchs.searchers.*; import org.junit.*; import gplx.xowa.addons.wikis.searchs.parsers.*; public class Srch_crt_scanner_tst { private final Srch_crt_scanner_fxt fxt = new Srch_crt_scanner_fxt(); - @Test public void Word() {fxt.Test__scan("abc" , "abc");} - @Test public void Word__many() {fxt.Test__scan("abc d ef" , "abc", "d", "ef");} - @Test public void Word__symbol() {fxt.Test__scan("a; b" , "a;", "b");} - @Test public void And() {fxt.Test__scan("a + b" , "a", "+", "b");} - @Test public void And__parens() {fxt.Test__scan("a +(b)" , "a", "+", "(", "b", ")");} // check that ( causes and to be treated as separate word - @Test public void Or() {fxt.Test__scan("a , b" , "a", ",", "b");} - @Test public void Or__no_space() {fxt.Test__scan("a, b" , "a", ",", "b");} - @Test public void Not() {fxt.Test__scan("-abc" , "-", "abc");} - @Test public void Not__mid__1() {fxt.Test__scan("a-b" , "a-b");} // fails if "a", "-", "b" - @Test public void Not__mid__2() {fxt.Test__scan("a b-c" , "a", "b-c");} // ignore - if in middle of word - @Test public void Not__and() {fxt.Test__scan("a -bc" , "a", "-", "bc");} // auto-add AND for - - @Test public void Not__dangling() {fxt.Test__scan("a -" , "a", "-");} - @Test public void Space() {fxt.Test__scan(" a b " , "a", "b");} // spaces should not generate tkns - @Test public void Quote() {fxt.Test__scan("\"a b\"" , "a b");} - @Test public void Quote__mid() {fxt.Test__scan("a\"b" , "a", "b");} - @Test public void Quote__double() {fxt.Test__scan("\"a\"\"b\"" , "a\"b");} - @Test public void Quote__missing__one() {fxt.Test__scan("\"abc" , "abc");} - @Test public void Quote__missing__many() {fxt.Test__scan("\"abc a" , "abc", "a");} - @Test public void Escape__bgn() {fxt.Test__scan("\\-a" , "-a");} // fails if "-", "a" - @Test public void Escape__and__bgn() {fxt.Test__scan("\\+" , "+");} // fails if "a", "&", "b" - @Test public void Escape__and__mid() {fxt.Test__scan("a\\+b" , "a+b");} // fails if "a", "&", "b" - @Test public void Escape__eos__1() {fxt.Test__scan("\\" , String_.Ary_empty);} - @Test public void Escape__eos__2() {fxt.Test__scan("a \\" , "a");} - @Test public void Escape__eos__3() {fxt.Test__scan("a\\" , "a");} - @Test public void Escape__many() {fxt.Test__scan("c\\+\\+" , "c++");} - @Test public void Escape__end() {fxt.Test__scan("a\\\\" , "a\\");} - @Test public void Complicated() {fxt.Test__scan("(a + \"b\") , -c", "(", "a", "+", "b", ")", ",", "-", "c");} + @Test public void Word() {fxt.Test__scan("abc" , "abc");} + @Test public void Word__many() {fxt.Test__scan("abc d ef" , "abc", "d", "ef");} + @Test public void Word__symbol() {fxt.Test__scan("a; b" , "a;", "b");} + @Test public void And() {fxt.Test__scan("a + b" , "a", "+", "b");} + @Test public void And__parens() {fxt.Test__scan("a +(b)" , "a", "+", "(", "b", ")");} // check that ( causes and to be treated as separate word + @Test public void Or() {fxt.Test__scan("a , b" , "a", ",", "b");} + @Test public void Or__no_space() {fxt.Test__scan("a, b" , "a", ",", "b");} + @Test public void Not() {fxt.Test__scan("-abc" , "-", "abc");} + @Test public void Not__mid__1() {fxt.Test__scan("a-b" , "a-b");} // fails if "a", "-", "b" + @Test public void Not__mid__2() {fxt.Test__scan("a b-c" , "a", "b-c");} // ignore - if in middle of word + @Test public void Not__and() {fxt.Test__scan("a -bc" , "a", "-", "bc");} // auto-add AND for - + @Test public void Not__dangling() {fxt.Test__scan("a -" , "a", "-");} + @Test public void Space() {fxt.Test__scan(" a b " , "a", "b");} // spaces should not generate tkns + @Test public void Quote() {fxt.Test__scan("\"a b\"" , "a b");} + @Test public void Quote__mid() {fxt.Test__scan("a\"b" , "a", "b");} + @Test public void Quote__double() {fxt.Test__scan("\"a\"\"b\"" , "a\"b");} + @Test public void Quote__missing__one() {fxt.Test__scan("\"abc" , "abc");} + @Test public void Quote__missing__many() {fxt.Test__scan("\"abc a" , "abc", "a");} + @Test public void Escape__bgn() {fxt.Test__scan("\\-a" , "-a");} // fails if "-", "a" + @Test public void Escape__and__bgn() {fxt.Test__scan("\\+" , "+");} // fails if "a", "&", "b" + @Test public void Escape__and__mid() {fxt.Test__scan("a\\+b" , "a+b");} // fails if "a", "&", "b" + @Test public void Escape__eos__1() {fxt.Test__scan("\\" , String_.Ary_empty);} + @Test public void Escape__eos__2() {fxt.Test__scan("a \\" , "a");} + @Test public void Escape__eos__3() {fxt.Test__scan("a\\" , "a");} + @Test public void Escape__many() {fxt.Test__scan("c\\+\\+" , "c++");} + @Test public void Escape__end() {fxt.Test__scan("a\\\\" , "a\\");} + @Test public void Complicated() {fxt.Test__scan("(a + \"b\") , -c", "(", "a", "+", "b", ")", ",", "-", "c");} } class Srch_crt_scanner_fxt { private final Srch_crt_scanner scanner; diff --git a/400_xowa/src/gplx/xowa/addons/wikis/searchs/searchers/crts/Srch_crt_sql_tst.java b/400_xowa/src/gplx/xowa/addons/wikis/searchs/searchers/crts/Srch_crt_sql_tst.java index e94d18103..7ba1dd0ef 100644 --- a/400_xowa/src/gplx/xowa/addons/wikis/searchs/searchers/crts/Srch_crt_sql_tst.java +++ b/400_xowa/src/gplx/xowa/addons/wikis/searchs/searchers/crts/Srch_crt_sql_tst.java @@ -1,27 +1,27 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.addons.wikis.searchs.searchers.crts; import gplx.*; import gplx.xowa.*; import gplx.xowa.addons.*; import gplx.xowa.addons.wikis.*; import gplx.xowa.addons.wikis.searchs.*; import gplx.xowa.addons.wikis.searchs.searchers.*; import org.junit.*; public class Srch_crt_sql_tst { private final Srch_crt_sql_fxt fxt = new Srch_crt_sql_fxt(); - @Test public void Eq() {fxt.Exec__new_or_null("a").Test__tid(Srch_crt_sql.Tid__eq).Test__eq("a");} - @Test public void Rng() {fxt.Exec__new_or_null("a*").Test__tid(Srch_crt_sql.Tid__rng).Test__rng_bgn("a").Test__rng_end("b").Test__pattern("a*");} - @Test public void Like() {fxt.Exec__new_or_null("a*b").Test__tid(Srch_crt_sql.Tid__like).Test__like("a%b").Test__pattern("a*b");} - @Test public void Like__escape() {fxt.Exec__new_or_null("a|\\*b").Test__tid(Srch_crt_sql.Tid__like).Test__like("a|\\%b").Test__pattern("a\\*b");} // "a\*b" - @Test public void Quote() {fxt.Exec__new_or_null("\"a b\"").Test__tid(Srch_crt_sql.Tid__eq).Test__eq("\"a b\"");} + @Test public void Eq() {fxt.Exec__new_or_null("a").Test__tid(Srch_crt_sql.Tid__eq).Test__eq("a");} + @Test public void Rng() {fxt.Exec__new_or_null("a*").Test__tid(Srch_crt_sql.Tid__rng).Test__rng_bgn("a").Test__rng_end("b").Test__pattern("a*");} + @Test public void Like() {fxt.Exec__new_or_null("a*b").Test__tid(Srch_crt_sql.Tid__like).Test__like("a%b").Test__pattern("a*b");} + @Test public void Like__escape() {fxt.Exec__new_or_null("a|\\*b").Test__tid(Srch_crt_sql.Tid__like).Test__like("a|\\%b").Test__pattern("a\\*b");} // "a\*b" + @Test public void Quote() {fxt.Exec__new_or_null("\"a b\"").Test__tid(Srch_crt_sql.Tid__eq).Test__eq("\"a b\"");} } class Srch_crt_sql_fxt { private Srch_crt_sql actl; diff --git a/400_xowa/src/gplx/xowa/addons/wikis/searchs/searchers/rslts/Srch_rslt_row_tst.java b/400_xowa/src/gplx/xowa/addons/wikis/searchs/searchers/rslts/Srch_rslt_row_tst.java index 40052747f..25ecc2d4c 100644 --- a/400_xowa/src/gplx/xowa/addons/wikis/searchs/searchers/rslts/Srch_rslt_row_tst.java +++ b/400_xowa/src/gplx/xowa/addons/wikis/searchs/searchers/rslts/Srch_rslt_row_tst.java @@ -1,23 +1,23 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.addons.wikis.searchs.searchers.rslts; import gplx.*; import gplx.xowa.*; import gplx.xowa.addons.*; import gplx.xowa.addons.wikis.*; import gplx.xowa.addons.wikis.searchs.*; import gplx.xowa.addons.wikis.searchs.searchers.*; import org.junit.*; import gplx.core.tests.*; public class Srch_rslt_row_tst { private final Srch_rslt_row_fxt fxt = new Srch_rslt_row_fxt(); - @Test public void To_display() { + @Test public void To_display() { Srch_rslt_row row_straight = fxt.Make__row_straight("Ab", "Ab"); Srch_rslt_row row_redirect = fxt.Make__row_redirect("Ab", "Ab", "C"); diff --git a/400_xowa/src/gplx/xowa/addons/wikis/searchs/searchers/wkrs/Srch_link_wkr_sql_tst.java b/400_xowa/src/gplx/xowa/addons/wikis/searchs/searchers/wkrs/Srch_link_wkr_sql_tst.java index fb54670e4..209bd0db4 100644 --- a/400_xowa/src/gplx/xowa/addons/wikis/searchs/searchers/wkrs/Srch_link_wkr_sql_tst.java +++ b/400_xowa/src/gplx/xowa/addons/wikis/searchs/searchers/wkrs/Srch_link_wkr_sql_tst.java @@ -1,23 +1,23 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.addons.wikis.searchs.searchers.wkrs; import gplx.*; import gplx.xowa.*; import gplx.xowa.addons.*; import gplx.xowa.addons.wikis.*; import gplx.xowa.addons.wikis.searchs.*; import gplx.xowa.addons.wikis.searchs.searchers.*; import org.junit.*; import gplx.xowa.addons.wikis.searchs.parsers.*; import gplx.xowa.addons.wikis.searchs.searchers.crts.*; import gplx.xowa.addons.wikis.searchs.searchers.crts.visitors.*; public class Srch_link_wkr_sql_tst { private final Srch_link_wkr_sql_fxt fxt = new Srch_link_wkr_sql_fxt(); - @Test public void Rng() { + @Test public void Rng() { fxt.Run__search("a").Test__eq ( "select" ); diff --git a/400_xowa/src/gplx/xowa/addons/wikis/searchs/searchers/wkrs/Srch_page_tbl_wkr_tst.java b/400_xowa/src/gplx/xowa/addons/wikis/searchs/searchers/wkrs/Srch_page_tbl_wkr_tst.java index 3e6fa88c8..3a7f652ac 100644 --- a/400_xowa/src/gplx/xowa/addons/wikis/searchs/searchers/wkrs/Srch_page_tbl_wkr_tst.java +++ b/400_xowa/src/gplx/xowa/addons/wikis/searchs/searchers/wkrs/Srch_page_tbl_wkr_tst.java @@ -1,33 +1,33 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.addons.wikis.searchs.searchers.wkrs; import gplx.*; import gplx.xowa.*; import gplx.xowa.addons.*; import gplx.xowa.addons.wikis.*; import gplx.xowa.addons.wikis.searchs.*; import gplx.xowa.addons.wikis.searchs.searchers.*; import org.junit.*; import gplx.xowa.addons.wikis.searchs.parsers.*; import gplx.xowa.addons.wikis.searchs.searchers.crts.*; import gplx.xowa.addons.wikis.searchs.searchers.crts.visitors.*; public class Srch_page_tbl_wkr_tst { private final Srch_page_tbl_wkr_fxt fxt = new Srch_page_tbl_wkr_fxt(); - @Test public void Word__one() {fxt.Test__to_bry_or_null("a" , "a");} - @Test public void Word__many() {fxt.Test__to_bry_or_null("a b c" , "a b c");} - @Test public void Wild__end() {fxt.Test__to_bry_or_null("a*" , "a");} - @Test public void Wild__both() {fxt.Test__to_bry_or_null("a*b*" , null);} - @Test public void Quote() {fxt.Test__to_bry_or_null("\"a b\"" , "a b");} - @Test public void Quote__mixed() {fxt.Test__to_bry_or_null("a \"b \"\" c\" d" , "a b \" c d");} - @Test public void Escape() {fxt.Test__to_bry_or_null("a\\+" , "a+");} - @Test public void Not() {fxt.Test__to_bry_or_null("a -b" , null);} - @Test public void And() {fxt.Test__to_bry_or_null("a + b" , null);} - @Test public void Or() {fxt.Test__to_bry_or_null("a , b" , null);} - @Test public void Parens() {fxt.Test__to_bry_or_null("(a)" , null);} + @Test public void Word__one() {fxt.Test__to_bry_or_null("a" , "a");} + @Test public void Word__many() {fxt.Test__to_bry_or_null("a b c" , "a b c");} + @Test public void Wild__end() {fxt.Test__to_bry_or_null("a*" , "a");} + @Test public void Wild__both() {fxt.Test__to_bry_or_null("a*b*" , null);} + @Test public void Quote() {fxt.Test__to_bry_or_null("\"a b\"" , "a b");} + @Test public void Quote__mixed() {fxt.Test__to_bry_or_null("a \"b \"\" c\" d" , "a b \" c d");} + @Test public void Escape() {fxt.Test__to_bry_or_null("a\\+" , "a+");} + @Test public void Not() {fxt.Test__to_bry_or_null("a -b" , null);} + @Test public void And() {fxt.Test__to_bry_or_null("a + b" , null);} + @Test public void Or() {fxt.Test__to_bry_or_null("a , b" , null);} + @Test public void Parens() {fxt.Test__to_bry_or_null("(a)" , null);} } class Srch_page_tbl_wkr_fxt { private final Srch_crt_parser crt_parser; diff --git a/400_xowa/src/gplx/xowa/addons/wikis/searchs/specials/htmls/Srch_html_page_bldr_tst.java b/400_xowa/src/gplx/xowa/addons/wikis/searchs/specials/htmls/Srch_html_page_bldr_tst.java index fe729912a..f2eef5482 100644 --- a/400_xowa/src/gplx/xowa/addons/wikis/searchs/specials/htmls/Srch_html_page_bldr_tst.java +++ b/400_xowa/src/gplx/xowa/addons/wikis/searchs/specials/htmls/Srch_html_page_bldr_tst.java @@ -1,18 +1,18 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.addons.wikis.searchs.specials.htmls; import gplx.*; import gplx.xowa.*; import gplx.xowa.addons.*; import gplx.xowa.addons.wikis.*; import gplx.xowa.addons.wikis.searchs.*; import gplx.xowa.addons.wikis.searchs.specials.*; import org.junit.*; import gplx.xowa.htmls.core.htmls.utls.*; import gplx.xowa.wikis.tdbs.*; import gplx.xowa.wikis.domains.*; @@ -20,13 +20,13 @@ import gplx.xowa.wikis.data.tbls.*; import gplx.xowa.addons.wikis.searchs.searchers.*; import gplx.xowa.addons.wikis.searchs.searchers.rslts.*; public class Srch_html_page_bldr_tst { @Before public void init() {fxt.Clear();} private Srch_html_page_bldr_fxt fxt = new Srch_html_page_bldr_fxt(); - @Test public void Paging() { + @Test public void Paging() { fxt.Test_paging(Bool_.Y, 1, "Next"); fxt.Test_paging(Bool_.N, 1, "Previous"); fxt.Test_paging(Bool_.Y, 2, "Next"); fxt.Test_paging(Bool_.N, 0, " "); } - @Test public void Rows() { + @Test public void Rows() { fxt.Test_rows(new Srch_rslt_row[] {fxt.Make_row(10, "A"), fxt.Make_row(20, "B")}, String_.Concat_lines_nl_skip_last ( "" , " " // ISSUE#:462; DATE:2019-05-12 diff --git a/400_xowa/src/gplx/xowa/addons/wikis/searchs/specials/htmls/Srch_rslt_cbk_tst.java b/400_xowa/src/gplx/xowa/addons/wikis/searchs/specials/htmls/Srch_rslt_cbk_tst.java index 33362c616..a50909e4d 100644 --- a/400_xowa/src/gplx/xowa/addons/wikis/searchs/specials/htmls/Srch_rslt_cbk_tst.java +++ b/400_xowa/src/gplx/xowa/addons/wikis/searchs/specials/htmls/Srch_rslt_cbk_tst.java @@ -1,23 +1,23 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.addons.wikis.searchs.specials.htmls; import gplx.*; import gplx.xowa.*; import gplx.xowa.addons.*; import gplx.xowa.addons.wikis.*; import gplx.xowa.addons.wikis.searchs.*; import gplx.xowa.addons.wikis.searchs.specials.*; import org.junit.*; import gplx.xowa.htmls.core.htmls.utls.*; import gplx.xowa.guis.cbks.js.*; import gplx.xowa.addons.wikis.searchs.searchers.rslts.*; public class Srch_rslt_cbk_tst { @Before public void init() {fxt.Clear();} private Srch_rslt_cbk_fxt fxt = new Srch_rslt_cbk_fxt(); - @Test public void Basic() {// ISSUE#:462; DATE:2019-05-12 + @Test public void Basic() {// ISSUE#:462; DATE:2019-05-12 fxt.Test_add(fxt.Make_rslt(50, "L"), fxt.Make_args_append("xowa_insert_w" , "w|L")); // insert new fxt.Test_add(fxt.Make_rslt(30, "N"), fxt.Make_args_append("xowa_insert_w" , "w|N")); // insert below last fxt.Test_add(fxt.Make_rslt(70, "J"), fxt.Make_args_append("w|L" , "w|J")); // insert above first diff --git a/400_xowa/src/gplx/xowa/apps/Xoa_app_eval_tst.java b/400_xowa/src/gplx/xowa/apps/Xoa_app_eval_tst.java index 8150156f5..408b035c3 100644 --- a/400_xowa/src/gplx/xowa/apps/Xoa_app_eval_tst.java +++ b/400_xowa/src/gplx/xowa/apps/Xoa_app_eval_tst.java @@ -1,18 +1,18 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.apps; import gplx.*; import gplx.xowa.*; import org.junit.*; import gplx.core.brys.fmtrs.*; @@ -20,7 +20,7 @@ import gplx.xowa.apps.gfs.*; public class Xoa_app_eval_tst { Xoa_app_eval_fxt fxt = new Xoa_app_eval_fxt(); @Before public void init() {fxt.Clear();} - @Test public void Basic() { + @Test public void Basic() { fxt.Eval_test("[~{<>app.sys_cfg.version;<>}]", "[" + Xoa_app_.Version + "]"); } } diff --git a/400_xowa/src/gplx/xowa/apps/Xoa_shell_tst.java b/400_xowa/src/gplx/xowa/apps/Xoa_shell_tst.java index df5ad6f49..d576e70f3 100644 --- a/400_xowa/src/gplx/xowa/apps/Xoa_shell_tst.java +++ b/400_xowa/src/gplx/xowa/apps/Xoa_shell_tst.java @@ -13,16 +13,16 @@ The terms of each license can be found in the source code repository: GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt */ -package gplx.xowa.apps; import gplx.*; import gplx.xowa.*; -import org.junit.*; import gplx.xowa.apps.gfs.*; -public class Xoa_shell_tst { - @Test public void Fetch_page() { // PURPOSE.fix: fetch_page failed with nullRef; DATE:2013-04-12 - Xop_fxt parser_fxt = new Xop_fxt(); - Xoae_app app = parser_fxt.App(); Xowe_wiki wiki = parser_fxt.Wiki(); - parser_fxt.Init_page_create("A", "test"); // need to create page in order for html output to gen - wiki.Html_mgr().Page_wtr_mgr().Html_capable_(true); // need to set html_capable in order for div_home to load - Xoa_gfs_mgr.Msg_parser_init(); - wiki.Html_mgr().Portal_mgr().Div_home_fmtr().Fmt_("~{<>app.user.msgs.get('mainpage-description');<>}"); - app.Gfs_mgr().Run_str("app.shell.fetch_page('en.wikipedia.org/wiki/A' 'html');"); // this causes a nullRef error b/c app.user.lang is null - } -} +package gplx.xowa.apps; import gplx.*; import gplx.xowa.*; +import org.junit.*; import gplx.xowa.apps.gfs.*; +public class Xoa_shell_tst { + @Test public void Fetch_page() { // PURPOSE.fix: fetch_page failed with nullRef; DATE:2013-04-12 + Xop_fxt parser_fxt = new Xop_fxt(); + Xoae_app app = parser_fxt.App(); Xowe_wiki wiki = parser_fxt.Wiki(); + parser_fxt.Init_page_create("A", "test"); // need to create page in order for html output to gen + wiki.Html_mgr().Page_wtr_mgr().Html_capable_(true); // need to set html_capable in order for div_home to load + Xoa_gfs_mgr.Msg_parser_init(); + wiki.Html_mgr().Portal_mgr().Div_home_fmtr().Fmt_("~{<>app.user.msgs.get('mainpage-description');<>}"); + app.Gfs_mgr().Run_str("app.shell.fetch_page('en.wikipedia.org/wiki/A' 'html');"); // this causes a nullRef error b/c app.user.lang is null + } +} diff --git a/400_xowa/src/gplx/xowa/apps/apis/xowa/addons/bldrs/Xopg_match_mgr__tst.java b/400_xowa/src/gplx/xowa/apps/apis/xowa/addons/bldrs/Xopg_match_mgr__tst.java index f10d892e9..d36fd60de 100644 --- a/400_xowa/src/gplx/xowa/apps/apis/xowa/addons/bldrs/Xopg_match_mgr__tst.java +++ b/400_xowa/src/gplx/xowa/apps/apis/xowa/addons/bldrs/Xopg_match_mgr__tst.java @@ -1,45 +1,45 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.apps.apis.xowa.addons.bldrs; import gplx.*; import gplx.xowa.*; import gplx.xowa.apps.*; import gplx.xowa.apps.apis.*; import gplx.xowa.apps.apis.xowa.*; import gplx.xowa.apps.apis.xowa.addons.*; import org.junit.*; import gplx.core.tests.*; public class Xopg_match_mgr__tst { private final Xopg_match_mgr__fxt fxt = new Xopg_match_mgr__fxt(); @Before public void init() {fxt.Clear();} - @Test public void Specific() { + @Test public void Specific() { fxt.Init__set("en.w:A"); fxt.Test__match_y("A"); fxt.Test__match_n("AB"); } - @Test public void Other_wiki() { + @Test public void Other_wiki() { fxt.Init__set("fr.w:A"); fxt.Test__match_n("A"); // note that test defaults to "en.w" as primary wiki } - @Test public void Wildcard__app() { + @Test public void Wildcard__app() { fxt.Init__set("*"); fxt.Test__match_y("A", "B"); } - @Test public void Wildcard__page() { + @Test public void Wildcard__page() { fxt.Init__set("en.w:*"); fxt.Test__match_y("A", "B"); } - @Test public void Wildcard__page__other() { + @Test public void Wildcard__page__other() { fxt.Init__set("fr.w:*"); fxt.Test__match_n("A", "B"); } - @Test public void Wildcard__wiki() { + @Test public void Wildcard__wiki() { fxt.Init__set("*:A"); fxt.Test__match_y("A"); fxt.Test__match_n("B"); diff --git a/400_xowa/src/gplx/xowa/apps/cfgs/Xowc_xtn_pages_tst.java b/400_xowa/src/gplx/xowa/apps/cfgs/Xowc_xtn_pages_tst.java index ef719d09c..3f755392c 100644 --- a/400_xowa/src/gplx/xowa/apps/cfgs/Xowc_xtn_pages_tst.java +++ b/400_xowa/src/gplx/xowa/apps/cfgs/Xowc_xtn_pages_tst.java @@ -1,30 +1,30 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.apps.cfgs; import gplx.*; import gplx.xowa.*; import gplx.xowa.apps.*; import org.junit.*; import gplx.xowa.wikis.*; import gplx.xowa.wikis.nss.*; public class Xowc_xtn_pages_tst { @Before public void init() {fxt.Clear();} private Xowc_xtn_pages_fxt fxt = new Xowc_xtn_pages_fxt(); - @Test public void Init() { + @Test public void Init() { fxt.Init_ns(200, "Foreign_page").Init_ns(201, "Foreign_page_talk").Init_ns(202, "Foreign_index").Init_ns(203, "Foreign_index_talk"); // ns set by fxt.Init_names("Foreign_page", "Foreign_page_talk", "Foreign_index", "Foreign_index_talk"); // ns set by .gfs files in /user/wiki/#cfg fxt.Exec_init(); fxt.Test_ns_ids(200, 201, 202, 203); fxt.Test_ns_canonical("Page", "Page_talk", "Index", "Index_talk"); } - @Test public void Spaces() { // PURPOSE: ensure underlines, not space; EX:"Mục_lục" not "Mục lục"; PAGE:vi.s:Việt_Nam_sử_lược/Quyển_II DATE:2015-10-27 + @Test public void Spaces() { // PURPOSE: ensure underlines, not space; EX:"Mục_lục" not "Mục lục"; PAGE:vi.s:Việt_Nam_sử_lược/Quyển_II DATE:2015-10-27 fxt.Init_ns(200, "Foreign_page").Init_ns(201, "Foreign_page_talk").Init_ns(202, "Foreign_index").Init_ns(203, "Foreign_index_talk"); // ns set by fxt.Init_names("Foreign page", "Foreign page talk", "Foreign index", "Foreign index talk"); // ns set by .gfs files in /user/wiki/#cfg fxt.Exec_init(); diff --git a/400_xowa/src/gplx/xowa/apps/fmtrs/Xoa_fmtr_itm_tst.java b/400_xowa/src/gplx/xowa/apps/fmtrs/Xoa_fmtr_itm_tst.java index cd23a65e1..049eb6dbb 100644 --- a/400_xowa/src/gplx/xowa/apps/fmtrs/Xoa_fmtr_itm_tst.java +++ b/400_xowa/src/gplx/xowa/apps/fmtrs/Xoa_fmtr_itm_tst.java @@ -1,23 +1,23 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.apps.fmtrs; import gplx.*; import gplx.xowa.*; import gplx.xowa.apps.*; import org.junit.*; import gplx.langs.gfs.*; public class Xoa_fmtr_itm_tst { @Before public void init() {fxt.Clear();} private Xoa_fmtr_itm_fxt fxt = new Xoa_fmtr_itm_fxt(); - @Test public void Basic() { + @Test public void Basic() { fxt.Init_src("app.wikis;"); fxt.Init_fmt("domain=~{<>domain;<>};"); fxt.Test_run("domain=en.wikipedia.org;"); diff --git a/400_xowa/src/gplx/xowa/apps/fsys/Xoa_url_finder_tst.java b/400_xowa/src/gplx/xowa/apps/fsys/Xoa_url_finder_tst.java index 056f5e3b2..489fb279f 100644 --- a/400_xowa/src/gplx/xowa/apps/fsys/Xoa_url_finder_tst.java +++ b/400_xowa/src/gplx/xowa/apps/fsys/Xoa_url_finder_tst.java @@ -1,24 +1,24 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.apps.fsys; import gplx.*; import gplx.xowa.*; import gplx.xowa.apps.*; import org.junit.*; import gplx.core.tests.*; import gplx.xowa.users.*; public class Xoa_url_finder_tst { private final Xoa_url_finder_fxt fxt = new Xoa_url_finder_fxt(); - @Test public void Find_by_css_or_null() { + @Test public void Find_by_css_or_null() { // init String wiki = "en.wikipedia.org"; String file = "logo_night.png"; diff --git a/400_xowa/src/gplx/xowa/apps/gfs/Gfs_php_converter__to_gfs__tst.java b/400_xowa/src/gplx/xowa/apps/gfs/Gfs_php_converter__to_gfs__tst.java index 60e7d21d5..fc7a0f1ad 100644 --- a/400_xowa/src/gplx/xowa/apps/gfs/Gfs_php_converter__to_gfs__tst.java +++ b/400_xowa/src/gplx/xowa/apps/gfs/Gfs_php_converter__to_gfs__tst.java @@ -1,23 +1,23 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.apps.gfs; import gplx.*; import gplx.xowa.*; import gplx.xowa.apps.*; import org.junit.*; public class Gfs_php_converter__to_gfs__tst { @Before public void init() {fxt.Clear();} private final Gfs_php_converter_fxt fxt = new Gfs_php_converter_fxt(); - @Test public void Escape_sequences() { + @Test public void Escape_sequences() { fxt.Test__to_gfs("a\\\"b" , "a\"b"); fxt.Test__to_gfs("a\\'b" , "a'b"); fxt.Test__to_gfs("a\\$b" , "a$b"); @@ -29,10 +29,10 @@ public class Gfs_php_converter__to_gfs__tst { fxt.Test__to_gfs("a\\\\b\\'c\\\"d\\$e" , "a\\b'c\"d$e"); // backslash.escape fxt.Test__to_gfs("\\" , "\\"); // backslash.eos; eos, but nothing to escape; render self but dont fail } - @Test public void Tilde() { + @Test public void Tilde() { fxt.Test__to_gfs("a~b" , "a~~b"); // tilde.escape } - @Test public void Arguments() { + @Test public void Arguments() { fxt.Test__to_gfs("a$1b" , "a~{0}b"); // dollar fxt.Test__to_gfs("a $ b" , "a $ b"); // noop } diff --git a/400_xowa/src/gplx/xowa/apps/gfs/Gfs_php_converter__to_php__tst.java b/400_xowa/src/gplx/xowa/apps/gfs/Gfs_php_converter__to_php__tst.java index 89474a359..9ec1fca85 100644 --- a/400_xowa/src/gplx/xowa/apps/gfs/Gfs_php_converter__to_php__tst.java +++ b/400_xowa/src/gplx/xowa/apps/gfs/Gfs_php_converter__to_php__tst.java @@ -13,16 +13,16 @@ The terms of each license can be found in the source code repository: GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt */ -package gplx.xowa.apps.gfs; import gplx.*; import gplx.xowa.*; import gplx.xowa.apps.*; -import org.junit.*; -public class Gfs_php_converter__to_php__tst { - @Before public void init() {fxt.Clear();} private final Gfs_php_converter_fxt fxt = new Gfs_php_converter_fxt(); - @Test public void Xto_php() { - fxt.Test_Xto_php_escape_y("a~{0}b" , "a$1b"); // tilde.arg.one - fxt.Test_Xto_php_escape_y("a~{0}b~{1}c~{2}d" , "a$1b$2c$3d"); // tilde.arg.many - fxt.Test_Xto_php_escape_y("a~{9}" , "a$10"); // tilde.arg.9 -> 10 - fxt.Test_Xto_php_escape_y("a~~b" , "a~b"); // tilde.escape - fxt.Test_Xto_php_escape_y("a\\b'c\"d$e" , "a\\\\b\\'c\\\"d\\$e"); // backslash.escape_y - fxt.Test_Xto_php_escape_n("a\\b'c\"d$e" , "a\\b'c\"d$e"); // backslash.escape_n - } -} +package gplx.xowa.apps.gfs; import gplx.*; import gplx.xowa.*; import gplx.xowa.apps.*; +import org.junit.*; +public class Gfs_php_converter__to_php__tst { + @Before public void init() {fxt.Clear();} private final Gfs_php_converter_fxt fxt = new Gfs_php_converter_fxt(); + @Test public void Xto_php() { + fxt.Test_Xto_php_escape_y("a~{0}b" , "a$1b"); // tilde.arg.one + fxt.Test_Xto_php_escape_y("a~{0}b~{1}c~{2}d" , "a$1b$2c$3d"); // tilde.arg.many + fxt.Test_Xto_php_escape_y("a~{9}" , "a$10"); // tilde.arg.9 -> 10 + fxt.Test_Xto_php_escape_y("a~~b" , "a~b"); // tilde.escape + fxt.Test_Xto_php_escape_y("a\\b'c\"d$e" , "a\\\\b\\'c\\\"d\\$e"); // backslash.escape_y + fxt.Test_Xto_php_escape_n("a\\b'c\"d$e" , "a\\b'c\"d$e"); // backslash.escape_n + } +} diff --git a/400_xowa/src/gplx/xowa/apps/gfs/Xoa_gfs_mgr.java b/400_xowa/src/gplx/xowa/apps/gfs/Xoa_gfs_mgr.java index bb6d97f85..1af28a217 100644 --- a/400_xowa/src/gplx/xowa/apps/gfs/Xoa_gfs_mgr.java +++ b/400_xowa/src/gplx/xowa/apps/gfs/Xoa_gfs_mgr.java @@ -1,21 +1,33 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ -package gplx.xowa.apps.gfs; import gplx.*; import gplx.xowa.*; import gplx.xowa.apps.*; -import gplx.langs.gfs.*; -import gplx.xowa.users.*; import gplx.xowa.apps.fsys.*; +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ +package gplx.xowa.apps.gfs; import gplx.Err_; +import gplx.GfoMsg; +import gplx.Gfo_invk; +import gplx.Gfo_invk_; +import gplx.Gfo_invk_root_wkr; +import gplx.Gfo_usr_dlg_; +import gplx.GfsCtx; +import gplx.Io_mgr; +import gplx.Io_url; +import gplx.String_; +import gplx.langs.gfs.GfsCore; +import gplx.langs.gfs.Gfs_wtr; +import gplx.xowa.Xoae_app; +import gplx.xowa.apps.Xoa_app_eval; +import gplx.xowa.apps.fsys.Xoa_fsys_mgr; public class Xoa_gfs_mgr implements Gfo_invk, Gfo_invk_root_wkr { private final String user_name; public Xoa_gfs_mgr(String user_name, Gfo_invk root_invk, Xoa_fsys_mgr app_fsys_mgr) { @@ -41,7 +53,7 @@ public class Xoa_gfs_mgr implements Gfo_invk, Gfo_invk_root_wkr { public Object Run_str_for(Gfo_invk invk, GfoMsg root_msg) { try { Object rv = null; - GfsCtx ctx = GfsCtx.new_().Fail_if_unhandled_(Fail_if_unhandled).Usr_dlg_(Gfo_usr_dlg_.Instance); + GfsCtx ctx = GfsCtx.new_().Fail_if_unhandled_(Fail_if_unhandled); int len = root_msg.Subs_count(); for (int i = 0; i < len; ++i) rv = GfsCore.Instance.ExecOne_to(ctx, invk, root_msg.Subs_getAt(i)); diff --git a/400_xowa/src/gplx/xowa/apps/servers/http/Http_server_page__tst.java b/400_xowa/src/gplx/xowa/apps/servers/http/Http_server_page__tst.java index ac4a3b504..5b968244a 100644 --- a/400_xowa/src/gplx/xowa/apps/servers/http/Http_server_page__tst.java +++ b/400_xowa/src/gplx/xowa/apps/servers/http/Http_server_page__tst.java @@ -1,23 +1,23 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.apps.servers.http; import gplx.*; import gplx.xowa.*; import gplx.xowa.apps.*; import gplx.xowa.apps.servers.*; import org.junit.*; import gplx.core.tests.*; public class Http_server_page__tst { private final Http_server_page__fxt fxt = new Http_server_page__fxt(); - @Test public void Xwiki() { + @Test public void Xwiki() { fxt.Init__xwiki("en.wikipedia.org", "it", "it.wikipedia.org"); fxt.Test__make_url(false, "en.wikipedia.org", "it:Roma", ""); fxt.Test__redirect("it.wikipedia.org/wiki/Roma"); diff --git a/400_xowa/src/gplx/xowa/apps/servers/http/Http_server_wkr__tst.java b/400_xowa/src/gplx/xowa/apps/servers/http/Http_server_wkr__tst.java index 98e6b4345..73522b6c7 100644 --- a/400_xowa/src/gplx/xowa/apps/servers/http/Http_server_wkr__tst.java +++ b/400_xowa/src/gplx/xowa/apps/servers/http/Http_server_wkr__tst.java @@ -1,23 +1,23 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.apps.servers.http; import gplx.*; import gplx.xowa.*; import gplx.xowa.apps.*; import gplx.xowa.apps.servers.*; import org.junit.*; public class Http_server_wkr__tst { @Before public void init() {fxt.Clear();} private Http_server_wkr__fxt fxt = new Http_server_wkr__fxt(); - @Test public void Assert_main_page() { + @Test public void Assert_main_page() { fxt.Init_wiki_main_page("fr.wikiversity.org", "Accueil"); fxt.Test_assert_main_page("/fr.wikiversity.org/" , "/fr.wikiversity.org/wiki/Accueil"); fxt.Test_assert_main_page("/fr.wikiversity.org/wiki" , "/fr.wikiversity.org/wiki/Accueil"); diff --git a/400_xowa/src/gplx/xowa/apps/servers/http/Http_server_wkr_fsys_hack__tst.java b/400_xowa/src/gplx/xowa/apps/servers/http/Http_server_wkr_fsys_hack__tst.java index 07e9a591f..608002012 100644 --- a/400_xowa/src/gplx/xowa/apps/servers/http/Http_server_wkr_fsys_hack__tst.java +++ b/400_xowa/src/gplx/xowa/apps/servers/http/Http_server_wkr_fsys_hack__tst.java @@ -1,56 +1,56 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.apps.servers.http; import gplx.*; import gplx.xowa.*; import gplx.xowa.apps.*; import gplx.xowa.apps.servers.*; import org.junit.*; import gplx.core.tests.*; public class Http_server_wkr_fsys_hack__tst { private final Http_server_wkr_fsys_hack__fxt fxt = new Http_server_wkr_fsys_hack__fxt(); - @Test public void File_bgn_missing() { // "file:" missing + @Test public void File_bgn_missing() { // "file:" missing fxt.Test__Replace_fsys_hack("src='file////home/lnxusr/xowa/file/'"); } - @Test public void File_bgn_at_bos() { // "file:" at start of page + @Test public void File_bgn_at_bos() { // "file:" at start of page fxt.Test__Replace_fsys_hack("file:////home/lnxusr/xowa/file/"); } - @Test public void Quote_bgn_missing() { + @Test public void Quote_bgn_missing() { fxt.Test__Replace_fsys_hack(""); } - @Test public void Quote_end_missing() { + @Test public void Quote_end_missing() { fxt.Test__Replace_fsys_hack("a'file:////home/lnxusr/xowa/file/"); } - @Test public void Too_long() { // skip if too long + @Test public void Too_long() { // skip if too long fxt.Test__Replace_fsys_hack("'file:" + String_.Repeat("a", 301) + "'"); } - @Test public void File_mid_missing() { // skip if no /file/ + @Test public void File_mid_missing() { // skip if no /file/ fxt.Test__Replace_fsys_hack("'file:////home/lnxusr/xowa/file_missing/'"); } - @Test public void File__one() { + @Test public void File__one() { fxt.Test__Replace_fsys_hack("'file:////home/lnxusr/xowa/file/A.png'", "'/fsys/file/A.png'"); } - @Test public void File__many() { + @Test public void File__many() { fxt.Test__Replace_fsys_hack("a 'file:////home/lnxusr/xowa/file/A.png' b 'file:////home/lnxusr/xowa/file/B.png' c", "a '/fsys/file/A.png' b '/fsys/file/B.png' c"); } - @Test public void Quote() { + @Test public void Quote() { fxt.Test__Replace_fsys_hack("a \"file:////home/lnxusr/xowa/file/A.png\" b", "a \"/fsys/file/A.png\" b"); } - @Test public void Ws() { + @Test public void Ws() { fxt.Test__Replace_fsys_hack("a file:////home/lnxusr/xowa/file/A.png\nb", "a /fsys/file/A.png\nb"); } - @Test public void Bin_any() { + @Test public void Bin_any() { fxt.Test__Replace_fsys_hack("a 'file:///C:/xowa/bin/any/xowa/file/app.window/app_icon.png' b", "a '/fsys/bin/any/xowa/file/app.window/app_icon.png' b"); } - @Test public void Url() { + @Test public void Url() { fxt.Test__Replace_fsys_hack("url(file:///C:/xowa/user/anonymous/wiki/en.wikipedia.org/html/logo.png)", "url(/fsys/user/anonymous/wiki/en.wikipedia.org/html/logo.png)"); } } diff --git a/400_xowa/src/gplx/xowa/apps/servers/http/Http_url_parser_tst.java b/400_xowa/src/gplx/xowa/apps/servers/http/Http_url_parser_tst.java index 44d6ddb69..aa67fcfee 100644 --- a/400_xowa/src/gplx/xowa/apps/servers/http/Http_url_parser_tst.java +++ b/400_xowa/src/gplx/xowa/apps/servers/http/Http_url_parser_tst.java @@ -1,25 +1,25 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.apps.servers.http; import gplx.*; import gplx.xowa.*; import gplx.xowa.apps.*; import gplx.xowa.apps.servers.*; import org.junit.*; import gplx.core.tests.*; import gplx.langs.htmls.encoders.*; import gplx.xowa.wikis.pages.*; public class Http_url_parser_tst { private final Http_url_parser_fxt fxt = new Http_url_parser_fxt(); - @Test public void Parse() { + @Test public void Parse() { // wiki-only fxt.Test__parse("/en.wikipedia.org", fxt.Make().Wiki_("en.wikipedia.org")); @@ -62,14 +62,14 @@ public class Http_url_parser_tst { */ // add qarg_ary and test for qarg; } - @Test public void Popup() { + @Test public void Popup() { fxt.Test__parse ( "/en.wikipedia.org/wiki/Page_1?action=popup&popup_id=xo_2&popup_mode=more" , fxt.Make().Wiki_("en.wikipedia.org").Page_("Page_1") .Popup_(true).Popup_id_("xo_2").Popup_mode_("more") ); } - @Test public void Qarg__search() { + @Test public void Qarg__search() { fxt.Test__parse ( "/en.wikipedia.org/wiki/Special:XowaSearch?search=earth&fulltext=y" , fxt.Make().Wiki_("en.wikipedia.org").Page_("Special:XowaSearch") diff --git a/400_xowa/src/gplx/xowa/apps/servers/http/hdocs/Xoh_hdoc_wkr__http_server__tst.java b/400_xowa/src/gplx/xowa/apps/servers/http/hdocs/Xoh_hdoc_wkr__http_server__tst.java index a1c26c15b..9c437fc2d 100644 --- a/400_xowa/src/gplx/xowa/apps/servers/http/hdocs/Xoh_hdoc_wkr__http_server__tst.java +++ b/400_xowa/src/gplx/xowa/apps/servers/http/hdocs/Xoh_hdoc_wkr__http_server__tst.java @@ -1,18 +1,18 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.apps.servers.http.hdocs; import gplx.*; import gplx.xowa.*; import gplx.xowa.apps.*; import gplx.xowa.apps.servers.*; import gplx.xowa.apps.servers.http.*; import org.junit.*; import gplx.core.tests.*; import gplx.xowa.htmls.*; import gplx.xowa.htmls.core.wkrs.*; @@ -21,61 +21,61 @@ public class Xoh_hdoc_wkr__http_server__tst { private final Xoh_hdoc_wkr__http_server__fxt fxt = new Xoh_hdoc_wkr__http_server__fxt(); @Before public void init() {Gfo_usr_dlg_.Instance = Gfo_usr_dlg_.Test_console();} @After public void term() {Gfo_usr_dlg_.Instance = Gfo_usr_dlg_.Noop;} - @Test public void Wiki_quot() { + @Test public void Wiki_quot() { fxt.Test ( "abc" , "abc" ); } - @Test public void Wiki_apos() { + @Test public void Wiki_apos() { fxt.Test ( "abc" , "abc" ); } -// @Test public void Lnki_caption() { +// @Test public void Lnki_caption() { // fxt.Test // ( "abc lmn xyz" // , "abc lmn xyz" // ); // } - @Test public void Xcmd() { + @Test public void Xcmd() { fxt.Test ( "abc" , "abc" ); } - @Test public void Site() { + @Test public void Site() { fxt.Test ( "abc" , "abc" ); } - @Test public void Action() { // NOTE: also used by Special:ItemByTitle; EX: "
    " + @Test public void Action() { // NOTE: also used by Special:ItemByTitle; EX: "" fxt.Test ( "abc
    " , "
    abc
    " ); } - @Test public void Fsys() { + @Test public void Fsys() { fxt.Test ( "abc" , "abc" ); } - @Test public void Fsys_bug() { // 2019-05 enwiki embedded build machine's path + @Test public void Fsys_bug() { // 2019-05 enwiki embedded build machine's path fxt.Test ( "abc" , "abc" ); } - @Test public void Fsys_img() { + @Test public void Fsys_img() { fxt.Test ( "abc" , "abc" ); } - @Test public void Fsys_div() { + @Test public void Fsys_div() { fxt.Test ( String_.Concat_lines_nl ( "
    " @@ -105,7 +105,7 @@ public class Xoh_hdoc_wkr__http_server__tst { ) ); } - @Test public void Fsys_gallery() { + @Test public void Fsys_gallery() { fxt.Test ( String_.Concat_lines_nl_skip_last ( "" )); } - @Test public void New_lines() { + @Test public void New_lines() { fxt.Test_parse_page_all_str(String_.Concat_lines_nl_skip_last ( "*a" , "" diff --git a/400_xowa/src/gplx/xowa/parsers/lists/Xop_list_wkr_para_tst.java b/400_xowa/src/gplx/xowa/parsers/lists/Xop_list_wkr_para_tst.java index be255be17..3504a4d0c 100644 --- a/400_xowa/src/gplx/xowa/parsers/lists/Xop_list_wkr_para_tst.java +++ b/400_xowa/src/gplx/xowa/parsers/lists/Xop_list_wkr_para_tst.java @@ -1,24 +1,24 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.parsers.lists; import gplx.*; import gplx.xowa.*; import gplx.xowa.parsers.*; import org.junit.*; public class Xop_list_wkr_para_tst { @Before public void init() {fxt.Reset(); fxt.Init_para_y_();} private final Xop_fxt fxt = new Xop_fxt(); @After public void term() {fxt.Init_para_n_();} - @Test public void Basic() { + @Test public void Basic() { fxt.Test_parse_page_wiki_str(String_.Concat_lines_nl_skip_last ( "*a" ) , String_.Concat_lines_nl_skip_last @@ -30,7 +30,7 @@ public class Xop_list_wkr_para_tst { ) ); } - @Test public void Multiple() { + @Test public void Multiple() { fxt.Test_parse_page_wiki_str(String_.Concat_lines_nl_skip_last ( "*a" , "*b" @@ -44,7 +44,7 @@ public class Xop_list_wkr_para_tst { ) ); } - @Test public void Multiple_w_1_nl() { + @Test public void Multiple_w_1_nl() { fxt.Test_parse_page_wiki_str(String_.Concat_lines_nl_skip_last ( "*a" , "" @@ -62,7 +62,7 @@ public class Xop_list_wkr_para_tst { ) ); } - @Test public void Pre_between_lists() { // PURPOSE: list should close pre; EX:en.b:Knowing Knoppix/Other applications; DATE:2014-02-18 + @Test public void Pre_between_lists() { // PURPOSE: list should close pre; EX:en.b:Knowing Knoppix/Other applications; DATE:2014-02-18 fxt.Test_parse_page_wiki_str(String_.Concat_lines_nl_skip_last ( "#a" , " b" diff --git a/400_xowa/src/gplx/xowa/parsers/lists/Xop_list_wkr_uncommon_tst.java b/400_xowa/src/gplx/xowa/parsers/lists/Xop_list_wkr_uncommon_tst.java index b57c6d67d..cec0d9a74 100644 --- a/400_xowa/src/gplx/xowa/parsers/lists/Xop_list_wkr_uncommon_tst.java +++ b/400_xowa/src/gplx/xowa/parsers/lists/Xop_list_wkr_uncommon_tst.java @@ -1,24 +1,24 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.parsers.lists; import gplx.*; import gplx.xowa.*; import gplx.xowa.parsers.*; import org.junit.*; public class Xop_list_wkr_uncommon_tst { private final Xop_fxt fxt = new Xop_fxt(); @After public void term() {fxt.Init_para_n_();} - @Test public void Bug_specified_div() { // FIX:
    was not clearing state for lnki; PAGE:en.w:Ananke (moon) + @Test public void Bug_specified_div() { // FIX:
    was not clearing state for lnki; PAGE:en.w:Ananke (moon) fxt.Test_parse_page_all_str(String_.Concat_lines_nl_skip_last ( "
    " , "#a" @@ -37,7 +37,7 @@ public class Xop_list_wkr_uncommon_tst { , "" )); } - @Test public void Bug_mismatched() { // FIX:
    was not clearing state for lnki; PAGE:en.w:Ananke (moon) + @Test public void Bug_mismatched() { // FIX:
    was not clearing state for lnki; PAGE:en.w:Ananke (moon) fxt.Test_parse_page_all_str(String_.Concat_lines_nl_skip_last ( "::a" , ":::1" @@ -69,7 +69,7 @@ public class Xop_list_wkr_uncommon_tst { , "" )); } - @Test public void Empty_li_ignored() { // PURPOSE: inner template can cause dupe li; PAGE:en.w:any Calendar day and NYT link; NOTE:deactivated prune_empty_list logic; DATE:2014-09-05 + @Test public void Empty_li_ignored() { // PURPOSE: inner template can cause dupe li; PAGE:en.w:any Calendar day and NYT link; NOTE:deactivated prune_empty_list logic; DATE:2014-09-05 fxt.Init_para_y_(); fxt.Test_parse_page_all_str(String_.Concat_lines_nl_skip_last ( "*a" @@ -91,7 +91,7 @@ public class Xop_list_wkr_uncommon_tst { )); fxt.Init_para_n_(); } - @Test public void List_in_tblw() { // PURPOSE: list inside table should not be close outer list; PAGE:en.w:Cato the Elder + @Test public void List_in_tblw() { // PURPOSE: list inside table should not be close outer list; PAGE:en.w:Cato the Elder fxt.Init_para_y_(); fxt.Test_parse_page_all_str(String_.Concat_lines_nl_skip_last ( "*a" @@ -123,7 +123,7 @@ public class Xop_list_wkr_uncommon_tst { )); fxt.Init_para_n_(); } - @Test public void Dt_dd_colon_at_eol() { // PURPOSE: dangling ":" should not put next line in
    ; PAGE:en.w:Stein; b was being wrapped in
    b
    ; NOTE:deactivated prune_empty_list logic; DATE:2014-09-05 + @Test public void Dt_dd_colon_at_eol() { // PURPOSE: dangling ":" should not put next line in
    ; PAGE:en.w:Stein; b was being wrapped in
    b
    ; NOTE:deactivated prune_empty_list logic; DATE:2014-09-05 fxt.Init_para_y_(); fxt.Test_parse_page_all_str(String_.Concat_lines_nl_skip_last ( ";a:" @@ -155,7 +155,7 @@ public class Xop_list_wkr_uncommon_tst { )); fxt.Init_para_n_(); } - @Test public void Dd_should_not_print_colon() {// PURPOSE: ;a:\n should show as ";a" not ";a:". colon should still be considered as part of empty list; DATE:2013-11-07; NOTE:deactivated prune_empty_list logic; DATE:2014-09-05 + @Test public void Dd_should_not_print_colon() {// PURPOSE: ;a:\n should show as ";a" not ";a:". colon should still be considered as part of empty list; DATE:2013-11-07; NOTE:deactivated prune_empty_list logic; DATE:2014-09-05 fxt.Test_parse_page_all_str ( ";a:\nb" , String_.Concat_lines_nl_skip_last @@ -168,7 +168,7 @@ public class Xop_list_wkr_uncommon_tst { , "b" )); } - @Test public void Dt_dd_colon_in_lnki() { // PURPOSE: "; [[Portal:a]]" should not split lnki; PAGE:en.w:Wikipedia:WikiProject Military history/Operation Majestic Titan; "; [[Wikipedia:WikiProject Military history/Operation Majestic Titan/Phase I|Phase I]]: a b" + @Test public void Dt_dd_colon_in_lnki() { // PURPOSE: "; [[Portal:a]]" should not split lnki; PAGE:en.w:Wikipedia:WikiProject Military history/Operation Majestic Titan; "; [[Wikipedia:WikiProject Military history/Operation Majestic Titan/Phase I|Phase I]]: a b" fxt.Init_para_y_(); fxt.Test_parse_page_all_str(String_.Concat_lines_nl_skip_last ( ";[[Portal:a]]" @@ -181,11 +181,11 @@ public class Xop_list_wkr_uncommon_tst { )); fxt.Init_para_n_(); } - @Test public void Max_list_depth() { // PURPOSE: 256+ * caused list parser to fail; ignore; PAGE:en.w:Bariatric surgery + @Test public void Max_list_depth() { // PURPOSE: 256+ * caused list parser to fail; ignore; PAGE:en.w:Bariatric surgery String multiple = String_.Repeat("*", 300); fxt.Test_parse_page_all_str(multiple, multiple); } - @Test public void Numbered_list_resets_incorrectly() { // PURPOSE: as description + @Test public void Numbered_list_resets_incorrectly() { // PURPOSE: as description fxt.Init_para_y_(); fxt.Test_parse_page_all_str(String_.Concat_lines_nl_skip_last ( "#A" @@ -216,7 +216,7 @@ public class Xop_list_wkr_uncommon_tst { )); fxt.Init_para_n_(); } - @Test public void List_should_not_end_indented_table() {// PURPOSE: :{| was being closed by \n*; EX:w:Maxwell's equations; DATE:20121231 + @Test public void List_should_not_end_indented_table() {// PURPOSE: :{| was being closed by \n*; EX:w:Maxwell's equations; DATE:20121231 fxt.Test_parse_page_all_str(String_.Concat_lines_nl_skip_last ( ":{|" , "|-" @@ -243,7 +243,7 @@ public class Xop_list_wkr_uncommon_tst { , "" )); } - @Test public void Dt_dd_broken_by_xnde() { // PURPOSE.fix: xnde was resetting dl incorrectly; EX:w:Virus; DATE:2013-01-31 + @Test public void Dt_dd_broken_by_xnde() { // PURPOSE.fix: xnde was resetting dl incorrectly; EX:w:Virus; DATE:2013-01-31 fxt.Test_parse_page_all_str(";a:c" , String_.Concat_lines_nl_skip_last ( "
    " @@ -254,7 +254,7 @@ public class Xop_list_wkr_uncommon_tst { , "
    " )); } - @Test public void Trim_empty_list_items() { // PURPOSE: empty list items should be ignored; DATE:2013-07-02; NOTE:deactivated prune_empty_list logic; DATE:2014-09-05 + @Test public void Trim_empty_list_items() { // PURPOSE: empty list items should be ignored; DATE:2013-07-02; NOTE:deactivated prune_empty_list logic; DATE:2014-09-05 fxt.Test_parse_page_all_str ("*** \n" , String_.Concat_lines_nl_skip_last @@ -273,7 +273,7 @@ public class Xop_list_wkr_uncommon_tst { , "" )); } - @Test public void Trim_empty_list_items_error() { // PURPOSE.fix: do not add empty itm's nesting to current list; DATE:2013-07-07; NOTE:deactivated prune_empty_list logic; DATE:2014-09-05 + @Test public void Trim_empty_list_items_error() { // PURPOSE.fix: do not add empty itm's nesting to current list; DATE:2013-07-07; NOTE:deactivated prune_empty_list logic; DATE:2014-09-05 fxt.Test_parse_page_all_str(String_.Concat_lines_nl ( "* a" , "** " // was: do not add ** to nest; now: add ** and \s @@ -296,7 +296,7 @@ public class Xop_list_wkr_uncommon_tst { , "" )); } - @Test public void Tblw_should_autoclose() {// PURPOSE: tblw should auto-close open list + @Test public void Tblw_should_autoclose() {// PURPOSE: tblw should auto-close open list fxt.Test_parse_page_all_str(String_.Concat_lines_nl_skip_last ( "#a" , "{|" @@ -316,7 +316,7 @@ public class Xop_list_wkr_uncommon_tst { , "" )); } - @Test public void Tblx_should_not_autoclose() { // PURPOSE: do not auto-close list if table is xnde; DATE:2014-02-05 + @Test public void Tblx_should_not_autoclose() { // PURPOSE: do not auto-close list if table is xnde; DATE:2014-02-05 fxt.Test_parse_page_all_str(String_.Concat_lines_nl ( "#a" , "#
    b
    " @@ -337,7 +337,7 @@ public class Xop_list_wkr_uncommon_tst { , "c" )); } - @Test public void Li_disappears() { // PURPOSE: "\n*" disappears when followed by "
  • "; PAGE:en.w:Bristol_Bullfinch; DATE:2014-06-24 + @Test public void Li_disappears() { // PURPOSE: "\n*" disappears when followed by "
  • "; PAGE:en.w:Bristol_Bullfinch; DATE:2014-06-24 fxt.Test_parse_page_all_str(String_.Concat_lines_nl ( "a" , "*b
  • " @@ -351,7 +351,7 @@ public class Xop_list_wkr_uncommon_tst { , "" )); } - @Test public void Ul_should_end_wlst() { // PURPOSE: should end wiki_list; PAGE:en.w:Bristol_Bullfinch; DATE:2014-06-24 + @Test public void Ul_should_end_wlst() { // PURPOSE: should end wiki_list; PAGE:en.w:Bristol_Bullfinch; DATE:2014-06-24 fxt.Test_parse_page_all_str ( "*ab" , String_.Concat_lines_nl_skip_last @@ -361,7 +361,7 @@ public class Xop_list_wkr_uncommon_tst { , "" )); } - @Test public void Colon_causes_dd() { // PURPOSE: colon was mistakenly being ignored due to proximity to "\n;"; PAGE:de.w:Schmach_von_Tirana#Kuriosit.C3.A4t:_EM-Qualifikationsspiel_vom_20._November_1983 DATE:2014-07-11 + @Test public void Colon_causes_dd() { // PURPOSE: colon was mistakenly being ignored due to proximity to "\n;"; PAGE:de.w:Schmach_von_Tirana#Kuriosit.C3.A4t:_EM-Qualifikationsspiel_vom_20._November_1983 DATE:2014-07-11 fxt.Test_parse_page_all_str ( String_.Concat_lines_nl_skip_last ( "a:b" @@ -374,7 +374,7 @@ public class Xop_list_wkr_uncommon_tst { , "" )); } - @Test public void Pre_and_nested() { // PURPOSE: pre should interrupt list; PAGE:fi.w:Luettelo_hyönteisistä; DATE:2015-03-31 + @Test public void Pre_and_nested() { // PURPOSE: pre should interrupt list; PAGE:fi.w:Luettelo_hyönteisistä; DATE:2015-03-31 fxt.Init_para_y_(); fxt.Test_parse_page_all_str ( String_.Concat_lines_nl_skip_last diff --git a/400_xowa/src/gplx/xowa/parsers/lnkes/Xop_lnke_wkr_brack_tst.java b/400_xowa/src/gplx/xowa/parsers/lnkes/Xop_lnke_wkr_brack_tst.java index 19d882d72..ce43776f9 100644 --- a/400_xowa/src/gplx/xowa/parsers/lnkes/Xop_lnke_wkr_brack_tst.java +++ b/400_xowa/src/gplx/xowa/parsers/lnkes/Xop_lnke_wkr_brack_tst.java @@ -1,64 +1,64 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.parsers.lnkes; import gplx.*; import gplx.xowa.*; import gplx.xowa.parsers.*; import org.junit.*; import gplx.xowa.parsers.xndes.*; public class Xop_lnke_wkr_brack_tst { @Before public void init() {fxt.Reset();} private final Xop_fxt fxt = new Xop_fxt(); - @Test public void Brace_noText() { + @Test public void Brace_noText() { fxt.Test_parse_page_wiki("[irc://a]", fxt.tkn_lnke_(0, 9).Lnke_typ_(Xop_lnke_tkn.Lnke_typ_brack).Lnke_rng_(1, 8)); } - @Test public void Brace_eos() { + @Test public void Brace_eos() { fxt.Test_parse_page_wiki("[irc://a", fxt.tkn_txt_(0, 1), fxt.tkn_lnke_(1, 8).Lnke_typ_(Xop_lnke_tkn.Lnke_typ_brack_dangling).Lnke_rng_(1, 8)); } - @Test public void Brace_text() { + @Test public void Brace_text() { fxt.Test_parse_page_wiki("[irc://a b c]", fxt.tkn_lnke_(0, 13).Lnke_rng_(1, 8).Subs_(fxt.tkn_txt_(9, 10), fxt.tkn_space_(10, 11), fxt.tkn_txt_(11, 12))); } - @Test public void Brace_lt() { + @Test public void Brace_lt() { fxt.Init_log_(Xop_xnde_log.Eos_while_closing_tag).Test_parse_page_wiki("[irc://ac]" , "c" ); } - @Test public void Brace_newLine() { + @Test public void Brace_newLine() { fxt.Test_parse_page_wiki("[irc://a\n]", fxt.tkn_txt_(0, 8), fxt.tkn_nl_char_len1_(8), fxt.tkn_txt_(9, 10)); } - @Test public void Html_brack() { + @Test public void Html_brack() { fxt.Test_parse_page_wiki_str("[irc://a]", "[1]"); } - @Test public void Apos() { + @Test public void Apos() { fxt.Test_parse_page_wiki_str("[http://www.a.org''b'']", "b"); fxt.Test_parse_page_wiki_str("[http://www.a.org'b]", "[1]"); } - @Test public void Nowiki() { + @Test public void Nowiki() { fxt.Test_parse_page_all_str ( "http://a.org" , "http://a.org" ); } - @Test public void Lnki_one() { // PURPOSE: parallel test for "http://a.org[[B]]"; DATE:2014-07-11 + @Test public void Lnki_one() { // PURPOSE: parallel test for "http://a.org[[B]]"; DATE:2014-07-11 fxt.Test_parse_page_wiki_str ( "[http://a.org b [[C]] d]" ,String_.Concat_lines_nl_skip_last ( "b C d" )); } - @Test public void Encode_xwiki() { // PURPOSE: href title and args should always be encoded; PAGE:en.w:List_of_Category_A_listed_buildings_in_West_Lothian DATE:2014-07-15 + @Test public void Encode_xwiki() { // PURPOSE: href title and args should always be encoded; PAGE:en.w:List_of_Category_A_listed_buildings_in_West_Lothian DATE:2014-07-15 fxt.App().Usere().Wiki().Xwiki_mgr().Add_by_atrs(Bry_.new_a7("commons.wikimedia.org"), Bry_.new_a7("commons.wikimedia.org")); fxt.Test__parse__wtxt_to_html // encode page ( "[http://commons.wikimedia.org/%22%3E_A B]" @@ -69,7 +69,7 @@ public class Xop_lnke_wkr_brack_tst { , "D" // '%22%3E' not '">' ); } - @Test public void Encode_basic() { // PURPOSE: counterpart to Encode_xwiki; DATE:2014-07-15 + @Test public void Encode_basic() { // PURPOSE: counterpart to Encode_xwiki; DATE:2014-07-15 fxt.Test_parse_page_wiki_str // encode page ( "[http://a.org/%22%3E_A B]" , "B" // '%22%3E' not '">' @@ -79,7 +79,7 @@ public class Xop_lnke_wkr_brack_tst { , "D" // '%22%3E' not '">' ); } - @Test public void Encode_relative() { // PURPOSE: counterpart to Encode_xwiki; DATE:2014-07-15 + @Test public void Encode_relative() { // PURPOSE: counterpart to Encode_xwiki; DATE:2014-07-15 fxt.Test_parse_page_wiki_str // encode page ( "[//a.org/%22%3E_A B]" , "B" // '%22%3E' not '">' diff --git a/400_xowa/src/gplx/xowa/parsers/lnkes/Xop_lnke_wkr_dangling_tst.java b/400_xowa/src/gplx/xowa/parsers/lnkes/Xop_lnke_wkr_dangling_tst.java index a6699406b..ddfef761b 100644 --- a/400_xowa/src/gplx/xowa/parsers/lnkes/Xop_lnke_wkr_dangling_tst.java +++ b/400_xowa/src/gplx/xowa/parsers/lnkes/Xop_lnke_wkr_dangling_tst.java @@ -1,29 +1,29 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.parsers.lnkes; import gplx.*; import gplx.xowa.*; import gplx.xowa.parsers.*; import org.junit.*; public class Xop_lnke_wkr_dangling_tst { @Before public void init() {fxt.Reset();} private final Xop_fxt fxt = new Xop_fxt(); - @Test public void Dangling_eos() { + @Test public void Dangling_eos() { fxt.Test_parse_page_wiki("[irc://a b" , fxt.tkn_lnke_(0, 8).Lnke_typ_(Xop_lnke_tkn.Lnke_typ_brack_dangling) , fxt.tkn_txt_(9, 10) ); } - @Test public void Dangling_newLine() { + @Test public void Dangling_newLine() { fxt.Test_parse_page_wiki("[irc://a b\nc]" , fxt.tkn_lnke_(0, 8).Lnke_typ_(Xop_lnke_tkn.Lnke_typ_brack_dangling) , fxt.tkn_txt_(9, 10) @@ -31,7 +31,7 @@ public class Xop_lnke_wkr_dangling_tst { , fxt.tkn_txt_(11, 13) ); } - @Test public void Dangling_gt() { + @Test public void Dangling_gt() { fxt.Test_parse_page_wiki("[irc://a>b c]", fxt.tkn_lnke_(0, 13).Lnke_typ_(Xop_lnke_tkn.Lnke_typ_brack).Subs_(fxt.tkn_txt_(8, 10), fxt.tkn_space_(10, 11), fxt.tkn_txt_(11, 12))); } } diff --git a/400_xowa/src/gplx/xowa/parsers/lnkes/Xop_lnke_wkr_relative_tst.java b/400_xowa/src/gplx/xowa/parsers/lnkes/Xop_lnke_wkr_relative_tst.java index 69be997bc..ca948ae8e 100644 --- a/400_xowa/src/gplx/xowa/parsers/lnkes/Xop_lnke_wkr_relative_tst.java +++ b/400_xowa/src/gplx/xowa/parsers/lnkes/Xop_lnke_wkr_relative_tst.java @@ -1,39 +1,39 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.parsers.lnkes; import gplx.*; import gplx.xowa.*; import gplx.xowa.parsers.*; import org.junit.*; public class Xop_lnke_wkr_relative_tst { @Before public void init() {fxt.Reset();} private final Xop_fxt fxt = new Xop_fxt(); - @Test public void Relative_obj() { + @Test public void Relative_obj() { fxt.Test_parse_page_wiki("[//a b]" , fxt.tkn_lnke_(0, 7).Lnke_rng_(1, 4).Subs_(fxt.tkn_txt_(5, 6)) ); } - @Test public void Relative_external() { + @Test public void Relative_external() { fxt.Test__parse__wtxt_to_html("[//www.a.org a]", "a"); } - @Test public void Relative_internal() { + @Test public void Relative_internal() { fxt.Init_xwiki_add_user_("en.wikipedia.org"); fxt.Test__parse__wtxt_to_html("[//en.wikipedia.org/wiki Wikipedia]", "Wikipedia"); } - @Test public void Relative_w_category() { // EX: [//commons.wikimedia.org/wiki/Category:Diomedeidae A] + @Test public void Relative_w_category() { // EX: [//commons.wikimedia.org/wiki/Category:Diomedeidae A] fxt.Init_xwiki_add_user_("en.wikipedia.org"); fxt.Test__parse__wtxt_to_html("[//en.wikipedia.org/wiki/Category:A A]", "A"); } - @Test public void Relurl() { + @Test public void Relurl() { fxt.App().Usere().Wiki().Xwiki_mgr().Add_by_atrs(Bry_.new_a7("en.wikipedia.org"), Bry_.new_a7("en.wikipedia.org")); fxt.Test__parse__wtxt_to_html("[[//en.wikipedia.org/ a]]", "[a]"); } diff --git a/400_xowa/src/gplx/xowa/parsers/lnkes/Xop_lnke_wkr_text_tst.java b/400_xowa/src/gplx/xowa/parsers/lnkes/Xop_lnke_wkr_text_tst.java index e7de5184c..a63a8c372 100644 --- a/400_xowa/src/gplx/xowa/parsers/lnkes/Xop_lnke_wkr_text_tst.java +++ b/400_xowa/src/gplx/xowa/parsers/lnkes/Xop_lnke_wkr_text_tst.java @@ -1,32 +1,32 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.parsers.lnkes; import gplx.*; import gplx.xowa.*; import gplx.xowa.parsers.*; import org.junit.*; import gplx.xowa.langs.cases.*; public class Xop_lnke_wkr_text_tst { @Before public void init() {fxt.Reset();} private final Xop_fxt fxt = new Xop_fxt(); - @Test public void Text_obj() { + @Test public void Text_obj() { fxt.Test_parse_page_wiki("irc://a", fxt.tkn_lnke_(0, 7).Lnke_typ_(Xop_lnke_tkn.Lnke_typ_text).Lnke_rng_(0, 7)); } - @Test public void Text_html() { + @Test public void Text_html() { fxt.Test_parse_page_wiki_str("irc://a", "irc://a"); } - @Test public void Text_after() { + @Test public void Text_after() { fxt.Test_parse_page_wiki("irc://a b c", fxt.tkn_lnke_(0, 7).Lnke_rng_(0, 7), fxt.tkn_space_(7, 8), fxt.tkn_txt_(8, 9), fxt.tkn_space_(9, 10), fxt.tkn_txt_(10, 11)); } - @Test public void Text_before_ascii() { // PURPOSE: free form external urls should not match if preceded by letters; EX:de.w:Sylvie_und_Bruno; DATE:2014-05-11 + @Test public void Text_before_ascii() { // PURPOSE: free form external urls should not match if preceded by letters; EX:de.w:Sylvie_und_Bruno; DATE:2014-05-11 fxt.Ctx().Lang().Case_mgr_u8_(); String expd_lnke_html = "tel:a"; fxt.Test_parse_page_wiki_str("titel:a" , "titel:a"); @@ -35,7 +35,7 @@ public class Xop_lnke_wkr_text_tst { fxt.Test_parse_page_wiki_str("ätel:a" , "ätel:a"); fxt.Test_parse_page_wiki_str("€tel:a" , "€" + expd_lnke_html); } - @Test public void Invalid_lnki_and_list_dt_dd() { // PURPOSE: invalid lnke should still allow processing of ":" in list
    ; PAGE:de.w:Mord_(Deutschland)#Besonders_verwerfliche_Begehungsweise DATE:2015-01-08 + @Test public void Invalid_lnki_and_list_dt_dd() { // PURPOSE: invalid lnke should still allow processing of ":" in list
    ; PAGE:de.w:Mord_(Deutschland)#Besonders_verwerfliche_Begehungsweise DATE:2015-01-08 fxt.Test_parse_page_wiki_str("; atel: b" , String_.Concat_lines_nl_skip_last ( "
    " , "
    atel" @@ -45,14 +45,14 @@ public class Xop_lnke_wkr_text_tst { , "
    " )); } - @Test public void Xnde() {// NOTE: compare to Brace_lt + @Test public void Xnde() {// NOTE: compare to Brace_lt fxt.Test_parse_page_wiki("irc://a" , fxt.tkn_xnde_(0, 20).Subs_ ( fxt.tkn_lnke_(6, 13) ) ); } - @Test public void List() { + @Test public void List() { fxt.Test_parse_page_wiki_str(String_.Concat_lines_nl_skip_last ( "*irc://a" , "*irc://b" @@ -65,33 +65,33 @@ public class Xop_lnke_wkr_text_tst { , "" )); } - @Test public void Defect_reverse_caption_link() { // PURPOSE: bad lnke formatting (caption before link); ] should show up at end, but only [ shows up; PAGE:en.w:Paul Philippoteaux; [caption http://www.americanheritage.com] + @Test public void Defect_reverse_caption_link() { // PURPOSE: bad lnke formatting (caption before link); ] should show up at end, but only [ shows up; PAGE:en.w:Paul Philippoteaux; [caption http://www.americanheritage.com] fxt.Test_parse_page_wiki_str("[caption irc://a]", "[caption irc://a]"); } - @Test public void Lnki() { // PURPOSE: trailing lnki should not get absorbed into lnke; DATE:2014-07-11 + @Test public void Lnki() { // PURPOSE: trailing lnki should not get absorbed into lnke; DATE:2014-07-11 fxt.Test_parse_page_wiki_str ( "http://a.org[[B]]" // NOTE: [[ should create another lnki ,String_.Concat_lines_nl_skip_last ( "http://a.orgB" )); } - @Test public void Protocol_only() { // PURPOSE: protocol only should return text; DATE:2014-10-09 + @Test public void Protocol_only() { // PURPOSE: protocol only should return text; DATE:2014-10-09 fxt.Test_parse_page_wiki_str("http://" , "http://"); fxt.Test_parse_page_wiki_str("http:" , "http:"); fxt.Test_parse_page_wiki_str("[http://]" , "[http://]"); fxt.Test_parse_page_wiki_str("[http:]" , "[http:]"); } - @Test public void Ignore_punctuation_at_end() { // PURPOSE: ignore "," and related punctuation at end; DATE:2014-10-09 + @Test public void Ignore_punctuation_at_end() { // PURPOSE: ignore "," and related punctuation at end; DATE:2014-10-09 fxt.Test_parse_page_wiki_str("http://a.org," , "http://a.org,"); // basic fxt.Test_parse_page_wiki_str("http://a.org,," , "http://a.org,,"); // many fxt.Test_parse_page_wiki_str("http://a.org/b,c" , "http://a.org/b,c"); // do not ignore if in middle fxt.Test_parse_page_wiki_str("http://a.org:" , "http://a.org:"); // colon at end; compare to "http:" } - @Test public void Ignore_punctuation_at_end__paren_end() { // PURPOSE: end parent has special rules; DATE:2014-10-10 + @Test public void Ignore_punctuation_at_end__paren_end() { // PURPOSE: end parent has special rules; DATE:2014-10-10 fxt.Test_parse_page_wiki_str("(http://a.org)" , "(http://a.org)"); // trim=y fxt.Test_parse_page_wiki_str("http://a.org/b(c)", "http://a.org/b(c)"); // trim=n } - @Test public void Sym_quote() { // PURPOSE: quote should interrupt lnke; DATE:2014-10-10 + @Test public void Sym_quote() { // PURPOSE: quote should interrupt lnke; DATE:2014-10-10 fxt.Test_parse_page_wiki_str("http://a.org/b\"c", "http://a.org/b"c"); } } diff --git a/400_xowa/src/gplx/xowa/parsers/lnkes/Xop_lnke_wkr_uncommon_tst.java b/400_xowa/src/gplx/xowa/parsers/lnkes/Xop_lnke_wkr_uncommon_tst.java index 66a915df8..78cfaac1b 100644 --- a/400_xowa/src/gplx/xowa/parsers/lnkes/Xop_lnke_wkr_uncommon_tst.java +++ b/400_xowa/src/gplx/xowa/parsers/lnkes/Xop_lnke_wkr_uncommon_tst.java @@ -1,34 +1,34 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.parsers.lnkes; import gplx.*; import gplx.xowa.*; import gplx.xowa.parsers.*; import org.junit.*; public class Xop_lnke_wkr_uncommon_tst { @Before public void init() {fxt.Reset();} private final Xop_fxt fxt = new Xop_fxt(); - @Test public void Err_multiple() { + @Test public void Err_multiple() { fxt.Test_parse_page_wiki("[irc://a][irc://b]" , fxt.tkn_lnke_(0, 9) , fxt.tkn_lnke_(9, 18) ); } - @Test public void Err_txt_is_protocol() { + @Test public void Err_txt_is_protocol() { fxt.Test_parse_page_wiki("[irc://a irc://b]" , fxt.tkn_lnke_(0, 17).Lnke_rng_(1, 8).Subs_(fxt.tkn_txt_(9, 16)) ); } - @Test public void Lnke_should_precede_lnki() { // PURPOSE: [[ should not be interpreted as lnki if [irc is available + @Test public void Lnke_should_precede_lnki() { // PURPOSE: [[ should not be interpreted as lnki if [irc is available fxt.Test_parse_page_wiki("[[irc://a/b c]]" , fxt.tkn_txt_(0, 1) , fxt.tkn_lnke_(1, 14).Subs_ @@ -37,7 +37,7 @@ public class Xop_lnke_wkr_uncommon_tst { , fxt.tkn_txt_(14, 15) ); } - @Test public void Defect_2nd_consecutive_lnke() { // PURPOSE: bad code that was causing lnkes to show up; PAGE:en.w:Template:Infobox_country; + @Test public void Defect_2nd_consecutive_lnke() { // PURPOSE: bad code that was causing lnkes to show up; PAGE:en.w:Template:Infobox_country; fxt.Test_parse_page_wiki_str(String_.Concat_lines_nl_skip_last ( "[[http://a.org a]] [[http://b.org b]]" ), String_.Concat_lines_nl_skip_last diff --git a/400_xowa/src/gplx/xowa/parsers/lnkes/Xop_lnke_wkr_xwiki_tst.java b/400_xowa/src/gplx/xowa/parsers/lnkes/Xop_lnke_wkr_xwiki_tst.java index e17807637..a7d6bfafc 100644 --- a/400_xowa/src/gplx/xowa/parsers/lnkes/Xop_lnke_wkr_xwiki_tst.java +++ b/400_xowa/src/gplx/xowa/parsers/lnkes/Xop_lnke_wkr_xwiki_tst.java @@ -1,55 +1,55 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.parsers.lnkes; import gplx.*; import gplx.xowa.*; import gplx.xowa.parsers.*; import org.junit.*; public class Xop_lnke_wkr_xwiki_tst { @Before public void init() {fxt.Reset();} private final Xop_fxt fxt = new Xop_fxt(); - @Test public void Xwiki() { + @Test public void Xwiki() { fxt.App().Usere().Wiki().Xwiki_mgr().Add_by_atrs(Bry_.new_a7("en.wikipedia.org"), Bry_.new_a7("en.wikipedia.org")); fxt.Test__parse__wtxt_to_html("[http://en.wikipedia.org/wiki/A a]", "a"); } - @Test public void Xwiki_relative() { + @Test public void Xwiki_relative() { fxt.App().Usere().Wiki().Xwiki_mgr().Add_by_atrs(Bry_.new_a7("en.wikipedia.org"), Bry_.new_a7("en.wikipedia.org")); fxt.Test__parse__wtxt_to_html("[//en.wikipedia.org/ a]", "a"); } - @Test public void Xwiki_qarg() {// DATE:2013-02-02 + @Test public void Xwiki_qarg() {// DATE:2013-02-02 fxt.Init_xwiki_add_user_("en.wikipedia.org"); fxt.Test__parse__wtxt_to_html("http://en.wikipedia.org/wiki/Special:Allpages?from=Earth", "http://en.wikipedia.org/wiki/Special:Allpages?from=Earth"); } - @Test public void Lang_prefix() { + @Test public void Lang_prefix() { fxt.App().Usere().Wiki().Xwiki_mgr().Add_by_atrs(Bry_.new_a7("en.wikipedia.org"), Bry_.new_a7("en.wikipedia.org")); fxt.Wiki().Xwiki_mgr().Add_by_atrs(Bry_.new_a7("fr"), Bry_.new_a7("fr.wikipedia.org")); fxt.Test__parse__wtxt_to_html("[http://en.wikipedia.org/wiki/fr:A a]", "a"); } - @Test public void Xwiki_query_arg() { + @Test public void Xwiki_query_arg() { fxt.App().Usere().Wiki().Xwiki_mgr().Add_by_atrs(Bry_.new_a7("en.wikipedia.org"), Bry_.new_a7("en.wikipedia.org")); fxt.Test__parse__wtxt_to_html("[http://en.wikipedia.org/wiki/A?action=edit a]", "a"); } - @Test public void Xwiki__history() { // PURPOSE: handle xwiki lnke's to history page else null ref; EX:[http://ru.wikipedia.org/w/index.php?title&diff=19103464&oldid=18910980 извещен]; PAGE:ru.w:Project:Заявки_на_снятие_флагов/Архив/Патрулирующие/2009 DATE:2016-11-24 + @Test public void Xwiki__history() { // PURPOSE: handle xwiki lnke's to history page else null ref; EX:[http://ru.wikipedia.org/w/index.php?title&diff=19103464&oldid=18910980 извещен]; PAGE:ru.w:Project:Заявки_на_снятие_флагов/Архив/Патрулирующие/2009 DATE:2016-11-24 fxt.App().Usere().Wiki().Xwiki_mgr().Add_by_atrs(Bry_.new_a7("en.wikipedia.org"), Bry_.new_a7("en.wikipedia.org")); fxt.Test__parse__wtxt_to_html("[http://en.wikipedia.org/w/index.php?title&diff=1&oldid=2 abc]", "abc"); } - @Test public void Ignore_proto() { // PURPOSE: handle other protocols; PAGE:uk.w:Маскалі; DATE:2015-07-28 + @Test public void Ignore_proto() { // PURPOSE: handle other protocols; PAGE:uk.w:Маскалі; DATE:2015-07-28 fxt.Test__parse__wtxt_to_html("[mailto:a b]", "b");// should be /w/, not /en.wikipedia.org } - @Test public void Ignore_alias() { // PURPOSE: fictitious example to make sure aliases are not subbed for domains; DATE:2015-07-28 + @Test public void Ignore_alias() { // PURPOSE: fictitious example to make sure aliases are not subbed for domains; DATE:2015-07-28 fxt.Init_xwiki_add_user_("w", "en.wikipedia.org"); fxt.Test__parse__wtxt_to_html("[https://w/b c]", "c");// should be /w/, not /en.wikipedia.org } - @Test public void Xwiki__qargs() { // PURPOSE: fix null ref error; PAGE:en.w:Wikipedia:Template_standardisation/demometa DATE:2015-08-02 + @Test public void Xwiki__qargs() { // PURPOSE: fix null ref error; PAGE:en.w:Wikipedia:Template_standardisation/demometa DATE:2015-08-02 fxt.Init_xwiki_add_user_("en.wikipedia.org"); fxt.Test__parse__wtxt_to_html ( "[http://en.wikipedia.org/w/index.php?action=edit&preload=Template:Afd2+starter&editintro=Template:Afd3+starter&title=Wikipedia:Articles+for+deletion/Template_standardisation/demometa]" diff --git a/400_xowa/src/gplx/xowa/parsers/lnkis/Xop_lnki_wkr__basic_tst.java b/400_xowa/src/gplx/xowa/parsers/lnkis/Xop_lnki_wkr__basic_tst.java index e62557da1..4d70384f3 100644 --- a/400_xowa/src/gplx/xowa/parsers/lnkis/Xop_lnki_wkr__basic_tst.java +++ b/400_xowa/src/gplx/xowa/parsers/lnkis/Xop_lnki_wkr__basic_tst.java @@ -1,18 +1,18 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.parsers.lnkis; import gplx.*; import gplx.xowa.*; import gplx.xowa.parsers.*; import org.junit.*; import gplx.xowa.langs.*; import gplx.xowa.langs.cases.*; import gplx.xowa.langs.funcs.*; import gplx.xowa.langs.lnki_trails.*; @@ -20,37 +20,37 @@ import gplx.xowa.wikis.nss.*; import gplx.xowa.parsers.paras.*; import gplx.xowa.wikis.ttls.*; public class Xop_lnki_wkr__basic_tst { @Before public void init() {fxt.Reset(); fxt.Init_para_n_();} private final Xop_fxt fxt = new Xop_fxt(); - @Test public void Basic() { + @Test public void Basic() { fxt.Test_parse_page_wiki("[[a]]", fxt.tkn_lnki_().Trg_tkn_(fxt.tkn_arg_val_txt_(2, 3))); } - @Test public void HtmlRef() { + @Test public void HtmlRef() { fxt.Test_parse_page_wiki_str("[[a&b]]" , "a&b" ); } - @Test public void Url_encode() { // PURPOSE:title should automatically do url decoding; DATE:2013-08-26 + @Test public void Url_encode() { // PURPOSE:title should automatically do url decoding; DATE:2013-08-26 fxt.Test_parse_page_all_str("[[A%20b]]", "A b"); } - @Test public void Url_encode_plus() { // PURPOSE:do not decode plus; DATE:2013-08-26 + @Test public void Url_encode_plus() { // PURPOSE:do not decode plus; DATE:2013-08-26 fxt.Test_parse_page_all_str("[[A+b]]", "A+b"); } - @Test public void Caption() { + @Test public void Caption() { fxt.Test_parse_page_wiki("[[a|b]]" , fxt.tkn_lnki_().Trg_tkn_(fxt.tkn_arg_val_txt_(2, 3)).Caption_tkn_(fxt.tkn_arg_val_txt_(4, 5))); fxt.Test_parse_page_wiki("[[a|b:c]]", fxt.tkn_lnki_().Trg_tkn_(fxt.tkn_arg_val_txt_(2, 3)).Caption_tkn_(fxt.tkn_arg_val_(fxt.tkn_txt_(4, 5), fxt.tkn_colon_(5), fxt.tkn_txt_(6, 7)))); } - @Test public void Caption_equal() { // should ignore = if only caption arg (2 args) + @Test public void Caption_equal() { // should ignore = if only caption arg (2 args) fxt.Test_parse_page_wiki("[[a|=]]", fxt.tkn_lnki_().Trg_tkn_(fxt.tkn_arg_val_txt_(2, 3)).Caption_tkn_(fxt.tkn_arg_val_(fxt.tkn_eq_(4)))); } - @Test public void Caption_ampersand() {fxt.Test_parse_page_wiki_str("[[A|a & b]]", "a & b");} - @Test public void Tail() { + @Test public void Caption_ampersand() {fxt.Test_parse_page_wiki_str("[[A|a & b]]", "a & b");} + @Test public void Tail() { fxt.Test_parse_page_wiki("[[a|b]]c" , fxt.tkn_lnki_(0, 8).Tail_bgn_(7).Tail_end_(8)); fxt.Test_parse_page_wiki("[[a|b]] c", fxt.tkn_lnki_(0, 7).Tail_bgn_(-1), fxt.tkn_space_(7, 8), fxt.tkn_txt_(8, 9)); fxt.Test_parse_page_wiki("[[a|b]]'c", fxt.tkn_lnki_(0, 7).Tail_bgn_(-1), fxt.tkn_txt_(7, 9)); } - @Test public void Tail_number() {fxt.Test_parse_page_wiki("[[a|b]]1" , fxt.tkn_lnki_(0, 7).Tail_bgn_(-1), fxt.tkn_txt_(7, 8));} - @Test public void Tail_upper() {fxt.Test_parse_page_wiki("[[a|b]]A" , fxt.tkn_lnki_(0, 7).Tail_bgn_(-1), fxt.tkn_txt_(7, 8));} // make sure trie is case-insensitive - @Test public void Tail_image() {fxt.Test_parse_page_wiki("[[Image:a|b]]c", fxt.tkn_lnki_(0, 13).Tail_bgn_(-1).Tail_end_(-1), fxt.tkn_txt_(13, 14));} // NOTE: this occurs on some pages; - @Test public void Image() { + @Test public void Tail_number() {fxt.Test_parse_page_wiki("[[a|b]]1" , fxt.tkn_lnki_(0, 7).Tail_bgn_(-1), fxt.tkn_txt_(7, 8));} + @Test public void Tail_upper() {fxt.Test_parse_page_wiki("[[a|b]]A" , fxt.tkn_lnki_(0, 7).Tail_bgn_(-1), fxt.tkn_txt_(7, 8));} // make sure trie is case-insensitive + @Test public void Tail_image() {fxt.Test_parse_page_wiki("[[Image:a|b]]c", fxt.tkn_lnki_(0, 13).Tail_bgn_(-1).Tail_end_(-1), fxt.tkn_txt_(13, 14));} // NOTE: this occurs on some pages; + @Test public void Image() { fxt.Test_parse_page_wiki("[[Image:a]]" , fxt.tkn_lnki_().Ns_id_(Xow_ns_.Tid__file).Trg_tkn_(fxt.tkn_arg_val_(fxt.tkn_txt_(2, 7), fxt.tkn_colon_(7), fxt.tkn_txt_(8, 9)))); fxt.Test_parse_page_wiki("[[Image:a|border]]" , fxt.tkn_lnki_().Border_(Bool_.Y_byte)); fxt.Test_parse_page_wiki("[[Image:a|thumb]]" , fxt.tkn_lnki_().ImgType_(Xop_lnki_type.Id_thumb)); @@ -67,94 +67,94 @@ public class Xop_lnki_wkr__basic_tst { .Caption_tkn_(fxt.tkn_arg_nde_(22, 25).Val_tkn_(fxt.tkn_arg_itm_(fxt.tkn_txt_(22, 23), fxt.tkn_space_(23, 24), fxt.tkn_txt_(24, 25))))) ; } - @Test public void Image_upright() { + @Test public void Image_upright() { fxt.Test_parse_page_wiki("[[Image:a|upright=.123]]" , fxt.tkn_lnki_().Upright_(.123)); fxt.Test_parse_page_wiki("[[Image:a|upright]]" , fxt.tkn_lnki_().Upright_(gplx.xowa.files.Xof_img_size.Upright_default_marker)); // no eq tokn fxt.Test_parse_page_wiki("[[Image:a|upright=.42190046219457]]", fxt.tkn_lnki_().Upright_(.42190046219457)); // many decimal places breaks upright fxt.Init_log_(Xop_lnki_log.Upright_val_is_invalid) .Test_parse_page_wiki("[[Image:a|upright=y]]" , fxt.tkn_lnki_().Upright_(-1)); // invalid } - @Test public void Recurse() { + @Test public void Recurse() { fxt.Test_parse_page_wiki("[[Image:a|b-[[c]]-d]]" , fxt.tkn_lnki_().Ns_id_(Xow_ns_.Tid__file) .Trg_tkn_(fxt.tkn_arg_nde_().Val_tkn_(fxt.tkn_arg_itm_(fxt.tkn_txt_(2, 7), fxt.tkn_colon_(7), fxt.tkn_txt_(8, 9)))) .Caption_tkn_(fxt.tkn_arg_nde_(10, 19).Val_tkn_(fxt.tkn_arg_itm_(fxt.tkn_txt_(10, 12), fxt.tkn_lnki_(12, 17), fxt.tkn_txt_(17, 19)))) ); } - @Test public void Outliers() { + @Test public void Outliers() { fxt.Test_parse_page_wiki("[[Image:a=b.svg|thumb|10px]]", fxt.tkn_lnki_().Ns_id_(Xow_ns_.Tid__file).Trg_tkn_(fxt.tkn_arg_nde_().Val_tkn_(fxt.tkn_arg_itm_(fxt.tkn_txt_(2, 7), fxt.tkn_colon_(7), fxt.tkn_txt_(8, 9), fxt.tkn_eq_(9), fxt.tkn_txt_(10, 15))))); fxt.Test_parse_page_wiki("[[Category:a|b]]", fxt.tkn_lnki_().Ns_id_(Xow_ns_.Tid__category)); } - @Test public void Exc_caption_has_eq() { + @Test public void Exc_caption_has_eq() { fxt.Test_parse_page_wiki("[[Image:a.svg|thumb|a=b]]", fxt.tkn_lnki_().Ns_id_(Xow_ns_.Tid__file) .Caption_tkn_(fxt.tkn_arg_nde_(20, 23).Val_tkn_(fxt.tkn_arg_itm_(fxt.tkn_txt_(20, 21), fxt.tkn_eq_(21), fxt.tkn_txt_(22, 23))))); } - @Test public void Border_with_space_should_not_be_caption() {// happens with {{flag}}; EX: [[Image:Flag of Argentina.svg|22x20px|border |alt=|link=]] + @Test public void Border_with_space_should_not_be_caption() {// happens with {{flag}}; EX: [[Image:Flag of Argentina.svg|22x20px|border |alt=|link=]] Xop_root_tkn root = fxt.Test_parse_page_wiki_root("[[Image:a.svg|22x20px|border |alt=|link=]]"); Xop_lnki_tkn lnki = (Xop_lnki_tkn)root.Subs_get(0); Tfds.Eq(Xop_tkn_itm_.Tid_null, lnki.Caption_tkn().Tkn_tid()); } - @Test public void Ws_key_bgn() { + @Test public void Ws_key_bgn() { fxt.Test_parse_page_wiki("[[Image:a| alt=b]]", fxt.tkn_lnki_() .Alt_tkn_(fxt.tkn_arg_nde_() . Key_tkn_(fxt.tkn_arg_itm_(fxt.tkn_space_(10, 11).Ignore_y_(), fxt.tkn_txt_(11, 14))) . Val_tkn_(fxt.tkn_arg_itm_(fxt.tkn_txt_(15, 16))) )); } - @Test public void Ws_key_end() { + @Test public void Ws_key_end() { fxt.Test_parse_page_wiki("[[Image:a|alt =b]]", fxt.tkn_lnki_() .Caption_tkn_(fxt.tkn_arg_nde_(10, 16) . Val_tkn_(fxt.tkn_arg_itm_(fxt.tkn_txt_(10, 13), fxt.tkn_space_(13, 14), fxt.tkn_eq_(14), fxt.tkn_txt_(15, 16))) )); } - @Test public void Ws_val_bgn() { + @Test public void Ws_val_bgn() { fxt.Test_parse_page_wiki("[[Image:a|alt= b]]", fxt.tkn_lnki_() .Alt_tkn_(fxt.tkn_arg_nde_() . Key_tkn_(fxt.tkn_arg_itm_(fxt.tkn_txt_(10, 13))) . Val_tkn_(fxt.tkn_arg_itm_(fxt.tkn_space_(14, 15), fxt.tkn_txt_(15, 16))) )); } - @Test public void Ws_val_end() { + @Test public void Ws_val_end() { fxt.Test_parse_page_wiki("[[Image:a|alt=b ]]", fxt.tkn_lnki_() .Alt_tkn_(fxt.tkn_arg_nde_() . Key_tkn_(fxt.tkn_arg_itm_(fxt.tkn_txt_(10, 13))) . Val_tkn_(fxt.tkn_arg_itm_(fxt.tkn_txt_(14, 15), fxt.tkn_space_(15, 16).Ignore_y_())) )); } - @Test public void Ws_val_only() { // simpler variation of Ws_val_size + @Test public void Ws_val_only() { // simpler variation of Ws_val_size fxt.Test_parse_page_wiki("[[Image:a| b ]]", fxt.tkn_lnki_() .Caption_tkn_(fxt.tkn_arg_nde_() . Val_tkn_(fxt.tkn_arg_itm_(fxt.tkn_space_(10, 11), fxt.tkn_txt_(11, 12), fxt.tkn_space_(12, 13))) )); } - @Test public void Ws_val_size() { + @Test public void Ws_val_size() { fxt.Test_parse_page_wiki("[[Image:a| 20x30px ]]" , fxt.tkn_lnki_().Width_(20).Height_(30)); } - @Test public void Nl_pipe() { // PURPOSE: "\n|" triggers tblw; PAGE:fr.w:France; [[Fichier:Carte demographique de la France.svg + @Test public void Nl_pipe() { // PURPOSE: "\n|" triggers tblw; PAGE:fr.w:France; [[Fichier:Carte demographique de la France.svg fxt.Test_parse_page_wiki("[[Image:A.png|thumb\n|alt=test]]", fxt.tkn_lnki_() .Alt_tkn_(fxt.tkn_arg_nde_() . Key_tkn_(fxt.tkn_arg_itm_(fxt.tkn_txt_(21, 24))) . Val_tkn_(fxt.tkn_arg_itm_(fxt.tkn_txt_(25, 29))) )); } - @Test public void Exc_empty_caption() { + @Test public void Exc_empty_caption() { fxt.Test_parse_page_wiki("[[a|]]", fxt.tkn_lnki_().Trg_tkn_(fxt.tkn_arg_val_txt_(2, 3))); } - @Test public void Exc_empty() { + @Test public void Exc_empty() { fxt.Init_log_(Xop_lnki_log.Invalid_ttl); fxt.Test_parse_page_wiki("[[]]", fxt.tkn_txt_(0, 2), fxt.tkn_txt_(2, 4)); fxt.Init_log_(Xop_lnki_log.Invalid_ttl); fxt.Test_parse_page_wiki("[[ ]]", fxt.tkn_txt_(0, 2), fxt.tkn_space_(2, 3), fxt.tkn_txt_(3, 5)); } - @Test public void Exc_invalid_u8() { // PURPOSE: "%DO" is an invalid UTF-8 sequence (requires 2 bytes, not just %D0); DATE:2013-11-11 + @Test public void Exc_invalid_u8() { // PURPOSE: "%DO" is an invalid UTF-8 sequence (requires 2 bytes, not just %D0); DATE:2013-11-11 fxt.Ctx().Lang().Case_mgr_u8_(); // NOTE: only occurs during Universal fxt.Test_parse_page_all_str("[[%D0]]", "[[%D0]]"); // invalid titles render literally } - @Test public void Ex_eq() { // make sure that eq is not evaluated for kv delimiter + @Test public void Ex_eq() { // make sure that eq is not evaluated for kv delimiter fxt.Test_parse_page_wiki("[[=]]", fxt.tkn_lnki_(0, 5)); fxt.Test_parse_page_wiki("[[a|=]]", fxt.tkn_lnki_(0, 7)); } - @Test public void Unclosed() { // PURPOSE: unclosed lnki skips rendering of next table; PAGE:en.w:William Penn (Royal Navy officer) + @Test public void Unclosed() { // PURPOSE: unclosed lnki skips rendering of next table; PAGE:en.w:William Penn (Royal Navy officer) fxt.Test_parse_page_wiki_str(String_.Concat_lines_nl_skip_last ( "a [[b|c]" , "" @@ -173,7 +173,7 @@ public class Xop_lnki_wkr__basic_tst { , "" )); } - @Test public void Caption_nl() { // PURPOSE: \n in caption should be rendered as space; PAGE:en.w:Schwarzschild radius; and the stellar [[Velocity dispersion|velocity\ndispersion]] + @Test public void Caption_nl() { // PURPOSE: \n in caption should be rendered as space; PAGE:en.w:Schwarzschild radius; and the stellar [[Velocity dispersion|velocity\ndispersion]] fxt.Init_para_y_(); fxt.Test_parse_page_wiki_str(String_.Concat_lines_nl_skip_last ( "a [[b|c" @@ -187,7 +187,7 @@ public class Xop_lnki_wkr__basic_tst { )); fxt.Init_para_n_(); } - @Test public void Caption_nl_2() { // PURPOSE: unclosed lnki breaks paragraph unexpectedly; PAGE:en.w:Oldsmobile; + @Test public void Caption_nl_2() { // PURPOSE: unclosed lnki breaks paragraph unexpectedly; PAGE:en.w:Oldsmobile; fxt.Init_para_y_(); fxt.Test_parse_page_wiki_str(String_.Concat_lines_nl_skip_last ( "a" @@ -204,7 +204,7 @@ public class Xop_lnki_wkr__basic_tst { )); fxt.Init_para_n_(); } - @Test public void Caption_ref() { // PURPOSE: not handled in lnki; PAGE:en.w:WWI + @Test public void Caption_ref() { // PURPOSE: not handled in lnki; PAGE:en.w:WWI fxt.Test_parse_page_wiki_str(String_.Concat_lines_nl_skip_last ( "[[File:A.png|thumb|b c]]" ), String_.Concat_lines_nl_skip_last @@ -219,90 +219,90 @@ public class Xop_lnki_wkr__basic_tst { , "" )); } - @Test public void Html_ent_pound() { + @Test public void Html_ent_pound() { fxt.Test_parse_page_wiki_str ( "[[A#b|c]]", String_.Concat_lines_nl_skip_last ( "c" )); } - @Test public void Html_ent_ltr_a() { + @Test public void Html_ent_ltr_a() { fxt.Test_parse_page_wiki_str ( "[[Ab|c]]", String_.Concat_lines_nl_skip_last ( "c" )); } - @Test public void Pipe_trick() { + @Test public void Pipe_trick() { fxt.Test_parse_page_wiki_str("[[Page1|]]" , "Page1"); fxt.Test_parse_page_wiki_str("[[Help:Page1|]]" , "Page1"); } - @Test public void Thumb_first_align_trumps_all() { // PURPOSE: if there are multiple alignment instructions, take the first EX:[[File:A.png|thumb|center|left]] DATE:20121226 + @Test public void Thumb_first_align_trumps_all() { // PURPOSE: if there are multiple alignment instructions, take the first EX:[[File:A.png|thumb|center|left]] DATE:20121226 fxt.Test_parse_page_wiki_str("[[File:A.png|thumb|right|center]]" // NOTE: right trumps center , String_.Concat_lines_nl_skip_last ( Xop_para_wkr_basic_tst.File_html("File", "A.png", "7/0", "") , "" )); } - @Test public void Eq() { + @Test public void Eq() { fxt.Test_parse_page_all_str("[[B|=]]", "="); } - @Test public void Href_encode_anchor() { // PURPOSE: test separate encoding for ttl (%) and anchor (.) + @Test public void Href_encode_anchor() { // PURPOSE: test separate encoding for ttl (%) and anchor (.) fxt.Test_parse_page_all_str("[[^#^]]", "^#^"); // ISSUE#:462; DATE:2019-05-12 } - @Test public void Href_question() { // PURPOSE.fix: ttl with ? at end should not be considered qarg; DATE:2013-02-08 + @Test public void Href_question() { // PURPOSE.fix: ttl with ? at end should not be considered qarg; DATE:2013-02-08 fxt.Test_parse_page_all_str("[[A?]]", "A?"); } - @Test public void Href_question_2() { // PURPOSE: ?action=edit should be encoded; DATE:2013-02-10 + @Test public void Href_question_2() { // PURPOSE: ?action=edit should be encoded; DATE:2013-02-10 fxt.Test_parse_page_all_str("[[A?action=edit]]", "A?action=edit"); } - @Test public void Href_question_3() { // PURPOSE.fix: DATE:2014-01-16 + @Test public void Href_question_3() { // PURPOSE.fix: DATE:2014-01-16 fxt.Test_parse_page_all_str("[[A?b]]", "A?b"); } - @Test public void Encoded_url() { // PURPOSE.fix: url-encoded characters broke parser when embedded in link; DATE:2013-03-01 + @Test public void Encoded_url() { // PURPOSE.fix: url-encoded characters broke parser when embedded in link; DATE:2013-03-01 fxt.Init_xwiki_add_user_("commons.wikimedia.org"); fxt.Test_parse_page_wiki_str("[[File:A.png|link=//commons.wikimedia.org/wiki/%D0%97%D0%B0%D0%B3%D0%BB%D0%B0%D0%B2%D0%BD%D0%B0%D1%8F_%D1%81%D1%82%D1%80%D0%B0%D0%BD%D0%B8%D1%86%D0%B0?uselang=ru|b]]" , "\"b\""); } - @Test public void Link__invalid() { // PURPOSE.fix: do not render invalid text; EX: link={{{1}}}; [[Fil:Randers_-_Hadsund_railway.png|120x160px|link={{{3}}}|Randers-Hadsund Jernbane]]; DATE:2013-03-04 + @Test public void Link__invalid() { // PURPOSE.fix: do not render invalid text; EX: link={{{1}}}; [[Fil:Randers_-_Hadsund_railway.png|120x160px|link={{{3}}}|Randers-Hadsund Jernbane]]; DATE:2013-03-04 fxt.Test_parse_page_wiki_str ( "[[File:A.png|12x10px|link={{{1}}}|c]]", String_.Concat_lines_nl_skip_last ( "\"c\"" )); } - @Test public void Link__html_ent() {// PURPOSE:html entities should be converted to chars; EX:  -> _; DATE:2013-12-16 + @Test public void Link__html_ent() {// PURPOSE:html entities should be converted to chars; EX:  -> _; DATE:2013-12-16 fxt.Test_parse_page_wiki_str ( "[[File:A.png|link=b c]]", String_.Concat_lines_nl_skip_last ( "\"\"" )); } - @Test public void Link__encode() {// PURPOSE:spaces should become underscore; DATE:2015-11-27 + @Test public void Link__encode() {// PURPOSE:spaces should become underscore; DATE:2015-11-27 fxt.Test_parse_page_wiki_str ( "[[File:A.png|link=File:A b ç.ogg]]", String_.Concat_lines_nl_skip_last ( "\"\"" )); } - @Test public void Href_anchor_leading_space() { // PURPOSE: ?action=edit should be encoded; DATE:2013-02-10 + @Test public void Href_anchor_leading_space() { // PURPOSE: ?action=edit should be encoded; DATE:2013-02-10 fxt.Test_parse_page_all_str("[[A #b]]", "A #b"); } - @Test public void Anchor_not_shown_for_wikipedia_ns() { // PURPOSE: Help:A#b was omitting anchor; showing text of "Help:A"; DATE:2013-06-21 + @Test public void Anchor_not_shown_for_wikipedia_ns() { // PURPOSE: Help:A#b was omitting anchor; showing text of "Help:A"; DATE:2013-06-21 fxt.Test_parse_page_all_str("[[Help:A#b]]", "Help:A#b"); } - @Test public void Anchor_shown_for_main_ns() { // PURPOSE: counterpart to Anchor_not_shown_for_wikipedia_ns; DATE:2013-06-21 + @Test public void Anchor_shown_for_main_ns() { // PURPOSE: counterpart to Anchor_not_shown_for_wikipedia_ns; DATE:2013-06-21 fxt.Test_parse_page_all_str("[[A#b]]", "A#b"); } - @Test public void Trail_en() { + @Test public void Trail_en() { fxt.Test_parse_page_all_str("[[Ab]]cd e", "Abcd e"); } - @Test public void Trail_fr() { + @Test public void Trail_fr() { byte[] ltr_c_in_french = Bry_.new_u8("ç"); Xol_lnki_trail_mgr lnki_trail_mgr = fxt.Wiki().Lang().Lnki_trail_mgr(); lnki_trail_mgr.Add(ltr_c_in_french); fxt.Test_parse_page_all_str("[[Ab]]çd e", "Abçd e"); lnki_trail_mgr.Del(ltr_c_in_french); } - @Test public void Page() { + @Test public void Page() { fxt.Test_parse_page_wiki("[[File:A.pdf|page=12]]" , fxt.tkn_lnki_().Page_(12)); } - @Test public void Visited() { // PURPOSE: show redirected titles as visited; EX:fr.w:Alpes_Pennines; DATE:2014-02-28 + @Test public void Visited() { // PURPOSE: show redirected titles as visited; EX:fr.w:Alpes_Pennines; DATE:2014-02-28 Xowe_wiki wiki = fxt.Wiki(); Xoa_ttl ttl = Xoa_ttl.Parse(wiki, Bry_.new_a7("Src")); // simulate requrest for "Src" page Xoae_page previous_page = Xoae_page.New_test(wiki, ttl); @@ -312,14 +312,14 @@ public class Xop_lnki_wkr__basic_tst { fxt.Test_parse_page_all_str("[[Src]]" , "Src"); // show [[Src]] as visited since it exists in history fxt.Test_parse_page_all_str("[[Other]]" , "Other"); // show other pages as not visited } - @Test public void File_keywords__ignore_if_not_file_ns() { // ISSUE#:303 DATE:2019-03-24 + @Test public void File_keywords__ignore_if_not_file_ns() { // ISSUE#:303 DATE:2019-03-24 fxt.Test_parse_page_all_str("[[A|class]]", "class"); fxt.Test_parse_page_all_str("[[A|alt]]", "alt"); fxt.Test_parse_page_all_str("[[A|sub]]", "sub"); fxt.Test_parse_page_all_str("[[A|sup]]", "sup"); fxt.Test_parse_page_all_str("[[A|alt|a|b]]", "alt|a|b"); } - @Test public void File_keywords__ignore_if_no_key() { // ISSUE#:303; DATE:2019-03-24 + @Test public void File_keywords__ignore_if_no_key() { // ISSUE#:303; DATE:2019-03-24 // assert treated as captions if no key Test__File_keywords__ignore_if_no_key("class", "alt", "link", "page", "thumbtime"); diff --git a/400_xowa/src/gplx/xowa/parsers/lnkis/Xop_lnki_wkr__ctg_tst.java b/400_xowa/src/gplx/xowa/parsers/lnkis/Xop_lnki_wkr__ctg_tst.java index ebec52c40..bc01ffc67 100644 --- a/400_xowa/src/gplx/xowa/parsers/lnkis/Xop_lnki_wkr__ctg_tst.java +++ b/400_xowa/src/gplx/xowa/parsers/lnkis/Xop_lnki_wkr__ctg_tst.java @@ -1,25 +1,25 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.parsers.lnkis; import gplx.*; import gplx.xowa.*; import gplx.xowa.parsers.*; import org.junit.*; import gplx.xowa.langs.cases.*; public class Xop_lnki_wkr__ctg_tst { @Before public void init() {fxt.Reset(); fxt.Init_para_y_();} private final Xop_fxt fxt = new Xop_fxt(); @After public void term() {fxt.Init_para_n_();} - @Test public void Pre() { // PURPOSE: Category should trim preceding nl; EX:w:Mount Kailash + @Test public void Pre() { // PURPOSE: Category should trim preceding nl; EX:w:Mount Kailash fxt.Test_parse_page_wiki_str(String_.Concat_lines_nl_skip_last ( "a" , " [[Category:b]]" @@ -31,7 +31,7 @@ public class Xop_lnki_wkr__ctg_tst { , "" )); } - @Test public void Ws() { // FUTURE: needs more para rework; conflicts with Li() test; WHEN: when issue is found + @Test public void Ws() { // FUTURE: needs more para rework; conflicts with Li() test; WHEN: when issue is found fxt.Test_parse_page_wiki_str(String_.Concat_lines_nl_skip_last ( "a" , "x [[Category:b]]" @@ -44,7 +44,7 @@ public class Xop_lnki_wkr__ctg_tst { , "" )); } - @Test public void Li() { // PURPOSE: Category strips all preceding ws; PAGE:en.w:NYC (in external links) + @Test public void Li() { // PURPOSE: Category strips all preceding ws; PAGE:en.w:NYC (in external links) fxt.Test_parse_page_wiki_str(String_.Concat_lines_nl_skip_last ( "*a" , "*b" @@ -61,7 +61,7 @@ public class Xop_lnki_wkr__ctg_tst { , "" )); } - @Test public void Li_w_lnke() { // PURPOSE: [[Category]] was being absorbed into lnke; PAGE:de.w:ISO/IEC/IEEE_29119_Software_Testing DATE:2014-07-11 + @Test public void Li_w_lnke() { // PURPOSE: [[Category]] was being absorbed into lnke; PAGE:de.w:ISO/IEC/IEEE_29119_Software_Testing DATE:2014-07-11 fxt.Test_parse_page_all_str(String_.Concat_lines_nl_skip_last ( "* http://a.org" , "[[Category:B]]" // category should not show below @@ -73,7 +73,7 @@ public class Xop_lnki_wkr__ctg_tst { , "" )); } - @Test public void Merge_li() { // PURPOSE: trim ws preceding [[Category:; de.d:plant; DATE:2014-03-27 + @Test public void Merge_li() { // PURPOSE: trim ws preceding [[Category:; de.d:plant; DATE:2014-03-27 fxt.Test_parse_page_all_str(String_.Concat_lines_nl_skip_last ( "*a" , "" @@ -86,7 +86,7 @@ public class Xop_lnki_wkr__ctg_tst { , "" )); } - @Test public void Merge_pre() { // PURPOSE: leading spaces / nls should be removed from normal Category, else false pre's or excessive line breaks + @Test public void Merge_pre() { // PURPOSE: leading spaces / nls should be removed from normal Category, else false pre's or excessive line breaks fxt.Test_parse_page_wiki_str(String_.Concat_lines_nl ( " [[Category:A]]" // removes \s , " [[Category:B]]" // removes \n\s @@ -95,7 +95,7 @@ public class Xop_lnki_wkr__ctg_tst { , "

    " )); } - @Test public void Literal() { // PURPOSE: do not trim ws if literal Category; EX:fr.wikiquote.org/wiki/Accueil; REF: https://sourceforge.net/p/xowa/tickets/167/; DATE:2013-07-10 + @Test public void Literal() { // PURPOSE: do not trim ws if literal Category; EX:fr.wikiquote.org/wiki/Accueil; REF: https://sourceforge.net/p/xowa/tickets/167/; DATE:2013-07-10 fxt.Test_parse_page_wiki_str(String_.Concat_lines_nl ( "[[:Category:A]]" , "[[:Category:B]]" @@ -105,21 +105,21 @@ public class Xop_lnki_wkr__ctg_tst { , "

    " )); } - @Test public void Hdr_w_nl() { // PURPOSE: hdr code broken by Category; DATE:2014-04-17 + @Test public void Hdr_w_nl() { // PURPOSE: hdr code broken by Category; DATE:2014-04-17 fxt.Test_parse_page_all_str("==a==\n[[Category:C]]" , String_.Concat_lines_nl_skip_last ( "

    a

    " , "" )); } - @Test public void Hdr_only() { // PURPOSE: check that == is hdr; EX:ar.d:جَبَّارَة; DATE:2014-04-17 + @Test public void Hdr_only() { // PURPOSE: check that == is hdr; EX:ar.d:جَبَّارَة; DATE:2014-04-17 fxt.Test_parse_page_wiki_str("==a==[[Category:C]]" , String_.Concat_lines_nl_skip_last ( "

    a

    " , "" )); } - @Test public void Hdr_ignore() { // PURPOSE: check that hdr is ignored if next char is not nl; DATE:2014-04-17 + @Test public void Hdr_ignore() { // PURPOSE: check that hdr is ignored if next char is not nl; DATE:2014-04-17 fxt.Test_parse_page_wiki_str("==a==[[Category:C]]b" , String_.Concat_lines_nl_skip_last ( "==a==b" diff --git a/400_xowa/src/gplx/xowa/parsers/lnkis/Xop_lnki_wkr__frame_tst.java b/400_xowa/src/gplx/xowa/parsers/lnkis/Xop_lnki_wkr__frame_tst.java index 1a18354e5..1608e185a 100644 --- a/400_xowa/src/gplx/xowa/parsers/lnkis/Xop_lnki_wkr__frame_tst.java +++ b/400_xowa/src/gplx/xowa/parsers/lnkis/Xop_lnki_wkr__frame_tst.java @@ -13,11 +13,11 @@ The terms of each license can be found in the source code repository: GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt */ -package gplx.xowa.parsers.lnkis; import gplx.*; import gplx.xowa.*; import gplx.xowa.parsers.*; -import org.junit.*; -public class Xop_lnki_wkr__frame_tst { - @Before public void init() {fxt.Reset(); fxt.Init_para_n_();} private final Xop_fxt fxt = new Xop_fxt(); - // PURPOSE:use 1st imgtype param; changed between mw1.22.2 and mw1.25.2 PAGE:he.w:מספן_המודיעין EX: [[File:Osa-I class Project205 DN-SN-84-01770.jpg|thumb|frame|abcde]] - @Test public void Use_1st__thumb() {fxt.Test_parse_page_wiki("[[File:A.png|thumb|frame]]", fxt.tkn_lnki_().ImgType_(Xop_lnki_type.Id_thumb));} - @Test public void Use_1st__frame() {fxt.Test_parse_page_wiki("[[File:A.png|frame|thumb]]", fxt.tkn_lnki_().ImgType_(Xop_lnki_type.Id_frame));} -} +package gplx.xowa.parsers.lnkis; import gplx.*; import gplx.xowa.*; import gplx.xowa.parsers.*; +import org.junit.*; +public class Xop_lnki_wkr__frame_tst { + @Before public void init() {fxt.Reset(); fxt.Init_para_n_();} private final Xop_fxt fxt = new Xop_fxt(); + // PURPOSE:use 1st imgtype param; changed between mw1.22.2 and mw1.25.2 PAGE:he.w:מספן_המודיעין EX: [[File:Osa-I class Project205 DN-SN-84-01770.jpg|thumb|frame|abcde]] + @Test public void Use_1st__thumb() {fxt.Test_parse_page_wiki("[[File:A.png|thumb|frame]]", fxt.tkn_lnki_().ImgType_(Xop_lnki_type.Id_thumb));} + @Test public void Use_1st__frame() {fxt.Test_parse_page_wiki("[[File:A.png|frame|thumb]]", fxt.tkn_lnki_().ImgType_(Xop_lnki_type.Id_frame));} +} diff --git a/400_xowa/src/gplx/xowa/parsers/lnkis/Xop_lnki_wkr__invalid_tst.java b/400_xowa/src/gplx/xowa/parsers/lnkis/Xop_lnki_wkr__invalid_tst.java index 2c377c447..382cee4b5 100644 --- a/400_xowa/src/gplx/xowa/parsers/lnkis/Xop_lnki_wkr__invalid_tst.java +++ b/400_xowa/src/gplx/xowa/parsers/lnkis/Xop_lnki_wkr__invalid_tst.java @@ -1,40 +1,40 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.parsers.lnkis; import gplx.*; import gplx.xowa.*; import gplx.xowa.parsers.*; import org.junit.*; import gplx.xowa.langs.cases.*; import gplx.xowa.wikis.ttls.*; public class Xop_lnki_wkr__invalid_tst { @Before public void init() {fxt.Reset(); fxt.Init_para_n_();} private final Xop_fxt fxt = new Xop_fxt(); - @Test public void Ignore_invalid_url_encodings() { // PURPOSE: if url encoding is invalid, still render lnki as ; EX: fr.w:Bordetella; + @Test public void Ignore_invalid_url_encodings() { // PURPOSE: if url encoding is invalid, still render lnki as ; EX: fr.w:Bordetella; fxt.Test_parse_page_all_str("[[%GC]]", "%GC"); } - @Test public void Caption_still_parsed() { // PURPOSE: failed lnki should still parse xml in caption; EX:ar.w:الصومال; DATE:2014-03-04 + @Test public void Caption_still_parsed() { // PURPOSE: failed lnki should still parse xml in caption; EX:ar.w:الصومال; DATE:2014-03-04 fxt.Test_parse_page_all_str("[[|''a'']]" , "[[|a]]"); } - @Test public void Ttl_still_parsed() { // PURPOSE: invalid lnki should still parse ttl; BASED_ON:ar.w:الصومال; DATE:2014-03-26 + @Test public void Ttl_still_parsed() { // PURPOSE: invalid lnki should still parse ttl; BASED_ON:ar.w:الصومال; DATE:2014-03-26 fxt.Test_parse_page_all_str("[[''[a]'']]" , "[[[a]]]"); } - @Test public void Pipe_only() { + @Test public void Pipe_only() { fxt.Init_log_(Xop_lnki_log.Invalid_ttl); fxt.Test_parse_page_wiki("[[|]]", fxt.tkn_txt_(0, 2), fxt.tkn_pipe_(2), fxt.tkn_txt_(3, 5)); } - @Test public void Xnde_should_force_ttl_parse() { // PURPOSE: reparse should be forced at xnde not at pipe; EX: [[ac|d]] reparse should start at ; DATE:2014-03-30 + @Test public void Xnde_should_force_ttl_parse() { // PURPOSE: reparse should be forced at xnde not at pipe; EX: [[ac|d]] reparse should start at ; DATE:2014-03-30 fxt.Test_parse_page_all_str_and_chk("[[ac|d]]" , "[[ac|d]]", Xop_lnki_log.Invalid_ttl); } - @Test public void Tblw_tb() { // PURPOSE: reparse should be forced at tblw.tb; DATE:2014-04-03 + @Test public void Tblw_tb() { // PURPOSE: reparse should be forced at tblw.tb; DATE:2014-04-03 fxt.Test_parse_page_all_str_and_chk("[[a\n{||b]]", String_.Concat_lines_nl_skip_last ( "[[a" , "|b]]" @@ -42,25 +42,25 @@ public class Xop_lnki_wkr__invalid_tst { , "" ), Xop_lnki_log.Invalid_ttl); } - @Test public void Tblw_tr() { // PURPOSE: reparse should be forced at tblw.tr; DATE:2014-04-03 + @Test public void Tblw_tr() { // PURPOSE: reparse should be forced at tblw.tr; DATE:2014-04-03 fxt.Test_parse_page_all_str_and_chk("[[a\n|-b]]", String_.Concat_lines_nl_skip_last ( "[[a" , "|-b]]" ), Xop_lnki_log.Invalid_ttl); } - @Test public void Tblw_tr_like() { // PURPOSE: do not invalidate if pseudo-tr; DATE:2014-04-03 + @Test public void Tblw_tr_like() { // PURPOSE: do not invalidate if pseudo-tr; DATE:2014-04-03 fxt.Test_parse_page_all_str_and_chk("[[a|-b]]", "-b"); } - @Test public void Nl() { // PURPOSE: invalidate if nl; DATE:2014-04-03 + @Test public void Nl() { // PURPOSE: invalidate if nl; DATE:2014-04-03 fxt.Test_parse_page_all_str_and_chk("''[[\n]]", "[[\n]]", Xop_lnki_log.Invalid_ttl); } - @Test public void Nl_with_apos_shouldnt_fail() { // PURPOSE: apos, lnki and nl will cause parser to fail; DATE:2013-10-31 + @Test public void Nl_with_apos_shouldnt_fail() { // PURPOSE: apos, lnki and nl will cause parser to fail; DATE:2013-10-31 fxt.Test_parse_page_all_str("''[[\n]]", "[[\n]]"); } -// @Test public void Brack_end_invalid() { // PURPOSE: invalidate if ]; DATE:2014-04-03; // TODO_OLD: backout apos changes +// @Test public void Brack_end_invalid() { // PURPOSE: invalidate if ]; DATE:2014-04-03; // TODO_OLD: backout apos changes // fxt.Test_parse_page_all_str_and_chk("[[A] ]", "[[A] ]", Xop_lnki_log.Invalid_ttl); // } - @Test public void Module() { // PURPOSE: handle lnki_wkr parsing Module text (shouldn't happen); apos, tblw, lnki, and nl will cause parser to fail; also handles scan-bwd; EX:Module:Taxobox; DATE:2013-11-10 + @Test public void Module() { // PURPOSE: handle lnki_wkr parsing Module text (shouldn't happen); apos, tblw, lnki, and nl will cause parser to fail; also handles scan-bwd; EX:Module:Taxobox; DATE:2013-11-10 fxt.Init_para_y_(); fxt.Test_parse_page_wiki_str(String_.Concat_lines_nl ( " [[''" @@ -80,15 +80,15 @@ public class Xop_lnki_wkr__invalid_tst { )); fxt.Init_para_n_(); } - @Test public void Tblw_in_lnki() { // PURPOSE: handle invalid tblw tkn inside lnki; DATE:2014-06-06 + @Test public void Tblw_in_lnki() { // PURPOSE: handle invalid tblw tkn inside lnki; DATE:2014-06-06 fxt.Test_parse_page_all_str("[[A[]\n|b]]", "[[A[]\n|b]]"); // NOTE: \n| is tblw code for td } -// @Test public void Tmpl() { // PURPOSE: invalid lnki breaks template +// @Test public void Tmpl() { // PURPOSE: invalid lnki breaks template // fxt.Init_defn_clear(); // fxt.Init_defn_add("a", "b"); // fxt.Test_parse_page_all_str("{{a|[[}}", "b"); // } - @Test public void Ns_is_not_main_and_starts_with_anchor() { // PURPOSE:page cannot start with # if non-main ns; PAGE:en.w:Spindale,_North_Carolina; DATE:2015-12-28 + @Test public void Ns_is_not_main_and_starts_with_anchor() { // PURPOSE:page cannot start with # if non-main ns; PAGE:en.w:Spindale,_North_Carolina; DATE:2015-12-28 fxt.Test_parse_page_all_str("[[File:#A]]" , "[[File:#A]]"); } } diff --git a/400_xowa/src/gplx/xowa/parsers/lnkis/Xop_lnki_wkr__link__basic__tst.java b/400_xowa/src/gplx/xowa/parsers/lnkis/Xop_lnki_wkr__link__basic__tst.java index fd328336e..19292aee5 100644 --- a/400_xowa/src/gplx/xowa/parsers/lnkis/Xop_lnki_wkr__link__basic__tst.java +++ b/400_xowa/src/gplx/xowa/parsers/lnkis/Xop_lnki_wkr__link__basic__tst.java @@ -1,78 +1,78 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.parsers.lnkis; import gplx.*; import gplx.xowa.*; import gplx.xowa.parsers.*; import org.junit.*; import gplx.xowa.langs.cases.*; public class Xop_lnki_wkr__link__basic__tst { @Before public void init() {fxt.Reset(); fxt.Init_para_n_();} private final Xop_fxt fxt = new Xop_fxt(); - @Test public void Link() { + @Test public void Link() { fxt.Test_parse_page_wiki_str ( "[[File:A.png|12x10px|link=File:B.png|c]]", String_.Concat_lines_nl_skip_last ( "\"c\"" )); } - @Test public void Link_blank() { + @Test public void Link_blank() { fxt.Test_parse_page_wiki_str ( "[[File:A.png|12x10px|link=|c]]", String_.Concat_lines_nl_skip_last ( "\"c\"" )); } - @Test public void Link_external() { + @Test public void Link_external() { fxt.Test_parse_page_wiki_str ( "[[File:A.png|12x10px|link=http://www.b.org|c]]", String_.Concat_lines_nl_skip_last ( "\"c\"" )); } - @Test public void Link_file_system() { + @Test public void Link_file_system() { fxt.Test_parse_page_wiki_str ( "[[File:A.png|12x10px|link=file:///C/B.png|c]]", String_.Concat_lines_nl_skip_last ( "\"c\"" )); } - @Test public void Link_file_ns() { + @Test public void Link_file_ns() { fxt.Test_parse_page_wiki_str ( "[[File:A.png|12x10px|link=File:B.png|c]]", String_.Concat_lines_nl_skip_last ( "\"c\"" )); } - @Test public void Link_external_relative() { + @Test public void Link_external_relative() { fxt.Test_parse_page_wiki_str ( "[[File:A.png|12x10px|link=//fr.wikipedia.org/wiki/|c]]", String_.Concat_lines_nl_skip_last ( "\"c\"" )); } - @Test public void Link_external_absolute() { + @Test public void Link_external_absolute() { fxt.Test_parse_page_wiki_str ( "[[File:A.png|12x10px|link=http://fr.wikipedia.org/wiki/|c]]", String_.Concat_lines_nl_skip_last ( "\"c\"" )); } - @Test public void Link_external_double_http() {// PURPOSE.fix: link=http://a.org?b=http://c.org breaks lnki; DATE:2013-02-03 + @Test public void Link_external_double_http() {// PURPOSE.fix: link=http://a.org?b=http://c.org breaks lnki; DATE:2013-02-03 fxt.Test_parse_page_wiki_str ( "[[File:A.png|12x10px|link=//a.org?b=http://c.org]]", String_.Concat_lines_nl_skip_last ( "\"\"" )); } - @Test public void Encode() {// PURPOSE: encode invalid characters in link; PAGE:en.w:List_of_cultural_heritage_sites_in_Punjab,_Pakistan DATE:2014-07-16 + @Test public void Encode() {// PURPOSE: encode invalid characters in link; PAGE:en.w:List_of_cultural_heritage_sites_in_Punjab,_Pakistan DATE:2014-07-16 fxt.Test_parse_page_wiki_str ( "[[File:A.png|link=//b?c\">|d]]" , "\"d\"" ); } - @Test public void Anchor() {// PURPOSE: handle anchors; PAGE:en.w: en.w:History_of_Nauru; DATE:2015-12-27 + @Test public void Anchor() {// PURPOSE: handle anchors; PAGE:en.w: en.w:History_of_Nauru; DATE:2015-12-27 fxt.Test_parse_page_wiki_str ( "[[File:A.png|link=#b]]" , "\"\"" diff --git a/400_xowa/src/gplx/xowa/parsers/lnkis/Xop_lnki_wkr__link__xwiki__tst.java b/400_xowa/src/gplx/xowa/parsers/lnkis/Xop_lnki_wkr__link__xwiki__tst.java index 311b97091..12552eafb 100644 --- a/400_xowa/src/gplx/xowa/parsers/lnkis/Xop_lnki_wkr__link__xwiki__tst.java +++ b/400_xowa/src/gplx/xowa/parsers/lnkis/Xop_lnki_wkr__link__xwiki__tst.java @@ -1,59 +1,59 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.parsers.lnkis; import gplx.*; import gplx.xowa.*; import gplx.xowa.parsers.*; import org.junit.*; import gplx.xowa.langs.cases.*; public class Xop_lnki_wkr__link__xwiki__tst { @Before public void init() {fxt.Reset(); fxt.Init_para_n_();} private final Xop_fxt fxt = new Xop_fxt(); - @Test public void Relative() { // NOTE: changed href to return "wiki/" instead of "wiki"; DATE:2013-02-18 + @Test public void Relative() { // NOTE: changed href to return "wiki/" instead of "wiki"; DATE:2013-02-18 fxt.Init_xwiki_add_user_("fr.wikipedia.org"); fxt.Test_parse_page_wiki_str ( "[[File:A.png|12x10px|link=//fr.wikipedia.org/wiki/|c]]", String_.Concat_lines_nl_skip_last ( "\"c\"" )); } - @Test public void Relative_domain_only() { // lnki_wtr fails if link is only domain; EX: wikimediafoundation.org; [[Image:Wikispecies-logo.png|35px|link=//species.wikimedia.org]]; // NOTE: changed href to return "/wiki/" instead of ""; DATE:2013-02-18 + @Test public void Relative_domain_only() { // lnki_wtr fails if link is only domain; EX: wikimediafoundation.org; [[Image:Wikispecies-logo.png|35px|link=//species.wikimedia.org]]; // NOTE: changed href to return "/wiki/" instead of ""; DATE:2013-02-18 fxt.Init_xwiki_add_user_("fr.wikipedia.org"); fxt.Test_parse_page_wiki_str ( "[[File:A.png|12x10px|link=//fr.wikipedia.org]]", String_.Concat_lines_nl_skip_last ( "\"\"" )); } - @Test public void Absolute() { // NOTE: changed href to return "wiki/" instead of "wiki"; DATE:2013-02-18 + @Test public void Absolute() { // NOTE: changed href to return "wiki/" instead of "wiki"; DATE:2013-02-18 fxt.Init_xwiki_add_user_("fr.wikipedia.org"); fxt.Test_parse_page_wiki_str ( "[[File:A.png|12x10px|link=http://fr.wikipedia.org/wiki/|c]]", String_.Concat_lines_nl_skip_last ( "\"c\"" )); } - @Test public void Absolute_upload() { // PURPOSE: link to upload.wikimedia.org omits /wiki/; EX: wikimediafoundation.org: [[File:Page1-250px-WMF_AR11_SHIP_spreads_15dec11_72dpi.png|right|125px|border|2010–2011 Annual Report|link=https://upload.wikimedia.org/wikipedia/commons/4/48/WMF_AR11_SHIP_spreads_15dec11_72dpi.pdf]] + @Test public void Absolute_upload() { // PURPOSE: link to upload.wikimedia.org omits /wiki/; EX: wikimediafoundation.org: [[File:Page1-250px-WMF_AR11_SHIP_spreads_15dec11_72dpi.png|right|125px|border|2010–2011 Annual Report|link=https://upload.wikimedia.org/wikipedia/commons/4/48/WMF_AR11_SHIP_spreads_15dec11_72dpi.pdf]] fxt.Init_xwiki_add_user_("commons.wikimedia.org"); fxt.Test_parse_page_wiki_str ( "[[File:A.png|12x10px|link=http://upload.wikimedia.org/wikipedia/commons/7/70/A.png|c]]", String_.Concat_lines_nl_skip_last ( "\"c\"" )); } - @Test public void Relative_deep() { + @Test public void Relative_deep() { fxt.Init_xwiki_add_user_("fr.wikipedia.org"); fxt.Test_parse_page_wiki_str ( "[[File:A.png|12x10px|link=//fr.wikipedia.org/wiki/A/b|c]]", String_.Concat_lines_nl_skip_last ( "\"c\"" )); } - @Test public void Url_w_alias() { // [[File:Commons-logo.svg|25x25px|link=http://en.wikipedia.org/wiki/commons:Special:Search/Earth|alt=|Search Commons]] + @Test public void Url_w_alias() { // [[File:Commons-logo.svg|25x25px|link=http://en.wikipedia.org/wiki/commons:Special:Search/Earth|alt=|Search Commons]] fxt.Init_xwiki_add_wiki_and_user_("commons", "commons.wikimedia.org"); fxt.Init_xwiki_add_wiki_and_user_("en.wikipedia.org", "en.wikipedia.org"); // DATE:2015-07-22 fxt.Test_parse_page_wiki_str @@ -62,7 +62,7 @@ public class Xop_lnki_wkr__link__xwiki__tst { )); fxt.Init_xwiki_clear(); } - @Test public void Url_w_alias_and_sub_page() { // same as above, but for sub-page; [[File:Commons-logo.svg|25x25px|link=http://en.wikipedia.org/wiki/commons:Special:Search/Earth|alt=|Search Commons]] + @Test public void Url_w_alias_and_sub_page() { // same as above, but for sub-page; [[File:Commons-logo.svg|25x25px|link=http://en.wikipedia.org/wiki/commons:Special:Search/Earth|alt=|Search Commons]] fxt.Init_xwiki_add_wiki_and_user_("commons", "commons.wikimedia.org"); fxt.Init_xwiki_add_wiki_and_user_("en.wikipedia.org", "en.wikipedia.org"); // DATE:2015-07-22 fxt.Test_parse_page_wiki_str @@ -71,7 +71,7 @@ public class Xop_lnki_wkr__link__xwiki__tst { )); fxt.Init_xwiki_clear(); } - @Test public void Alias__basic() { // alias: basic; [[File:Commons-logo.svg|25x25px|link=commons:Special:Search/Earth]]; fictitious example; DATE:2013-02-18 + @Test public void Alias__basic() { // alias: basic; [[File:Commons-logo.svg|25x25px|link=commons:Special:Search/Earth]]; fictitious example; DATE:2013-02-18 fxt.Init_xwiki_add_wiki_and_user_("commons", "commons.wikimedia.org"); fxt.Test_parse_page_wiki_str ( "[[File:A.png|12x10px|link=commons:Special:Search/B|c]]", String_.Concat_lines_nl_skip_last @@ -79,7 +79,7 @@ public class Xop_lnki_wkr__link__xwiki__tst { )); fxt.Init_xwiki_clear(); } - @Test public void Alias__prepended_colon() { // alias prepended with ":"; [[File:Wikipedia-logo.svg|40px|link=:w:|Wikipedia]]; DATE:2013-05-06 + @Test public void Alias__prepended_colon() { // alias prepended with ":"; [[File:Wikipedia-logo.svg|40px|link=:w:|Wikipedia]]; DATE:2013-05-06 fxt.Init_xwiki_add_wiki_and_user_("commons", "commons.wikimedia.org"); fxt.Test_parse_page_wiki_str ( "[[File:A.png|12x10px|link=:commons:A/B|c]]", String_.Concat_lines_nl_skip_last @@ -87,7 +87,7 @@ public class Xop_lnki_wkr__link__xwiki__tst { )); fxt.Init_xwiki_clear(); } - @Test public void Alias__colon_only() {// alias: w/ only colon; EX: [[File:Commons-logo.svg|25x25px|link=commons:]]; PAGE:en.w:Wikipedia:Main_Page_alternative_(CSS_Update) DATE:2016-08-18 + @Test public void Alias__colon_only() {// alias: w/ only colon; EX: [[File:Commons-logo.svg|25x25px|link=commons:]]; PAGE:en.w:Wikipedia:Main_Page_alternative_(CSS_Update) DATE:2016-08-18 // make commons wiki fxt.Init_xwiki_add_wiki_and_user_("commons", "commons.wikimedia.org"); Xowe_wiki commons_wiki = (Xowe_wiki)fxt.App().Wiki_mgr().Get_by_or_make_init_n(gplx.xowa.wikis.domains.Xow_domain_itm_.Bry__commons); diff --git a/400_xowa/src/gplx/xowa/parsers/lnkis/Xop_lnki_wkr__pre_tst.java b/400_xowa/src/gplx/xowa/parsers/lnkis/Xop_lnki_wkr__pre_tst.java index 8d2f8a26b..63ff74246 100644 --- a/400_xowa/src/gplx/xowa/parsers/lnkis/Xop_lnki_wkr__pre_tst.java +++ b/400_xowa/src/gplx/xowa/parsers/lnkis/Xop_lnki_wkr__pre_tst.java @@ -1,25 +1,25 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.parsers.lnkis; import gplx.*; import gplx.xowa.*; import gplx.xowa.parsers.*; import org.junit.*; import gplx.xowa.langs.cases.*; public class Xop_lnki_wkr__pre_tst { @Before public void init() {fxt.Reset(); fxt.Init_para_y_();} private final Xop_fxt fxt = new Xop_fxt(); @After public void term() {fxt.Init_para_n_();} - @Test public void Previous_pre() { // PURPOSE: if pre is already in effect, end it; EX: en.b:Knowing_Knoppix/Other_applications + @Test public void Previous_pre() { // PURPOSE: if pre is already in effect, end it; EX: en.b:Knowing_Knoppix/Other_applications fxt.Test_parse_page_all_str(String_.Concat_lines_nl_skip_last ( "a" , " b" @@ -39,7 +39,7 @@ public class Xop_lnki_wkr__pre_tst { , "" )); } - @Test public void Current_pre_and_thumb() { // PURPOSE: current pre should be ended by thumb; EX: w:Roller coaster; it.w:Provincia_di_Pesaro_e_Urbino; DATE:2014-02-17 + @Test public void Current_pre_and_thumb() { // PURPOSE: current pre should be ended by thumb; EX: w:Roller coaster; it.w:Provincia_di_Pesaro_e_Urbino; DATE:2014-02-17 fxt.Test_parse_page_all_str(String_.Concat_lines_nl_skip_last ( "a" , " [[File:A.png|thumb]]" @@ -55,7 +55,7 @@ public class Xop_lnki_wkr__pre_tst { , "" )); } - @Test public void Current_pre_and_halign() { // PURPOSE: current pre should be ended by halign since they also produce divs; EX: w:Trombiculidae; DATE:2014-02-17 + @Test public void Current_pre_and_halign() { // PURPOSE: current pre should be ended by halign since they also produce divs; EX: w:Trombiculidae; DATE:2014-02-17 fxt.Test_parse_page_all_str(String_.Concat_lines_nl_skip_last ( "a" , " [[File:A.png|right]]" @@ -71,7 +71,7 @@ public class Xop_lnki_wkr__pre_tst { , "" )); } - @Test public void Current_pre() { // PURPOSE: current pre should exist if not div; DATE:2014-02-17 + @Test public void Current_pre() { // PURPOSE: current pre should exist if not div; DATE:2014-02-17 fxt.Test_parse_page_all_str(String_.Concat_lines_nl_skip_last ( "a" , " [[File:A.png]]" diff --git a/400_xowa/src/gplx/xowa/parsers/lnkis/Xop_lnki_wkr__size_tst.java b/400_xowa/src/gplx/xowa/parsers/lnkis/Xop_lnki_wkr__size_tst.java index ab91a5296..4d9ab78ef 100644 --- a/400_xowa/src/gplx/xowa/parsers/lnkis/Xop_lnki_wkr__size_tst.java +++ b/400_xowa/src/gplx/xowa/parsers/lnkis/Xop_lnki_wkr__size_tst.java @@ -1,50 +1,50 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.parsers.lnkis; import gplx.*; import gplx.xowa.*; import gplx.xowa.parsers.*; import org.junit.*; import gplx.xowa.parsers.xndes.*; public class Xop_lnki_wkr__size_tst { @Before public void init() {fxt.Reset(); fxt.Init_para_n_();} private final Xop_fxt fxt = new Xop_fxt(); - @Test public void Width__w__ws() { + @Test public void Width__w__ws() { fxt.Test_parse_page_wiki("[[Image:a| 123 px]]" , fxt.tkn_lnki_().Width_(123)); } - @Test public void Height() { + @Test public void Height() { fxt.Test_parse_page_wiki("[[Image:a|x40px]]" , fxt.tkn_lnki_().Height_(40).Width_(-1)); } - @Test public void Invalid_px__accept_double() { + @Test public void Invalid_px__accept_double() { fxt.Test_parse_page_wiki("[[Image:a|40pxpx]]" , fxt.tkn_lnki_().Width_(40).Height_(-1)); } - @Test public void Invalid_px__accept_double__w_ws() { + @Test public void Invalid_px__accept_double__w_ws() { fxt.Test_parse_page_wiki("[[Image:a|40pxpx ]]" , fxt.tkn_lnki_().Width_(40).Height_(-1)); } - @Test public void Invalid_px__accept_double__w_ws_2() {// PURPOSE: handle ws between px's; EX:sv.w:Drottningholms_slott; DATE:2014-03-01 + @Test public void Invalid_px__accept_double__w_ws_2() {// PURPOSE: handle ws between px's; EX:sv.w:Drottningholms_slott; DATE:2014-03-01 fxt.Test_parse_page_wiki("[[Image:a|40px px]]" , fxt.tkn_lnki_().Width_(40).Height_(-1)); } - @Test public void Invalid_px__ignore_if_w() { + @Test public void Invalid_px__ignore_if_w() { fxt.Test_parse_page_wiki("[[Image:a|40px20px]]" , fxt.tkn_lnki_().Width_(-1).Height_(-1)); // -1 b/c "40px" } - @Test public void Large_number() { // PURPOSE: perf code identified large sizes as caption; DATE:2014-02-15 + @Test public void Large_number() { // PURPOSE: perf code identified large sizes as caption; DATE:2014-02-15 fxt.Test_parse_page_wiki("[[Image:a|1234567890x1234567890px]]" , fxt.tkn_lnki_().Width_(1234567890).Height_(1234567890)); } - @Test public void Large_number__discard_if_gt_int() { // PURPOSE: size larger than int should be discarded, not be Int_.Max_value: PAGE:id.w:Baho; DATE:2014-06-10 + @Test public void Large_number__discard_if_gt_int() { // PURPOSE: size larger than int should be discarded, not be Int_.Max_value: PAGE:id.w:Baho; DATE:2014-06-10 fxt.Test_html_wiki_frag("[[File:A.png|9999999999x30px]]", " width=\"0\" height=\"30\""); // width should not be Int_.Max_value } - @Test public void Dangling_xnde() { // PURPOSE: dangling xnde should not eat rest of lnki; PAGE:sr.w:Сићевачка_клисура DATE:2014-07-03 + @Test public void Dangling_xnde() { // PURPOSE: dangling xnde should not eat rest of lnki; PAGE:sr.w:Сићевачка_клисура DATE:2014-07-03 fxt.Init_log_(Xop_xnde_log.Dangling_xnde).Test_parse_page_wiki("[[Image:a.png|c|40px]]" , fxt.tkn_lnki_().Width_(40).Height_(-1)); } - @Test public void Ws_para() { // PURPOSE:

    in arg_bldr causes parse to fail; EX: w:Supreme_Court_of_the_United_States; DATE:2014-04-05; updated test; DATE:2015-03-31 + @Test public void Ws_para() { // PURPOSE:

    in arg_bldr causes parse to fail; EX: w:Supreme_Court_of_the_United_States; DATE:2014-04-05; updated test; DATE:2015-03-31 fxt.Init_para_y_(); fxt.Test_parse_page_all("[[File:A.png| \n 40px]]" , fxt.tkn_para_bgn_para_(0) @@ -52,7 +52,7 @@ public class Xop_lnki_wkr__size_tst { , fxt.tkn_para_end_para_(22)); fxt.Init_para_n_(); } - @Test public void Invalid_size() { // PURPOSE: handle invalid sizes + @Test public void Invalid_size() { // PURPOSE: handle invalid sizes fxt.Test_parse_page_wiki("[[File:A.png|1234xSomeTextpx]]" , fxt.tkn_lnki_().Width_(-1).Height_(-1)); // PAGE:es.b:Alimentación_infantil; DATE:2015-07-10 fxt.Test_parse_page_wiki("[[File:A.png|100 KBpx]]" , fxt.tkn_lnki_().Width_(-1).Height_(-1)); // PAGE:en.w:Bahamas; DATE:2015-08-05 fxt.Test_parse_page_wiki("[[File:A.png|size100px]]" , fxt.tkn_lnki_().Width_(-1).Height_(-1)); // PAGE:en.w:Data_compression; DATE:2015-08-05 diff --git a/400_xowa/src/gplx/xowa/parsers/lnkis/Xop_lnki_wkr__subpage_tst.java b/400_xowa/src/gplx/xowa/parsers/lnkis/Xop_lnki_wkr__subpage_tst.java index f8bea1af7..5c7244978 100644 --- a/400_xowa/src/gplx/xowa/parsers/lnkis/Xop_lnki_wkr__subpage_tst.java +++ b/400_xowa/src/gplx/xowa/parsers/lnkis/Xop_lnki_wkr__subpage_tst.java @@ -1,62 +1,62 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.parsers.lnkis; import gplx.*; import gplx.xowa.*; import gplx.xowa.parsers.*; import org.junit.*; import gplx.xowa.wikis.nss.*; public class Xop_lnki_wkr__subpage_tst { @Before public void init() {fxt.Reset(); fxt.Init_para_n_();} private final Xop_fxt fxt = new Xop_fxt(); - @Test public void Disabled() { // PURPOSE: slash being interpreted as subpage; PAGE:en.w:[[/dev/null]] + @Test public void Disabled() { // PURPOSE: slash being interpreted as subpage; PAGE:en.w:[[/dev/null]] fxt.Wiki().Ns_mgr().Ids_get_or_null(Xow_ns_.Tid__main).Subpages_enabled_(false); fxt.Test_parse_page_all_str("[[/dev/null]]", "/dev/null"); fxt.Wiki().Ns_mgr().Ids_get_or_null(Xow_ns_.Tid__main).Subpages_enabled_(true); } - @Test public void False_match() {// PAGE:en.w:en.wiktionary.org/wiki/Wiktionary:Requests for cleanup/archive/2006 + @Test public void False_match() {// PAGE:en.w:en.wiktionary.org/wiki/Wiktionary:Requests for cleanup/archive/2006 fxt.Test_parse_page_wiki_str ( "[[.../compare ...]]" , ".../compare ..." ); } - @Test public void Owner() { // PURPOSE: ../c does "A/c", not "c"; DATE:2014-01-02 + @Test public void Owner() { // PURPOSE: ../c does "A/c", not "c"; DATE:2014-01-02 fxt.Page_ttl_("A/b"); fxt.Test_parse_page_wiki_str ( "[[../c]]" , "A/c" ); } - @Test public void Owner_w_slash() { // PURPOSE: ../c/ does "c", not "A/c"; DATE:2014-01-02 + @Test public void Owner_w_slash() { // PURPOSE: ../c/ does "c", not "A/c"; DATE:2014-01-02 fxt.Page_ttl_("A/b"); fxt.Test_parse_page_wiki_str ( "[[../c/]]" , "c" ); } - @Test public void Slash() { // PURPOSE: /B should show /B, not A/B; DATE:2014-01-02 + @Test public void Slash() { // PURPOSE: /B should show /B, not A/B; DATE:2014-01-02 fxt.Page_ttl_("A"); fxt.Test_parse_page_wiki_str ( "[[/B]]", String_.Concat_lines_nl_skip_last ( "/B" )); } - @Test public void Slash_w_slash() { // PURPOSE: /B/ should show B, not /B; DATE:2014-01-02 + @Test public void Slash_w_slash() { // PURPOSE: /B/ should show B, not /B; DATE:2014-01-02 fxt.Page_ttl_("A"); fxt.Test_parse_page_wiki_str ( "[[/B/]]", String_.Concat_lines_nl_skip_last ( "B" )); } - @Test public void Leaf_w_ncr() { // PURPOSE: /Bc should not encode c PAGE:en.s:The_English_Constitution_(1894) DATE:2014-09-07 + @Test public void Leaf_w_ncr() { // PURPOSE: /Bc should not encode c PAGE:en.s:The_English_Constitution_(1894) DATE:2014-09-07 fxt.Page_ttl_("A"); fxt.Test_parse_page_wiki_str ( "[[/Bc|B]]", String_.Concat_lines_nl_skip_last diff --git a/400_xowa/src/gplx/xowa/parsers/lnkis/Xop_lnki_wkr__uncommon_tst.java b/400_xowa/src/gplx/xowa/parsers/lnkis/Xop_lnki_wkr__uncommon_tst.java index 7061672b9..cb2ae190c 100644 --- a/400_xowa/src/gplx/xowa/parsers/lnkis/Xop_lnki_wkr__uncommon_tst.java +++ b/400_xowa/src/gplx/xowa/parsers/lnkis/Xop_lnki_wkr__uncommon_tst.java @@ -1,54 +1,54 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.parsers.lnkis; import gplx.*; import gplx.xowa.*; import gplx.xowa.parsers.*; import org.junit.*; import gplx.xowa.langs.*; import gplx.xowa.langs.cases.*; public class Xop_lnki_wkr__uncommon_tst { @Before public void init() {fxt.Reset(); fxt.Init_para_n_();} private final Xop_fxt fxt = new Xop_fxt(); - @Test public void Double_bracket() { // PURPOSE: handle [[[[A]]]] constructions; PAGE:ru.w:Меркатале_ин_Валь_ди_Песа; DATE:2014-02-04 + @Test public void Double_bracket() { // PURPOSE: handle [[[[A]]]] constructions; PAGE:ru.w:Меркатале_ин_Валь_ди_Песа; DATE:2014-02-04 fxt.Test_parse_page_all_str("[[[[Test_1]]]]" , "[[Test_1]]"); } - @Test public void Single_bracket() { // PURPOSE: handle [[A|[b]]] PAGE:en.w:Aubervilliers DATE:2014-06-25 + @Test public void Single_bracket() { // PURPOSE: handle [[A|[b]]] PAGE:en.w:Aubervilliers DATE:2014-06-25 fxt.Test_html_full_str("[[A|[B]]]", "[B]"); } - @Test public void Triple_bracket() { // PURPOSE: "]]]" shouldn't invalidate tkn; PAGE:en.w:Tall_poppy_syndrome; DATE:2014-07-23 + @Test public void Triple_bracket() { // PURPOSE: "]]]" shouldn't invalidate tkn; PAGE:en.w:Tall_poppy_syndrome; DATE:2014-07-23 fxt.Test_parse_page_all_str("[[A]]]" , "A]"); // title only fxt.Test_parse_page_all_str("[[A|B]]]" , "B]"); // title + caption; note that ] should be outside b/c MW has more logic that says "if caption starts with '['", but leaving as is; DATE:2014-07-23 } - @Test public void Triple_bracket_with_lnke_lnki() { // PURPOSE: handle [http://a.org [[File:A.png|123px]]]; PAGE:ar.w:محمد DATE:2014-08-20 + @Test public void Triple_bracket_with_lnke_lnki() { // PURPOSE: handle [http://a.org [[File:A.png|123px]]]; PAGE:ar.w:محمد DATE:2014-08-20 fxt.Test_parse_page_all_str("[http://a.org [[File:A.png|123px]]]" , "\"\"" ); } - @Test public void Multiple_captions() { // PURPOSE: multiple captions should be concatenated (used to only take first); EX:zh.d:维基词典:Unicode字符索引/0000–0FFF; DATE:2014-05-05 + @Test public void Multiple_captions() { // PURPOSE: multiple captions should be concatenated (used to only take first); EX:zh.d:维基词典:Unicode字符索引/0000–0FFF; DATE:2014-05-05 fxt.Test_parse_page_all_str("[[A|B|C|D]]" , "B|C|D"); } - @Test public void Multiple_captions_file() { // PURPOSE: multiple captions should take last; EX:none; DATE:2014-05-05 + @Test public void Multiple_captions_file() { // PURPOSE: multiple captions should take last; EX:none; DATE:2014-05-05 fxt.Test_html_wiki_frag("[[File:A|B|C|D|thumb]]" , "D\n "); } - @Test public void Multiple_captions_pipe() { // PURPOSE.fix: multiple captions caused multiple pipes; PAGE:w:Wikipedia:Administrators'_noticeboard/IncidentArchive24; DATE:2014-06-08 + @Test public void Multiple_captions_pipe() { // PURPOSE.fix: multiple captions caused multiple pipes; PAGE:w:Wikipedia:Administrators'_noticeboard/IncidentArchive24; DATE:2014-06-08 fxt.Test_parse_page_all_str("[[a|b|c d e]]", "b|c d e"); // was b|c| |d| |e } - @Test public void Toc_fails() { // PURPOSE: null ref when writing hdr with lnki inside xnde; EX:pl.d:head_sth_off;DATE:2014-05-07 + @Test public void Toc_fails() { // PURPOSE: null ref when writing hdr with lnki inside xnde; EX:pl.d:head_sth_off;DATE:2014-05-07 fxt.Test_parse_page_all_str("== [[A]] ==", "

    A

    \n"); } - @Test public void Upright_is_large() { // PURPOSE: handle large upright which overflows int; PAGE:de.w:Feuerland DATE:2015-02-03 + @Test public void Upright_is_large() { // PURPOSE: handle large upright which overflows int; PAGE:de.w:Feuerland DATE:2015-02-03 fxt.Test_html_wiki_frag("[[File:A.png|upright=1.333333333333333333333333333333333333333333333333333333333333333333333]]", " width=\"0\" height=\"0\""); // failure would print out original lnki } - @Test public void Persian() { // PURPOSE: handle il8n nums; EX:[[پرونده:Shahbazi 3.jpg|۲۰۰px]] -> 200px; PAGE:fa.w:فهرست_آثار_علیرضا_شاپور_شهبازی; DATE:2015-07-18 + @Test public void Persian() { // PURPOSE: handle il8n nums; EX:[[پرونده:Shahbazi 3.jpg|۲۰۰px]] -> 200px; PAGE:fa.w:فهرست_آثار_علیرضا_شاپور_شهبازی; DATE:2015-07-18 Xol_lang_itm lang = fxt.Wiki().Lang(); fxt.App().Gfs_mgr().Run_str_for(lang, gplx.xowa.xtns.pfuncs.numbers.Pf_formatnum_fa_tst.Persian_numbers_gfs); lang.Evt_lang_changed(); // force rebuild of size_trie diff --git a/400_xowa/src/gplx/xowa/parsers/lnkis/Xop_lnki_wkr__video_tst.java b/400_xowa/src/gplx/xowa/parsers/lnkis/Xop_lnki_wkr__video_tst.java index 5094681c9..ad8de1b38 100644 --- a/400_xowa/src/gplx/xowa/parsers/lnkis/Xop_lnki_wkr__video_tst.java +++ b/400_xowa/src/gplx/xowa/parsers/lnkis/Xop_lnki_wkr__video_tst.java @@ -13,17 +13,17 @@ The terms of each license can be found in the source code repository: GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt */ -package gplx.xowa.parsers.lnkis; import gplx.*; import gplx.xowa.*; import gplx.xowa.parsers.*; -import org.junit.*; import gplx.xowa.files.*; -public class Xop_lnki_wkr__video_tst { - @Before public void init() {fxt.Reset(); fxt.Init_para_n_();} private final Xop_fxt fxt = new Xop_fxt(); - @Test public void Thumbtime() { - fxt.Test_parse_page_wiki("[[File:A.ogv|thumbtime=123]]" , fxt.tkn_lnki_().Thumbtime_(123)); - fxt.Test_parse_page_wiki("[[File:A.ogv|thumbtime=1:23]]" , fxt.tkn_lnki_().Thumbtime_(83)); - fxt.Test_parse_page_wiki("[[File:A.ogv|thumbtime=1:01:01]]" , fxt.tkn_lnki_().Thumbtime_(3661)); - fxt.Init_log_(Xop_lnki_log.Upright_val_is_invalid).Test_parse_page_wiki("[[File:A.ogv|thumbtime=a]]", fxt.tkn_lnki_().Thumbtime_(-1)); - } - @Test public void Size__null() { // NOTE: make sure that no size defaults to -1; needed for Xof_img_size logic of defaulting -1 to orig_w; DATE:2015-08-07 - fxt.Test_parse_page_wiki("[[File:A.ogv]]" , fxt.tkn_lnki_().Width_(Xof_img_size.Size__neg1)); - } -} +package gplx.xowa.parsers.lnkis; import gplx.*; import gplx.xowa.*; import gplx.xowa.parsers.*; +import org.junit.*; import gplx.xowa.files.*; +public class Xop_lnki_wkr__video_tst { + @Before public void init() {fxt.Reset(); fxt.Init_para_n_();} private final Xop_fxt fxt = new Xop_fxt(); + @Test public void Thumbtime() { + fxt.Test_parse_page_wiki("[[File:A.ogv|thumbtime=123]]" , fxt.tkn_lnki_().Thumbtime_(123)); + fxt.Test_parse_page_wiki("[[File:A.ogv|thumbtime=1:23]]" , fxt.tkn_lnki_().Thumbtime_(83)); + fxt.Test_parse_page_wiki("[[File:A.ogv|thumbtime=1:01:01]]" , fxt.tkn_lnki_().Thumbtime_(3661)); + fxt.Init_log_(Xop_lnki_log.Upright_val_is_invalid).Test_parse_page_wiki("[[File:A.ogv|thumbtime=a]]", fxt.tkn_lnki_().Thumbtime_(-1)); + } + @Test public void Size__null() { // NOTE: make sure that no size defaults to -1; needed for Xof_img_size logic of defaulting -1 to orig_w; DATE:2015-08-07 + fxt.Test_parse_page_wiki("[[File:A.ogv]]" , fxt.tkn_lnki_().Width_(Xof_img_size.Size__neg1)); + } +} diff --git a/400_xowa/src/gplx/xowa/parsers/lnkis/Xop_lnki_wkr__xwiki_tst.java b/400_xowa/src/gplx/xowa/parsers/lnkis/Xop_lnki_wkr__xwiki_tst.java index 729550661..0de395759 100644 --- a/400_xowa/src/gplx/xowa/parsers/lnkis/Xop_lnki_wkr__xwiki_tst.java +++ b/400_xowa/src/gplx/xowa/parsers/lnkis/Xop_lnki_wkr__xwiki_tst.java @@ -1,23 +1,23 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.parsers.lnkis; import gplx.*; import gplx.xowa.*; import gplx.xowa.parsers.*; import org.junit.*; public class Xop_lnki_wkr__xwiki_tst { @Before public void init() {fxt.Reset(); fxt.Init_para_n_();} private Xop_fxt fxt = new Xop_fxt(); - @Test public void Xwiki_file() { // PURPOSE: if xwiki and File, ignore xwiki (hackish); DATE:2013-12-22 + @Test public void Xwiki_file() { // PURPOSE: if xwiki and File, ignore xwiki (hackish); DATE:2013-12-22 Reg_xwiki_alias("test", "test.wikimedia.org"); // must register xwiki, else ttl will not parse it fxt.Wiki().Cfg_parser().Lnki_cfg().Xwiki_repo_mgr().Add_or_mod(Bry_.new_a7("test")); // must add to xwiki_repo_mgr fxt.Test_parse_page_wiki_str @@ -26,28 +26,28 @@ public class Xop_lnki_wkr__xwiki_tst { )); fxt.Wiki().Cfg_parser_lnki_xwiki_repos_enabled_(false); // disable for other tests } - @Test public void Xwiki_anchor() { + @Test public void Xwiki_anchor() { Reg_xwiki_alias("test", "test.wikimedia.org"); fxt.Test_parse_page_wiki_str ( "[[test:A#b]]", String_.Concat_lines_nl_skip_last ( "test:A#b" )); } - @Test public void Xwiki_empty() { + @Test public void Xwiki_empty() { Reg_xwiki_alias("test", "test.wikimedia.org"); fxt.Test_parse_page_wiki_str ( "[[test:]]", String_.Concat_lines_nl_skip_last ( "test:" )); } - @Test public void Xwiki_empty_literal() { + @Test public void Xwiki_empty_literal() { Reg_xwiki_alias("test", "test.wikimedia.org"); fxt.Test_parse_page_wiki_str ( "[[:test:]]", String_.Concat_lines_nl_skip_last ( "test:" )); } - @Test public void Xwiki_not_registered() { + @Test public void Xwiki_not_registered() { fxt.App().Usere().Wiki().Xwiki_mgr().Clear(); fxt.Wiki().Xwiki_mgr().Add_by_atrs(Bry_.new_a7("test"), Bry_.new_a7("test.wikimedia.org")); // register alias only, but not in user_wiki fxt.Test_parse_page_wiki_str @@ -55,7 +55,7 @@ public class Xop_lnki_wkr__xwiki_tst { ( "A" )); } - @Test public void Literal_lang() { + @Test public void Literal_lang() { Reg_xwiki_alias("fr", "fr.wikipedia.org"); fxt.Test_parse_page_wiki_str ( "[[:fr:A]]", String_.Concat_lines_nl_skip_last @@ -63,7 +63,7 @@ public class Xop_lnki_wkr__xwiki_tst { )); Tfds.Eq(0, fxt.Page().Slink_list().Count()); } - @Test public void Simple_and_english() { // PURPOSE: s.w xwiki links to en were not working b/c s.w and en had same super lang of English; PAGE:s.q:Anonymous DATE:2014-09-10 + @Test public void Simple_and_english() { // PURPOSE: s.w xwiki links to en were not working b/c s.w and en had same super lang of English; PAGE:s.q:Anonymous DATE:2014-09-10 Xoae_app app = Xoa_app_fxt.Make__app__edit(); Xowe_wiki wiki = Xoa_app_fxt.Make__wiki__edit(app, "simple.wikipedia.org"); fxt = new Xop_fxt(app, wiki); // change fxt to simple.wikipedia.org @@ -74,7 +74,7 @@ public class Xop_lnki_wkr__xwiki_tst { ); Tfds.Eq(1, fxt.Page().Slink_list().Count()); // test 1 xwiki lang } - @Test public void Species_and_commons() { // PURPOSE: species xwiki links to commons should not put link in wikidata langs; PAGE:species:Scarabaeidae DATE:2014-09-10 + @Test public void Species_and_commons() { // PURPOSE: species xwiki links to commons should not put link in wikidata langs; PAGE:species:Scarabaeidae DATE:2014-09-10 Xoae_app app = Xoa_app_fxt.Make__app__edit(); Xowe_wiki wiki = Xoa_app_fxt.Make__wiki__edit(app, "species.wikimedia.org"); fxt = new Xop_fxt(app, wiki); // change fxt to species.wikimedia.org @@ -85,7 +85,7 @@ public class Xop_lnki_wkr__xwiki_tst { ); Tfds.Eq(0, fxt.Page().Slink_list().Count()); // no xwiki langs } - @Test public void Wiktionary_and_wikipedia() { // PURPOSE: do not create xwiki links if same lang and differet type; PAGE:s.d:water DATE:2014-09-14 + @Test public void Wiktionary_and_wikipedia() { // PURPOSE: do not create xwiki links if same lang and differet type; PAGE:s.d:water DATE:2014-09-14 Xoae_app app = Xoa_app_fxt.Make__app__edit(); Xowe_wiki wiki = Xoa_app_fxt.Make__wiki__edit(app, "simple.wiktionary.org"); fxt = new Xop_fxt(app, wiki); // change fxt to simple.wiktionary.org @@ -96,7 +96,7 @@ public class Xop_lnki_wkr__xwiki_tst { ); Tfds.Eq(0, fxt.Page().Slink_list().Count()); // test 0 xwiki lang } - @Test public void Species_and_wikipedia() { // PURPOSE: species creates xwiki links to wikipedia; PAGE:species:Puccinia DATE:2014-09-14 + @Test public void Species_and_wikipedia() { // PURPOSE: species creates xwiki links to wikipedia; PAGE:species:Puccinia DATE:2014-09-14 Xoae_app app = Xoa_app_fxt.Make__app__edit(); Xowe_wiki wiki = Xoa_app_fxt.Make__wiki__edit(app, "species.wikimedia.org"); fxt = new Xop_fxt(app, wiki); // change fxt to species.wikimedia.org diff --git a/400_xowa/src/gplx/xowa/parsers/miscs/Xop_comm_lxr_tst.java b/400_xowa/src/gplx/xowa/parsers/miscs/Xop_comm_lxr_tst.java index fb4373881..f6af03803 100644 --- a/400_xowa/src/gplx/xowa/parsers/miscs/Xop_comm_lxr_tst.java +++ b/400_xowa/src/gplx/xowa/parsers/miscs/Xop_comm_lxr_tst.java @@ -1,29 +1,29 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.parsers.miscs; import gplx.*; import gplx.xowa.*; import gplx.xowa.parsers.*; import org.junit.*; public class Xop_comm_lxr_tst { private final Xop_fxt fxt = new Xop_fxt(); - @Test public void Basic() { + @Test public void Basic() { fxt.Test_parse_page_all_str("ac", "ac"); } - @Test public void Err() { + @Test public void Err() { fxt.Init_log_(Xop_comm_log.Eos).Test_parse_page_all_str(" " @@ -33,7 +33,7 @@ public class Xop_comm_lxr_tst { , "c" )); } - @Test public void Ws_bgn_end() { + @Test public void Ws_bgn_end() { fxt.Test_parse_page_all_str(String_.Concat_lines_nl_skip_last ( "a" , " " @@ -43,13 +43,13 @@ public class Xop_comm_lxr_tst { , "c" )); } - @Test public void Ws_noop() { // PURPOSE: assert that comments do not strip ws + @Test public void Ws_noop() { // PURPOSE: assert that comments do not strip ws fxt.Test_parse_page_all_str("a c", "a c"); } - @Test public void Noinclude() {// PURPOSE: templates can construct comments; EX:WBK: {{Subjects/allbooks|subject=Computer programming|origin=Computer programming languages|diagnose=}} + @Test public void Noinclude() {// PURPOSE: templates can construct comments; EX:WBK: {{Subjects/allbooks|subject=Computer programming|origin=Computer programming languages|diagnose=}} fxt.Test_parse_page_all_str("a - b -->c", "a c"); } - @Test public void Comment_can_cause_pre() {// PURPOSE: assert that comment causes pre; DATE:2014-02-18 + @Test public void Comment_can_cause_pre() {// PURPOSE: assert that comment causes pre; DATE:2014-02-18 fxt.Init_para_y_(); fxt.Test_parse_page_all_str(String_.Concat_lines_nl_skip_last ( "a" @@ -68,7 +68,7 @@ public class Xop_comm_lxr_tst { )); fxt.Init_para_n_(); } - @Test public void Ws_bgn_needs_nl() { // PURPOSE: do not strip new line unles *entire* line is comment + @Test public void Ws_bgn_needs_nl() { // PURPOSE: do not strip new line unles *entire* line is comment fxt.Init_para_y_(); fxt.Test_parse_page_all_str(String_.Concat_lines_nl_skip_last ( "a" @@ -82,7 +82,7 @@ public class Xop_comm_lxr_tst { )); fxt.Init_para_n_(); } - @Test public void Ws_strip_nl() { // PURPOSE: handle multiple "\n"; was only trimming 1st; DATE:2014-02-24 + @Test public void Ws_strip_nl() { // PURPOSE: handle multiple "\n"; was only trimming 1st; DATE:2014-02-24 fxt.Init_para_y_(); fxt.Test_parse_page_all_str(String_.Concat_lines_nl_skip_last ( "a" @@ -97,7 +97,7 @@ public class Xop_comm_lxr_tst { )); fxt.Init_para_n_(); } - @Test public void Comment_should_not_gobble_paras() {// ISSUE#:437 DATE:2019-04-27 + @Test public void Comment_should_not_gobble_paras() {// ISSUE#:437 DATE:2019-04-27 fxt.Init_para_y_(); fxt.Test_parse_page_all_str(String_.Concat_lines_nl_skip_last ( "a" diff --git a/400_xowa/src/gplx/xowa/parsers/miscs/Xop_hr_lxr_basic_tst.java b/400_xowa/src/gplx/xowa/parsers/miscs/Xop_hr_lxr_basic_tst.java index 99ba91c36..716599daa 100644 --- a/400_xowa/src/gplx/xowa/parsers/miscs/Xop_hr_lxr_basic_tst.java +++ b/400_xowa/src/gplx/xowa/parsers/miscs/Xop_hr_lxr_basic_tst.java @@ -13,17 +13,17 @@ The terms of each license can be found in the source code repository: GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt */ -package gplx.xowa.parsers.miscs; import gplx.*; import gplx.xowa.*; import gplx.xowa.parsers.*; -import org.junit.*; -public class Xop_hr_lxr_basic_tst { - @Before public void init() {fxt.Reset();} private final Xop_fxt fxt = new Xop_fxt(); - @Test public void Basic() {fxt.Test_parse_page_wiki("----" , fxt.tkn_hr_(0, 4));} - @Test public void Basic_w_nl() {fxt.Test_parse_page_wiki("\n----a" , fxt.tkn_para_blank_(0), fxt.tkn_hr_(0, 5), fxt.tkn_txt_(5, 6));} - @Test public void Many() {fxt.Test_parse_page_wiki("---------" , fxt.tkn_hr_(0, 9).Hr_len_(9));} - @Test public void Exc_short() {fxt.Test_parse_page_wiki("---" , fxt.tkn_txt_(0, 3));} - @Test public void Exc_interrupt() {fxt.Test_parse_page_wiki("\na----" , fxt.tkn_nl_char_len1_(0), fxt.tkn_txt_(1, 6));} - @Test public void Html_basic() {fxt.Test_parse_page_wiki_str("----" , "
    ");} - @Test public void Html_extended() {fxt.Test_parse_page_wiki_str("------" , "
    ");} - @Test public void Nl_bgn() {fxt.Test_parse_page_wiki_str("a\n----" , "a\n
    ");} - @Test public void Nl_end() {fxt.Test_parse_page_wiki_str("----\na" , "
    \na");} -} +package gplx.xowa.parsers.miscs; import gplx.*; import gplx.xowa.*; import gplx.xowa.parsers.*; +import org.junit.*; +public class Xop_hr_lxr_basic_tst { + @Before public void init() {fxt.Reset();} private final Xop_fxt fxt = new Xop_fxt(); + @Test public void Basic() {fxt.Test_parse_page_wiki("----" , fxt.tkn_hr_(0, 4));} + @Test public void Basic_w_nl() {fxt.Test_parse_page_wiki("\n----a" , fxt.tkn_para_blank_(0), fxt.tkn_hr_(0, 5), fxt.tkn_txt_(5, 6));} + @Test public void Many() {fxt.Test_parse_page_wiki("---------" , fxt.tkn_hr_(0, 9).Hr_len_(9));} + @Test public void Exc_short() {fxt.Test_parse_page_wiki("---" , fxt.tkn_txt_(0, 3));} + @Test public void Exc_interrupt() {fxt.Test_parse_page_wiki("\na----" , fxt.tkn_nl_char_len1_(0), fxt.tkn_txt_(1, 6));} + @Test public void Html_basic() {fxt.Test_parse_page_wiki_str("----" , "
    ");} + @Test public void Html_extended() {fxt.Test_parse_page_wiki_str("------" , "
    ");} + @Test public void Nl_bgn() {fxt.Test_parse_page_wiki_str("a\n----" , "a\n
    ");} + @Test public void Nl_end() {fxt.Test_parse_page_wiki_str("----\na" , "
    \na");} +} diff --git a/400_xowa/src/gplx/xowa/parsers/miscs/Xop_hr_lxr_para_tst.java b/400_xowa/src/gplx/xowa/parsers/miscs/Xop_hr_lxr_para_tst.java index dd1e5ad59..2729902dd 100644 --- a/400_xowa/src/gplx/xowa/parsers/miscs/Xop_hr_lxr_para_tst.java +++ b/400_xowa/src/gplx/xowa/parsers/miscs/Xop_hr_lxr_para_tst.java @@ -1,23 +1,23 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.parsers.miscs; import gplx.*; import gplx.xowa.*; import gplx.xowa.parsers.*; import org.junit.*; public class Xop_hr_lxr_para_tst { @Before public void init() {fxt.Reset(); fxt.Init_para_y_();} private final Xop_fxt fxt = new Xop_fxt(); - @Test public void Bos() { // PURPOSE: check that bos rendered correctly; DATE:2014-04-18 + @Test public void Bos() { // PURPOSE: check that bos rendered correctly; DATE:2014-04-18 fxt.Test_parse_page_wiki_str(String_.Concat_lines_nl_skip_last ( "----" , "a" @@ -28,7 +28,7 @@ public class Xop_hr_lxr_para_tst { , "

    " )); } - @Test public void Multiple() { // PURPOSE.fix: hr disables para for rest of page; ca.b:Xarxes; DATE:2014-04-18 + @Test public void Multiple() { // PURPOSE.fix: hr disables para for rest of page; ca.b:Xarxes; DATE:2014-04-18 fxt.Test_parse_page_wiki_str(String_.Concat_lines_nl_skip_last ( "a" , "----" diff --git a/400_xowa/src/gplx/xowa/parsers/miscs/Xop_space_lxr_tst.java b/400_xowa/src/gplx/xowa/parsers/miscs/Xop_space_lxr_tst.java index 357e4077c..657243d53 100644 --- a/400_xowa/src/gplx/xowa/parsers/miscs/Xop_space_lxr_tst.java +++ b/400_xowa/src/gplx/xowa/parsers/miscs/Xop_space_lxr_tst.java @@ -13,18 +13,18 @@ The terms of each license can be found in the source code repository: GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt */ -package gplx.xowa.parsers.miscs; import gplx.*; import gplx.xowa.*; import gplx.xowa.parsers.*; -import org.junit.*; -public class Xop_space_lxr_tst { - private final Xop_fxt fxt = new Xop_fxt(); - @Before public void init() {fxt.Reset();} - @After public void term() {fxt.Init_para_n_();} - @Test public void Toc_basic() { // PURPOSE: make sure nbsp char is not converted to space; PAGE:en.w:Macedonian–Carthaginian_Treaty; DATE:2014-06-07 - fxt.Init_para_y_(); - fxt.Test_parse_page_all_str("     a", String_.Concat_lines_nl_skip_last // NOTE: ws is actually nbsp; - ( "

         a" // should be

    not

    -		, "

    " - , "" - )); - } -} +package gplx.xowa.parsers.miscs; import gplx.*; import gplx.xowa.*; import gplx.xowa.parsers.*; +import org.junit.*; +public class Xop_space_lxr_tst { + private final Xop_fxt fxt = new Xop_fxt(); + @Before public void init() {fxt.Reset();} + @After public void term() {fxt.Init_para_n_();} + @Test public void Toc_basic() { // PURPOSE: make sure nbsp char is not converted to space; PAGE:en.w:Macedonian–Carthaginian_Treaty; DATE:2014-06-07 + fxt.Init_para_y_(); + fxt.Test_parse_page_all_str("     a", String_.Concat_lines_nl_skip_last // NOTE: ws is actually nbsp; + ( "

         a" // should be

    not

    +		, "

    " + , "" + )); + } +} diff --git a/400_xowa/src/gplx/xowa/parsers/miscs/Xop_under_lxr_tst.java b/400_xowa/src/gplx/xowa/parsers/miscs/Xop_under_lxr_tst.java index e022fdccb..24bd1e255 100644 --- a/400_xowa/src/gplx/xowa/parsers/miscs/Xop_under_lxr_tst.java +++ b/400_xowa/src/gplx/xowa/parsers/miscs/Xop_under_lxr_tst.java @@ -1,34 +1,34 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.parsers.miscs; import gplx.*; import gplx.xowa.*; import gplx.xowa.parsers.*; import org.junit.*; import gplx.xowa.langs.*; import gplx.xowa.langs.kwds.*; public class Xop_under_lxr_tst { private final Xop_fxt fxt = new Xop_fxt(); @Before public void init() {fxt.Reset();} @After public void term() {fxt.Init_para_n_();} - @Test public void Toc_basic() { + @Test public void Toc_basic() { fxt.Test_parse_page_all_str("a__TOC__b", "ab"); } - @Test public void Toc_match_failed() { + @Test public void Toc_match_failed() { fxt.Test_parse_page_all_str("a__TOCA__b", "a__TOCA__b"); } - @Test public void Toc_match_ci() { + @Test public void Toc_match_ci() { fxt.Test_parse_page_all_str("a__toc__b", "ab"); } - @Test public void Notoc_basic() { + @Test public void Notoc_basic() { fxt.Wtr_cfg().Toc__show_(Bool_.Y); // NOTE: must enable in order for TOC to show (and to make sure NOTOC suppresses) fxt.Test_parse_page_all_str__esc(String_.Concat_lines_nl ( "__NOTOC__" @@ -47,7 +47,7 @@ public class Xop_under_lxr_tst { )); fxt.Wtr_cfg().Toc__show_(Bool_.N); } - @Test public void Ignore_pre() { + @Test public void Ignore_pre() { fxt.Init_para_y_(); fxt.Test_parse_page_all_str("a\n __NOTOC__\n", String_.Concat_lines_nl ( "

    a" @@ -58,7 +58,7 @@ public class Xop_under_lxr_tst { )); fxt.Init_para_n_(); } - @Test public void Toc_works() { // PURPOSE: make sure "suppressed" pre does not somehow suppress TOC + @Test public void Toc_works() { // PURPOSE: make sure "suppressed" pre does not somehow suppress TOC fxt.Wtr_cfg().Toc__show_(Bool_.Y); fxt.Init_para_y_(); Bry_bfr tmp = Bry_bfr_.New(); @@ -82,7 +82,7 @@ public class Xop_under_lxr_tst { fxt.Init_para_n_(); fxt.Wtr_cfg().Toc__show_(Bool_.N); } - @Test public void Ignore_pre_after() { // PURPOSE: "__TOC__\s\n" must be trimmed at end, else false pre; assertion only (no code exists to handle this test); DATE:2013-07-08 + @Test public void Ignore_pre_after() { // PURPOSE: "__TOC__\s\n" must be trimmed at end, else false pre; assertion only (no code exists to handle this test); DATE:2013-07-08 fxt.Init_para_y_(); fxt.Test_parse_page_all_str(String_.Concat_lines_nl ( "a" @@ -97,10 +97,10 @@ public class Xop_under_lxr_tst { )); fxt.Init_para_n_(); } - @Test public void Disambig() { // PURPOSE: ignore "__DISAMBIG__"; EX:{{disambiguation}} DATE:2013-07-24 + @Test public void Disambig() { // PURPOSE: ignore "__DISAMBIG__"; EX:{{disambiguation}} DATE:2013-07-24 fxt.Test_parse_page_all_str("__DISAMBIG__", ""); } - @Test public void Nocontentconvert() { // simple test; test for flag only; DATE:2014-02-06 + @Test public void Nocontentconvert() { // simple test; test for flag only; DATE:2014-02-06 gplx.xowa.parsers.Xop_ctx_page_data page_data = fxt.Ctx().Page_data(); Tfds.Eq(page_data.Lang_convert_content(), true); Tfds.Eq(page_data.Lang_convert_title(), true); @@ -108,10 +108,10 @@ public class Xop_under_lxr_tst { Tfds.Eq(page_data.Lang_convert_content(), false); Tfds.Eq(page_data.Lang_convert_title(), false); } - @Test public void Eos() { // PURPOSE: check that __ at eos doesn't fail; es.s:Luisa de Bustamante: 3; DATE:2014-02-15 + @Test public void Eos() { // PURPOSE: check that __ at eos doesn't fail; es.s:Luisa de Bustamante: 3; DATE:2014-02-15 fxt.Test_parse_page_all_str("__", "__"); } - @Test public void Pre_toc() { // PURPOSE: make sure that "\n\s__TOC" does not create pre; PAGE:de.w:Main_Page; DATE:2014-04-07 + @Test public void Pre_toc() { // PURPOSE: make sure that "\n\s__TOC" does not create pre; PAGE:de.w:Main_Page; DATE:2014-04-07 fxt.Init_para_y_(); fxt.Test_parse_page_all_str(String_.Concat_lines_nl_skip_last ( "a" @@ -127,7 +127,7 @@ public class Xop_under_lxr_tst { )); fxt.Init_para_n_(); } - @Test public void Pre_notoc() { // PURPOSE: make sure that "\n\s__NOTOC" does not create pre. note that mechanism is different from TOC; DATE:2014-07-05 + @Test public void Pre_notoc() { // PURPOSE: make sure that "\n\s__NOTOC" does not create pre. note that mechanism is different from TOC; DATE:2014-07-05 fxt.Init_para_y_(); fxt.Test_parse_page_all_str(String_.Concat_lines_nl_skip_last ( "a" @@ -142,20 +142,20 @@ public class Xop_under_lxr_tst { )); fxt.Init_para_n_(); } - @Test public void Hook_alt() { // PURPOSE: ja wikis use alternate __; DATE:2014-03-04 + @Test public void Hook_alt() { // PURPOSE: ja wikis use alternate __; DATE:2014-03-04 Xowe_wiki wiki = fxt.Wiki(); Xol_lang_itm lang = wiki.Lang(); fxt.Init_lang_kwds(lang, Xol_kwd_grp_.Id_toc, true, "__TOC__"); wiki.Parser_mgr().Main().Init_by_lang(lang); fxt.Test_parse_page_all_str("a__TOC__b", "ab"); } - @Test public void Ascii_ci() { // PURPOSE: case-insensitive ascii; DATE:2014-07-10 + @Test public void Ascii_ci() { // PURPOSE: case-insensitive ascii; DATE:2014-07-10 Xowe_wiki wiki = fxt.Wiki(); Xol_lang_itm lang = wiki.Lang(); fxt.Init_lang_kwds(lang, Xol_kwd_grp_.Id_toc, false, "__TOC__"); wiki.Parser_mgr().Main().Init_by_lang(lang); fxt.Test_parse_page_all_str("a__TOC__b", "ab"); fxt.Test_parse_page_all_str("a__toc__b", "ab"); } - @Test public void Utf8_ci() { // PURPOSE: case-insensitive UTF8; DATE:2014-07-10 + @Test public void Utf8_ci() { // PURPOSE: case-insensitive UTF8; DATE:2014-07-10 Xowe_wiki wiki = fxt.Wiki(); Xol_lang_itm lang = wiki.Lang(); lang.Case_mgr_u8_(); fxt.Init_lang_kwds(lang, Xol_kwd_grp_.Id_toc, false, "__AÉI__"); @@ -163,21 +163,21 @@ public class Xop_under_lxr_tst { fxt.Test_parse_page_all_str("a__AÉI__b", "ab"); fxt.Test_parse_page_all_str("a__aéi__b", "ab"); } - @Test public void Utf8_ci_asymmetric() { // PURPOSE: case-insensitive UTF8; asymmetric; DATE:2014-07-10 + @Test public void Utf8_ci_asymmetric() { // PURPOSE: case-insensitive UTF8; asymmetric; DATE:2014-07-10 Xowe_wiki wiki = fxt.Wiki(); Xol_lang_itm lang = wiki.Lang(); lang.Case_mgr_u8_(); fxt.Init_lang_kwds(lang, Xol_kwd_grp_.Id_toc, false, "__İÇİNDEKİLER__"); // __TOC__ for tr.w wiki.Parser_mgr().Main().Init_by_lang(lang); fxt.Test_parse_page_all_str("a__İçindekiler__b", "ab"); } - @Test public void Cs() { // PURPOSE: cs (ascii / utf8 doesn't matter); DATE:2014-07-11 + @Test public void Cs() { // PURPOSE: cs (ascii / utf8 doesn't matter); DATE:2014-07-11 Xowe_wiki wiki = fxt.Wiki(); Xol_lang_itm lang = wiki.Lang(); fxt.Init_lang_kwds(lang, Xol_kwd_grp_.Id_toc , Bool_.Y, "__TOC__"); wiki.Parser_mgr().Main().Init_by_lang(lang); fxt.Test_parse_page_all_str("a__TOC__b" , "ab"); // ci.pass fxt.Test_parse_page_all_str("a__toc__b" , "a__toc__b"); // ci.pass } - @Test public void Ascii_cs_ci() { // PURPOSE: test simultaneous cs and ci; DATE:2014-07-11 + @Test public void Ascii_cs_ci() { // PURPOSE: test simultaneous cs and ci; DATE:2014-07-11 Xowe_wiki wiki = fxt.Wiki(); Xol_lang_itm lang = wiki.Lang(); fxt.Init_lang_kwds(lang, Xol_kwd_grp_.Id_toc , Bool_.N, "__TOC__"); fxt.Init_lang_kwds(lang, Xol_kwd_grp_.Id_notoc , Bool_.Y, "__NOTOC__"); @@ -187,7 +187,7 @@ public class Xop_under_lxr_tst { fxt.Test_parse_page_all_str("a__NOTOC__b" , "ab"); // cs.pass fxt.Test_parse_page_all_str("a__notoc__b" , "a__notoc__b"); // cs.fail } - @Test public void Notoc_in_tmpl() { // PURPOSE: test simultaneous cs and ci; DATE:2017-06-11 + @Test public void Notoc_in_tmpl() { // PURPOSE: test simultaneous cs and ci; DATE:2017-06-11 fxt.Init_page_create("Template:Notoc", "page_text\n__NOTOC__"); fxt.Wiki().Html_mgr().Html_wtr().Cfg().Toc__show_(true); diff --git a/400_xowa/src/gplx/xowa/parsers/paras/Xop_nl_tab_lxr_tst.java b/400_xowa/src/gplx/xowa/parsers/paras/Xop_nl_tab_lxr_tst.java index ca2d68cc5..e5e18b776 100644 --- a/400_xowa/src/gplx/xowa/parsers/paras/Xop_nl_tab_lxr_tst.java +++ b/400_xowa/src/gplx/xowa/parsers/paras/Xop_nl_tab_lxr_tst.java @@ -1,24 +1,24 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.parsers.paras; import gplx.*; import gplx.xowa.*; import gplx.xowa.parsers.*; import org.junit.*; public class Xop_nl_tab_lxr_tst { @Before public void init() {fxt.Reset(); fxt.Init_para_y_();} private final Xop_fxt fxt = new Xop_fxt(); @After public void teardown() {fxt.Init_para_n_();} - @Test public void Basic() { // PURPOSE: \n\t|- should be recognized as tblw; EX:zh.v:西安; DATE:2014-05-06 + @Test public void Basic() { // PURPOSE: \n\t|- should be recognized as tblw; EX:zh.v:西安; DATE:2014-05-06 fxt.Test_parse_page_wiki_str(String_.Concat_lines_nl ( "{|" , "\t|-" @@ -33,7 +33,7 @@ public class Xop_nl_tab_lxr_tst { , "

    " )); } - @Test public void Ws() { // PURPOSE: \n\t|- should be recognized as tblw; EX:zh.v:西安; DATE:2014-05-06 + @Test public void Ws() { // PURPOSE: \n\t|- should be recognized as tblw; EX:zh.v:西安; DATE:2014-05-06 fxt.Test_parse_page_wiki_str(String_.Concat_lines_nl ( "{|" , "\t |-" // \t @@ -48,7 +48,7 @@ public class Xop_nl_tab_lxr_tst { , "" )); } - @Test public void Ignore() {// PURPOSE: \n\t should not be pre; EX:pl.w:Main_Page; DATE:2014-05-06 + @Test public void Ignore() {// PURPOSE: \n\t should not be pre; EX:pl.w:Main_Page; DATE:2014-05-06 fxt.Test_parse_page_wiki_str(String_.Concat_lines_nl_skip_last ( "a" , "\t b" diff --git a/400_xowa/src/gplx/xowa/parsers/paras/Xop_para_wkr_basic_tst.java b/400_xowa/src/gplx/xowa/parsers/paras/Xop_para_wkr_basic_tst.java index e665c230e..8cadd5cbc 100644 --- a/400_xowa/src/gplx/xowa/parsers/paras/Xop_para_wkr_basic_tst.java +++ b/400_xowa/src/gplx/xowa/parsers/paras/Xop_para_wkr_basic_tst.java @@ -1,25 +1,25 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.parsers.paras; import gplx.*; import gplx.xowa.*; import gplx.xowa.parsers.*; import org.junit.*; import gplx.xowa.parsers.lists.*; public class Xop_para_wkr_basic_tst { private final Xop_fxt fxt = new Xop_fxt(); String raw; @Before public void init() {fxt.Reset(); fxt.Init_para_y_();} @After public void teardown() {fxt.Init_para_n_();} - @Test public void Nl_0() { + @Test public void Nl_0() { raw = "a"; fxt.Test_parse_page_wiki_str(raw, String_.Concat_lines_nl_skip_last ( "

    a" @@ -30,7 +30,7 @@ public class Xop_para_wkr_basic_tst { , fxt.tkn_txt_(0, 1), fxt.tkn_para_end_para_(1) // t2/x1: a -> a\n

    1=bgn 2=blank ); } - @Test public void Nl_1() { + @Test public void Nl_1() { raw = String_.Concat_lines_nl_skip_last ( "a" , "b" @@ -46,7 +46,7 @@ public class Xop_para_wkr_basic_tst { , fxt.tkn_txt_(2, 3), fxt.tkn_para_end_para_(3) // t3/x1: b -> b\n

    2=blank 3=blank ); } - @Test public void Nl_2() { + @Test public void Nl_2() { raw = String_.Concat_lines_nl_skip_last ( "a" , "" @@ -66,7 +66,7 @@ public class Xop_para_wkr_basic_tst { , fxt.tkn_txt_(3, 4), fxt.tkn_para_end_para_(4) // t1/x1: b -> b\n

    2=mid 3=blank ); } - @Test public void Nl_3() { + @Test public void Nl_3() { raw = String_.Concat_lines_nl_skip_last ( "a" , "" @@ -89,7 +89,7 @@ public class Xop_para_wkr_basic_tst { , fxt.tkn_txt_(4, 5), fxt.tkn_para_end_para_(5) // t1/x1: b -> b\n

    4=blank ); } - @Test public void Nl_4() { + @Test public void Nl_4() { raw = String_.Concat_lines_nl_skip_last ( "a" , "" @@ -116,7 +116,7 @@ public class Xop_para_wkr_basic_tst { , fxt.tkn_txt_(6, 7), fxt.tkn_para_end_para_(7) ); } - @Test public void Nl_5() { + @Test public void Nl_5() { raw = String_.Concat_lines_nl_skip_last ( "

    a" , "b" @@ -128,7 +128,7 @@ public class Xop_para_wkr_basic_tst { , "

    " )); } - @Test public void Pre() { + @Test public void Pre() { raw = String_.Concat_lines_nl_skip_last ( "a" , " b" @@ -151,7 +151,7 @@ public class Xop_para_wkr_basic_tst { , fxt.tkn_txt_(5, 6), fxt.tkn_para_end_para_(6) ); } - @Test public void Pre_2() { + @Test public void Pre_2() { raw = String_.Concat_lines_nl_skip_last ( "a" , " b" @@ -170,7 +170,7 @@ public class Xop_para_wkr_basic_tst { , "

    " )); } - @Test public void Pre_3() { + @Test public void Pre_3() { raw = String_.Concat_lines_nl_skip_last ( "a" , "" @@ -188,7 +188,7 @@ public class Xop_para_wkr_basic_tst { , "" )); } - @Test public void Pre_4() { + @Test public void Pre_4() { raw = String_.Concat_lines_nl_skip_last ( "a" , "" @@ -207,7 +207,7 @@ public class Xop_para_wkr_basic_tst { , "

    " )); } - @Test public void Pre_5() { // PAGE:en.w:SHA-2 + @Test public void Pre_5() { // PAGE:en.w:SHA-2 fxt.Test_parse_page_wiki_str(String_.Concat_lines_nl_skip_last ( "a" , " b" @@ -224,7 +224,7 @@ public class Xop_para_wkr_basic_tst { , "" )); } - @Test public void Pre_6() { // PURPOSE: close list if open; PAGE:en.w:SHA-2 + @Test public void Pre_6() { // PURPOSE: close list if open; PAGE:en.w:SHA-2 fxt.Test_parse_page_wiki_str(String_.Concat_lines_nl_skip_last ( "*a" , " b" @@ -238,7 +238,7 @@ public class Xop_para_wkr_basic_tst { , "" )); } - @Test public void Pre_init() { + @Test public void Pre_init() { fxt.Test_parse_page_wiki_str(String_.Concat_lines_nl_skip_last ( " a" ), String_.Concat_lines_nl_skip_last @@ -246,7 +246,7 @@ public class Xop_para_wkr_basic_tst { , "" )); } - @Test public void Pre_leading_ws() { // PURPOSE: preserve leading ws; PAGE:en.w:Merge sort + @Test public void Pre_leading_ws() { // PURPOSE: preserve leading ws; PAGE:en.w:Merge sort fxt.Test_parse_page_wiki_str(String_.Concat_lines_nl_skip_last ( " a" , " b" @@ -258,7 +258,7 @@ public class Xop_para_wkr_basic_tst { , "" )); } - @Test public void Pre_newLine() { // PURPOSE: "\n \n" inside pre should be ignored; trims to "" + @Test public void Pre_newLine() { // PURPOSE: "\n \n" inside pre should be ignored; trims to "" raw = String_.Concat_lines_nl_skip_last ( "a" , " b" @@ -279,7 +279,7 @@ public class Xop_para_wkr_basic_tst { , "

    " )); } - @Test public void Pre_xnde() { // PURPOSE:
    and other xndes should invalidate pre on same line; EX: "\n a
    b"; SEE: any {{refimprove}} article + @Test public void Pre_xnde() { // PURPOSE:
    and other xndes should invalidate pre on same line; EX: "\n a
    b"; SEE: any {{refimprove}} article raw = String_.Concat_lines_nl_skip_last ( "a" , " b
    c
    d" @@ -294,7 +294,7 @@ public class Xop_para_wkr_basic_tst { , "

    " )); } - @Test public void Pre_lnki_in_td() { // PURPOSE: ]] in td causes strange parsing; SEE: any {{Commons category}} article; updated test; DATE:2015-03-31 + @Test public void Pre_lnki_in_td() { // PURPOSE: ]] in td causes strange parsing; SEE: any {{Commons category}} article; updated test; DATE:2015-03-31 raw = String_.Concat_lines_nl_skip_last ( "" , "" @@ -316,7 +316,7 @@ public class Xop_para_wkr_basic_tst { , "
    " )); } - @Test public void Pre_trailing_end() { // PURPOSE: "\n " at end was failing + @Test public void Pre_trailing_end() { // PURPOSE: "\n " at end was failing raw = String_.Concat_lines_nl_skip_last ( "a" , " " @@ -326,7 +326,7 @@ public class Xop_para_wkr_basic_tst { , "

    " )); } - @Test public void Pre_xnde_code() { // PAGE:en.w:cURL + @Test public void Pre_xnde_code() { // PAGE:en.w:cURL raw = String_.Concat_lines_nl_skip_last ( "a" , " b" @@ -344,7 +344,7 @@ public class Xop_para_wkr_basic_tst { , "

    " )); } - @Test public void Pre_xnde_pre() { + @Test public void Pre_xnde_pre() { raw = String_.Concat_lines_nl_skip_last ( "
      " , "
    • " @@ -364,7 +364,7 @@ public class Xop_para_wkr_basic_tst { , "
    " )); } - @Test public void Pre_td() { // PURPOSE: EX: "\n a"; deactivates pre; PAGE:en.w:AGPLv3 + @Test public void Pre_td() { // PURPOSE: EX: "\n a"; deactivates pre; PAGE:en.w:AGPLv3 raw = String_.Concat_lines_nl_skip_last ( "" , "" @@ -383,7 +383,7 @@ public class Xop_para_wkr_basic_tst { , "
    " )); } - @Test public void Nl_2_2_space() { // test trim + @Test public void Nl_2_2_space() { // test trim raw = String_.Concat_lines_nl_skip_last ( "a" , "" @@ -402,7 +402,7 @@ public class Xop_para_wkr_basic_tst { , "

    " )); } - @Test public void File_1() { + @Test public void File_1() { raw = String_.Concat_lines_nl_skip_last ( "a" , "[[Image:Test.png|thumb|caption]]" @@ -421,7 +421,7 @@ public class Xop_para_wkr_basic_tst { , fxt.tkn_para_blank_(34) ); } - @Test public void File_2() { + @Test public void File_2() { raw = String_.Concat_lines_nl_skip_last ( "a" , "[[Image:Test.png|thumb|caption]]" @@ -445,7 +445,7 @@ public class Xop_para_wkr_basic_tst { , fxt.tkn_txt_(35, 36), fxt.tkn_para_end_para_(36) ); } - @Test public void File_3() { + @Test public void File_3() { raw = String_.Concat_lines_nl_skip_last ( "[[Image:Test.png|thumb|caption]]" , "" @@ -466,7 +466,7 @@ public class Xop_para_wkr_basic_tst { , fxt.tkn_txt_(34, 35), fxt.tkn_para_end_para_(35) ); } - @Test public void File_4() { + @Test public void File_4() { raw = String_.Concat_lines_nl_skip_last ( "a" , "" @@ -494,7 +494,7 @@ public class Xop_para_wkr_basic_tst { , fxt.tkn_txt_(37, 38), fxt.tkn_para_end_para_(38) ); } - @Test public void File_5() { // PURPOSE: \n in caption should not force paragraph + @Test public void File_5() { // PURPOSE: \n in caption should not force paragraph raw = String_.Concat_lines_nl_skip_last ( "[[Image:Test.png|thumb|" , "caption]]" @@ -514,7 +514,7 @@ public class Xop_para_wkr_basic_tst { , fxt.tkn_txt_(34, 35), fxt.tkn_para_end_para_(35) ); } - @Test public void File_6() { // PAGE:en.w:Pyotr Ilyich Tchaikovsky + @Test public void File_6() { // PAGE:en.w:Pyotr Ilyich Tchaikovsky raw = String_.Concat_lines_nl_skip_last ( "a" , " [[Image:Test.png|thumb|caption]]" @@ -532,7 +532,7 @@ public class Xop_para_wkr_basic_tst { , "" )); } - @Test public void List() { + @Test public void List() { raw = String_.Concat_lines_nl_skip_last ( "a" , "*b" @@ -555,7 +555,7 @@ public class Xop_para_wkr_basic_tst { , fxt.tkn_para_blank_(4) ); } - @Test public void Hdr_1() { + @Test public void Hdr_1() { raw = String_.Concat_lines_nl_skip_last ( "a" , "==b==" @@ -568,7 +568,7 @@ public class Xop_para_wkr_basic_tst { , "" )); } - @Test public void Hdr_2() { + @Test public void Hdr_2() { raw = String_.Concat_lines_nl_skip_last ( "a" , "" @@ -582,7 +582,7 @@ public class Xop_para_wkr_basic_tst { , "" )); } - @Test public void Hdr_list() { + @Test public void Hdr_list() { raw = String_.Concat_lines_nl_skip_last ( "==a==" , "*b" @@ -596,7 +596,7 @@ public class Xop_para_wkr_basic_tst { , "" )); } - @Test public void Hdr_list_multi() { + @Test public void Hdr_list_multi() { raw = String_.Concat_lines_nl_skip_last ( "==a==" , "" @@ -615,7 +615,7 @@ public class Xop_para_wkr_basic_tst { , "" )); } - @Test public void Para_hdr() { + @Test public void Para_hdr() { raw = String_.Concat_lines_nl_skip_last ( "a" , "" @@ -638,7 +638,7 @@ public class Xop_para_wkr_basic_tst { , "" )); } - @Test public void Div() { // PURPOSE:
    should not go into para + @Test public void Div() { // PURPOSE:
    should not go into para raw = String_.Concat_lines_nl_skip_last ( "a" , "" @@ -658,7 +658,7 @@ public class Xop_para_wkr_basic_tst { , "" )); } - @Test public void Div_para() { // PURPOSE:

    inserted between closing divs + @Test public void Div_para() { // PURPOSE:

    inserted between closing divs raw = String_.Concat_lines_nl_skip_last ( "
    " , "
    " @@ -676,7 +676,7 @@ public class Xop_para_wkr_basic_tst { , "
    " )); } - @Test public void Tbl() { + @Test public void Tbl() { raw = String_.Concat_lines_nl_skip_last ( "" , "" @@ -699,7 +699,7 @@ public class Xop_para_wkr_basic_tst { , "" )); } - @Test public void Tbl_leading_ws() { // REF: [[Corneal dystrophy (human)]] + @Test public void Tbl_leading_ws() { // REF: [[Corneal dystrophy (human)]] raw = String_.Concat_lines_nl_skip_last ( " {|" , " |-" @@ -716,14 +716,14 @@ public class Xop_para_wkr_basic_tst { , "" )); } - @Test public void Bos_pipe() { // PURPOSE: | is interpreted as a tblw dlm and calls a different section of code + @Test public void Bos_pipe() { // PURPOSE: | is interpreted as a tblw dlm and calls a different section of code fxt.Test_parse_page_wiki_str("|", String_.Concat_lines_nl_skip_last ( "

    |" , "

    " , "" )); } - @Test public void Ws_mistakenly_ignored() {// PURPOSE: ws before ''' somehow gets ignored; EX: en.w:Vacuum tube; {{Unreferenced section|date=July 2010|reason=date taken from existing cn}} + @Test public void Ws_mistakenly_ignored() {// PURPOSE: ws before ''' somehow gets ignored; EX: en.w:Vacuum tube; {{Unreferenced section|date=July 2010|reason=date taken from existing cn}} fxt.Test_parse_page_all_str(String_.Concat_lines_nl_skip_last ( "
    a" , " '''b'''
    " @@ -738,7 +738,7 @@ public class Xop_para_wkr_basic_tst { , "" )); } - @Test public void Pre_7() { // PURPOSE: alternating pres; EX:w:World Wide Web + @Test public void Pre_7() { // PURPOSE: alternating pres; EX:w:World Wide Web fxt.Test_parse_page_wiki_str(String_.Concat_lines_nl_skip_last ( "a" , " b" @@ -763,7 +763,7 @@ public class Xop_para_wkr_basic_tst { , "" )); } - @Test public void Nowiki() { + @Test public void Nowiki() { fxt.Test_parse_page_all_str(String_.Concat_lines_nl_skip_last ( "a" , " b" @@ -780,7 +780,7 @@ public class Xop_para_wkr_basic_tst { , "" )); } - @Test public void Nowiki_tbl() { // EX: de.wikipedia.org/wiki/Hilfe:Vorlagenprogrammierung + @Test public void Nowiki_tbl() { // EX: de.wikipedia.org/wiki/Hilfe:Vorlagenprogrammierung fxt.Test_parse_page_all_str(String_.Concat_lines_nl_skip_last ( "a" , " bc" @@ -805,7 +805,7 @@ public class Xop_para_wkr_basic_tst { , "" )); } - @Test public void Pre_at_end_should_autoclose() { // PURPOSE: as per proc_name + @Test public void Pre_at_end_should_autoclose() { // PURPOSE: as per proc_name fxt.Test_parse_page_all_str(String_.Concat_lines_nl_skip_last ( "a" , " b" @@ -819,7 +819,7 @@ public class Xop_para_wkr_basic_tst { , "" )); } - @Test public void Pre_xtn() { // PURPOSE: (and other xtn) was unnecessarily canceling pre; PAGE:en.w:MD5_Hash + @Test public void Pre_xtn() { // PURPOSE: (and other xtn) was unnecessarily canceling pre; PAGE:en.w:MD5_Hash fxt.Test_parse_page_all_str(String_.Concat_lines_nl_skip_last ( " a" , " b" @@ -837,7 +837,7 @@ public class Xop_para_wkr_basic_tst { , "" )); } - @Test public void Pre_tbl() { // PURPOSE: pre was being garbled by tables b/c table was ignoring whitespace; DATE:2013-02-11 + @Test public void Pre_tbl() { // PURPOSE: pre was being garbled by tables b/c table was ignoring whitespace; DATE:2013-02-11 fxt.Test_parse_page_all_str(String_.Concat_lines_nl_skip_last ( "{|" , "|a" @@ -877,7 +877,7 @@ public class Xop_para_wkr_basic_tst { , "" )); } - @Test public void Nowiki_tbl2() { // EX: de.wikipedia.org/wiki/Hilfe:Vorlagenprogrammierung + @Test public void Nowiki_tbl2() { // EX: de.wikipedia.org/wiki/Hilfe:Vorlagenprogrammierung fxt.Test_parse_page_wiki_str(String_.Concat_lines_nl_skip_last ( "{|" , "|a" @@ -911,10 +911,10 @@ public class Xop_para_wkr_basic_tst { , "" )); } - @Test public void Pre_nowiki() { // PURPOSE: nowikis inside pre should be ignored; DATE:2013-03-30 + @Test public void Pre_nowiki() { // PURPOSE: nowikis inside pre should be ignored; DATE:2013-03-30 fxt.Test_parse_page_all_str("\n a<b" , "\n
    a<b\n
    \n"); // basic } - @Test public void Para_bos_tblw() { + @Test public void Para_bos_tblw() { raw = String_.Concat_lines_nl_skip_last ( "{|" , "|-" @@ -931,7 +931,7 @@ public class Xop_para_wkr_basic_tst { , "" )); } - @Test public void Para_bos_tblx() { + @Test public void Para_bos_tblx() { raw = String_.Concat_lines_nl_skip_last ( "" , "" @@ -950,7 +950,7 @@ public class Xop_para_wkr_basic_tst { , "" )); } - @Test public void Pre_tblw_td() { + @Test public void Pre_tblw_td() { raw = String_.Concat_lines_nl_skip_last ( "a" , " b" @@ -970,7 +970,7 @@ public class Xop_para_wkr_basic_tst { , "" )); } - @Test public void Pre_tblw_tr() { + @Test public void Pre_tblw_tr() { raw = String_.Concat_lines_nl_skip_last ( "a" , " b" @@ -990,7 +990,7 @@ public class Xop_para_wkr_basic_tst { , "" )); } - @Test public void Pre_tblw_te() { + @Test public void Pre_tblw_te() { raw = String_.Concat_lines_nl_skip_last ( "a" , " b" diff --git a/400_xowa/src/gplx/xowa/parsers/paras/Xop_para_wkr_para_tst.java b/400_xowa/src/gplx/xowa/parsers/paras/Xop_para_wkr_para_tst.java index 75e77f065..1665241d9 100644 --- a/400_xowa/src/gplx/xowa/parsers/paras/Xop_para_wkr_para_tst.java +++ b/400_xowa/src/gplx/xowa/parsers/paras/Xop_para_wkr_para_tst.java @@ -1,24 +1,24 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.parsers.paras; import gplx.*; import gplx.xowa.*; import gplx.xowa.parsers.*; import org.junit.*; public class Xop_para_wkr_para_tst { @Before public void init() {fxt.Reset(); fxt.Init_para_y_();} private final Xop_fxt fxt = new Xop_fxt(); @After public void teardown() {fxt.Init_para_n_();} - @Test public void Pre_then_xnde_pre() { // PURPOSE: if ws_pre is in effect, xnde_pre should end it; EX: b:Knowing Knoppix/Other applications + @Test public void Pre_then_xnde_pre() { // PURPOSE: if ws_pre is in effect, xnde_pre should end it; EX: b:Knowing Knoppix/Other applications fxt.Test_parse_page_all_str(String_.Concat_lines_nl_skip_last ( " a" , "b
    c"
    @@ -35,7 +35,7 @@ public class Xop_para_wkr_para_tst {
     		,	""
     		));
     	}
    -	@Test  public void List_ignore_pre_lines() {	// PURPOSE: "\s\n" should create new list; was continuing previous list; DATE:2013-07-12
    +	@Test public void List_ignore_pre_lines() {	// PURPOSE: "\s\n" should create new list; was continuing previous list; DATE:2013-07-12
     		fxt.Test_parse_page_all_str(String_.Concat_lines_nl
     		(	": a"
     		,	":* b"
    @@ -66,7 +66,7 @@ public class Xop_para_wkr_para_tst {
     		,	""
     		));		
     	}
    -	@Test  public void Multiple_nl_in_tblx() {	// PURPOSE: "\n\n\n" was causing multiple breaks; EX:fr.w:Portail:G�nie m�canique; DATE:2014-02-17
    +	@Test public void Multiple_nl_in_tblx() {	// PURPOSE: "\n\n\n" was causing multiple breaks; EX:fr.w:Portail:G�nie m�canique; DATE:2014-02-17
     		fxt.Test_parse_page_all_str(String_.Concat_lines_nl
     		(	"
    " @@ -88,7 +88,7 @@ public class Xop_para_wkr_para_tst { ) ); } - @Test public void Ignore_cr() { // PURPOSE: handle "\r\n"; EX: Special:MovePage; DATE:2014-03-02 + @Test public void Ignore_cr() { // PURPOSE: handle "\r\n"; EX: Special:MovePage; DATE:2014-03-02 fxt.Test_parse_page_all_str(String_.Concat_lines_nl ( "a\r" , "\r" diff --git a/400_xowa/src/gplx/xowa/parsers/paras/Xop_para_wkr_pre_tst.java b/400_xowa/src/gplx/xowa/parsers/paras/Xop_para_wkr_pre_tst.java index ab3266d75..e102b65e7 100644 --- a/400_xowa/src/gplx/xowa/parsers/paras/Xop_para_wkr_pre_tst.java +++ b/400_xowa/src/gplx/xowa/parsers/paras/Xop_para_wkr_pre_tst.java @@ -1,24 +1,24 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.parsers.paras; import gplx.*; import gplx.xowa.*; import gplx.xowa.parsers.*; import org.junit.*; public class Xop_para_wkr_pre_tst { @Before public void init() {fxt.Reset(); fxt.Init_para_y_();} private final Xop_fxt fxt = new Xop_fxt(); @After public void teardown() {fxt.Init_para_n_();} - @Test public void Pre_ignore_bos() { // PURPOSE: ignore pre at bgn; DATE:2013-07-09 + @Test public void Pre_ignore_bos() { // PURPOSE: ignore pre at bgn; DATE:2013-07-09 fxt.Test_parse_page_all_str(String_.Concat_lines_nl ( " " , "b" @@ -28,7 +28,7 @@ public class Xop_para_wkr_pre_tst { , "

    " )); } - @Test public void Pre_ignore_bos_tblw() { // PURPOSE: ignore pre at bgn shouldn't break tblw; EX:commons.wikimedia.org; DATE:2013-07-11 + @Test public void Pre_ignore_bos_tblw() { // PURPOSE: ignore pre at bgn shouldn't break tblw; EX:commons.wikimedia.org; DATE:2013-07-11 fxt.Test_parse_page_all_str(String_.Concat_lines_nl ( " " , "{|" @@ -46,7 +46,7 @@ public class Xop_para_wkr_pre_tst { , "
    a" , "
    " )); } - @Test public void Ignore_bos_xnde() { // PURPOSE: space at bgn shouldn't create pre; EX:commons.wikimedia.org; "
    a\n
    "; DATE:2013-11-28 + @Test public void Ignore_bos_xnde() { // PURPOSE: space at bgn shouldn't create pre; EX:commons.wikimedia.org; "
    a\n
    "; DATE:2013-11-28 fxt.Test_parse_page_wiki_str(String_.Concat_lines_nl_skip_last ( "
    a" // NOTE: leading " " matches MW; DATE:2014-06-23 , "
    " @@ -56,7 +56,7 @@ public class Xop_para_wkr_pre_tst { , "" )); } - @Test public void Ignore_pre_in_gallery() {// PURPOSE: pre in gallery should be ignored; EX:uk.w:EP2; DATE:2014-03-11 + @Test public void Ignore_pre_in_gallery() {// PURPOSE: pre in gallery should be ignored; EX:uk.w:EP2; DATE:2014-03-11 gplx.xowa.xtns.gallery.Gallery_mgr_wtr.File_found_mode = Bool_.Y_byte; fxt.Test_parse_page_wiki_str(String_.Concat_lines_nl_skip_last ( "a" @@ -84,7 +84,7 @@ public class Xop_para_wkr_pre_tst { )); gplx.xowa.xtns.gallery.Gallery_mgr_wtr.File_found_mode = Bool_.N_byte; } - @Test public void Pre_xnde_gallery() { // PURPOSE: should invalidate pre; EX: en.w:Mary, Queen of Scots + @Test public void Pre_xnde_gallery() { // PURPOSE: should invalidate pre; EX: en.w:Mary, Queen of Scots gplx.xowa.xtns.gallery.Gallery_mgr_wtr.File_found_mode = Bool_.Y_byte; fxt.Wiki().Xtn_mgr().Init_by_wiki(fxt.Wiki()); String raw = String_.Concat_lines_nl_skip_last @@ -111,7 +111,7 @@ public class Xop_para_wkr_pre_tst { )); gplx.xowa.xtns.gallery.Gallery_mgr_wtr.File_found_mode = Bool_.N_byte; } - @Test public void Ignore_pre_in_center() {// PURPOSE: pre in gallery should be ignored; EX:uk.w:EP2; DATE:2014-03-11 + @Test public void Ignore_pre_in_center() {// PURPOSE: pre in gallery should be ignored; EX:uk.w:EP2; DATE:2014-03-11 fxt.Test_parse_page_wiki_str(String_.Concat_lines_nl_skip_last ( "a" , "
    b" @@ -128,7 +128,7 @@ public class Xop_para_wkr_pre_tst { ) ); } - @Test public void Remove_only_1st_space() { // PURPOSE: pre should only remove 1st space]; EX: w:Wikipedia:WikiProject_History/CategoryExample; DATE:2014-04-14 + @Test public void Remove_only_1st_space() { // PURPOSE: pre should only remove 1st space]; EX: w:Wikipedia:WikiProject_History/CategoryExample; DATE:2014-04-14 fxt.Test_parse_page_wiki_str(String_.Concat_lines_nl_skip_last ( " a" , " b" @@ -141,7 +141,7 @@ public class Xop_para_wkr_pre_tst { ) ); } - @Test public void Remove_only_1st_space__bos() { // PURPOSE: similar to above but check that pre at \n\s is indented correctly; DATE:2014-04-14 + @Test public void Remove_only_1st_space__bos() { // PURPOSE: similar to above but check that pre at \n\s is indented correctly; DATE:2014-04-14 fxt.Test_parse_page_wiki_str(String_.Concat_lines_nl_skip_last ( "" , " a" @@ -154,7 +154,7 @@ public class Xop_para_wkr_pre_tst { ) ); } - @Test public void Ignore_tblw_td() {// PURPOSE: \n\s| should continue pre; EX:w:Wikipedia:WikiProject_History/CategoryExample; DATE:2014-04-14 + @Test public void Ignore_tblw_td() {// PURPOSE: \n\s| should continue pre; EX:w:Wikipedia:WikiProject_History/CategoryExample; DATE:2014-04-14 fxt.Test_parse_page_wiki_str(String_.Concat_lines_nl_skip_last ( " a" , " |" @@ -167,7 +167,7 @@ public class Xop_para_wkr_pre_tst { ) ); } - @Test public void Tab() { // PURPOSE: tab inside pre was being converted to space; PAGE:en.w:Cascading_Style_Sheets DATE:2014-06-23 + @Test public void Tab() { // PURPOSE: tab inside pre was being converted to space; PAGE:en.w:Cascading_Style_Sheets DATE:2014-06-23 fxt.Test_html_full_str ( " \ta" , String_.Concat_lines_nl @@ -175,7 +175,7 @@ public class Xop_para_wkr_pre_tst { , "" )); } - @Test public void Style() { // PURPOSE: " " @@ -185,7 +185,7 @@ public class Xop_para_wkr_pre_tst { , "" )); } - @Test public void Nl_only() { // PURPOSE: wiki_pre with \n only was being dropped; PAGE:en.w:Preferred_number DATE:2014-06-24 + @Test public void Nl_only() { // PURPOSE: wiki_pre with \n only was being dropped; PAGE:en.w:Preferred_number DATE:2014-06-24 fxt.Test_html_full_str(String_.Concat_lines_nl_skip_last ( " a" , " " // was being dropped @@ -197,7 +197,7 @@ public class Xop_para_wkr_pre_tst { , "" )); } - @Test public void Nl_w_ws() { // PURPOSE: based on Nl_only; make sure that 1 or more spaces does not add extra \n; PAGE:en.w:Preferred_number DATE:2014-06-24 + @Test public void Nl_w_ws() { // PURPOSE: based on Nl_only; make sure that 1 or more spaces does not add extra \n; PAGE:en.w:Preferred_number DATE:2014-06-24 fxt.Test_html_full_str(String_.Concat_lines_nl_skip_last ( " a" , " " // 2 spaces @@ -209,7 +209,7 @@ public class Xop_para_wkr_pre_tst { , "" )); } - @Test public void Nl_many() { // PURPOSE: handle alternating \n\s; PAGE:en.w:Preferred_number DATE:2014-06-24 + @Test public void Nl_many() { // PURPOSE: handle alternating \n\s; PAGE:en.w:Preferred_number DATE:2014-06-24 fxt.Test_html_full_str(String_.Concat_lines_nl_skip_last ( " a" , " " @@ -225,7 +225,7 @@ public class Xop_para_wkr_pre_tst { , "" )); } - @Test public void Source() { // PURPOSE: " " in pre has issues; PAGE:en.w:Comment_(computer_programming) DATE:2014-06-23 + @Test public void Source() { // PURPOSE: " " in pre has issues; PAGE:en.w:Comment_(computer_programming) DATE:2014-06-23 fxt.Init_para_y_(); fxt.Test_html_wiki_str(String_.Concat_lines_nl ( " " @@ -244,7 +244,7 @@ public class Xop_para_wkr_pre_tst { , "

    " )); } - @Test public void False_match_xnde() { // PURPOSE: "\s" being evaluted as "\s"; PAGE:de.v:Via_Jutlandica/Gpx DATE:2014-11-29 + @Test public void False_match_xnde() { // PURPOSE: "\s" being evaluted as "\s"; PAGE:de.v:Via_Jutlandica/Gpx DATE:2014-11-29 fxt.Init_para_y_(); fxt.Test_html_wiki_str(String_.Concat_lines_nl ( "" diff --git a/400_xowa/src/gplx/xowa/parsers/tblws/Xop_tblw_wkr__atrs_tst.java b/400_xowa/src/gplx/xowa/parsers/tblws/Xop_tblw_wkr__atrs_tst.java index 8f8259a39..6339b438b 100644 --- a/400_xowa/src/gplx/xowa/parsers/tblws/Xop_tblw_wkr__atrs_tst.java +++ b/400_xowa/src/gplx/xowa/parsers/tblws/Xop_tblw_wkr__atrs_tst.java @@ -1,23 +1,23 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.parsers.tblws; import gplx.*; import gplx.xowa.*; import gplx.xowa.parsers.*; import org.junit.*; public class Xop_tblw_wkr__atrs_tst { private final Xop_fxt fxt = new Xop_fxt(); - @Test public void Tr() { + @Test public void Tr() { fxt.Test_parse_page_wiki(String_.Concat_lines_nl_skip_last ( "{|" , "|-style='a'" @@ -29,7 +29,7 @@ public class Xop_tblw_wkr__atrs_tst { )) ); } - @Test public void Td() { + @Test public void Td() { fxt.Test_parse_page_wiki(String_.Concat_lines_nl_skip_last ( "{|" , "|-" @@ -41,7 +41,7 @@ public class Xop_tblw_wkr__atrs_tst { )) ); } - @Test public void Td_mult() { + @Test public void Td_mult() { fxt.Init_para_y_(); fxt.Test_parse_page_wiki_str(String_.Concat_lines_nl_skip_last ( "{|" @@ -77,7 +77,7 @@ public class Xop_tblw_wkr__atrs_tst { ); fxt.Init_para_n_(); } - @Test public void Tc() { // PAGE:en.w:1920_Palm_Sunday_tornado_outbreak + @Test public void Tc() { // PAGE:en.w:1920_Palm_Sunday_tornado_outbreak fxt.Init_para_y_(); fxt.Test_parse_page_wiki_str(String_.Concat_lines_nl_skip_last ( "{|id='1'" @@ -94,7 +94,7 @@ public class Xop_tblw_wkr__atrs_tst { ); fxt.Init_para_n_(); } - @Test public void Td_mixed() { + @Test public void Td_mixed() { fxt.Test_parse_page_wiki(String_.Concat_lines_nl_skip_last ( "{|" , "|-" @@ -107,7 +107,7 @@ public class Xop_tblw_wkr__atrs_tst { )) ); } - @Test public void Th() { + @Test public void Th() { fxt.Test_parse_page_wiki(String_.Concat_lines_nl_skip_last ( "{|" , "|-" @@ -119,7 +119,7 @@ public class Xop_tblw_wkr__atrs_tst { )) ); } - @Test public void Skip_hdr() { + @Test public void Skip_hdr() { fxt.Test_parse_page_wiki(String_.Concat_lines_nl_skip_last ( "{|" , "|+b" @@ -132,7 +132,7 @@ public class Xop_tblw_wkr__atrs_tst { ) )); } - @Test public void Td_bg_color() { // PURPOSE: atr_parser should treat # as valid character in unquoted val; PAGE:en.w:UTF8; |bgcolor=#eeeeee|Indic
    0800*
    '''''224''''' + @Test public void Td_bg_color() { // PURPOSE: atr_parser should treat # as valid character in unquoted val; PAGE:en.w:UTF8; |bgcolor=#eeeeee|Indic
    0800*
    '''''224''''' fxt.Init_para_y_(); fxt.Test_parse_page_wiki_str(String_.Concat_lines_nl_skip_last ( "{|" @@ -151,7 +151,7 @@ public class Xop_tblw_wkr__atrs_tst { ); fxt.Init_para_n_(); } - @Test public void Xnde_tb() { // PURPOSE: xnde should close any open xatrs; PAGE:en.w:Western_Front_(World_War_I); stray > after == Dramatizations == + @Test public void Xnde_tb() { // PURPOSE: xnde should close any open xatrs; PAGE:en.w:Western_Front_(World_War_I); stray > after == Dramatizations == fxt.Test_parse_page_wiki_str(String_.Concat_lines_nl_skip_last ( "{|id='1'

    " , "|a" @@ -165,7 +165,7 @@ public class Xop_tblw_wkr__atrs_tst { , "" )); } - @Test public void Xnde_tr() { // PURPOSE: xnde should disable all tkns; PAGE:en.w:A DATE:2014-07-16 + @Test public void Xnde_tr() { // PURPOSE: xnde should disable all tkns; PAGE:en.w:A DATE:2014-07-16 fxt.Test_parse_page_wiki_str(String_.Concat_lines_nl_skip_last ( "{|" , "|-cid='d'
    " // note that id='d' should not show up since invalidates entire line @@ -180,7 +180,7 @@ public class Xop_tblw_wkr__atrs_tst { , "" )); } - @Test public void Xnde_mix_tblw_tblx() { // PURPOSE: issue with somehow rolling up everything after ; PAGE:en.w:20th_century; {{Decades and years}} + @Test public void Xnde_mix_tblw_tblx() { // PURPOSE: issue with somehow rolling up everything after ; PAGE:en.w:20th_century; {{Decades and years}} fxt.Init_para_y_(); fxt.Test_parse_page_wiki_str(String_.Concat_lines_nl_skip_last ( "" @@ -131,16 +131,16 @@ public class Xop_tblw_wkr__basic_tst { ) ); } - @Test public void Bang_should_not_make_cell_td_1_bang() { // PURPOSE: "| a! b" ! should not separate cell + @Test public void Bang_should_not_make_cell_td_1_bang() { // PURPOSE: "| a! b" ! should not separate cell fxt.Test_parse_page_wiki_str(String_.Concat_lines_nl_skip_last("{|", "|-", "|a!b", "|}"), String_.Concat_lines_nl_skip_last("
    a" diff --git a/400_xowa/src/gplx/xowa/parsers/tblws/Xop_tblw_wkr__basic_tst.java b/400_xowa/src/gplx/xowa/parsers/tblws/Xop_tblw_wkr__basic_tst.java index eaf70c836..e928d66c5 100644 --- a/400_xowa/src/gplx/xowa/parsers/tblws/Xop_tblw_wkr__basic_tst.java +++ b/400_xowa/src/gplx/xowa/parsers/tblws/Xop_tblw_wkr__basic_tst.java @@ -1,30 +1,30 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.parsers.tblws; import gplx.*; import gplx.xowa.*; import gplx.xowa.parsers.*; import org.junit.*; public class Xop_tblw_wkr__basic_tst { private final Xop_fxt fxt = new Xop_fxt(); - @Test public void Td() { // Tb_tr_td_te + @Test public void Td() { // Tb_tr_td_te fxt.Test_parse_page_wiki("{|\n|-\n|a\n|}" , fxt.tkn_tblw_tb_(0, 11).Subs_ ( fxt.tkn_tblw_tr_(2, 8).Subs_ ( fxt.tkn_tblw_td_(5, 8).Subs_(fxt.tkn_txt_(7, 8), fxt.tkn_para_blank_(9)))) ); } - @Test public void Td2() { // Tb_tr_td_td2_te + @Test public void Td2() { // Tb_tr_td_td2_te fxt.Test_parse_page_wiki("{|\n|-\n|a||b\n|}" , fxt.tkn_tblw_tb_(0, 14).Subs_ ( fxt.tkn_tblw_tr_(2, 11).Subs_ @@ -32,7 +32,7 @@ public class Xop_tblw_wkr__basic_tst { , fxt.tkn_tblw_td_(8, 11).Subs_(fxt.tkn_txt_(10, 11), fxt.tkn_para_blank_(12)) ))); } - @Test public void Tc() { // Tb_tc_te + @Test public void Tc() { // Tb_tc_te fxt.Test_parse_page_wiki("{|\n|+a\n|}" , fxt.tkn_tblw_tb_(0, 9).Caption_count_(1).Subs_ ( fxt.tkn_tblw_tc_(2, 6).Subs_ @@ -42,7 +42,7 @@ public class Xop_tblw_wkr__basic_tst { ) ); } - @Test public void Tc_longer() { // Tb_tc_tr_td_te + @Test public void Tc_longer() { // Tb_tc_tr_td_te fxt.Test_parse_page_wiki("{|\n|+a\n|-\n|b\n|}" , fxt.tkn_tblw_tb_(0, 15).Caption_count_(1).Subs_ ( fxt.tkn_tblw_tc_(2, 6).Subs_(fxt.tkn_txt_(5, 6)) @@ -51,14 +51,14 @@ public class Xop_tblw_wkr__basic_tst { ) )); } - @Test public void Th() { // Tb_th_te + @Test public void Th() { // Tb_th_te fxt.Test_parse_page_wiki("{|\n|-\n!a\n|}" , fxt.tkn_tblw_tb_(0, 11).Subs_ ( fxt.tkn_tblw_tr_(2, 8).Subs_ ( fxt.tkn_tblw_th_(5, 8).Subs_(fxt.tkn_txt_(7, 8), fxt.tkn_para_blank_(9)) ))); } - @Test public void Th2() { // Tb_th_th2_te + @Test public void Th2() { // Tb_th_th2_te fxt.Test_parse_page_wiki("{|\n|-\n!a!!b\n|}" , fxt.tkn_tblw_tb_(0, 14).Subs_ ( fxt.tkn_tblw_tr_(2, 11).Subs_ @@ -66,7 +66,7 @@ public class Xop_tblw_wkr__basic_tst { , fxt.tkn_tblw_th_(8, 11).Subs_(fxt.tkn_txt_(10, 11), fxt.tkn_para_blank_(12)) ))); } - @Test public void Th2_td_syntax() { // Tb_th_td; || should be treated as th + @Test public void Th2_td_syntax() { // Tb_th_td; || should be treated as th fxt.Test_parse_page_wiki("{|\n|-\n!a||b\n|}" , fxt.tkn_tblw_tb_(0, 14).Subs_ ( fxt.tkn_tblw_tr_(2, 11).Subs_ @@ -74,7 +74,7 @@ public class Xop_tblw_wkr__basic_tst { , fxt.tkn_tblw_th_(8, 11).Subs_(fxt.tkn_txt_(10, 11), fxt.tkn_para_blank_(12)) ))); } - @Test public void Tb_td2() { // PAGE:en.w:Hectare; {| class="wikitable" || style="border: 1px solid #FFFFFF;" + @Test public void Tb_td2() { // PAGE:en.w:Hectare; {| class="wikitable" || style="border: 1px solid #FFFFFF;" fxt.Test_parse_page_wiki_str(String_.Concat_lines_nl_skip_last ( "{|id='1' || class='a'" , "|-" @@ -90,14 +90,14 @@ public class Xop_tblw_wkr__basic_tst { , "" )); } - @Test public void Td_lnki() { + @Test public void Td_lnki() { fxt.Test_parse_page_wiki("{|\n|-\n|[[a|b]]\n|}" , fxt.tkn_tblw_tb_(0, 17).Subs_ ( fxt.tkn_tblw_tr_(2, 14).Subs_ ( fxt.tkn_tblw_td_(5, 14).Subs_(fxt.tkn_lnki_(7, 14), fxt.tkn_para_blank_(15)))) ); } - @Test public void Tr_dupe_xnde() { // PURPOSE: redundant tr should not be dropped; see [[Jupiter]] + @Test public void Tr_dupe_xnde() { // PURPOSE: redundant tr should not be dropped; see [[Jupiter]] fxt.Test_parse_page_wiki_str(String_.Concat_lines_nl_skip_last ( "{|" , "|-" @@ -115,7 +115,7 @@ public class Xop_tblw_wkr__basic_tst { ) ); } - @Test public void Tr_dupe_xnde_2() { // causes problems + @Test public void Tr_dupe_xnde_2() { // causes problems fxt.Test_parse_page_wiki_str(String_.Concat_lines_nl_skip_last ( "{|" , "
    a
    ", " ", " ", " ", "
    a!b" , "
    ", "")); } - @Test public void Bang_should_not_make_cell_td_2_bang() { + @Test public void Bang_should_not_make_cell_td_2_bang() { fxt.Test_parse_page_wiki_str(String_.Concat_lines_nl_skip_last("{|", "|-", "|a!!b", "|}"), String_.Concat_lines_nl_skip_last("", " ", " ", " ", "
    a!!b" , "
    ", "")); } - @Test public void Bang_should_not_make_cell_th_1_bang() { + @Test public void Bang_should_not_make_cell_th_1_bang() { fxt.Test_parse_page_wiki_str(String_.Concat_lines_nl_skip_last("{|", "|-", "!a!b", "|}"), String_.Concat_lines_nl_skip_last("", " ", " ", " ", "
    a!b" , "
    ", "")); } - @Test public void Bang_should_not_make_cell_th_2_bang() { + @Test public void Bang_should_not_make_cell_th_2_bang() { fxt.Test_parse_page_wiki_str(String_.Concat_lines_nl_skip_last("{|", "|-", "!a!!b", "|}") , String_.Concat_lines_nl_skip_last ( "" @@ -154,7 +154,7 @@ public class Xop_tblw_wkr__basic_tst { , "" )); } - @Test public void Bang_should_not_make_cell_th_mult_line() { // FIX: make sure code does not disable subsequent bangs + @Test public void Bang_should_not_make_cell_th_mult_line() { // FIX: make sure code does not disable subsequent bangs fxt.Test_parse_page_wiki_str(String_.Concat_lines_nl_skip_last("{|", "|-", "!a", "!b", "|}") , String_.Concat_lines_nl_skip_last ( "
    " @@ -168,7 +168,7 @@ public class Xop_tblw_wkr__basic_tst { , "" )); } - @Test public void Fix_extra_cell() { // PURPOSE: trim should not affect td; WP:Base32 + @Test public void Fix_extra_cell() { // PURPOSE: trim should not affect td; WP:Base32 fxt.Init_para_y_(); fxt.Test_parse_page_wiki_str(String_.Concat_lines_nl_skip_last ( "{|" @@ -202,7 +202,7 @@ public class Xop_tblw_wkr__basic_tst { ); fxt.Init_para_n_(); } - @Test public void Nl_td() { // PURPOSE:

    inside

    does not get enclosed + @Test public void Nl_td() { // PURPOSE:

    inside

    does not get enclosed fxt.Init_para_y_(); fxt.Test_parse_page_wiki_str(String_.Concat_lines_nl_skip_last ( "" @@ -235,7 +235,7 @@ public class Xop_tblw_wkr__basic_tst { ); fxt.Init_para_n_(); } - @Test public void Trim_ws() { // PURPOSE: trim should be done from both sides + @Test public void Trim_ws() { // PURPOSE: trim should be done from both sides fxt.Init_para_y_(); fxt.Test_parse_page_wiki_str(String_.Concat_lines_nl_skip_last ( "
    " @@ -262,7 +262,7 @@ public class Xop_tblw_wkr__basic_tst { ); fxt.Init_para_n_(); } - @Test public void Trim_ws_tr() { // PURPOSE: trim should be done from both sides + @Test public void Trim_ws_tr() { // PURPOSE: trim should be done from both sides fxt.Init_para_y_(); fxt.Test_parse_page_wiki_str(String_.Concat_lines_nl_skip_last ( "
    " @@ -295,7 +295,7 @@ public class Xop_tblw_wkr__basic_tst { ); fxt.Init_para_n_(); } - @Test public void Trim_ws_td() { // PURPOSE: trim should not affect td + @Test public void Trim_ws_td() { // PURPOSE: trim should not affect td fxt.Init_para_y_(); fxt.Test_parse_page_wiki_str(String_.Concat_lines_nl_skip_last ( "
    " @@ -328,7 +328,7 @@ public class Xop_tblw_wkr__basic_tst { ); fxt.Init_para_n_(); } - @Test public void No_wiki_3() { + @Test public void No_wiki_3() { fxt.Test_parse_page_wiki_str(String_.Concat_lines_nl_skip_last ( "{|" , "|style='a[b]c'|d" @@ -343,7 +343,7 @@ public class Xop_tblw_wkr__basic_tst { , "" )); } - @Test public void Trailing_tr_breaks_para_mode() {// PURPOSE.fix: empty trailing tr breaks para mode; EX:w:Sibelius + @Test public void Trailing_tr_breaks_para_mode() {// PURPOSE.fix: empty trailing tr breaks para mode; EX:w:Sibelius fxt.Init_para_y_(); fxt.Test_parse_page_all_str(String_.Concat_lines_nl_skip_last ( "{|" @@ -370,7 +370,7 @@ public class Xop_tblw_wkr__basic_tst { )); fxt.Init_para_n_(); } - @Test public void Blank_line_should_be_own_para() {// PURPOSE.fix: caption does not begin on own line; EX:w:Old St. Peter's Basilica + @Test public void Blank_line_should_be_own_para() {// PURPOSE.fix: caption does not begin on own line; EX:w:Old St. Peter's Basilica fxt.Init_para_y_(); fxt.Test_parse_page_all_str(String_.Concat_lines_nl_skip_last ( "{|" @@ -391,7 +391,7 @@ public class Xop_tblw_wkr__basic_tst { )); fxt.Init_para_n_(); } - @Test public void Blank_line_should_be_own_para_2() {// PURPOSE.fix: caption does not begin on own line; EX:w:Old St. Peter's Basilica + @Test public void Blank_line_should_be_own_para_2() {// PURPOSE.fix: caption does not begin on own line; EX:w:Old St. Peter's Basilica fxt.Init_para_y_(); fxt.Test_parse_page_all_str(String_.Concat_lines_nl_skip_last ( "{|" @@ -413,7 +413,7 @@ public class Xop_tblw_wkr__basic_tst { )); fxt.Init_para_n_(); } - @Test public void Bold_stops_at_table() { // PURPOSE: do not allow unclosed bold to extend over tables; + @Test public void Bold_stops_at_table() { // PURPOSE: do not allow unclosed bold to extend over tables; fxt.Test_parse_page_all_str("'''
    a
    ", String_.Concat_lines_nl_skip_last ( "" , "" @@ -426,7 +426,7 @@ public class Xop_tblw_wkr__basic_tst { )); fxt.Init_defn_clear(); } - @Test public void Orphaned_tr_breaks_nested_tables() { // PUPRPOSE: should not match outside scope; EX:w:Enthalpy_of_fusion; {{States of matter}} + @Test public void Orphaned_tr_breaks_nested_tables() { // PUPRPOSE: should not match outside scope; EX:w:Enthalpy_of_fusion; {{States of matter}} fxt.Test_parse_page_all_str(String_.Concat_lines_nl_skip_last ( "
    " , "" @@ -455,7 +455,7 @@ public class Xop_tblw_wkr__basic_tst { ) ); } - @Test public void Space_causes_extra_p() {// PURPOSE: "\n\s" should be equivalent to "\n"; EX: w:Earth + @Test public void Space_causes_extra_p() {// PURPOSE: "\n\s" should be equivalent to "\n"; EX: w:Earth fxt.Init_para_y_(); fxt.Test_parse_page_all_str(String_.Concat_lines_nl_skip_last ( "
    " @@ -541,7 +541,7 @@ public class Xop_tblw_wkr__basic_tst { , "" )); } - @Test public void List_and_orphaned_td2_should_not_create_tblw() {// PURPOSE: !! was creating table; DATE:2013-04-28 + @Test public void List_and_orphaned_td2_should_not_create_tblw() {// PURPOSE: !! was creating table; DATE:2013-04-28 fxt.Test_parse_page_all_str("*a !! b", String_.Concat_lines_nl_skip_last ( "
      " , "
    • a !! b" @@ -549,7 +549,7 @@ public class Xop_tblw_wkr__basic_tst { , "
    " )); } - @Test public void Tr_trailing_dashes_should_be_stripped() {// PURPOSE: trailing dashes should be stripped; |--- -> |-; EX: |--style="x" was being ignored; DATE:2013-06-21 + @Test public void Tr_trailing_dashes_should_be_stripped() {// PURPOSE: trailing dashes should be stripped; |--- -> |-; EX: |--style="x" was being ignored; DATE:2013-06-21 fxt.Test_parse_page_all_str(String_.Concat_lines_nl_skip_last ( "{|" , "|-----style='a'" @@ -564,7 +564,7 @@ public class Xop_tblw_wkr__basic_tst { , "
    " @@ -477,7 +477,7 @@ public class Xop_tblw_wkr__basic_tst { )); fxt.Init_para_n_(); } - @Test public void Br_should_not_be_ignored() {// PURPOSE: document
    's should not be ignored between tables; 20121226 + @Test public void Br_should_not_be_ignored() {// PURPOSE: document
    's should not be ignored between tables; 20121226 fxt.Init_para_y_(); fxt.Test_parse_page_all_str(String_.Concat_lines_nl_skip_last ( "{|" @@ -509,7 +509,7 @@ public class Xop_tblw_wkr__basic_tst { )); fxt.Init_para_n_(); } - @Test public void AutoClose_td_when_new_tr() { // retain; needed for de.w:Main_Page; DATE:2013-12-09 + @Test public void AutoClose_td_when_new_tr() { // retain; needed for de.w:Main_Page; DATE:2013-12-09 fxt.Test_parse_page_wiki_str(String_.Concat_lines_nl_skip_last ( "{|" , "==a==" @@ -527,7 +527,7 @@ public class Xop_tblw_wkr__basic_tst { , "" )); } - @Test public void Auto_create_table() {// PURPOSE:
    should create table; EX:w:Hatfield-McCoy_feud; DATE:20121226 + @Test public void Auto_create_table() {// PURPOSE: should create table; EX:w:Hatfield-McCoy_feud; DATE:20121226 fxt.Test_parse_page_all_str(String_.Concat_lines_nl_skip_last ( "a" , "
    " )); } - @Test public void Th_without_tr() { // PURPOSE: !! without preceding ! should not create table-cell; DATE:2013-12-18 + @Test public void Th_without_tr() { // PURPOSE: !! without preceding ! should not create table-cell; DATE:2013-12-18 fxt.Test_parse_page_all_str(String_.Concat_lines_nl_skip_last ( "{|" , "|-" @@ -581,7 +581,7 @@ public class Xop_tblw_wkr__basic_tst { , "
    " )); } - @Test public void Td_at_eos() {// PURPOSE.fix: !! at eos fails; EX:es.s:Si_mis_manos_pudieran_deshojar; DATE:2014-02-11 + @Test public void Td_at_eos() {// PURPOSE.fix: !! at eos fails; EX:es.s:Si_mis_manos_pudieran_deshojar; DATE:2014-02-11 fxt.Test_parse_page_all_str(String_.Concat_lines_nl_skip_last ( "{|" , "|-" @@ -600,7 +600,7 @@ public class Xop_tblw_wkr__basic_tst { , "" )); } - @Test public void Tr_without_tb_should_start_tb() {// PURPOSE: orphaned tr should automatically start table; EX: pl.w:Portal:Technika; DATE:2014-02-13 + @Test public void Tr_without_tb_should_start_tb() {// PURPOSE: orphaned tr should automatically start table; EX: pl.w:Portal:Technika; DATE:2014-02-13 fxt.Test_parse_page_all_str("a" , String_.Concat_lines_nl ( "" @@ -611,7 +611,7 @@ public class Xop_tblw_wkr__basic_tst { , "
    " )); } - @Test public void Tblx_should_not_close_tblw() {// PURPOSE: should not close {|; EX:fr.w:Exp%C3%A9dition_Endurance; DATE:2014-02-13 + @Test public void Tblx_should_not_close_tblw() {// PURPOSE: should not close {|; EX:fr.w:Exp%C3%A9dition_Endurance; DATE:2014-02-13 fxt.Test_parse_page_all_str(String_.Concat_lines_nl_skip_last ( "{|" , "|-" @@ -628,7 +628,7 @@ public class Xop_tblw_wkr__basic_tst { , "" )); } - @Test public void Tblx_should_not_close_tblw_2() {// PURPOSE: should close {|; ignore latter |}; EX:ru.q:Авель; DATE:2014-02-22 + @Test public void Tblx_should_not_close_tblw_2() {// PURPOSE: should close {|; ignore latter |}; EX:ru.q:Авель; DATE:2014-02-22 fxt.Test_parse_page_all_str(String_.Concat_lines_nl_skip_last ( "{|" , "|-" @@ -665,7 +665,7 @@ public class Xop_tblw_wkr__basic_tst { , "" )); } - @Test public void Td_in_list_in_tblw_should_be_ignored() {// PURPOSE: || should be ignored if in list; EX:es.d:casa; DATE:2014-02-15 + @Test public void Td_in_list_in_tblw_should_be_ignored() {// PURPOSE: || should be ignored if in list; EX:es.d:casa; DATE:2014-02-15 fxt.Test_parse_page_all_str(String_.Concat_lines_nl_skip_last ( "{|" , "|-" @@ -686,7 +686,7 @@ public class Xop_tblw_wkr__basic_tst { , "" )); } - @Test public void List_in_tblw() {// PURPOSE: list should close previous cell; EX: ru.d:Викисловарь:Условные_сокращения; DATE:2014-02-22 + @Test public void List_in_tblw() {// PURPOSE: list should close previous cell; EX: ru.d:Викисловарь:Условные_сокращения; DATE:2014-02-22 fxt.Test_parse_page_all_str(String_.Concat_lines_nl_skip_last ( "{|" , "|-" @@ -716,7 +716,7 @@ public class Xop_tblw_wkr__basic_tst { )); } } -// @Test public void Tb_under_tr_is_ignored() { // PURPOSE: table directly under tr is ignored; PAGE:en.w:Category:Dessert stubs; TODO_OLD: complicated, especially to handle 2nd |} +// @Test public void Tb_under_tr_is_ignored() { // PURPOSE: table directly under tr is ignored; PAGE:en.w:Category:Dessert stubs; TODO_OLD: complicated, especially to handle 2nd |} // fxt.Test_parse_page_wiki_str(String_.Concat_lines_nl_skip_last // ( "{|" // , "|-id='a'" @@ -735,7 +735,7 @@ public class Xop_tblw_wkr__basic_tst { // , "" // )); // } -// @Test public void Leading_ws() { // PAGE:en.w:Corneal dystrophy (human) +// @Test public void Leading_ws() { // PAGE:en.w:Corneal dystrophy (human) // fxt.Test_parse_page_wiki(String_.Concat_lines_nl_skip_last // ( " {|" // , " |-" @@ -750,14 +750,14 @@ public class Xop_tblw_wkr__basic_tst { // ) // ); // } -// @Test public void Atrs_tb() { // Tb_te // FUTURE: reinstate; WHEN: Template +// @Test public void Atrs_tb() { // Tb_te // FUTURE: reinstate; WHEN: Template // fxt.Init_log_(Xop_tblw_log.Tbl_empty).Test_parse_page_wiki("{|style='a'\n|}" // , fxt.tkn_tblw_tb_(0, 14).Atrs_rng_(2, 11).Subs_ // ( fxt.tkn_tblw_tr_(11, 11).Subs_ // ( fxt.tkn_tblw_td_(11, 11) // ))); // } -// @Test public void Td_p() { // PURPOSE:

    not being closed correctly +// @Test public void Td_p() { // PURPOSE:

    not being closed correctly // fxt.Init_para_y_(); // fxt.Test_parse_page_wiki_str(String_.Concat_lines_nl_skip_last // ( "{|" @@ -778,7 +778,7 @@ public class Xop_tblw_wkr__basic_tst { // )); // fxt.Init_para_n_(); // } -// @Test public void Tb_tb() { +// @Test public void Tb_tb() { // fxt.Test_parse_page_wiki_str(String_.Concat_lines_nl_skip_last // ( "{|id='1'" // , "{|id='2'" @@ -795,7 +795,7 @@ public class Xop_tblw_wkr__basic_tst { // , "" // )); // } -// @Test public void Tb_tb_2() { +// @Test public void Tb_tb_2() { // fxt.Test_parse_page_wiki_str(String_.Concat_lines_nl_skip_last // ( "{|id='1'" // , "{|id='2' " diff --git a/400_xowa/src/gplx/xowa/parsers/tblws/Xop_tblw_wkr__dangling_tst.java b/400_xowa/src/gplx/xowa/parsers/tblws/Xop_tblw_wkr__dangling_tst.java index 3040f4583..376eaafd9 100644 --- a/400_xowa/src/gplx/xowa/parsers/tblws/Xop_tblw_wkr__dangling_tst.java +++ b/400_xowa/src/gplx/xowa/parsers/tblws/Xop_tblw_wkr__dangling_tst.java @@ -1,24 +1,24 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.parsers.tblws; import gplx.*; import gplx.xowa.*; import gplx.xowa.parsers.*; import org.junit.*; public class Xop_tblw_wkr__dangling_tst { @Before public void init() {fxt.Reset(); fxt.Init_para_y_();} private final Xop_fxt fxt = new Xop_fxt(); @After public void term() {fxt.Init_para_n_();} - @Test public void Dangling_tb_in_xnde() {// PURPOSE: dangling tblw incorrectly auto-closed by ; PAGE:en.w:Atlanta_Olympics; DATE:2014-03-18 + @Test public void Dangling_tb_in_xnde() {// PURPOSE: dangling tblw incorrectly auto-closed by ; PAGE:en.w:Atlanta_Olympics; DATE:2014-03-18 fxt.Test_parse_page_all_str(String_.Concat_lines_nl_skip_last ( "
    " , "{|" diff --git a/400_xowa/src/gplx/xowa/parsers/tblws/Xop_tblw_wkr__double_pipe_tst.java b/400_xowa/src/gplx/xowa/parsers/tblws/Xop_tblw_wkr__double_pipe_tst.java index 9354c205c..4ae0eb27b 100644 --- a/400_xowa/src/gplx/xowa/parsers/tblws/Xop_tblw_wkr__double_pipe_tst.java +++ b/400_xowa/src/gplx/xowa/parsers/tblws/Xop_tblw_wkr__double_pipe_tst.java @@ -1,31 +1,31 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.parsers.tblws; import gplx.*; import gplx.xowa.*; import gplx.xowa.parsers.*; import org.junit.*; public class Xop_tblw_wkr__double_pipe_tst { @Before public void init() {fxt.Reset(); fxt.Init_para_y_();} private final Xop_fxt fxt = new Xop_fxt(); @After public void term() {fxt.Init_para_n_();} - @Test public void No_tblw() { // PURPOSE: if || has no tblw, treat as lnki; none; DATE:2014-05-06 + @Test public void No_tblw() { // PURPOSE: if || has no tblw, treat as lnki; none; DATE:2014-05-06 fxt.Test_parse_page_all_str("[[A||b|c]]", String_.Concat_lines_nl_skip_last ( "

    b|c" // NOTE: technically this should be "|b|c", but difficult to implement; DATE:2014-05-06 , "

    " , "" )); } - @Test public void Lnki_nth() { // PURPOSE: if || is nth pipe, then treat as lnki; PAGE:en.w:Main_Page;de.w:Main_Page; DATE:2014-05-06 + @Test public void Lnki_nth() { // PURPOSE: if || is nth pipe, then treat as lnki; PAGE:en.w:Main_Page;de.w:Main_Page; DATE:2014-05-06 fxt.Test_parse_page_wiki_str(String_.Concat_lines_nl_skip_last ( "{|" , "|[[File:A.png|b||c]]" @@ -41,7 +41,7 @@ public class Xop_tblw_wkr__double_pipe_tst { ) ); } - @Test public void Lnki_list_1st() { // PURPOSE: if || is 1st pipe, but inside list, then treat as lnki; EX:w:Second_Boer_War; DATE:2014-05-05 + @Test public void Lnki_list_1st() { // PURPOSE: if || is 1st pipe, but inside list, then treat as lnki; EX:w:Second_Boer_War; DATE:2014-05-05 fxt.Test_parse_page_wiki_str(String_.Concat_lines_nl_skip_last ( "{|" , "|" @@ -63,7 +63,7 @@ public class Xop_tblw_wkr__double_pipe_tst { ) ); } - @Test public void Double_bang_lnki() { // PURPOSE: do not treat !! as tblw; PAGE:en.w:Pink_(singer); DATE:2014-06-25 + @Test public void Double_bang_lnki() { // PURPOSE: do not treat !! as tblw; PAGE:en.w:Pink_(singer); DATE:2014-06-25 fxt.Test_parse_page_wiki_str(String_.Concat_lines_nl_skip_last ( "{|" , "|" @@ -83,7 +83,7 @@ public class Xop_tblw_wkr__double_pipe_tst { ) ); } - @Test public void Double_bang_list() { // PURPOSE: do not treat !! as tblw; PAGE:en.w:Wikipedia:Featured_picture_candidates; DATE:2014-10-19 + @Test public void Double_bang_list() { // PURPOSE: do not treat !! as tblw; PAGE:en.w:Wikipedia:Featured_picture_candidates; DATE:2014-10-19 fxt.Test_parse_page_wiki_str(String_.Concat_lines_nl_skip_last ( "{|" , "* a !! b" diff --git a/400_xowa/src/gplx/xowa/parsers/tblws/Xop_tblw_wkr__errs_tst.java b/400_xowa/src/gplx/xowa/parsers/tblws/Xop_tblw_wkr__errs_tst.java index fb0e0830f..3a0a46125 100644 --- a/400_xowa/src/gplx/xowa/parsers/tblws/Xop_tblw_wkr__errs_tst.java +++ b/400_xowa/src/gplx/xowa/parsers/tblws/Xop_tblw_wkr__errs_tst.java @@ -1,23 +1,23 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.parsers.tblws; import gplx.*; import gplx.xowa.*; import gplx.xowa.parsers.*; import org.junit.*; public class Xop_tblw_wkr__errs_tst { private final Xop_fxt fxt = new Xop_fxt(); - @Test public void Err_row_empty() { + @Test public void Err_row_empty() { fxt.Test_parse_page_wiki("{|\n|-\n|-\n|a\n|}" , fxt.tkn_tblw_tb_(0, 14).Subs_ ( fxt.tkn_tblw_tr_(2, 5) @@ -26,7 +26,7 @@ public class Xop_tblw_wkr__errs_tst { )) ); } - @Test public void Err_row_trailing() { + @Test public void Err_row_trailing() { fxt.Test_parse_page_wiki("{|\n|-\n|a\n|-\n|}" , fxt.tkn_tblw_tb_(0, 14).Subs_ ( fxt.tkn_tblw_tr_(2, 8).Subs_ @@ -34,14 +34,14 @@ public class Xop_tblw_wkr__errs_tst { )) ); } - @Test public void Err_caption_after_tr() { + @Test public void Err_caption_after_tr() { fxt.Test_parse_page_wiki("{|\n|-\n|+a\n|}" , fxt.tkn_tblw_tb_(0, 12).Caption_count_(1).Subs_ ( fxt.tkn_tblw_tr_(2, 5) , fxt.tkn_tblw_tc_(5, 9).Subs_(fxt.tkn_txt_(8, 9), fxt.tkn_para_blank_(10))) ); } - @Test public void Err_caption_after_td() { + @Test public void Err_caption_after_td() { fxt.Init_log_(Xop_tblw_log.Caption_after_td).Test_parse_page_wiki("{|\n|-\n|a\n|+b\n|}" , fxt.tkn_tblw_tb_(0, 15).Caption_count_(1).Subs_ ( fxt.tkn_tblw_tr_(2, 8).Subs_ @@ -49,21 +49,21 @@ public class Xop_tblw_wkr__errs_tst { , fxt.tkn_tblw_tc_(8, 12).Subs_(fxt.tkn_txt_(11, 12), fxt.tkn_para_blank_(13))) ); } - @Test public void Err_caption_after_tc() { + @Test public void Err_caption_after_tc() { fxt.Init_log_(Xop_tblw_log.Caption_after_tc).Test_parse_page_wiki("{|\n|+a\n|+b\n|}" , fxt.tkn_tblw_tb_(0, 13).Caption_count_(2).Subs_ ( fxt.tkn_tblw_tc_(2, 6).Subs_(fxt.tkn_txt_( 5, 6)) , fxt.tkn_tblw_tc_(6, 10).Subs_(fxt.tkn_txt_( 9, 10), fxt.tkn_para_blank_(11))) ); } - @Test public void Err_row_auto_opened() { + @Test public void Err_row_auto_opened() { fxt.Test_parse_page_wiki("{|\n|a\n|}" , fxt.tkn_tblw_tb_(0, 8).Subs_ ( fxt.tkn_tblw_tr_(2, 5).Subs_ ( fxt.tkn_tblw_td_(2, 5).Subs_(fxt.tkn_txt_(4, 5), fxt.tkn_para_blank_(6)) ))); } - @Test public void Err_caption_auto_closed() { + @Test public void Err_caption_auto_closed() { fxt.Test_parse_page_wiki("{|\n|+a\n|b\n|}" , fxt.tkn_tblw_tb_(0, 12).Caption_count_(1).Subs_ ( fxt.tkn_tblw_tc_(2, 6).Subs_(fxt.tkn_txt_(5, 6)) @@ -71,7 +71,7 @@ public class Xop_tblw_wkr__errs_tst { ( fxt.tkn_tblw_td_(6, 9).Subs_(fxt.tkn_txt_(8, 9),fxt.tkn_para_blank_(10)) ))); } - @Test public void Err_Atrs_dumped_into_text() { // PURPOSE: [[Prawn]] and {{Taxobox}} was dumping text + @Test public void Err_Atrs_dumped_into_text() { // PURPOSE: [[Prawn]] and {{Taxobox}} was dumping text fxt.Test_parse_page_wiki_str(String_.Concat_lines_nl_skip_last ( "{|" , "|-" diff --git a/400_xowa/src/gplx/xowa/parsers/tblws/Xop_tblw_wkr__nested_tst.java b/400_xowa/src/gplx/xowa/parsers/tblws/Xop_tblw_wkr__nested_tst.java index 0413d28d3..f6f3a27b7 100644 --- a/400_xowa/src/gplx/xowa/parsers/tblws/Xop_tblw_wkr__nested_tst.java +++ b/400_xowa/src/gplx/xowa/parsers/tblws/Xop_tblw_wkr__nested_tst.java @@ -1,23 +1,23 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.parsers.tblws; import gplx.*; import gplx.xowa.*; import gplx.xowa.parsers.*; import org.junit.*; public class Xop_tblw_wkr__nested_tst { private final Xop_fxt fxt = new Xop_fxt(); - @Test public void Basic() { + @Test public void Basic() { fxt.Test_parse_page_wiki(String_.Concat_lines_nl_skip_last ( "{|" , "|-" @@ -44,7 +44,7 @@ public class Xop_tblw_wkr__nested_tst { ) ); } - @Test public void Leading_ws() { + @Test public void Leading_ws() { fxt.Init_para_y_(); fxt.Test_parse_page_wiki_str(String_.Concat_lines_nl_skip_last ( "{|id='a'" @@ -80,7 +80,7 @@ public class Xop_tblw_wkr__nested_tst { ); fxt.Init_para_n_(); } - @Test public void Tblx_tblw() { // PURPOSE: if
    followed by {|, ignore 2nd table; EX: en.b:Wikibooks:Featured_books; DATE:2014-02-08 + @Test public void Tblx_tblw() { // PURPOSE: if
    followed by {|, ignore 2nd table; EX: en.b:Wikibooks:Featured_books; DATE:2014-02-08 fxt.Test_parse_page_wiki_str(String_.Concat_lines_nl_skip_last ( "
    " , "{| cellspacing=\"0\"" @@ -97,7 +97,7 @@ public class Xop_tblw_wkr__nested_tst { , "" )); } - @Test public void Caption_and_tblw() { // TIDY: don't try to fix should auto-close |-; EX:fr.wikipedia.org/wiki/Napoléon_Ier; DATE:2013-12-09 + @Test public void Tblw_and_tr() {// PURPOSE: should auto-close |-; EX:fr.wikipedia.org/wiki/Napoléon_Ier; DATE:2013-12-09 fxt.Test_parse_page_wiki_str(String_.Concat_lines_nl ( "{|" , "|-" @@ -98,7 +98,7 @@ public class Xop_xnde_wkr__err_dangling_tst { ) ); } - @Test public void Tblx_and_b() { + @Test public void Tblx_and_b() { fxt.Init_log_(Xop_xnde_log.Dangling_xnde).Test_parse_page_wiki("
    sequence; PAGE:es.w:Sevilla; DATE:2014-06-29 + @Test public void Caption_and_tblw() { // TIDY: don't try to fix
    sequence; PAGE:es.w:Sevilla; DATE:2014-06-29 fxt.Test_parse_page_wiki_str(String_.Concat_lines_nl_skip_last ( "{|" , "|+" @@ -117,7 +117,7 @@ public class Xop_tblw_wkr__nested_tst { , "" )); } - @Test public void Tb_tr_tb() { // PURPOSE: if
    , auto-create
    ; EX:w:Paris; DATE:2014-03-18 + @Test public void Tb_tr_tb() { // PURPOSE: if
    , auto-create
    ; EX:w:Paris; DATE:2014-03-18 fxt.Test_parse_page_wiki_str(String_.Concat_lines_nl_skip_last ( "{|" , "|-" @@ -137,7 +137,7 @@ public class Xop_tblw_wkr__nested_tst { , "" )); } -// @Test public void Nested_tbl_missing() { // PURPOSE: nested table not rendering properly; EX:ar.s:; DATE:2014-03-18 +// @Test public void Nested_tbl_missing() { // PURPOSE: nested table not rendering properly; EX:ar.s:; DATE:2014-03-18 // fxt.Test_parse_page_wiki_str(String_.Concat_lines_nl_skip_last // ( "{|" // , "|-" diff --git a/400_xowa/src/gplx/xowa/parsers/tblws/Xop_tblw_wkr__para_tst.java b/400_xowa/src/gplx/xowa/parsers/tblws/Xop_tblw_wkr__para_tst.java index a2dac3194..2870ea56a 100644 --- a/400_xowa/src/gplx/xowa/parsers/tblws/Xop_tblw_wkr__para_tst.java +++ b/400_xowa/src/gplx/xowa/parsers/tblws/Xop_tblw_wkr__para_tst.java @@ -1,24 +1,24 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.parsers.tblws; import gplx.*; import gplx.xowa.*; import gplx.xowa.parsers.*; import org.junit.*; public class Xop_tblw_wkr__para_tst { @Before public void init() {fxt.Reset(); fxt.Init_para_y_();} private final Xop_fxt fxt = new Xop_fxt(); @After public void term() {fxt.Init_para_n_();} - @Test public void Para() { // PURPOSE: para causing strange breaks; SEE:[[John F. Kennedy]] and "two Supreme Court appointments" + @Test public void Para() { // PURPOSE: para causing strange breaks; SEE:[[John F. Kennedy]] and "two Supreme Court appointments" fxt.Test_parse_page_wiki_str(String_.Concat_lines_nl_skip_last ( "{|" , "

    " @@ -37,7 +37,7 @@ public class Xop_tblw_wkr__para_tst { ) ); } - @Test public void Nl() { // PURPOSE: para causing strange breaks; SEE:[[John F. Kennedy]] and "two Supreme Court appointments" + @Test public void Nl() { // PURPOSE: para causing strange breaks; SEE:[[John F. Kennedy]] and "two Supreme Court appointments" fxt.Test_parse_page_wiki_str(String_.Concat_lines_nl_skip_last ( "{|" , "|-" @@ -56,7 +56,7 @@ public class Xop_tblw_wkr__para_tst { ) ); } - @Test public void Unnecessary_para() { // PURPOSE: tblw causes unnecessary

    ; home/wiki/Dashboard/Image_databases; DATE:2014-02-20 + @Test public void Unnecessary_para() { // PURPOSE: tblw causes unnecessary

    ; home/wiki/Dashboard/Image_databases; DATE:2014-02-20 fxt.Test_parse_page_wiki_str(String_.Concat_lines_nl_skip_last ( "{|" , "|-" @@ -88,7 +88,7 @@ public class Xop_tblw_wkr__para_tst { ) ); } - @Test public void Ws_leading() { // PAGE:en.w:AGPLv3 + @Test public void Ws_leading() { // PAGE:en.w:AGPLv3 fxt.Test_parse_page_wiki_str(String_.Concat_lines_nl_skip_last ( "{|" , " !a" @@ -108,7 +108,7 @@ public class Xop_tblw_wkr__para_tst { ) ); } - @Test public void Ws_th_2() { // "\n\s!" should still be interpreted as tblw; s.w:Manchester; DATE:2014-02-14 + @Test public void Ws_th_2() { // "\n\s!" should still be interpreted as tblw; s.w:Manchester; DATE:2014-02-14 fxt.Test_parse_page_wiki_str(String_.Concat_lines_nl_skip_last ( "{|" , "|-" @@ -129,7 +129,7 @@ public class Xop_tblw_wkr__para_tst { ) ); } - @Test public void Ws_th_3() { // "\n\s!" and "!!" breaks tblw; ru.w:Храмы_Санкт-Петербурга (List of churches in St Petersburg); DATE:2014-02-20 + @Test public void Ws_th_3() { // "\n\s!" and "!!" breaks tblw; ru.w:Храмы_Санкт-Петербурга (List of churches in St Petersburg); DATE:2014-02-20 fxt.Test_parse_page_wiki_str(String_.Concat_lines_nl_skip_last ( "{|" , " ! id='1' | a !! id='2' | b" @@ -148,10 +148,10 @@ public class Xop_tblw_wkr__para_tst { ) ); } - @Test public void Tblw_td2_should_not_create_ws() { // PURPOSE: a||b -> a\n||b; EX:none;discovered during luaj test; DATE:2014-04-14 + @Test public void Tblw_td2_should_not_create_ws() { // PURPOSE: a||b -> a\n||b; EX:none;discovered during luaj test; DATE:2014-04-14 fxt.Test_parse_page_wiki_str("a||b", "

    a||b\n

    "); } - @Test public void Para_on_tblw() { // PURPOSE:table following link should automatically add para around link; PAGE:en.w:Template_engine_(web) DATE:2017-04-08 + @Test public void Para_on_tblw() { // PURPOSE:table following link should automatically add para around link; PAGE:en.w:Template_engine_(web) DATE:2017-04-08 fxt.Test_parse_page_wiki_str(String_.Concat_lines_nl_skip_last ( "[[A]] b" , "{|" diff --git a/400_xowa/src/gplx/xowa/parsers/tblws/Xop_tblw_wkr__tblx_tst.java b/400_xowa/src/gplx/xowa/parsers/tblws/Xop_tblw_wkr__tblx_tst.java index 024e9f775..bee24e42d 100644 --- a/400_xowa/src/gplx/xowa/parsers/tblws/Xop_tblw_wkr__tblx_tst.java +++ b/400_xowa/src/gplx/xowa/parsers/tblws/Xop_tblw_wkr__tblx_tst.java @@ -1,24 +1,24 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.parsers.tblws; import gplx.*; import gplx.xowa.*; import gplx.xowa.parsers.*; import org.junit.*; public class Xop_tblw_wkr__tblx_tst { @Before public void init() {fxt.Reset(); fxt.Init_para_y_();} private final Xop_fxt fxt = new Xop_fxt(); @After public void term() {fxt.Init_para_n_();} - @Test public void Ignore_td() { // PURPOSE: do not parse pipe as td if in ; EX:ru.w:Сочи; DATE:2014-02-22 + @Test public void Ignore_td() { // PURPOSE: do not parse pipe as td if in
    ; EX:ru.w:Сочи; DATE:2014-02-22 fxt.Test_parse_page_wiki_str(String_.Concat_lines_nl_skip_last ( "
    " , " " @@ -39,7 +39,7 @@ public class Xop_tblw_wkr__tblx_tst { ) ); } - @Test public void Ignore_tr() { // PURPOSE: do not parse "\n|-", "\n!" if in
    ; EX:s.w:Uranus; DATE:2014-05-05 + @Test public void Ignore_tr() { // PURPOSE: do not parse "\n|-", "\n!" if in
    ; EX:s.w:Uranus; DATE:2014-05-05 fxt.Test_parse_page_wiki_str(String_.Concat_lines_nl_skip_last ( "
    " , " " @@ -66,7 +66,7 @@ public class Xop_tblw_wkr__tblx_tst { ) ); } - @Test public void Tblw_tblx_tblw_fails() { // PURPOSE: {| ->
    -> \n| was not rendering as " @@ -127,7 +127,7 @@ public class Xop_tblw_wkr__tblx_tst { ) ); } - @Test public void Ignore_tr_in_lnki() { // PURPOSE: fragment within lnki should be ignored; PAGE:en.w:Aargau DATE:2016-08-14 + @Test public void Ignore_tr_in_lnki() { // PURPOSE: fragment within lnki should be ignored; PAGE:en.w:Aargau DATE:2016-08-14 fxt.Test_parse_page_wiki_str(String_.Concat_lines_nl_skip_last ( "
    ; PAGE:en.w:Paris#Demographics; DATE:2014-03-18 + @Test public void Tblw_tblx_tblw_fails() { // PURPOSE: {| -> -> \n| was not rendering as
    ; PAGE:en.w:Paris#Demographics; DATE:2014-03-18 fxt.Test_parse_page_wiki_str(String_.Concat_lines_nl_skip_last ( "{|" , "|-" @@ -101,7 +101,7 @@ public class Xop_tblw_wkr__tblx_tst { , "
    " )); } - @Test public void Auto_tr_after_td() { // PURPOSE: "
    \n|" -> "
    "; PAGE:fi.w:Salibandyn_maailmanmestaruuskilpailut_2012 DATE:2015-09-07 + @Test public void Auto_tr_after_td() { // PURPOSE: "
    \n|" -> "
    "; PAGE:fi.w:Salibandyn_maailmanmestaruuskilpailut_2012 DATE:2015-09-07 fxt.Test_parse_page_wiki_str(String_.Concat_lines_nl_skip_last ( "{|" , "
    " , "" diff --git a/400_xowa/src/gplx/xowa/parsers/tblws/Xop_tblw_wkr__uncommon_tst.java b/400_xowa/src/gplx/xowa/parsers/tblws/Xop_tblw_wkr__uncommon_tst.java index 46186e8fa..b1fdb7284 100644 --- a/400_xowa/src/gplx/xowa/parsers/tblws/Xop_tblw_wkr__uncommon_tst.java +++ b/400_xowa/src/gplx/xowa/parsers/tblws/Xop_tblw_wkr__uncommon_tst.java @@ -1,24 +1,24 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.parsers.tblws; import gplx.*; import gplx.xowa.*; import gplx.xowa.parsers.*; import org.junit.*; public class Xop_tblw_wkr__uncommon_tst { @Before public void init() {fxt.Reset(); fxt.Init_para_y_();} private final Xop_fxt fxt = new Xop_fxt(); @After public void term() {fxt.Init_para_n_();} - @Test public void Tr_pops_entire_stack() { // PURPOSE: in strange cases, tr will pop entire stack; PAGE:en.w:Turks_in_Denmark; DATE:2014-03-02 + @Test public void Tr_pops_entire_stack() { // PURPOSE: in strange cases, tr will pop entire stack; PAGE:en.w:Turks_in_Denmark; DATE:2014-03-02 fxt.Test_parse_page_all_str(String_.Concat_lines_nl_skip_last ( "{|" , "
    a" @@ -42,7 +42,7 @@ public class Xop_tblw_wkr__uncommon_tst { , "
    " )); } - @Test public void Atrs_defect() { // PURPOSE: < in atrs was causing premature termination; PAGE:en.w:Wikipedia:List of hoaxes on Wikipedia + @Test public void Atrs_defect() { // PURPOSE: < in atrs was causing premature termination; PAGE:en.w:Wikipedia:List of hoaxes on Wikipedia fxt.Test_parse_page_wiki_str(String_.Concat_lines_nl_skip_last ( "{|id=\"a" )); } - @Test public void Broken_lnki_2() { // PURPOSE: variation on above; PAGE:hr.b:Knjiga_pojmova_u_zrakoplovstvu/Kratice_u_zrakoplovstvu/S; DATE:2014-09-05 + @Test public void Broken_lnki_2() { // PURPOSE: variation on above; PAGE:hr.b:Knjiga_pojmova_u_zrakoplovstvu/Kratice_u_zrakoplovstvu/S; DATE:2014-09-05 fxt.Test_parse_page_wiki_str(String_.Concat_lines_nl_skip_last ( "{|" , "|-" @@ -99,7 +99,7 @@ public class Xop_tblw_wkr__uncommon_tst { , "
    " )); } - @Test public void Tr_with_pipe_ignores_content() { // PURPOSE: "|-" followed by "|" ignores rest of content; EX: {|\n|-|a\n|} PAGE:lv.w:Starptautiska_kosmosa_stacija; DATE:2015-11-21 + @Test public void Tr_with_pipe_ignores_content() { // PURPOSE: "|-" followed by "|" ignores rest of content; EX: {|\n|-|a\n|} PAGE:lv.w:Starptautiska_kosmosa_stacija; DATE:2015-11-21 fxt.Test_parse_page_wiki_str(String_.Concat_lines_nl_skip_last ( "{|" , "|- |a" @@ -109,7 +109,7 @@ public class Xop_tblw_wkr__uncommon_tst { , "
    " )); } - @Test public void Tr_with_pipe_should_ignore() { // PURPOSE: ignore sequences like "\n|- ||"; PAGE: nl.w:Tabel_van_Belgische_gemeenten; DATE:2015-12-03 + @Test public void Tr_with_pipe_should_ignore() { // PURPOSE: ignore sequences like "\n|- ||"; PAGE: nl.w:Tabel_van_Belgische_gemeenten; DATE:2015-12-03 fxt.Test_parse_page_wiki_str(String_.Concat_lines_nl_skip_last ( "{|" , "|- ||" diff --git a/400_xowa/src/gplx/xowa/parsers/tmpls/Arg_nde_tkn.java b/400_xowa/src/gplx/xowa/parsers/tmpls/Arg_nde_tkn.java index 44135e8f0..df81219eb 100644 --- a/400_xowa/src/gplx/xowa/parsers/tmpls/Arg_nde_tkn.java +++ b/400_xowa/src/gplx/xowa/parsers/tmpls/Arg_nde_tkn.java @@ -1,18 +1,18 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.parsers.tmpls; import gplx.*; import gplx.xowa.*; import gplx.xowa.parsers.*; public class Arg_nde_tkn extends Xop_tkn_itm_base { public Arg_nde_tkn() {} // for mock @@ -22,7 +22,7 @@ public class Arg_nde_tkn extends Xop_tkn_itm_base { public int Arg_colon_pos() {return arg_colon_pos;} public Arg_nde_tkn Arg_colon_pos_(int v) {arg_colon_pos = v; return this;} private int arg_colon_pos = -1; public Arg_itm_tkn Key_tkn() {return key_tkn;} public Arg_nde_tkn Key_tkn_(Arg_itm_tkn v) {key_tkn = v; return this;} Arg_itm_tkn key_tkn = Arg_itm_tkn_null.Null_arg_itm; public Arg_itm_tkn Val_tkn() {return val_tkn;} public Arg_nde_tkn Val_tkn_(Arg_itm_tkn v) {val_tkn = v; return this;} Arg_itm_tkn val_tkn = Arg_itm_tkn_null.Null_arg_itm; - @gplx.Virtual public boolean KeyTkn_exists() {return key_tkn != Arg_itm_tkn_null.Null_arg_itm;} + public boolean KeyTkn_exists() {return key_tkn != Arg_itm_tkn_null.Null_arg_itm;} public Xop_tkn_itm Eq_tkn() {return eq_tkn;} public Arg_nde_tkn Eq_tkn_(Xop_tkn_itm v) {eq_tkn = v; return this;} private Xop_tkn_itm eq_tkn = Xop_tkn_null.Null_tkn; public int Arg_tid() {return arg_tid;} public void Arg_tid_(int v) {arg_tid = v;} private int arg_tid = Int_.Max_value; @Override public void Tmpl_fmt(Xop_ctx ctx, byte[] src, Xot_fmtr fmtr) {fmtr.Reg_arg(ctx, src, arg_idx, this);} diff --git a/400_xowa/src/gplx/xowa/parsers/tmpls/Xop_subst_tst.java b/400_xowa/src/gplx/xowa/parsers/tmpls/Xop_subst_tst.java index 4c70a1802..d610732dc 100644 --- a/400_xowa/src/gplx/xowa/parsers/tmpls/Xop_subst_tst.java +++ b/400_xowa/src/gplx/xowa/parsers/tmpls/Xop_subst_tst.java @@ -1,18 +1,18 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.parsers.tmpls; import gplx.*; import gplx.xowa.*; import gplx.xowa.parsers.*; import org.junit.*; import gplx.xowa.wikis.ttls.*; public class Xop_subst_tst { @@ -23,19 +23,19 @@ public class Xop_subst_tst { fxt.Init_defn_add("xo_print", "{{{1}}}"); fxt.Init_defn_add("!", "|"); } - @Test public void Wiki_txt_subst() {fxt.Test_parse_tmpl_str_test("{{{1}}}" , "{{subst:test|a}}" , "a");} - @Test public void Wiki_txt_subst_ws() {fxt.Test_parse_tmpl_str_test("{{{1}}}" , "{{ subst:test|a}}" , "a");} - @Test public void Wiki_txt_safesubst() {fxt.Test_parse_tmpl_str_test("{{{1}}}" , "{{safesubst:test|a}}" , "a");} - @Test public void Tmpl_txt_subst_empty() {fxt.Test_parse_tmpl_str_test("{{subst:}}" , "{{test}}" , "{{subst:}}");} - @Test public void Tmpl_txt_safesubst() {fxt.Test_parse_tmpl_str_test("{{safesubst:xo_print|a}}" , "{{test}}" , "a");} - @Test public void Tmpl_prm_subst() {fxt.Test_parse_tmpl_str_test("{{{{{1|subst:}}}xo_print|a}}" , "{{test}}" , "{{subst:xo_print|a}}");} - @Test public void Tmpl_prm_subst_ws() {fxt.Test_parse_tmpl_str_test("{{{{{1| subst:}}}xo_print|a}}" , "{{test}}" , "{{ subst:xo_print|a}}");} - @Test public void Tmpl_prm_safesubst() {fxt.Test_parse_tmpl_str_test("{{{{{1|safesubst:}}}xo_print|a}}" , "{{test}}" , "a");} - @Test public void Tmpl_prm_safesubst_empty() {fxt.Test_parse_tmpl_str_test("{{{{{|safesubst:}}}xo_print|a}}" , "{{test}}" , "a");} - @Test public void Tmpl_txt_subst_pf() {fxt.Test_parse_tmpl_str_test("{{subst:#expr:0}}" , "{{test}}" , "0");} - @Test public void Tmpl_txt_safesubst_prm() {fxt.Test_parse_tmpl_str_test("{{{{{|safesubst:}}}#if:{{{1|}}}{{{{{|safesubst:}}}!}}c1|c2}}" , "{{test}}" , "c2");} - @Test public void Exc_tmpl_prm_safesubst_ns() {fxt.Test_parse_tmpl_str_test("{{{{{|safesubst}}}:NAMESPACE}}" , "{{test}}" , "");} - @Test public void Unreferenced() { // PURPOSE: if subst, but in tmpl stage, do not actually subst; PAGE:en.w:Unreferenced; DATE:2013-01-31 + @Test public void Wiki_txt_subst() {fxt.Test_parse_tmpl_str_test("{{{1}}}" , "{{subst:test|a}}" , "a");} + @Test public void Wiki_txt_subst_ws() {fxt.Test_parse_tmpl_str_test("{{{1}}}" , "{{ subst:test|a}}" , "a");} + @Test public void Wiki_txt_safesubst() {fxt.Test_parse_tmpl_str_test("{{{1}}}" , "{{safesubst:test|a}}" , "a");} + @Test public void Tmpl_txt_subst_empty() {fxt.Test_parse_tmpl_str_test("{{subst:}}" , "{{test}}" , "{{subst:}}");} + @Test public void Tmpl_txt_safesubst() {fxt.Test_parse_tmpl_str_test("{{safesubst:xo_print|a}}" , "{{test}}" , "a");} + @Test public void Tmpl_prm_subst() {fxt.Test_parse_tmpl_str_test("{{{{{1|subst:}}}xo_print|a}}" , "{{test}}" , "{{subst:xo_print|a}}");} + @Test public void Tmpl_prm_subst_ws() {fxt.Test_parse_tmpl_str_test("{{{{{1| subst:}}}xo_print|a}}" , "{{test}}" , "{{ subst:xo_print|a}}");} + @Test public void Tmpl_prm_safesubst() {fxt.Test_parse_tmpl_str_test("{{{{{1|safesubst:}}}xo_print|a}}" , "{{test}}" , "a");} + @Test public void Tmpl_prm_safesubst_empty() {fxt.Test_parse_tmpl_str_test("{{{{{|safesubst:}}}xo_print|a}}" , "{{test}}" , "a");} + @Test public void Tmpl_txt_subst_pf() {fxt.Test_parse_tmpl_str_test("{{subst:#expr:0}}" , "{{test}}" , "0");} + @Test public void Tmpl_txt_safesubst_prm() {fxt.Test_parse_tmpl_str_test("{{{{{|safesubst:}}}#if:{{{1|}}}{{{{{|safesubst:}}}!}}c1|c2}}" , "{{test}}" , "c2");} + @Test public void Exc_tmpl_prm_safesubst_ns() {fxt.Test_parse_tmpl_str_test("{{{{{|safesubst}}}:NAMESPACE}}" , "{{test}}" , "");} + @Test public void Unreferenced() { // PURPOSE: if subst, but in tmpl stage, do not actually subst; PAGE:en.w:Unreferenced; DATE:2013-01-31 fxt.Init_defn_clear(); fxt.Init_defn_add("substcheck", "SUBST"); fxt.Init_defn_add("ifsubst", String_.Concat_lines_nl @@ -46,29 +46,29 @@ public class Xop_subst_tst { )); fxt.Test_parse_tmpl_str_test("{{ {{{|safesubst:}}}ifsubst |yes|{{subst:substcheck}}}}", "{{test}}", "{{subst:substcheck}}"); } - @Test public void Urlencode_missing_ttl() { // PURPOSE: handle missing ttl inside {{does-template-exist}}; EX: en.d:Kazakhstan; DATE:2014-03-25 + @Test public void Urlencode_missing_ttl() { // PURPOSE: handle missing ttl inside {{does-template-exist}}; EX: en.d:Kazakhstan; DATE:2014-03-25 fxt.Init_defn_clear(); fxt.Init_defn_add("test", "{{safesubst:urlencode:{{safesubst:Template:{{{1}}}}}}}"); fxt.Test_parse_page_tmpl_str("{{test|xyz}}", "%5B%5BTemplate%3Axyz%5D%5D"); // url-encoded version of [[:Template:xyz]]; NOTE: removed leading ":" from ":Template:" DATE:2016-06-24 } - @Test public void Urlencode_invalid_ttl() { // PURPOSE: handle invalid ttl inside does-template-exist; EX: en.d:peace; DATE:2014-03-31 + @Test public void Urlencode_invalid_ttl() { // PURPOSE: handle invalid ttl inside does-template-exist; EX: en.d:peace; DATE:2014-03-31 fxt.Init_defn_clear(); fxt.Init_defn_add("test", "{{safesubst:urlencode:{{safesubst:Template:{{{1}}}}}}}"); fxt.Test_parse_page_tmpl_str("{{test|[xyz]}}", "%7B%7Bsafesubst%3ATemplate%3A%5Bxyz%5D%7D%7D"); // url-encoded version of {{safesubst:Template:xyz}} } - @Test public void Urlencode_template_ttl() { // PURPOSE: handle template ttl inside does-template-exist; based on above; DATE:2014-03-31 + @Test public void Urlencode_template_ttl() { // PURPOSE: handle template ttl inside does-template-exist; based on above; DATE:2014-03-31 fxt.Init_defn_clear(); fxt.Init_defn_add("test", "{{safesubst:urlencode:{{Template:{{{1}}}}}}}"); fxt.Test_parse_page_tmpl_str("{{test|Template:[xyz]}}", "%7B%7BTemplate%3ATemplate%3A%5Bxyz%5D%7D%7D"); // url-encoded version of {{safesubst:Template:xyz}} } - @Test public void Nowiki() { // PURPOSE: stack overflow; PAGE:Близкие_друзья_(Сезон_2) DATE:2014-10-21 + @Test public void Nowiki() { // PURPOSE: stack overflow; PAGE:Близкие_друзья_(Сезон_2) DATE:2014-10-21 fxt.Init_defn_add("ET", ""); fxt.Init_defn_add("ds", "{{subst:ET|{{subst:ds}}}}"); fxt.Test_parse_page_tmpl_str("{{subst:ds}}", ""); // {{subst:ds}} causes stack overflow; {{ds}} does not } // NOTE: these are actually not good tests; MW does subst just before save; it doesn't do subst on load; in this case, the tests are testing load (which will noop); they need to test save (which xowa doesn't do) - // @Test public void Tmpl_txt_subst() {fxt.Test_parse_tmpl_str_test("{{subst:xo_print|a}}" , "{{test}}" , "a");} - // @Test public void Tmpl_txt_subst_prm() {fxt.Test_parse_tmpl_str_test("{{subst:xo_print|{{{1}}}}}" , "{{test|a}}" , "a");} - //@Test public void Tmpl_txt_safesubst_prm() {fxt.Test_parse_tmpl_str_test("{{{{{|safesubst:}}}ns:Category}}" , "{{test}}" , "Category");} - //@Test public void Tmpl_txt_subst_immed() {fxt.Test_parse_tmpl_str_test("{{xo_print{{subst:!}}a}}" , "{{test}}" , "a");} + // @Test public void Tmpl_txt_subst() {fxt.Test_parse_tmpl_str_test("{{subst:xo_print|a}}" , "{{test}}" , "a");} + // @Test public void Tmpl_txt_subst_prm() {fxt.Test_parse_tmpl_str_test("{{subst:xo_print|{{{1}}}}}" , "{{test|a}}" , "a");} + //@Test public void Tmpl_txt_safesubst_prm() {fxt.Test_parse_tmpl_str_test("{{{{{|safesubst:}}}ns:Category}}" , "{{test}}" , "Category");} + //@Test public void Tmpl_txt_subst_immed() {fxt.Test_parse_tmpl_str_test("{{xo_print{{subst:!}}a}}" , "{{test}}" , "a");} } diff --git a/400_xowa/src/gplx/xowa/parsers/tmpls/Xop_tkn_print_tst.java b/400_xowa/src/gplx/xowa/parsers/tmpls/Xop_tkn_print_tst.java index 6a3048a15..a7278378e 100644 --- a/400_xowa/src/gplx/xowa/parsers/tmpls/Xop_tkn_print_tst.java +++ b/400_xowa/src/gplx/xowa/parsers/tmpls/Xop_tkn_print_tst.java @@ -1,31 +1,31 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.parsers.tmpls; import gplx.*; import gplx.xowa.*; import gplx.xowa.parsers.*; import org.junit.*; public class Xop_tkn_print_tst { private final Xop_fxt fxt = new Xop_fxt(); - @Test public void Text() {tst_Print("a ''b'' c [[d]] e");} - @Test public void Prm() {tst_Print("{{{1}}}");} - @Test public void Prm_dflt() {tst_Print("{{{1|a}}}");} - @Test public void Prm_dflt_prm() {tst_Print("{{{1|{{{2}}}}}}");} - @Test public void Tmpl() {tst_Print("{{a}}");} - @Test public void Tmpl_arg() {tst_Print("{{a|1|2}}");} - @Test public void Tmpl_arg_prm() {tst_Print("{{a|1|{{{1}}}}}");} - @Test public void Tmpl_arg_tmpl() {tst_Print("{{a|1|{{b}}}}");} - @Test public void Tmpl_pf() {tst_Print("{{#expr:1}}");} + @Test public void Text() {tst_Print("a ''b'' c [[d]] e");} + @Test public void Prm() {tst_Print("{{{1}}}");} + @Test public void Prm_dflt() {tst_Print("{{{1|a}}}");} + @Test public void Prm_dflt_prm() {tst_Print("{{{1|{{{2}}}}}}");} + @Test public void Tmpl() {tst_Print("{{a}}");} + @Test public void Tmpl_arg() {tst_Print("{{a|1|2}}");} + @Test public void Tmpl_arg_prm() {tst_Print("{{a|1|{{{1}}}}}");} + @Test public void Tmpl_arg_tmpl() {tst_Print("{{a|1|{{b}}}}");} + @Test public void Tmpl_pf() {tst_Print("{{#expr:1}}");} private void tst_Print(String raw) { Xop_ctx ctx = fxt.Ctx(); byte[] raw_bry = Bry_.new_u8(raw); diff --git a/400_xowa/src/gplx/xowa/parsers/tmpls/Xot_defn_trace_brief_tst.java b/400_xowa/src/gplx/xowa/parsers/tmpls/Xot_defn_trace_brief_tst.java index 0f3bcfa76..afab64ebe 100644 --- a/400_xowa/src/gplx/xowa/parsers/tmpls/Xot_defn_trace_brief_tst.java +++ b/400_xowa/src/gplx/xowa/parsers/tmpls/Xot_defn_trace_brief_tst.java @@ -1,18 +1,18 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.parsers.tmpls; import gplx.*; import gplx.xowa.*; import gplx.xowa.parsers.*; import org.junit.*; import gplx.core.strings.*; public class Xot_defn_trace_brief_tst { @@ -23,9 +23,9 @@ public class Xot_defn_trace_brief_tst { fxt.Init_defn_add("leaf_b", "{{{1}}}"); fxt.Ctx().Defn_trace_(new Xot_defn_trace_brief()); } - @Test public void Basic_a_1() {fxt.tst_("{{leaf_a}}" , "0001 leaf_a");} - @Test public void Basic_a_2() {fxt.tst_("{{leaf_a}} {{leaf_a}}" , "0002 leaf_a");} - @Test public void Basic_a_b() {fxt.tst_("{{leaf_a}} {{leaf_b}}" , "0001 leaf_a", "0001 leaf_b");} + @Test public void Basic_a_1() {fxt.tst_("{{leaf_a}}" , "0001 leaf_a");} + @Test public void Basic_a_2() {fxt.tst_("{{leaf_a}} {{leaf_a}}" , "0002 leaf_a");} + @Test public void Basic_a_b() {fxt.tst_("{{leaf_a}} {{leaf_b}}" , "0001 leaf_a", "0001 leaf_b");} } class Xot_defn_trace_fxt { private final Xop_fxt fxt = new Xop_fxt(); diff --git a/400_xowa/src/gplx/xowa/parsers/tmpls/Xot_defn_trace_dbg_tst.java b/400_xowa/src/gplx/xowa/parsers/tmpls/Xot_defn_trace_dbg_tst.java index f6cd4730d..b7fa55be2 100644 --- a/400_xowa/src/gplx/xowa/parsers/tmpls/Xot_defn_trace_dbg_tst.java +++ b/400_xowa/src/gplx/xowa/parsers/tmpls/Xot_defn_trace_dbg_tst.java @@ -1,18 +1,18 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.parsers.tmpls; import gplx.*; import gplx.xowa.*; import gplx.xowa.parsers.*; import org.junit.*; public class Xot_defn_trace_dbg_tst { @@ -25,7 +25,7 @@ public class Xot_defn_trace_dbg_tst { fx.Init_defn_add("mid_1", "{{print|[ {{concat|{{{1}}}|{{{2}}}}} ]}}"); fx.Ctx().Defn_trace_(Xot_defn_trace_dbg.Instance); } - @Test public void Tmpl() { + @Test public void Tmpl() { fx.tst_ ( "{{print|a|key1=b}}" , "*source" @@ -43,5 +43,5 @@ public class Xot_defn_trace_dbg_tst { , "a" ); } - //@Test public void Basic_b() {fx.tst_("{{mwo_b|2}}" , "[[Test page]]", "00 11 {{mwo_b|1}} -> b");} + //@Test public void Basic_b() {fx.tst_("{{mwo_b|2}}" , "[[Test page]]", "00 11 {{mwo_b|1}} -> b");} } diff --git a/400_xowa/src/gplx/xowa/parsers/tmpls/Xot_examples_tst.java b/400_xowa/src/gplx/xowa/parsers/tmpls/Xot_examples_tst.java index fb23ee64b..485b6f18c 100644 --- a/400_xowa/src/gplx/xowa/parsers/tmpls/Xot_examples_tst.java +++ b/400_xowa/src/gplx/xowa/parsers/tmpls/Xot_examples_tst.java @@ -1,18 +1,18 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.parsers.tmpls; import gplx.*; import gplx.xowa.*; import gplx.xowa.parsers.*; import org.junit.*; public class Xot_examples_tst { @@ -21,29 +21,29 @@ public class Xot_examples_tst { Io_mgr.Instance.InitEngine_mem(); fxt.Reset(); } - @Test public void Arg_0() {Init_tmpl_for(); fxt.Test_parse_tmpl_str("{{For}}" , "For other uses, see [[Test page (disambiguation)]].");} - @Test public void Arg_1() {Init_tmpl_for(); fxt.Test_parse_tmpl_str("{{For|a}}" , "For a, see [[Test page (disambiguation)]].");} - @Test public void Arg_2() {Init_tmpl_for(); fxt.Test_parse_tmpl_str("{{For|a|b}}" , "For a, see [[b]].");} - @Test public void Arg_3() {Init_tmpl_for(); fxt.Test_parse_tmpl_str("{{For|a|b|c}}" , "For a, see [[b]] and [[c]].");} - @Test public void Arg_4() {Init_tmpl_for(); fxt.Test_parse_tmpl_str("{{For|a|b|c|d}}" , "For a, see [[b]], [[c]], and [[d]].");} - @Test public void Arg_5() {Init_tmpl_for(); fxt.Test_parse_tmpl_str("{{For|a|b|c|d|e}}" , "For a, see [[b]], [[c]], [[d]], and [[e]].");} - @Test public void Arg_1_nil() {Init_tmpl_for(); fxt.Test_parse_tmpl_str("{{For||a|b}}" , "For other uses, see [[a]] and [[b]].");} - @Test public void Main() { + @Test public void Arg_0() {Init_tmpl_for(); fxt.Test_parse_tmpl_str("{{For}}" , "For other uses, see [[Test page (disambiguation)]].");} + @Test public void Arg_1() {Init_tmpl_for(); fxt.Test_parse_tmpl_str("{{For|a}}" , "For a, see [[Test page (disambiguation)]].");} + @Test public void Arg_2() {Init_tmpl_for(); fxt.Test_parse_tmpl_str("{{For|a|b}}" , "For a, see [[b]].");} + @Test public void Arg_3() {Init_tmpl_for(); fxt.Test_parse_tmpl_str("{{For|a|b|c}}" , "For a, see [[b]] and [[c]].");} + @Test public void Arg_4() {Init_tmpl_for(); fxt.Test_parse_tmpl_str("{{For|a|b|c|d}}" , "For a, see [[b]], [[c]], and [[d]].");} + @Test public void Arg_5() {Init_tmpl_for(); fxt.Test_parse_tmpl_str("{{For|a|b|c|d|e}}" , "For a, see [[b]], [[c]], [[d]], and [[e]].");} + @Test public void Arg_1_nil() {Init_tmpl_for(); fxt.Test_parse_tmpl_str("{{For||a|b}}" , "For other uses, see [[a]] and [[b]].");} + @Test public void Main() { Init_tmpl_main(); fxt.Test_parse_tmpl_str("{{Main|a}}", "Main article: [[a|a]]"); } - @Test public void About() { + @Test public void About() { Init_tmpl_about(); fxt.Test_parse_tmpl_str("{{About|abc}}", "This article is about abc. For other uses, see [[Test page (disambiguation)]]."); } - @Test public void About_2() { // PAGE:en.w:{{About|the NASA space mission||Messenger (disambiguation)}} + @Test public void About_2() { // PAGE:en.w:{{About|the NASA space mission||Messenger (disambiguation)}} Init_tmpl_about(); fxt.Test_parse_tmpl_str("{{About|a||b{{!}}c}}", "This article is about a. For other uses, see [[b|c]]."); } - @Test public void OtherUses() { + @Test public void OtherUses() { Init_tmpl_other_uses(); fxt.Test_parse_tmpl_str("{{Other uses|abc}}", "For other uses, see [[abc]]."); } - @Test public void SeeAlso() { + @Test public void SeeAlso() { Init_tmpl_see_also(); fxt.Test_parse_tmpl_str("{{See also|abc}}", "See also: [[abc]]"); } - @Test public void Redirect() { + @Test public void Redirect() { Init_tmpl_redirect(); fxt.Test_parse_tmpl_str("{{Redirect|abc}}", "\"abc\" redirects here. For other uses, see [[abc (disambiguation)]]."); } private void Init_tmpl_main() { diff --git a/400_xowa/src/gplx/xowa/parsers/tmpls/Xot_invk_sandbox_tst.java b/400_xowa/src/gplx/xowa/parsers/tmpls/Xot_invk_sandbox_tst.java index 2377e4152..bda6faaa7 100644 --- a/400_xowa/src/gplx/xowa/parsers/tmpls/Xot_invk_sandbox_tst.java +++ b/400_xowa/src/gplx/xowa/parsers/tmpls/Xot_invk_sandbox_tst.java @@ -1,18 +1,18 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.parsers.tmpls; import gplx.*; import gplx.xowa.*; import gplx.xowa.parsers.*; import org.junit.*; public class Xot_invk_sandbox_tst { @@ -22,25 +22,25 @@ public class Xot_invk_sandbox_tst { fxt.Init_defn_clear(); fxt.Init_defn_add("concat", "{{{1}}}{{{2}}}"); } - @Test public void Basic() { + @Test public void Basic() { fxt.Test_parse_tmpl_str("{{concat|a|b}}", "ab"); } - @Test public void Basic_too_many() { // c gets ignored + @Test public void Basic_too_many() { // c gets ignored fxt.Test_parse_tmpl_str("{{concat|a|b|c}}", "ab"); } - @Test public void Basic_too_few() { + @Test public void Basic_too_few() { fxt.Test_parse_tmpl_str("{{concat|a}}", "a{{{2}}}"); } - @Test public void Basic_else() { + @Test public void Basic_else() { fxt.Init_defn_add("concat", "{{{1}}}{{{2|?}}}"); fxt.Test_parse_tmpl_str("{{concat|a}}", "a?"); } - @Test public void Eq_2() { + @Test public void Eq_2() { fxt.Init_defn_add("concat", "{{{lkp1}}}"); fxt.Test_parse_tmpl_str("{{concat|lkp1=a=b}}", "a=b"); } - @Test public void Recurse() {fxt.Test_parse_tmpl_str_test("<{{concat|{{{1}}}|{{{2}}}}}>" , "{{test|a|b}}", "");} - @Test public void Recurse_mix() {fxt.Test_parse_tmpl_str_test("{{concat|.{{{1}}}.|{{{2}}}}}" , "{{test|a|b}}", ".a.b");} - @Test public void Recurse_err() {fxt.Test_parse_tmpl_str_test("{{concat|{{{1}}}|{{{2}}}}}" , "{{test1|a|b}}", "[[:Template:test1]]");} // NOTE: make sure test1 does not match test - @Test public void KeyNewLine() {fxt.Test_parse_tmpl_str_test("{{\n concat|a|b}}" , "{{\n test}}", "ab");} + @Test public void Recurse() {fxt.Test_parse_tmpl_str_test("<{{concat|{{{1}}}|{{{2}}}}}>" , "{{test|a|b}}", "");} + @Test public void Recurse_mix() {fxt.Test_parse_tmpl_str_test("{{concat|.{{{1}}}.|{{{2}}}}}" , "{{test|a|b}}", ".a.b");} + @Test public void Recurse_err() {fxt.Test_parse_tmpl_str_test("{{concat|{{{1}}}|{{{2}}}}}" , "{{test1|a|b}}", "[[:Template:test1]]");} // NOTE: make sure test1 does not match test + @Test public void KeyNewLine() {fxt.Test_parse_tmpl_str_test("{{\n concat|a|b}}" , "{{\n test}}", "ab");} } diff --git a/400_xowa/src/gplx/xowa/parsers/tmpls/Xot_invk_wkr__basic__tst.java b/400_xowa/src/gplx/xowa/parsers/tmpls/Xot_invk_wkr__basic__tst.java index 789c5f917..d8b31da81 100644 --- a/400_xowa/src/gplx/xowa/parsers/tmpls/Xot_invk_wkr__basic__tst.java +++ b/400_xowa/src/gplx/xowa/parsers/tmpls/Xot_invk_wkr__basic__tst.java @@ -1,31 +1,31 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.parsers.tmpls; import gplx.*; import gplx.xowa.*; import gplx.xowa.parsers.*; import org.junit.*; import gplx.xowa.wikis.ttls.*; import gplx.xowa.wikis.nss.*; public class Xot_invk_wkr__basic__tst { private final Xop_fxt fxt = new Xop_fxt(); @Before public void init() {fxt.Reset();} - @Test public void Basic() { + @Test public void Basic() { fxt.Test_parse_page_tmpl("{{a}}", fxt.tkn_tmpl_invk_w_name(0, 5, 2, 3)); } - @Test public void Arg_many() { + @Test public void Arg_many() { fxt.Test_parse_page_tmpl("{{a|b|c|d}}", fxt.tkn_tmpl_invk_w_name(0, 11, 2, 3) .Args_(fxt.tkn_arg_val_txt_(4, 5), fxt.tkn_arg_val_txt_(6, 7), fxt.tkn_arg_val_txt_(8, 9))); } - @Test public void Kv() { + @Test public void Kv() { fxt.Test_parse_page_tmpl("{{a|b=c}}", fxt.tkn_tmpl_invk_w_name(0, 9, 2, 3) .Args_ ( fxt.tkn_arg_nde_() @@ -33,7 +33,7 @@ public class Xot_invk_wkr__basic__tst { . Val_tkn_(fxt.tkn_arg_itm_(fxt.tkn_txt_(6, 7))) )); } - @Test public void Kv_arg() { + @Test public void Kv_arg() { fxt.Test_parse_tmpl("{{a|b={{{1}}}}}", fxt.tkn_tmpl_invk_w_name(0, 15, 2, 3) .Args_ ( fxt.tkn_arg_nde_() @@ -41,7 +41,7 @@ public class Xot_invk_wkr__basic__tst { . Val_tkn_(fxt.tkn_arg_itm_(fxt.tkn_tmpl_prm_find_(fxt.tkn_txt_(9, 10)))) )); } - @Test public void Kv_tmpl_compiled() { + @Test public void Kv_tmpl_compiled() { fxt.Test_parse_tmpl("{{a|b={{c}}}}", fxt.tkn_tmpl_invk_w_name(0, 13, 2, 3) .Args_ ( fxt.tkn_arg_nde_() @@ -49,7 +49,7 @@ public class Xot_invk_wkr__basic__tst { . Val_tkn_(fxt.tkn_arg_itm_(fxt.tkn_tmpl_invk_w_name(6, 11, 8, 9))) )); } - @Test public void Kv_tmpl_dynamic() { + @Test public void Kv_tmpl_dynamic() { fxt.Test_parse_tmpl("{{a|b={{c|{{{1}}}}}}}", fxt.tkn_tmpl_invk_w_name(0, 21, 2, 3) .Args_ ( fxt.tkn_arg_nde_() @@ -58,7 +58,7 @@ public class Xot_invk_wkr__basic__tst { ) )); } - @Test public void Nest() { + @Test public void Nest() { fxt.Test_parse_page_tmpl("{{a|b{{c|d}}e}}", fxt.tkn_tmpl_invk_w_name(0, 15, 2, 3).Args_ ( fxt.tkn_arg_nde_().Val_tkn_(fxt.tkn_arg_itm_ ( fxt.tkn_txt_(4, 5) @@ -69,33 +69,33 @@ public class Xot_invk_wkr__basic__tst { )) )); } - @Test public void Whitespace() { + @Test public void Whitespace() { fxt.Test_parse_page_tmpl("{{a| b = c }}", fxt.tkn_tmpl_invk_w_name(0, 13, 2, 3).Args_ ( fxt.tkn_arg_nde_() .Key_tkn_(fxt.tkn_arg_itm_(fxt.tkn_space_(4, 5).Ignore_y_(), fxt.tkn_txt_(5, 6), fxt.tkn_space_( 6, 7).Ignore_y_())) .Val_tkn_(fxt.tkn_arg_itm_(fxt.tkn_space_(8, 9).Ignore_y_(), fxt.tkn_txt_(9, 10), fxt.tkn_space_(10, 11).Ignore_y_())) )); } - @Test public void Whitespace_nl() { + @Test public void Whitespace_nl() { fxt.Test_parse_page_tmpl("{{a|b=c\n}}", fxt.tkn_tmpl_invk_w_name(0, 10, 2, 3).Args_ ( fxt.tkn_arg_nde_() .Key_tkn_(fxt.tkn_arg_itm_(fxt.tkn_txt_(4, 5))) .Val_tkn_(fxt.tkn_arg_itm_(fxt.tkn_txt_(6, 7), fxt.tkn_nl_char_(7, 8).Ignore_y_())) )); } - @Test public void Err_noName() { // WP: [[Russian language]] + @Test public void Err_noName() { // WP: [[Russian language]] fxt.Test_parse_page_tmpl("{{|}}", fxt.tkn_curly_bgn_(0), fxt.tkn_pipe_(2), fxt.tkn_txt_(3, 5)); } - @Test public void Err_noName_nl() { + @Test public void Err_noName_nl() { fxt.Test_parse_page_tmpl("{{\n|}}", fxt.tkn_curly_bgn_(0), fxt.tkn_nl_char_len1_(2), fxt.tkn_pipe_(3), fxt.tkn_txt_(4, 6)); } - @Test public void Err_noName_tab() { + @Test public void Err_noName_tab() { fxt.Test_parse_page_tmpl("{{\t|}}", fxt.tkn_curly_bgn_(0), fxt.tkn_tab_(2), fxt.tkn_pipe_(3), fxt.tkn_txt_(4, 6)); } - @Test public void Err_empty() { // WP: [[Set theory]] + @Test public void Err_empty() { // WP: [[Set theory]] fxt.Test_parse_page_tmpl("{{}}", fxt.tkn_txt_(0, 4)); } - @Test public void DynamicName() { + @Test public void DynamicName() { fxt.Init_defn_clear(); fxt.Init_defn_add("proc_1", "proc_1 called"); fxt.Init_defn_add("proc_2", "proc_2 called"); @@ -103,76 +103,76 @@ public class Xot_invk_wkr__basic__tst { fxt.Test_parse_tmpl_str_test("{{proc_{{{1}}}}}" , "{{test|2}}" , "proc_2 called"); fxt.Test_parse_tmpl_str_test("{{proc_{{#expr:1}}}}" , "{{test}}" , "proc_1 called"); } - @Test public void Comment() { + @Test public void Comment() { fxt.Test_parse_tmpl_str_test("b" , "{{test}}" , "b"); } - @Test public void Err_equal() { // WP:[[E (mathematical constant)]] + @Test public void Err_equal() { // WP:[[E (mathematical constant)]] fxt.Test_parse_page_tmpl("{{=}}", fxt.tkn_tmpl_invk_(0, 5).Name_tkn_(fxt.tkn_arg_nde_(2, 3).Key_tkn_(fxt.tkn_arg_itm_(fxt.tkn_eq_(2))))); } - @Test public void Err_dangling() { // WP:[[Antoni Salieri]]; {{icon it}\n + @Test public void Err_dangling() { // WP:[[Antoni Salieri]]; {{icon it}\n fxt.Test_parse_page_tmpl("{{fail} {{pass}}", fxt.tkn_curly_bgn_(0), fxt.tkn_txt_(2, 7), fxt.tkn_space_(7, 8), fxt.tkn_tmpl_invk_w_name(8, 16, 10, 14)); } - @Test public void MultipleColon() { + @Test public void MultipleColon() { fxt.Init_defn_clear(); fxt.Init_defn_add("H:IPA", "{{{1}}}"); fxt.Test_parse_tmpl_str_test("{{H:IPA|{{{1}}}}}" , "{{test|a}}" , "a"); } - @Test public void RedundantTemplate() { // {{Template:a}} == {{a}} + @Test public void RedundantTemplate() { // {{Template:a}} == {{a}} fxt.Init_defn_clear(); fxt.Init_defn_add("a", "a"); fxt.Test_parse_tmpl_str_test("{{Template:a}}" , "{{test}}" , "a"); fxt.Init_defn_clear(); } - @Test public void Lnki() { // PURPOSE: pipe inside lnki should not be interpreted for tmpl: WP:[[Template:Quote]] + @Test public void Lnki() { // PURPOSE: pipe inside lnki should not be interpreted for tmpl: WP:[[Template:Quote]] fxt.Test_parse_tmpl_str_test("{{{1}}}{{{2}}}" , "{{test|[[a|b]]|c}}" , "[[a|b]]c"); } - @Test public void Lnki2() {// PURPOSE: pipe inside lnki inside tmpl should be interpreted WP:[[H:IPA]] + @Test public void Lnki2() {// PURPOSE: pipe inside lnki inside tmpl should be interpreted WP:[[H:IPA]] fxt.Test_parse_tmpl_str_test("[[a|{{#switch:{{{1}}}|b=c]]|d=e]]|f]]}}" , "{{test|b}}" , "[[a|c]]"); } - @Test public void Nowiki() { // PURPOSE: nowiki tag should be ignored: en.w:Template:Main + @Test public void Nowiki() { // PURPOSE: nowiki tag should be ignored: en.w:Template:Main fxt.Test_parse_tmpl_str_test("
    class='a' />" , "{{test}}" , "
    class='a' />"); } - @Test public void Nowiki_if() { // PURPOSE: templates and functions inside nowiki should not be evaluated + @Test public void Nowiki_if() { // PURPOSE: templates and functions inside nowiki should not be evaluated fxt.Test_parse_tmpl_str_test("a {{#if:|y|n}} b" , "{{test}}" , "a {{#if:|y|n}} b"); } - @Test public void Nowiki_endtag() { // PURPOSE: should not match + @Test public void Nowiki_endtag() { // PURPOSE: should not match fxt.Test_parse_page_all_str(" ''b'' c" , " b c"); } - @Test public void Nowiki_xnde_frag() { // PURPOSE: nowiki did not handle xnde frag and literalized; nowiki_xnde_frag; DATE:2013-01-27 + @Test public void Nowiki_xnde_frag() { // PURPOSE: nowiki did not handle xnde frag and literalized; nowiki_xnde_frag; DATE:2013-01-27 fxt.Test_parse_page_all_str("
    {{#expr:1}}
    b
    " , "<pre>1
    b
    "); } - @Test public void Nowiki_lnki() { // PURPOSE: nowiki should noop lnkis; DATE:2013-01-27 + @Test public void Nowiki_lnki() { // PURPOSE: nowiki should noop lnkis; DATE:2013-01-27 fxt.Test_parse_page_all_str("[[A]]" , "[[A]]"); } - @Test public void Nowiki_underscore() { // PURPOSE: nowiki did not handle __DISAMBIG__; DATE:2013-07-28 + @Test public void Nowiki_underscore() { // PURPOSE: nowiki did not handle __DISAMBIG__; DATE:2013-07-28 fxt.Test_parse_page_all_str("__DISAMBIG__" , "__DISAMBIG__"); } - @Test public void Nowiki_asterisk() { // PURPOSE: nowiki should noop lists; DATE:2013-08-26 + @Test public void Nowiki_asterisk() { // PURPOSE: nowiki should noop lists; DATE:2013-08-26 fxt.Test_parse_page_all_str("*a", "*a"); } - @Test public void Nowiki_space() { // PURPOSE: nowiki should noop space (else pre); DATE:2013-09-03 + @Test public void Nowiki_space() { // PURPOSE: nowiki should noop space (else pre); DATE:2013-09-03 fxt.Init_para_y_(); fxt.Test_parse_page_all_str("a\n b", "

    a\n b\n

    \n"); fxt.Init_para_n_(); } - @Test public void LnkiWithPipe_basic() { // PURPOSE: pipe in link should not count towards tmpl: WP:{{H:title|dotted=no|pronunciation:|[[File:Loudspeaker.svg|11px|link=|alt=play]]}} + @Test public void LnkiWithPipe_basic() { // PURPOSE: pipe in link should not count towards tmpl: WP:{{H:title|dotted=no|pronunciation:|[[File:Loudspeaker.svg|11px|link=|alt=play]]}} fxt.Test_parse_tmpl_str_test("{{{1}}}{{{2}}}" , "{{test|[[b=c|d]]}}" , "[[b=c|d]]{{{2}}}"); } - @Test public void LnkiWithPipe_nested() { + @Test public void LnkiWithPipe_nested() { fxt.Test_parse_tmpl_str_test("{{{1}}}{{{2}}}" , "{{test|[[b=c|d[[e|f]]g]]}}" , "[[b=c|d[[e|f]]g]]{{{2}}}"); } - @Test public void LnkiWithPipe_unclosed() { + @Test public void LnkiWithPipe_unclosed() { fxt.Test_parse_tmpl_str_test("{{{1}}}{{{2}}}" , "{{test|[[b=c|d}}" , "{{test|[[b=c|d}}"); } - @Test public void Err_tmp_empty() { // PURPOSE: {{{{R from misspelling}} }} + @Test public void Err_tmp_empty() { // PURPOSE: {{{{R from misspelling}} }} fxt.Test_parse_tmpl_str_test("{{{1}}}" , "{{ {{a}} }}" , "{{[[:Template:a]]}}"); } - @Test public void Mismatch_bgn() { // PURPOSE: handle {{{ }}; WP:Paris Commune; Infobox Former Country + @Test public void Mismatch_bgn() { // PURPOSE: handle {{{ }}; WP:Paris Commune; Infobox Former Country fxt.Init_defn_clear(); fxt.Init_defn_add("!", "|"); fxt.Test_parse_tmpl_str_test("{{#if:|{{{!}}{{!}}}|x}}" , "{{test}}" , "x"); } - @Test public void Mismatch_tblw() { // PURPOSE: handle {{{!}}; WP:Soviet Union + @Test public void Mismatch_tblw() { // PURPOSE: handle {{{!}}; WP:Soviet Union fxt.Init_defn_clear(); fxt.Init_defn_add("!", "|"); fxt.Test_parse_page_all_str("a\n{{{!}}\n|b\n|}", String_.Concat_lines_nl_skip_last @@ -188,61 +188,61 @@ public class Xot_invk_wkr__basic__tst { ); fxt.Init_defn_clear(); } - @Test public void Lnki_space() { + @Test public void Lnki_space() { fxt.Init_defn_clear(); fxt.Init_defn_add("c", "{{{1}}}"); fxt.Test_parse_tmpl_str("{{c|[[a|b ]]}}", "[[a|b ]]"); } - @Test public void Bug_innerTemplate() { // PURPOSE: issue with inner templates not using correct key + @Test public void Bug_innerTemplate() { // PURPOSE: issue with inner templates not using correct key fxt.Init_defn_clear(); fxt.Init_defn_add("temp_1", "{{temp_2|key1=val1}}"); fxt.Init_defn_add("temp_2", "{{{key1}}}"); fxt.Test_parse_tmpl_str("{{temp_1}}", "val1"); } - @Test public void Xnde_xtn_preserved() { // PURPOSE: tmpl was dropping .Xtn ndes; + @Test public void Xnde_xtn_preserved() { // PURPOSE: tmpl was dropping .Xtn ndes; fxt.Init_defn_clear(); fxt.Init_defn_add("test_template", "{{{1}}}"); fxt.Test_parse_page_all_str("{{test_template|a1b}}", "a
    1
    b"); // was just ab fxt.Init_defn_clear(); } - @Test public void Recurse() { + @Test public void Recurse() { fxt.Init_defn_clear(); fxt.Init_defn_add("test_recurse", "bgn:{{test_recurse}}:end"); fxt.Test_parse_page_all_str("{{test_recurse}}", "bgn::end"); fxt.Init_defn_clear(); } - @Test public void Ws_nl() { + @Test public void Ws_nl() { fxt.Test_parse_tmpl_str_test("{{{1}}}" , "{{test|\na}}" , "\na"); } - @Test public void Ws_trimmed_key_0() { // PURPOSE: control test for key_1, key_2 + @Test public void Ws_trimmed_key_0() { // PURPOSE: control test for key_1, key_2 fxt.Init_defn_clear(); fxt.Init_defn_add("test_1", "{{test_2|{{{1}}}}}"); fxt.Init_defn_add("test_2", "{{{1}}}"); fxt.Test_parse_tmpl_str("{{test_1| a }}", " a "); fxt.Init_defn_clear(); } - @Test public void Ws_trimmed_key_1() { // PURPOSE: trim prm when passed as key; + @Test public void Ws_trimmed_key_1() { // PURPOSE: trim prm when passed as key; fxt.Init_defn_clear(); fxt.Init_defn_add("test_1", "{{test_2|key={{{1}}}}}"); fxt.Init_defn_add("test_2", "{{{key}}}"); fxt.Test_parse_tmpl_str("{{test_1| a }}", "a"); fxt.Init_defn_clear(); } - @Test public void Ws_trimmed_key_2() { // PURPOSE: trim prm; note that 1 is key not idx; PAGE:en.w:Coord in Chernobyl disaster, Sahara + @Test public void Ws_trimmed_key_2() { // PURPOSE: trim prm; note that 1 is key not idx; PAGE:en.w:Coord in Chernobyl disaster, Sahara fxt.Init_defn_clear(); fxt.Init_defn_add("test_1", "{{test_2|1={{{1}}}}}"); fxt.Init_defn_add("test_2", "{{{1}}}"); fxt.Test_parse_tmpl_str("{{test_1| a }}", "a"); fxt.Init_defn_clear(); } - @Test public void Ws_trimmed_key_3() { // PURPOSE: trim entire arg only, not individual prm + @Test public void Ws_trimmed_key_3() { // PURPOSE: trim entire arg only, not individual prm fxt.Init_defn_clear(); fxt.Init_defn_add("test_1", "{{test_2|1={{{1}}}{{{2}}}}}"); fxt.Init_defn_add("test_2", "{{{1}}}"); fxt.Test_parse_tmpl_str("{{test_1| a | b }}", "a b"); fxt.Init_defn_clear(); } - @Test public void Ws_eval_prm() { // PURPOSE: skip ws in prm_idx; EX:it.w:Portale:Giochi_da_tavolo; it.w:Template:Alternate; DATE:2014-02-09 + @Test public void Ws_eval_prm() { // PURPOSE: skip ws in prm_idx; EX:it.w:Portale:Giochi_da_tavolo; it.w:Template:Alternate; DATE:2014-02-09 fxt.Init_defn_clear(); fxt.Init_defn_add("test_1", String_.Concat_lines_nl_skip_last ( "{{{ {{#expr: 1}} }}}" @@ -250,26 +250,26 @@ public class Xot_invk_wkr__basic__tst { fxt.Test_parse_tmpl_str("{{test_1|a}}", "a"); fxt.Init_defn_clear(); } - @Test public void Keyd_arg_is_trimmed() { // PURPOSE: trim entire arg only, not individual prm; PAGE:en.w:William Shakespeare; {{Relatebardtree}} + @Test public void Keyd_arg_is_trimmed() { // PURPOSE: trim entire arg only, not individual prm; PAGE:en.w:William Shakespeare; {{Relatebardtree}} fxt.Init_defn_clear(); fxt.Init_defn_add("test_1", "{{test_2|1={{{{{{1}}}}}}}}"); fxt.Init_defn_add("test_2", "{{{1}}}"); fxt.Test_parse_tmpl_str("{{test_1| b | b = x }}", "x"); fxt.Init_defn_clear(); } - @Test public void Ws_arg() { // PURPOSE: whitespace arg should not throw array index out of bounds; EX.WIKT: wear one's heart on one's sleeve + @Test public void Ws_arg() { // PURPOSE: whitespace arg should not throw array index out of bounds; EX.WIKT: wear one's heart on one's sleeve fxt.Init_defn_clear(); fxt.Init_defn_add("test_1", "{{{{{1}}}}}"); fxt.Test_parse_tmpl_str("{{test_1| }}", ""); fxt.Init_defn_clear(); } - @Test public void Xnde_xtn_ref_not_arg() { // PURPOSE: }}; arg1 is a not "b"; PAGE:en.w:WWI + @Test public void Xnde_xtn_ref_not_arg() { // PURPOSE: }}; arg1 is a not "b"; PAGE:en.w:WWI fxt.Init_defn_clear(); fxt.Init_defn_add("test_1", "{{{1}}}"); fxt.Test_parse_page_tmpl_str("{{test_1|a}}", "a"); fxt.Init_defn_clear(); } - @Test public void Multi_bgn_5_end_3_2() { + @Test public void Multi_bgn_5_end_3_2() { fxt.Test_parse_tmpl("{{{{{1}}}|a}}", fxt.tkn_tmpl_invk_(0, 13) .Name_tkn_(fxt.tkn_arg_nde_(2, 9).Key_tkn_(fxt.tkn_arg_itm_(fxt.tkn_tmpl_prm_find_(fxt.tkn_txt_(5, 6))))) .Args_ @@ -277,7 +277,7 @@ public class Xot_invk_wkr__basic__tst { ) ); } - @Test public void Lnki_has_invk_end() {// PURPOSE: [[A|bcd}}]] should not break enclosing templates; EX.CM:Template:Protect + @Test public void Lnki_has_invk_end() {// PURPOSE: [[A|bcd}}]] should not break enclosing templates; EX.CM:Template:Protect fxt.Test_parse_page_tmpl_str(String_.Concat_lines_nl_skip_last ( "{{#switch:y" , " |y=[[A|b}}]]" @@ -285,7 +285,7 @@ public class Xot_invk_wkr__basic__tst { , "}}" ), "[[A|b}}]]"); } - @Test public void Lnki_has_prm_end() {// PURPOSE: [[A|bcd}}}]] should not break enclosing templates; EX.CM:Template:Protect + @Test public void Lnki_has_prm_end() {// PURPOSE: [[A|bcd}}}]] should not break enclosing templates; EX.CM:Template:Protect fxt.Test_parse_page_tmpl_str(String_.Concat_lines_nl_skip_last ( "{{#switch:y" , " |y=[[A|b}}}]]" @@ -293,14 +293,14 @@ public class Xot_invk_wkr__basic__tst { , "}}" ), "[[A|b}}}]]"); } - @Test public void Tmpl_overrides_pfunc() { // PURPOSE: {{plural|}} overrides {{plural:}} + @Test public void Tmpl_overrides_pfunc() { // PURPOSE: {{plural|}} overrides {{plural:}} fxt.Init_defn_clear(); fxt.Init_defn_add("plural", "{{{1}}}"); fxt.Test_parse_tmpl_str("{{plural|a}}" , "a"); fxt.Test_parse_tmpl_str("{{plural:2|a|b}}" , "b"); // make sure pfunc still works fxt.Init_defn_clear(); } - @Test public void Tmpl_aliases() { // PURPOSE: handled aliases for Template ns + @Test public void Tmpl_aliases() { // PURPOSE: handled aliases for Template ns fxt.Wiki().Ns_mgr().Aliases_add(Xow_ns_.Tid__template, "TemplateAlias"); fxt.Wiki().Ns_mgr().Init(); fxt.Init_defn_clear(); @@ -308,7 +308,7 @@ public class Xot_invk_wkr__basic__tst { fxt.Test_parse_tmpl_str("{{TemplateAlias:tmpl_key}}" , "tmpl_val"); fxt.Init_defn_clear(); } - @Test public void Tmpl_aliases_2() { // PURPOSE: handled aliases for other ns; DATE:2013-02-08 + @Test public void Tmpl_aliases_2() { // PURPOSE: handled aliases for other ns; DATE:2013-02-08 fxt.Wiki().Ns_mgr().Aliases_add(Xow_ns_.Tid__project, "WP"); fxt.Wiki().Ns_mgr().Init(); fxt.Init_defn_clear(); @@ -316,26 +316,26 @@ public class Xot_invk_wkr__basic__tst { fxt.Test_parse_tmpl_str("{{WP:tmpl_key}}" , "tmpl_val"); fxt.Init_defn_clear(); } - @Test public void Template_loop_across_namespaces() {// PURPOSE: {{Institution:Louvre}} results in template loop b/c it calls {{Louvre}}; EX: c:Mona Lisa + @Test public void Template_loop_across_namespaces() {// PURPOSE: {{Institution:Louvre}} results in template loop b/c it calls {{Louvre}}; EX: c:Mona Lisa fxt.Init_page_create("Template:Test", "test"); fxt.Init_page_create("Category:Test", "{{Test}}"); fxt.Test_parse_page_all_str("{{Category:Test}}", "test"); } - @Test public void Closing_braces_should_not_extend_beyond_lnki() { // PURPOSE: extra }} should not close any frames beyond lnki; EX:w:Template:Cite wikisource; w:John Fletcher (playwright) + @Test public void Closing_braces_should_not_extend_beyond_lnki() { // PURPOSE: extra }} should not close any frames beyond lnki; EX:w:Template:Cite wikisource; w:John Fletcher (playwright) fxt.Init_defn_clear(); fxt.Init_defn_add("test_b", "{{{test_b_0|}}}"); fxt.Init_defn_add("test_a", "{{test_b|test_b_0=[[{{{test_a_0}}}}}]]}}"); // NOTE: extra 2 }}; should render literally and not close "{{test_b" fxt.Test_parse_tmpl_str("{{test_a|test_a_0=1}}" , "[[1}}]]"); fxt.Init_defn_clear(); } -// @Test public void Trim_ws_on_sub_tmpls() { // PURPOSE: ws should be trimmed on eval tkns; EX:w:Lackawanna Cut-Off; {{Lackawanna Cut-Off}}; DELETE: no longer needed; DATE:2014-02-04 +// @Test public void Trim_ws_on_sub_tmpls() { // PURPOSE: ws should be trimmed on eval tkns; EX:w:Lackawanna Cut-Off; {{Lackawanna Cut-Off}}; DELETE: no longer needed; DATE:2014-02-04 // fxt.Init_defn_clear(); // fxt.Init_defn_add("test_b", "\n\nb\n\n"); // fxt.Init_defn_add("test_a", "a{{test_b}}c"); // fxt.Test_parse_tmpl_str("{{test_a}}" , "a\n\nbc"); // fxt.Init_defn_clear(); // } - @Test public void Nowiki_tblw() { // PURPOSE: nowiki does not exclude sections with pipe; will cause tables to fail; EX: de.wikipedia.org/wiki/Hilfe:Vorlagenprogrammierung + @Test public void Nowiki_tblw() { // PURPOSE: nowiki does not exclude sections with pipe; will cause tables to fail; EX: de.wikipedia.org/wiki/Hilfe:Vorlagenprogrammierung fxt.Test_parse_page_all_str(String_.Concat_lines_nl_skip_last ( "{|" , "|-" @@ -351,18 +351,18 @@ public class Xot_invk_wkr__basic__tst { , "" )); } - @Test public void Template_plus_other_ns() { // PURPOSE.fix: Template:Wikipedia:A was transcluding "Wikipedia:A" instead of "Template:Wikipedia:A"; DATE:2013-04-03 + @Test public void Template_plus_other_ns() { // PURPOSE.fix: Template:Wikipedia:A was transcluding "Wikipedia:A" instead of "Template:Wikipedia:A"; DATE:2013-04-03 fxt.Init_defn_clear(); fxt.Init_page_create("Template:Wikipedia:A" , "B"); fxt.Test_parse_tmpl_str("{{Template:Wikipedia:A}}" , "B"); fxt.Init_defn_clear(); } - @Test public void Return_nl() { // PURPOSE: allow \n to be returned by tmpl; do not trim; EX: zh.wikipedia.org/wiki/北區_(香港); DATE:2014-02-04 + @Test public void Return_nl() { // PURPOSE: allow \n to be returned by tmpl; do not trim; EX: zh.wikipedia.org/wiki/北區_(香港); DATE:2014-02-04 fxt.Init_defn_add("1x", "{{{1}}}"); fxt.Test_parse_tmpl_str("a{{1x|\n}}b", "a\nb"); fxt.Init_defn_clear(); } - @Test public void Ignore_hdr() { // PURPOSE: hdr-like tkns inside tmpl should not be treated as "=" in tmpl_prm; EX: key_1\n==a==; EX:it.b:Wikibooks:Vetrina; DATE:2014-02-09 + @Test public void Ignore_hdr() { // PURPOSE: hdr-like tkns inside tmpl should not be treated as "=" in tmpl_prm; EX: key_1\n==a==; EX:it.b:Wikibooks:Vetrina; DATE:2014-02-09 fxt.Init_defn_clear(); fxt.Init_defn_add("test_1", "{{{key_1|null_key_1}}}"); fxt.Test_parse_tmpl_str(String_.Concat_lines_nl_skip_last // == a === should be treated as hdr; @@ -381,7 +381,7 @@ public class Xot_invk_wkr__basic__tst { ); fxt.Init_defn_clear(); } - @Test public void Ignore_hdr_2() { // PURPOSE: hdr-like logic did not work for "== \n"; PAGE:nl.q:Geert_Wilders; DATE:2014-06-05 + @Test public void Ignore_hdr_2() { // PURPOSE: hdr-like logic did not work for "== \n"; PAGE:nl.q:Geert_Wilders; DATE:2014-06-05 fxt.Init_defn_clear(); fxt.Init_defn_add("Hdr_w_space", String_.Concat_lines_nl_skip_last ( "{{#if:{{{key|}}} | " @@ -396,7 +396,7 @@ public class Xot_invk_wkr__basic__tst { ); fxt.Init_defn_clear(); } - @Test public void Ignore_hdr_3() { // PURPOSE: tkn with multiple eq should have be treated as value, not header; PAGE:zh.w:Wikipedia:条目评选; DATE:2014-08-27 + @Test public void Ignore_hdr_3() { // PURPOSE: tkn with multiple eq should have be treated as value, not header; PAGE:zh.w:Wikipedia:条目评选; DATE:2014-08-27 fxt.Init_defn_clear(); fxt.Init_defn_add("test_1", "{{{key_1|null_key_1}}}"); fxt.Test_parse_page_tmpl_str(String_.Concat_lines_nl_skip_last @@ -407,7 +407,7 @@ public class Xot_invk_wkr__basic__tst { ); fxt.Init_defn_clear(); } - @Test public void Ignore_hdr_4() { // PURPOSE: variation of above; make sure 2nd "==" doesn't trigger another key; DATE:2014-08-27 + @Test public void Ignore_hdr_4() { // PURPOSE: variation of above; make sure 2nd "==" doesn't trigger another key; DATE:2014-08-27 fxt.Init_defn_clear(); fxt.Init_defn_add("test_1", "{{{key_1|null_key_1}}}"); fxt.Test_parse_page_tmpl_str(String_.Concat_lines_nl_skip_last @@ -418,21 +418,21 @@ public class Xot_invk_wkr__basic__tst { ); fxt.Init_defn_clear(); } - @Test public void Tmpl_case_match() { // PURPOSE: template name should match by case; EX:es.d:eclipse; DATE:2014-02-12 + @Test public void Tmpl_case_match() { // PURPOSE: template name should match by case; EX:es.d:eclipse; DATE:2014-02-12 fxt.Init_defn_clear(); fxt.Init_defn_add("CASE_MATCH", "found", Xow_ns_case_.Tid__all); fxt.Test_parse_tmpl_str("{{case_match}}", "[[:Template:case_match]]"); // Xot_invk_tkn will do 2 searches: "test" and "Test" fxt.Test_parse_tmpl_str("{{cASE_MATCH}}", "found"); // Xot_invk_tkn will do 2 searches: "tEST" and "TEST" fxt.Init_defn_clear(); } - @Test public void Kv_same() { // PURPOSE: multiple identical keys should retrieve last, not first; EX: {{A|1=a|1=b}}; PAGE:el.d:ἔχω DATE:2014-07-23 + @Test public void Kv_same() { // PURPOSE: multiple identical keys should retrieve last, not first; EX: {{A|1=a|1=b}}; PAGE:el.d:ἔχω DATE:2014-07-23 fxt.Init_defn_clear(); fxt.Init_defn_add("tmpl_1", "{{{1}}}"); fxt.Test_parse_tmpl_str_test("{{tmpl_1|1=a|1=b}}" , "{{test}}" , "b"); // duplicate "1"; use last fxt.Test_parse_tmpl_str_test("{{tmpl_1|a|1=b}}" , "{{test}}" , "b"); // "a" has implicit key of "1"; overwritten by "1=b"; verified against MW fxt.Test_parse_tmpl_str_test("{{tmpl_1|1=a|b}}" , "{{test}}" , "b"); // "b" has implicit key of "1"; overwritten by "1=b"; verified against MW } - @Test public void Bang() { // PURPOSE: support new bang keyword; DATE:2014-08-05 + @Test public void Bang() { // PURPOSE: support new bang keyword; DATE:2014-08-05 fxt.Test_parse_tmpl_str("{{!}}", "|"); } } diff --git a/400_xowa/src/gplx/xowa/parsers/tmpls/Xot_invk_wkr__missing__tst.java b/400_xowa/src/gplx/xowa/parsers/tmpls/Xot_invk_wkr__missing__tst.java index 33c650e5b..fe6594472 100644 --- a/400_xowa/src/gplx/xowa/parsers/tmpls/Xot_invk_wkr__missing__tst.java +++ b/400_xowa/src/gplx/xowa/parsers/tmpls/Xot_invk_wkr__missing__tst.java @@ -1,41 +1,41 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.parsers.tmpls; import gplx.*; import gplx.xowa.*; import gplx.xowa.parsers.*; import org.junit.*; import gplx.xowa.wikis.ttls.*; import gplx.xowa.wikis.nss.*; public class Xot_invk_wkr__missing__tst { @Before public void init() {fxt.Reset();} private final Xop_fxt fxt = new Xop_fxt(); - @Test public void Missing() { + @Test public void Missing() { fxt.Init_defn_clear(); fxt.Init_defn_add("test_template", "{{[[Template:{{{1}}}|{{{1}}}]]}}"); fxt.Test_parse_tmpl_str("{{test_template|a}}", "{{[[Template:a|a]]}}"); fxt.Init_defn_clear(); } - @Test public void Missing__name_and_args() { // PURPOSE: missing title should return name + args; used to only return name; PAGE:en.w:Flag_of_Greenland; DATE:2016-06-21 + @Test public void Missing__name_and_args() { // PURPOSE: missing title should return name + args; used to only return name; PAGE:en.w:Flag_of_Greenland; DATE:2016-06-21 fxt.Init_defn_clear(); fxt.Init_defn_add("test_template", "{{ {{{1}}} | a | b }}"); fxt.Test_parse_tmpl_str("{{test_template}}", "{{{{{1}}}| a | b }}"); // NOTE: this should include spaces (" {{{1}}} "), but for now, ignore fxt.Init_defn_clear(); } - @Test public void Missing__evaluate_optional() { // PURPOSE: missing title should still evaulate optional args; "{{{a|}}}" -> ""; PAGE:en.w:Europe; en.w:Template:Country_data_Guernsey DATE:2016-10-13 + @Test public void Missing__evaluate_optional() { // PURPOSE: missing title should still evaulate optional args; "{{{a|}}}" -> ""; PAGE:en.w:Europe; en.w:Template:Country_data_Guernsey DATE:2016-10-13 fxt.Init_defn_clear(); fxt.Init_defn_add("test_template", "{{ {{{1}}} | {{{a|}}} | b }}"); fxt.Test_parse_tmpl_str("{{test_template}}", "{{{{{1}}}| | b }}"); // NOTE: "| |" not "| {{{a|}}} |" fxt.Init_defn_clear(); } - @Test public void Missing_foreign() { + @Test public void Missing_foreign() { Xow_ns ns = fxt.Wiki().Ns_mgr().Ns_template(); byte[] old_ns = ns.Name_db(); ns.Name_bry_(Bry_.new_a7("Template_foreign")); diff --git a/400_xowa/src/gplx/xowa/parsers/tmpls/Xot_invk_wkr__prepend_nl__tst.java b/400_xowa/src/gplx/xowa/parsers/tmpls/Xot_invk_wkr__prepend_nl__tst.java index 33632fb9a..b40cb0062 100644 --- a/400_xowa/src/gplx/xowa/parsers/tmpls/Xot_invk_wkr__prepend_nl__tst.java +++ b/400_xowa/src/gplx/xowa/parsers/tmpls/Xot_invk_wkr__prepend_nl__tst.java @@ -1,35 +1,35 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.parsers.tmpls; import gplx.*; import gplx.xowa.*; import gplx.xowa.parsers.*; import org.junit.*; public class Xot_invk_wkr__prepend_nl__tst { @Before public void init() {fxt.Reset();} private final Xop_fxt fxt = new Xop_fxt(); - @Test public void Basic() { // PURPOSE: if {| : ; # *, auto add new_line REF.MW:Parser.php|braceSubstitution + @Test public void Basic() { // PURPOSE: if {| : ; # *, auto add new_line REF.MW:Parser.php|braceSubstitution fxt.Init_defn_clear(); fxt.Init_defn_add("test_inner", "# a"); fxt.Test_parse_tmpl_str_test("{{test_inner}}" , "z {{test}}" , "z \n# a"); fxt.Init_defn_clear(); } - @Test public void Skip_if_nl_exists() { + @Test public void Skip_if_nl_exists() { fxt.Init_defn_clear(); fxt.Init_defn_add("test_inner", "# a"); fxt.Test_parse_tmpl_str_test("{{test_inner}}" , "z \n{{test}}" , "z \n# a"); // NOTE: no \n fxt.Init_defn_clear(); } - @Test public void Skip_if_nl_exists_2() { // PURPOSE: \n inside template args should not print \n\n; PAGE:bn.w:লিওনেল_মেসি |ko.w:도쿄_지하철_히비야_선|DATE:2014-05-27 + @Test public void Skip_if_nl_exists_2() { // PURPOSE: \n inside template args should not print \n\n; PAGE:bn.w:লিওনেল_মেসি |ko.w:도쿄_지하철_히비야_선|DATE:2014-05-27 fxt.Init_defn_clear(); fxt.Init_defn_add("test_list", "# a"); fxt.Init_defn_add("test_print", "{{{1}}}"); @@ -46,13 +46,13 @@ public class Xot_invk_wkr__prepend_nl__tst { )); fxt.Init_defn_clear(); } - @Test public void Pfunc() {// PURPOSE: if {| : ; # *, auto add new_line; parser_function variant; PAGE:en.w:Soviet Union; Infobox former country + @Test public void Pfunc() {// PURPOSE: if {| : ; # *, auto add new_line; parser_function variant; PAGE:en.w:Soviet Union; Infobox former country fxt.Test_parse_tmpl_str_test("" , "z {{#if:true|#a|n}}" , "z \n#a"); } - @Test public void Bos() { // PURPOSE: function should expand "*a" to "\n*a" even if "*a" is bos; SEE:NOTE_1 PAGE:en.w:Rome and Panoramas; DATE:2014-02-05 + @Test public void Bos() { // PURPOSE: function should expand "*a" to "\n*a" even if "*a" is bos; SEE:NOTE_1 PAGE:en.w:Rome and Panoramas; DATE:2014-02-05 fxt.Test_parse_page_tmpl_str("{{#if:x|*a}}", "\n*a"); } - @Test public void Tmpl_arg() { // PURPOSE: tmpl arg should auto-create; PAGE:vi.w:Friedrich_II_của_Phổ; DATE:2014-04-26 + @Test public void Tmpl_arg() { // PURPOSE: tmpl arg should auto-create; PAGE:vi.w:Friedrich_II_của_Phổ; DATE:2014-04-26 fxt.Init_defn_add("cquote" , "*b"); fxt.Init_defn_add("blockquote" , "
    {{{1}}}
    "); fxt.Test_html_full_str("a\n{{blockquote|{{cquote}}}}" @@ -66,7 +66,7 @@ public class Xot_invk_wkr__prepend_nl__tst { ) ); } - @Test public void Nested_1_n() { // PURPOSE: handled nested templates; PAGE:en.w:Central_Line en.w:Panama_Canal; DATE:2014-08-21 + @Test public void Nested_1_n() { // PURPOSE: handled nested templates; PAGE:en.w:Central_Line en.w:Panama_Canal; DATE:2014-08-21 fxt.Init_defn_clear(); fxt.Init_defn_add("Nest_1" , "a{{Nest_1_1}}"); // 0: no \n fxt.Init_defn_add("Nest_1_1" , "b\n{{Nest_1_1_1}}"); // 1: \n @@ -76,7 +76,7 @@ public class Xot_invk_wkr__prepend_nl__tst { , "*c" )); } - @Test public void Nested_1_y() { // PURPOSE: handled nested templates; PAGE:en.w:Lackawanna_Cut-Off; DATE:2014-08-21 + @Test public void Nested_1_y() { // PURPOSE: handled nested templates; PAGE:en.w:Lackawanna_Cut-Off; DATE:2014-08-21 fxt.Init_defn_clear(); fxt.Init_defn_add("Nest_1" , "a\n{{Nest_1_1}}"); // 0: no \n fxt.Init_defn_add("Nest_1_1" , "b{{Nest_1_1_1}}"); // 1: char @@ -87,7 +87,7 @@ public class Xot_invk_wkr__prepend_nl__tst { , "*c" )); } - @Test public void Nested_0_n() { // PURPOSE: handled nested templates variation of above; DATE:2014-08-21 + @Test public void Nested_0_n() { // PURPOSE: handled nested templates variation of above; DATE:2014-08-21 fxt.Init_defn_clear(); fxt.Init_defn_add("Nest_1" , "a\n{{Nest_1_1}}"); // 0: \n fxt.Init_defn_add("Nest_1_1" , "{{Nest_1_1_1}}"); // 1: "" @@ -97,7 +97,7 @@ public class Xot_invk_wkr__prepend_nl__tst { , "*b" )); } - @Test public void Nested_0_y() { // PURPOSE: handled nested templates variation of above; DATE:2014-08-21 + @Test public void Nested_0_y() { // PURPOSE: handled nested templates variation of above; DATE:2014-08-21 fxt.Init_defn_clear(); fxt.Init_defn_add("Nest_1" , "a{{Nest_1_1}}"); // 0: no \n fxt.Init_defn_add("Nest_1_1" , "{{Nest_1_1_1}}"); // 1: "" diff --git a/400_xowa/src/gplx/xowa/parsers/tmpls/Xot_invk_wkr__raw_msg__tst.java b/400_xowa/src/gplx/xowa/parsers/tmpls/Xot_invk_wkr__raw_msg__tst.java index d0326ad68..bbf468dbe 100644 --- a/400_xowa/src/gplx/xowa/parsers/tmpls/Xot_invk_wkr__raw_msg__tst.java +++ b/400_xowa/src/gplx/xowa/parsers/tmpls/Xot_invk_wkr__raw_msg__tst.java @@ -1,46 +1,46 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.parsers.tmpls; import gplx.*; import gplx.xowa.*; import gplx.xowa.parsers.*; import org.junit.*; public class Xot_invk_wkr__raw_msg__tst { @Before public void init() {fxt.Reset();} private final Xop_fxt fxt = new Xop_fxt(); @After public void term() {fxt.Init_defn_clear();} - @Test public void Raw() { // PURPOSE: {{raw:A}} is same as {{A}}; EX.WIKT:android; {{raw:ja/script}} + @Test public void Raw() { // PURPOSE: {{raw:A}} is same as {{A}}; EX.WIKT:android; {{raw:ja/script}} fxt.Init_defn_clear(); fxt.Init_defn_add("Test 1", "{{#if:|y|{{{1}}}}}"); fxt.Test_parse_tmpl_str("{{raw:Test 1|a}}", "a"); fxt.Init_defn_clear(); } - @Test public void Raw_spanish() { // PURPOSE.fix: {{raw}} should not fail; EX:es.s:Carta_a_Silvia; DATE:2014-02-11 + @Test public void Raw_spanish() { // PURPOSE.fix: {{raw}} should not fail; EX:es.s:Carta_a_Silvia; DATE:2014-02-11 fxt.Test_parse_tmpl_str("{{raw}}", "[[:Template:raw]]"); // used to fail; now tries to get Template:Raw which doesn't exist } - @Test public void Special() { // PURPOSE: {{Special:Whatlinkshere}} is same as [[:Special:Whatlinkshere]]; EX.WIKT:android; isValidPageName + @Test public void Special() { // PURPOSE: {{Special:Whatlinkshere}} is same as [[:Special:Whatlinkshere]]; EX.WIKT:android; isValidPageName fxt.Test_parse_page_tmpl_str("{{Special:Whatlinkshere}}", "[[:Special:Whatlinkshere]]"); } - @Test public void Special_arg() { // PURPOSE: make sure Special still works with {{{1}}} + @Test public void Special_arg() { // PURPOSE: make sure Special still works with {{{1}}} fxt.Init_defn_clear(); fxt.Init_defn_add("Test1", "{{Special:Whatlinkshere/{{{1}}}}}"); fxt.Test_parse_tmpl_str("{{Test1|-1}}", "[[:Special:Whatlinkshere/-1]]"); fxt.Init_defn_clear(); } - @Test public void Raw_special() { // PURPOSE: {{raw:A}} is same as {{A}}; EX.WIKT:android; {{raw:ja/script}} + @Test public void Raw_special() { // PURPOSE: {{raw:A}} is same as {{A}}; EX.WIKT:android; {{raw:ja/script}} fxt.Test_parse_tmpl_str("{{raw:Special:Whatlinkshere}}", "[[:Special:Whatlinkshere]]"); fxt.Init_defn_clear(); } - @Test public void Msg() { + @Test public void Msg() { fxt.Init_defn_add("CURRENTMONTH", "a"); fxt.Test_parse_tmpl_str("{{msg:CURRENTMONTH}}", "a"); } diff --git a/400_xowa/src/gplx/xowa/parsers/tmpls/Xot_invk_wkr__transclude__tst.java b/400_xowa/src/gplx/xowa/parsers/tmpls/Xot_invk_wkr__transclude__tst.java index df1073f1f..0d22f80eb 100644 --- a/400_xowa/src/gplx/xowa/parsers/tmpls/Xot_invk_wkr__transclude__tst.java +++ b/400_xowa/src/gplx/xowa/parsers/tmpls/Xot_invk_wkr__transclude__tst.java @@ -1,52 +1,52 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.parsers.tmpls; import gplx.*; import gplx.xowa.*; import gplx.xowa.parsers.*; import org.junit.*; public class Xot_invk_wkr__transclude__tst { @Before public void init() {fxt.Reset();} private final Xop_fxt fxt = new Xop_fxt(); @After public void term() {fxt.Init_defn_clear();} - @Test public void Basic() { // PURPOSE: {{:Template:Test}} is same as {{Template:Test}}; EX.WIKT:android; japanese and {{:Template:ja/script}} + @Test public void Basic() { // PURPOSE: {{:Template:Test}} is same as {{Template:Test}}; EX.WIKT:android; japanese and {{:Template:ja/script}} fxt.Init_defn_add("Test_1", "{{#if:|y|n}}"); // NOTE: must be of form "Test 1"; test_1 will fail fxt.Test_parse_tmpl_str("{{:Template:Test 1}}", "n"); } - @Test public void Arguments() { // PURPOSE: transclusion test with arguments + @Test public void Arguments() { // PURPOSE: transclusion test with arguments fxt.Init_page_create("PageToTransclude", "a{{{key}}}c"); fxt.Test_parse_tmpl_str("some text to make this page longer than transclusion {{:PageToTransclude|key=b}}" , "some text to make this page longer than transclusion abc"); } - @Test public void Redirect() { // PURPOSE: StackOverflowError when transcluded sub-page redirects back to root_page; DATE:2014-01-07 + @Test public void Redirect() { // PURPOSE: StackOverflowError when transcluded sub-page redirects back to root_page; DATE:2014-01-07 fxt.Init_page_create("Root/Leaf", "#REDIRECT [[Root]]"); fxt.Init_page_create("Root", "A.png|a{{/Leaf}}b"); // NOTE: gallery neeeded for XOWA to fail; MW fails if just {{/Leaf}} fxt.Test_parse_page("Root", "A.png|a{{/Leaf}}b"); } - @Test public void Missing__sub_page() { // PURPOSE: transclusion of a missing page should create a link, not print an empty String; EX: it.u:Dipartimento:Design; DATE:2014-02-12 + @Test public void Missing__sub_page() { // PURPOSE: transclusion of a missing page should create a link, not print an empty String; EX: it.u:Dipartimento:Design; DATE:2014-02-12 fxt.Page_ttl_("Test_Page"); fxt.Test_parse_tmpl_str("{{/Sub}}", "[[Test_Page/Sub]]"); } - @Test public void Missing__colon_prefix() {// PURPOSE: page with colon_prefix should not add Template: PAGE:en.d:a; DATE:2016-06-24 + @Test public void Missing__colon_prefix() {// PURPOSE: page with colon_prefix should not add Template: PAGE:en.d:a; DATE:2016-06-24 fxt.Test_parse_tmpl_str("{{:a}}", "[[:a]]"); // ":a", not "Template:A" or "A" } - @Test public void Colon_by_safesubst() { // SUPPORT: page with colon_prefix should not add Template: PAGE:en.d:a; DATE:2016-06-24 + @Test public void Colon_by_safesubst() { // SUPPORT: page with colon_prefix should not add Template: PAGE:en.d:a; DATE:2016-06-24 fxt.Init_defn_add("Test_2", "{{safesubst:Template:{{{1}}}}}"); fxt.Test_parse_tmpl_str("{{Test 2|b}}", "[[Template:b]]"); } - @Test public void Colon_w_template() { // SUPPORT: page with colon_prefix should not add Template: PAGE:en.d:a; DATE:2016-06-24 + @Test public void Colon_w_template() { // SUPPORT: page with colon_prefix should not add Template: PAGE:en.d:a; DATE:2016-06-24 fxt.Init_defn_add("Test_3", "{{:Template:{{{1}}}}}"); fxt.Test_parse_tmpl_str("{{Test 3|b}}", "[[:Template:b]]"); } - @Test public void Toc() { // PURPOSE: __TOC__ in transcluded page should be ignored; PAGE:de.w:Game_of_Thrones DATE:2016-11-21 + @Test public void Toc() { // PURPOSE: __TOC__ in transcluded page should be ignored; PAGE:de.w:Game_of_Thrones DATE:2016-11-21 fxt.Init_page_create("TranscludedToc", "__TOC__\na"); fxt.Parser().Expand_tmpl(Bry_.new_u8("{{:TranscludedToc}}")); Tfds.Eq(false, fxt.Page().Wtxt().Toc().Flag__toc()); // transcluded page is true, but current page should still be false diff --git a/400_xowa/src/gplx/xowa/parsers/tmpls/Xot_prm_tkn_tst.java b/400_xowa/src/gplx/xowa/parsers/tmpls/Xot_prm_tkn_tst.java index 424375851..f15d418c8 100644 --- a/400_xowa/src/gplx/xowa/parsers/tmpls/Xot_prm_tkn_tst.java +++ b/400_xowa/src/gplx/xowa/parsers/tmpls/Xot_prm_tkn_tst.java @@ -1,55 +1,55 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.parsers.tmpls; import gplx.*; import gplx.xowa.*; import gplx.xowa.parsers.*; import org.junit.*; public class Xot_prm_tkn_tst { private final Xop_fxt fxt = new Xop_fxt(); @Before public void init() {fxt.Reset();} - @Test public void Idx_1() {fxt.Test_parse_tmpl_str_test("{{{1}}}" , "{{test|a|b}}" , "a");} - @Test public void Idx_2() {fxt.Test_parse_tmpl_str_test("{{{2}}}" , "{{test|a|b}}" , "b");} - @Test public void Idx_3_nil() {fxt.Test_parse_tmpl_str_test("{{{3}}}" , "{{test|a|b}}" , "{{{3}}}");} - @Test public void Idx_3_dflt() {fxt.Test_parse_tmpl_str_test("{{{3|c}}}" , "{{test|a|b}}" , "c");} - @Test public void Idx_3_dflt_len0() {fxt.Test_parse_tmpl_str_test("{{{1|}}}" , "{{test}}" , "");} - @Test public void Idx_1_and_2() {fxt.Test_parse_tmpl_str_test("({{{1}}} {{{2}}})" , "{{test|a|b}}" , "(a b)");} - @Test public void Idx_2_len0() {fxt.Test_parse_tmpl_str_test("{{{1}}}" , "{{test||b}}" , "");}// should not fail - @Test public void Key() {fxt.Test_parse_tmpl_str_test("{{{k1}}}" , "{{test|k1=a|k2=b}}" , "a");} - @Test public void Key_nil() {fxt.Test_parse_tmpl_str_test("{{{k3|c}}}" , "{{test|k1=a|k2=b}}" , "c");} - @Test public void Key_exact() {fxt.Test_parse_tmpl_str_test("{{{k|}}}{{{k2|}}}" , "{{test|k=a}}" , "a");} // only {{{k}}} matched - @Test public void Var() {fxt.Test_parse_tmpl_str_test("{{{1|-{{PAGENAME}}-}}}" , "{{test}}" , "-Test page-");} - @Test public void Newline_bgn() {fxt.Test_parse_tmpl_str_test("{{{1}}} {{{2}}}" , "{{test|a|\nb}}" , "a \nb");} - @Test public void Newline_end() {fxt.Test_parse_tmpl_str_test("{{{1}}} {{{2}}}" , "{{test|a|b\n}}" , "a b\n");} - @Test public void Exc_lkp_nil() {fxt.Test_parse_tmpl_str_test("{{{}}}" , "{{test|a|b}}" , "{{{}}}");} - @Test public void Exc_lkp_and_args1() {fxt.Test_parse_tmpl_str_test("{{{|}}}" , "{{test|a|b}}" , "");} - @Test public void Exc_lkp_nil_args1_txt() {fxt.Test_parse_tmpl_str_test("{{{|a}}}" , "{{test|a|b}}" , "a");} - @Test public void Ws_idx() {fxt.Test_parse_tmpl_str_test("{{{ 1 }}}" , "{{test|a|b}}" , "a");} - @Test public void Ws_idx_nil() {fxt.Test_parse_tmpl_str_test("{{{ 1 }}}" , "{{test}}" , "{{{ 1 }}}");} - @Test public void Ws_key() {fxt.Test_parse_tmpl_str_test("{{{ k1 }}}" , "{{test|k1=a|k2=b}}" , "a");} - @Test public void Ws_dflt() {fxt.Test_parse_tmpl_str_test("{{{1| a }}}" , "{{test}}" , " a ");} - @Test public void Dflt_multiple() {fxt.Test_parse_tmpl_str_test("{{{1|a|b}}}" , "{{test}}" , "a");} - @Test public void Keyd_not_idxd() {fxt.Test_parse_tmpl_str_test("{{{1}}}{{{2}}}" , "{{test|a|key=b}}" , "a{{{2}}}");} - @Test public void Keyd_not_idxd_ints() {fxt.Test_parse_tmpl_str_test("{{{1}}}{{{2}}}" , "{{test|1=a|2=b}}" , "ab");} - @Test public void Recurse_1() {fxt.Test_parse_tmpl_str_test("{{{1{{{2|}}}|}}}" , "{{test|a}}" , "a");} // used in {{See}} to test if argument 2 is last - @Test public void Recurse_2() {fxt.Test_parse_tmpl_str_test("{{{1{{{2|}}}|}}}" , "{{test|a|b}}" , "");} - @Test public void Keyd_int() {fxt.Test_parse_tmpl_str_test("{{{1}}}{{{2}}}" , "{{test|2=a|b}}" , "ba");} - @Test public void Keyd_int2() {fxt.Test_parse_tmpl_str_test("{{{1}}}{{{2}}}" , "{{test|2=a|1=b}}" , "ba");} - @Test public void Keyd_int3() {fxt.Test_parse_tmpl_str_test("{{{12}}}" , "{{test|12=a}}" , "a");} - @Test public void Equal_ignored() {fxt.Test_parse_tmpl_str_test("{{{1|b=c}}}" , "{{test}}" , "b=c");} - @Test public void Unresolved() {fxt.Test_parse_tmpl_str_test("" , "{{{a|b}}}" , "b");} - @Test public void Six_ltr() {fxt.Test_parse_tmpl_str_test("{{{{{{1}}}}}}" , "{{test|a}}" , "{{{a}}}");} - @Test public void Six_num() {fxt.Test_parse_tmpl_str_test("{{{{{{1}}}}}}" , "{{test|1}}" , "1");} + @Test public void Idx_1() {fxt.Test_parse_tmpl_str_test("{{{1}}}" , "{{test|a|b}}" , "a");} + @Test public void Idx_2() {fxt.Test_parse_tmpl_str_test("{{{2}}}" , "{{test|a|b}}" , "b");} + @Test public void Idx_3_nil() {fxt.Test_parse_tmpl_str_test("{{{3}}}" , "{{test|a|b}}" , "{{{3}}}");} + @Test public void Idx_3_dflt() {fxt.Test_parse_tmpl_str_test("{{{3|c}}}" , "{{test|a|b}}" , "c");} + @Test public void Idx_3_dflt_len0() {fxt.Test_parse_tmpl_str_test("{{{1|}}}" , "{{test}}" , "");} + @Test public void Idx_1_and_2() {fxt.Test_parse_tmpl_str_test("({{{1}}} {{{2}}})" , "{{test|a|b}}" , "(a b)");} + @Test public void Idx_2_len0() {fxt.Test_parse_tmpl_str_test("{{{1}}}" , "{{test||b}}" , "");}// should not fail + @Test public void Key() {fxt.Test_parse_tmpl_str_test("{{{k1}}}" , "{{test|k1=a|k2=b}}" , "a");} + @Test public void Key_nil() {fxt.Test_parse_tmpl_str_test("{{{k3|c}}}" , "{{test|k1=a|k2=b}}" , "c");} + @Test public void Key_exact() {fxt.Test_parse_tmpl_str_test("{{{k|}}}{{{k2|}}}" , "{{test|k=a}}" , "a");} // only {{{k}}} matched + @Test public void Var() {fxt.Test_parse_tmpl_str_test("{{{1|-{{PAGENAME}}-}}}" , "{{test}}" , "-Test page-");} + @Test public void Newline_bgn() {fxt.Test_parse_tmpl_str_test("{{{1}}} {{{2}}}" , "{{test|a|\nb}}" , "a \nb");} + @Test public void Newline_end() {fxt.Test_parse_tmpl_str_test("{{{1}}} {{{2}}}" , "{{test|a|b\n}}" , "a b\n");} + @Test public void Exc_lkp_nil() {fxt.Test_parse_tmpl_str_test("{{{}}}" , "{{test|a|b}}" , "{{{}}}");} + @Test public void Exc_lkp_and_args1() {fxt.Test_parse_tmpl_str_test("{{{|}}}" , "{{test|a|b}}" , "");} + @Test public void Exc_lkp_nil_args1_txt() {fxt.Test_parse_tmpl_str_test("{{{|a}}}" , "{{test|a|b}}" , "a");} + @Test public void Ws_idx() {fxt.Test_parse_tmpl_str_test("{{{ 1 }}}" , "{{test|a|b}}" , "a");} + @Test public void Ws_idx_nil() {fxt.Test_parse_tmpl_str_test("{{{ 1 }}}" , "{{test}}" , "{{{ 1 }}}");} + @Test public void Ws_key() {fxt.Test_parse_tmpl_str_test("{{{ k1 }}}" , "{{test|k1=a|k2=b}}" , "a");} + @Test public void Ws_dflt() {fxt.Test_parse_tmpl_str_test("{{{1| a }}}" , "{{test}}" , " a ");} + @Test public void Dflt_multiple() {fxt.Test_parse_tmpl_str_test("{{{1|a|b}}}" , "{{test}}" , "a");} + @Test public void Keyd_not_idxd() {fxt.Test_parse_tmpl_str_test("{{{1}}}{{{2}}}" , "{{test|a|key=b}}" , "a{{{2}}}");} + @Test public void Keyd_not_idxd_ints() {fxt.Test_parse_tmpl_str_test("{{{1}}}{{{2}}}" , "{{test|1=a|2=b}}" , "ab");} + @Test public void Recurse_1() {fxt.Test_parse_tmpl_str_test("{{{1{{{2|}}}|}}}" , "{{test|a}}" , "a");} // used in {{See}} to test if argument 2 is last + @Test public void Recurse_2() {fxt.Test_parse_tmpl_str_test("{{{1{{{2|}}}|}}}" , "{{test|a|b}}" , "");} + @Test public void Keyd_int() {fxt.Test_parse_tmpl_str_test("{{{1}}}{{{2}}}" , "{{test|2=a|b}}" , "ba");} + @Test public void Keyd_int2() {fxt.Test_parse_tmpl_str_test("{{{1}}}{{{2}}}" , "{{test|2=a|1=b}}" , "ba");} + @Test public void Keyd_int3() {fxt.Test_parse_tmpl_str_test("{{{12}}}" , "{{test|12=a}}" , "a");} + @Test public void Equal_ignored() {fxt.Test_parse_tmpl_str_test("{{{1|b=c}}}" , "{{test}}" , "b=c");} + @Test public void Unresolved() {fxt.Test_parse_tmpl_str_test("" , "{{{a|b}}}" , "b");} + @Test public void Six_ltr() {fxt.Test_parse_tmpl_str_test("{{{{{{1}}}}}}" , "{{test|a}}" , "{{{a}}}");} + @Test public void Six_num() {fxt.Test_parse_tmpl_str_test("{{{{{{1}}}}}}" , "{{test|1}}" , "1");} } /* */ diff --git a/400_xowa/src/gplx/xowa/parsers/uniqs/Xop_uniq_mgr__parse__tst.java b/400_xowa/src/gplx/xowa/parsers/uniqs/Xop_uniq_mgr__parse__tst.java index af033a38f..33706a3b0 100644 --- a/400_xowa/src/gplx/xowa/parsers/uniqs/Xop_uniq_mgr__parse__tst.java +++ b/400_xowa/src/gplx/xowa/parsers/uniqs/Xop_uniq_mgr__parse__tst.java @@ -13,14 +13,14 @@ The terms of each license can be found in the source code repository: GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt */ -package gplx.xowa.parsers.uniqs; import gplx.*; import gplx.xowa.*; import gplx.xowa.parsers.*; -import org.junit.*; import gplx.core.tests.*; -public class Xop_uniq_mgr__parse__tst { - private final Xop_fxt fxt = Xop_fxt.New_app_html(); - @Before public void init() {fxt.Reset();} - @Test public void Ref_becomes_UNIQ() { - String wikitext = "b"; - fxt.Init_defn_add("test", "{{#ifeq:{{{1}}}|a" + wikitext + "c|fail|pass}}"); // fail if {{{1}}} is still wikitext; should be UNIQ - fxt.Test__parse__tmpl_to_html("{{test|a" + wikitext + "c}}", "pass"); - } -} +package gplx.xowa.parsers.uniqs; import gplx.*; import gplx.xowa.*; import gplx.xowa.parsers.*; +import org.junit.*; import gplx.core.tests.*; +public class Xop_uniq_mgr__parse__tst { + private final Xop_fxt fxt = Xop_fxt.New_app_html(); + @Before public void init() {fxt.Reset();} + @Test public void Ref_becomes_UNIQ() { + String wikitext = "b"; + fxt.Init_defn_add("test", "{{#ifeq:{{{1}}}|a" + wikitext + "c|fail|pass}}"); // fail if {{{1}}} is still wikitext; should be UNIQ + fxt.Test__parse__tmpl_to_html("{{test|a" + wikitext + "c}}", "pass"); + } +} diff --git a/400_xowa/src/gplx/xowa/parsers/uniqs/Xop_uniq_mgr__tst.java b/400_xowa/src/gplx/xowa/parsers/uniqs/Xop_uniq_mgr__tst.java index 4f5ae25d4..5814b7fe0 100644 --- a/400_xowa/src/gplx/xowa/parsers/uniqs/Xop_uniq_mgr__tst.java +++ b/400_xowa/src/gplx/xowa/parsers/uniqs/Xop_uniq_mgr__tst.java @@ -1,41 +1,41 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.parsers.uniqs; import gplx.*; import gplx.xowa.*; import gplx.xowa.parsers.*; import org.junit.*; import gplx.core.tests.*; public class Xop_uniq_mgr__tst { private final Xop_uniq_mgr__fxt fxt = new Xop_uniq_mgr__fxt(); @Before public void init() {fxt.Init();} - @Test public void Test__random_bry() { + @Test public void Test__random_bry() { fxt.Init_random_int_ary(Int_ary_.New(240563374, 22728940, 1451248133)); fxt.Test__uniq_bry_new("'\"`UNIQ-E56B4AE15AD0EC68"); fxt.Init_random_int_ary(Int_ary_.New(1363621437, 426295411, 421041101)); fxt.Test__uniq_bry_new("'\"`UNIQ-147363D968C07391"); } - @Test public void Add_and_get() { + @Test public void Add_and_get() { String expd_key = "'\"`UNIQ--item-0-QINU`\"'"; fxt.Test__add("a", expd_key); fxt.Test__get(expd_key, "a"); } - @Test public void Parse__basic() { + @Test public void Parse__basic() { String expd_key = "'\"`UNIQ--item-0-QINU`\"'"; fxt.Test__add("_b_", expd_key); fxt.Test__parse("a" + expd_key + "c", "a_b_c"); } - @Test public void Parse__recurse() { + @Test public void Parse__recurse() { String key_0 = "'\"`UNIQ--item-0-QINU`\"'"; String key_1 = "'\"`UNIQ--item-1-QINU`\"'"; String key_2 = "'\"`UNIQ--item-2-QINU`\"'"; @@ -44,12 +44,12 @@ public class Xop_uniq_mgr__tst { fxt.Test__add("2-" + key_1 + "-2", key_2); fxt.Test__parse("3-" + key_2 + "-3", "3-2-1-0-1-2-3"); } - @Test public void Convert() { + @Test public void Convert() { String key = "'\"`UNIQ--item-0-QINU`\"'"; fxt.Test__add("2", key); fxt.Test__convert("1" + key + "3", "123"); } - @Test public void Convert__many() { + @Test public void Convert__many() { String key_0 = "'\"`UNIQ--item-0-QINU`\"'"; String key_1 = "'\"`UNIQ--item-1-QINU`\"'"; fxt.Test__add("0", key_0); diff --git a/400_xowa/src/gplx/xowa/parsers/utils/TstObj_tst.java b/400_xowa/src/gplx/xowa/parsers/utils/TstObj_tst.java index 394dad529..87e1f837f 100644 --- a/400_xowa/src/gplx/xowa/parsers/utils/TstObj_tst.java +++ b/400_xowa/src/gplx/xowa/parsers/utils/TstObj_tst.java @@ -1,18 +1,18 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.parsers.utils; import gplx.*; import gplx.xowa.*; import gplx.xowa.parsers.*; import org.junit.*; import gplx.core.strings.*; import gplx.core.type_xtns.*; import gplx.core.stores.*; import gplx.core.envs.*; interface TstRuleMgr { @@ -59,7 +59,7 @@ class Xop_rule_dat { public Xop_rule_dat(String atrKey, String subKey, Object skipVal) {this.atrKey = atrKey; this.subKey = subKey; this.skipVal = skipVal;} } public class TstObj_tst { - @Test public void Basic() { + @Test public void Basic() { tst_(mock_().Val1_(1).Val2_("a"), mock_().Val1_(1).Val2_("a")); // tst_(mock_().Val1_(3).Val2_("a"), mock_().Val1_(1).Val2_("b")); } diff --git a/400_xowa/src/gplx/xowa/parsers/utils/Xop_redirect_mgr_tst.java b/400_xowa/src/gplx/xowa/parsers/utils/Xop_redirect_mgr_tst.java index c07cd8347..d668ed29c 100644 --- a/400_xowa/src/gplx/xowa/parsers/utils/Xop_redirect_mgr_tst.java +++ b/400_xowa/src/gplx/xowa/parsers/utils/Xop_redirect_mgr_tst.java @@ -1,30 +1,30 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.parsers.utils; import gplx.*; import gplx.xowa.*; import gplx.xowa.parsers.*; import org.junit.*; import gplx.xowa.langs.kwds.*; import gplx.xowa.parsers.tmpls.*; public class Xop_redirect_mgr_tst { @Before public void init() {fxt.Clear();} private Xop_redirect_mgr_fxt fxt = new Xop_redirect_mgr_fxt(); - @Test public void Basic() {fxt.Test_redirect("#REDIRECT [[a]]", "A");} - @Test public void Basic_colon() {fxt.Test_redirect("#REDIRECT:[[a]]", "A");} - @Test public void Ns_help() {fxt.Test_redirect("#REDIRECT [[Help:a]]", "Help:A");} - @Test public void First() {fxt.Test_redirect("#REDIRECT [[a]] [[b]]", "A");} - @Test public void Exc_false_match() {fxt.Test_redirect("#REDIRECTA [[a]]", "");} - @Test public void Exc_lnki_not_found() {fxt.Test_redirect("#REDIRECT test", "");} - @Test public void Ws() {fxt.Test_redirect("\n#REDIRECT [[a]]", "A");} // PAGE:en.w:Germany; {{Template group}} -> \n#REDIRECT [[Template:Navboxes]] - @Test public void U8() { + @Test public void Basic() {fxt.Test_redirect("#REDIRECT [[a]]", "A");} + @Test public void Basic_colon() {fxt.Test_redirect("#REDIRECT:[[a]]", "A");} + @Test public void Ns_help() {fxt.Test_redirect("#REDIRECT [[Help:a]]", "Help:A");} + @Test public void First() {fxt.Test_redirect("#REDIRECT [[a]] [[b]]", "A");} + @Test public void Exc_false_match() {fxt.Test_redirect("#REDIRECTA [[a]]", "");} + @Test public void Exc_lnki_not_found() {fxt.Test_redirect("#REDIRECT test", "");} + @Test public void Ws() {fxt.Test_redirect("\n#REDIRECT [[a]]", "A");} // PAGE:en.w:Germany; {{Template group}} -> \n#REDIRECT [[Template:Navboxes]] + @Test public void U8() { fxt.Init_u8(); fxt.Init_kwds(Bool_.N, "#REDIRECT", "#перенаправление"); fxt.Test_redirect("#REDIRECT [[A]]", "A"); @@ -32,19 +32,19 @@ public class Xop_redirect_mgr_tst { fxt.Test_redirect("#перенаправление [[A]]", "A"); fxt.Test_redirect("#ПЕРЕНАПРАВЛЕНИЕ [[A]]", "A"); } - @Test public void Url_decode() {fxt.Test_redirect("#REDIRECT [[A%28B%29]]" , "A(B)");} // PURPOSE: url-decode links; PAGE:en.w:Watcher_(Buffy_the_Vampire_Slayer); DATE:2014-08-18 - @Test public void Url_decode_plus() {fxt.Test_redirect("#REDIRECT [[A%28B%29+]]", "A(B)+");} // PURPOSE: do not url-decode +; PAGE:en.w:Template:Positionskarte+; DATE:2014-08-22 - @Test public void Amp() {fxt.Test_redirect("#REDIRECT [[A & B]]", "A & B");} // PURPOSE: & -> &; PAGE:en.w:Amadou Bagayoko?redirect=n; DATE:2014-09-23 - @Test public void Frame_ttl() { // PURPOSE: redirect should set invk frame title to redirect_trg, not original; PAGE:en.w:Statutory_city DATE:2014-08-22 + @Test public void Url_decode() {fxt.Test_redirect("#REDIRECT [[A%28B%29]]" , "A(B)");} // PURPOSE: url-decode links; PAGE:en.w:Watcher_(Buffy_the_Vampire_Slayer); DATE:2014-08-18 + @Test public void Url_decode_plus() {fxt.Test_redirect("#REDIRECT [[A%28B%29+]]", "A(B)+");} // PURPOSE: do not url-decode +; PAGE:en.w:Template:Positionskarte+; DATE:2014-08-22 + @Test public void Amp() {fxt.Test_redirect("#REDIRECT [[A & B]]", "A & B");} // PURPOSE: & -> &; PAGE:en.w:Amadou Bagayoko?redirect=n; DATE:2014-09-23 + @Test public void Frame_ttl() { // PURPOSE: redirect should set invk frame title to redirect_trg, not original; PAGE:en.w:Statutory_city DATE:2014-08-22 fxt.Test_frame_ttl("Template:A", "#REDIRECT [[Template:B]]", "Template:B", "Template:B"); } - @Test public void State_collapsed() { // PURPOSE: state=collapsed broke redirects; PAGE:da.w:Middelaldercentret; DATE:2015-11-06 + @Test public void State_collapsed() { // PURPOSE: state=collapsed broke redirects; PAGE:da.w:Middelaldercentret; DATE:2015-11-06 fxt.Test_redirect("#REDIRECT [[Template:A|state=collapsed]]", "Template:A"); } - @Test public void Parse_1st_link_only() { // PURPOSE: do not take pipe from 2nd lnki; PAGE:en.w:Template:pp-semi; DATE:2015-11-14 + @Test public void Parse_1st_link_only() { // PURPOSE: do not take pipe from 2nd lnki; PAGE:en.w:Template:pp-semi; DATE:2015-11-14 fxt.Test_redirect("#REDIRECT [[Template:A]][[Category:B|b]]", "Template:A"); } - @Test public void Redirected_html() { + @Test public void Redirected_html() { // PURPOSE: "Redirected from" message was using "_" instead of " "; PAGE:en.w:Summer_Solstice; DATE:2015-12-29 fxt.Test__redirected_html("A_B", "(Redirected from A B)"); diff --git a/400_xowa/src/gplx/xowa/parsers/utils/Xop_sanitizer_tst.java b/400_xowa/src/gplx/xowa/parsers/utils/Xop_sanitizer_tst.java index fcb941895..1df90791b 100644 --- a/400_xowa/src/gplx/xowa/parsers/utils/Xop_sanitizer_tst.java +++ b/400_xowa/src/gplx/xowa/parsers/utils/Xop_sanitizer_tst.java @@ -1,32 +1,32 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.parsers.utils; import gplx.*; import gplx.xowa.*; import gplx.xowa.parsers.*; import org.junit.*; import gplx.core.log_msgs.*; import gplx.xowa.parsers.amps.*; public class Xop_sanitizer_tst { Xop_sanitizer_fxt fxt = new Xop_sanitizer_fxt(); @Before public void init() {fxt.Clear();} - @Test public void Space() {fxt.tst_Escape_id("a b" , "a_b");} - @Test public void Colon() {fxt.tst_Escape_id("a%3Ab" , "a:b");} - @Test public void Percent() {fxt.tst_Escape_id("a%b" , "a%b");} - @Test public void Amp_eos() {fxt.tst_Escape_id("a&" , "a&");} - @Test public void Amp_unrecognized() {fxt.tst_Escape_id("a&bcd" , "a&bcd");} - @Test public void Amp_name() {fxt.tst_Escape_id("a<b" , "ahkhk", "cncncn"); } - @Test public void Attribs() { + @Test public void Attribs() { fxt.Test_parse(rule + "hk", "cn"); } - @Test public void Attribs__title() { + @Test public void Attribs__title() { fxt.Test_parse(rule + "hk", "cn"); } - @Test public void Attribs__alt() { + @Test public void Attribs__alt() { fxt.Test_parse(rule + "hk", "cn"); } - @Test public void Attribs__alt_w_embedded_vnt() { // PURPOSE: handle embedded variants inside attribute tags; PAGE:sr.n:Проглашени_победници_„Вики_воли_Земљу" DATE:2015-10-13 + @Test public void Attribs__alt_w_embedded_vnt() { // PURPOSE: handle embedded variants inside attribute tags; PAGE:sr.n:Проглашени_победници_„Вики_воли_Земљу" DATE:2015-10-13 fxt.Test_parse(rule + "hk-{hk}-hk", "cnhkcn"); } - @Test public void Attribs__skip_url() { + @Test public void Attribs__skip_url() { fxt.Test_parse(rule + "hk", "cn"); } - @Test public void Node__script() { + @Test public void Node__script() { fxt.Test_parse(rule + "hkhk", "cncn"); } - @Test public void Node__code() { + @Test public void Node__code() { fxt.Test_parse(rule + "hkhkhk", "cnhkcn"); } - @Test public void Node__pre() { + @Test public void Node__pre() { fxt.Test_parse(rule + "hk
    hk
    hk", "cn
    hk
    cn"); } - @Test public void Node__pre__nested() { + @Test public void Node__pre__nested() { fxt.Test_parse(rule + "hk
    hk
    hk", "cn
    hk
    cn"); } - @Test public void Recursive__deep() { + @Test public void Recursive__deep() { fxt.Test_parse("a-{b-{c-{d}-e}-f}-g", "abcdefg"); } - @Test public void Recursive__many() { + @Test public void Recursive__many() { fxt.Test_parse("a-{b-{c}-d-{e}-f}-g", "abcdefg"); } - @Test public void Recursive__unclosed() { + @Test public void Recursive__unclosed() { fxt.Test_parse("a-{b-{c", "a-{b-{c"); } - @Test public void Recursive__unclosed_2() { + @Test public void Recursive__unclosed_2() { fxt.Test_parse("a-{b-{c}-", "a-{bc"); } - @Test public void Recursive__failed() { // PURPOSE: handle out of bounds exception; PAGE:zh.w:重庆市 ;DATE:2015-10-01 + @Test public void Recursive__failed() { // PURPOSE: handle out of bounds exception; PAGE:zh.w:重庆市 ;DATE:2015-10-01 fxt.Test_parse("-{zh-cn:a-{b}-c; zh-tw:d-{e}-f; }-", "abc"); } - @Test public void Unclosed() { + @Test public void Unclosed() { fxt.Test_parse("a-{bc", "a-{bc"); } - @Test public void Entity__body() { + @Test public void Entity__body() { fxt.Test_parse("-{H|zh-cn:nbsp-cn;zh-hk:nbsp;}-" + " nbsp", " nbsp-cn"); } - @Test public void Entity__atr() { + @Test public void Entity__atr() { fxt.Test_parse("-{H|zh-cn:nbsp-cn;zh-hk:nbsp;}-" + "
    " , "
    "); } - @Test public void Node__example() { + @Test public void Node__example() { fxt.Test_parse(rule + String_.Concat_lines_nl_skip_last ( "{|" , "|-" @@ -93,7 +93,7 @@ public class Vnt_convert_lang__html__tst { // REF: https://www.mediawiki.org/wik , "|}" )); } - @Test public void Attribs__title__w_vnt() { + @Test public void Attribs__title__w_vnt() { fxt.Init_cur("zh-tw"); fxt.Test_parse("cn", "cn"); // cn not converted to hk } diff --git a/400_xowa/src/gplx/xowa/parsers/vnts/Vnt_convert_lang__syntax__tst.java b/400_xowa/src/gplx/xowa/parsers/vnts/Vnt_convert_lang__syntax__tst.java index 8a05fd733..845221283 100644 --- a/400_xowa/src/gplx/xowa/parsers/vnts/Vnt_convert_lang__syntax__tst.java +++ b/400_xowa/src/gplx/xowa/parsers/vnts/Vnt_convert_lang__syntax__tst.java @@ -1,44 +1,44 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.parsers.vnts; import gplx.*; import gplx.xowa.*; import gplx.xowa.parsers.*; import org.junit.*; import gplx.xowa.langs.vnts.*; import gplx.xowa.langs.vnts.converts.*; public class Vnt_convert_lang__syntax__tst { // REF: https://www.mediawiki.org/wiki/Writing_systems/Syntax private final Vnt_convert_lang_fxt fxt = new Vnt_convert_lang_fxt(); - @Test public void Bidi() { + @Test public void Bidi() { String text = "-{zh-hans:a;zh-hant:b}-"; fxt.Test_parse_many(text, "a", "zh-hans", "zh-cn", "zh-sg", "zh"); fxt.Test_parse_many(text, "b", "zh-hant", "zh-hk", "zh-tw"); } - @Test public void Undi() { + @Test public void Undi() { String text = "-{H|cn_k=>zh-cn:cn_v}-cn_k"; fxt.Test_parse_many(text, "cn_k", "zh", "zh-hans", "zh-hant", "zh-hk", "zh-my", "zh-mo", "zh-sg", "zh-tw"); fxt.Test_parse_many(text, "cn_v", "zh-cn"); } - @Test public void Raw() { + @Test public void Raw() { fxt.Test_parse_many("-{a}-", "a", "zh-hans", "zh-cn", "zh-sg", "zh", "zh-hant", "zh-hk", "zh-tw"); fxt.Test_parse_many("-{R|a}-", "a", "zh-hans", "zh-cn", "zh-sg", "zh", "zh-hant", "zh-hk", "zh-tw"); } - @Test public void Hide() { + @Test public void Hide() { String text = "-{H|zh-cn:cn;zh-hk:hk;zh-tw:tw}-cn hk tw"; fxt.Test_parse_many(text, "cn cn cn", "zh-cn", "zh-sg"); fxt.Test_parse_many(text, "hk hk hk", "zh-hk"); fxt.Test_parse_many(text, "tw tw tw", "zh-tw"); fxt.Test_parse_many(text, "cn hk tw", "zh", "zh-hans", "zh-hant"); } - @Test public void Aout() { + @Test public void Aout() { String text = "-{A|zh-cn:cn;zh-hk:hk;zh-tw:tw}- cn hk tw"; fxt.Test_parse_many(text, "cn cn cn cn", "zh-cn", "zh-sg"); fxt.Test_parse_many(text, "hk hk hk hk", "zh-hk"); @@ -47,14 +47,14 @@ public class Vnt_convert_lang__syntax__tst { // REF: https://www.mediawiki.org/w fxt.Test_parse_many(text, "tw cn hk tw", "zh-hant"); fxt.Test_parse_many("h-{}-k", "hk", "zh-cn"); // semi-disabled } - @Test public void Del() { + @Test public void Del() { String text = "-{H|zh-cn:cn;zh-hk:hk;zh-tw:tw}-cn hk tw-{-|zh-cn:cn;zh-hk:hk;zh-tw:tw}- cn hk tw"; fxt.Test_parse_many(text, "cn cn cn cn hk tw", "zh-cn", "zh-sg"); fxt.Test_parse_many(text, "hk hk hk cn hk tw", "zh-hk"); fxt.Test_parse_many(text, "tw tw tw cn hk tw", "zh-tw"); fxt.Test_parse_many(text, "cn hk tw cn hk tw", "zh", "zh-hans", "zh-hant"); } - @Test public void Title() { + @Test public void Title() { fxt.Test_parse_title("-{}-", null, "", "zh-cn"); String text = "-{T|zh-cn:cn;zh-hk:hk;zh-tw:tw}-cn hk tw"; fxt.Test_parse_title(text, "cn", "cn hk tw", "zh-cn"); @@ -65,17 +65,17 @@ public class Vnt_convert_lang__syntax__tst { // REF: https://www.mediawiki.org/w fxt.Test_parse_title(text, "tw", "cn hk tw", "zh-hant"); fxt.Test_parse_title(text, null, "cn hk tw", "zh"); } - @Test public void Descrip() { + @Test public void Descrip() { String text = "-{D|zh-cn:cn;zh-hk:hk;zh-tw:tw}-"; fxt.Test_parse_many(text, "ZH-CN:cn;ZH-HK:hk;ZH-TW:tw;", "zh", "zh-hans", "zh-hant", "zh-cn", "zh-hk", "zh-my", "zh-mo", "zh-sg", "zh-tw"); } - @Test public void Mixture() { + @Test public void Mixture() { String text = "-{H|zh-cn:cn;zh-hk:hk;zh-tw:tw}--{zh;zh-hans;zh-hant|cn hk tw}- -{zh;zh-cn;zh-hk;zh-tw|cn hk tw}-"; fxt.Test_parse_many(text, "cn hk tw cn cn cn", "zh-cn", "zh-sg", "zh-hans"); fxt.Test_parse_many(text, "cn hk tw hk hk hk", "zh-hk"); fxt.Test_parse_many(text, "cn hk tw tw tw tw", "zh-tw", "zh-hant"); fxt.Test_parse_many(text, "cn hk tw cn hk tw", "zh"); } - @Test public void Descrip__undi() {fxt.Test_parse("-{D|cn_k=>zh-cn:cn_v;hk_k=>zh-hk:hk_v}-", "cn_k⇒ZH-CN:cn_v;hk_k⇒ZH-HK:hk_v;");} - @Test public void Descrip__mixd() {fxt.Test_parse("-{D|zh-tw:tw_v;cn_k=>zh-cn:cn_v;hk_k=>zh-hk:hk_v;zh-mo:mo_v}-", "ZH-TW:tw_v;ZH-MO:mo_v;cn_k⇒ZH-CN:cn_v;hk_k⇒ZH-HK:hk_v;");} + @Test public void Descrip__undi() {fxt.Test_parse("-{D|cn_k=>zh-cn:cn_v;hk_k=>zh-hk:hk_v}-", "cn_k⇒ZH-CN:cn_v;hk_k⇒ZH-HK:hk_v;");} + @Test public void Descrip__mixd() {fxt.Test_parse("-{D|zh-tw:tw_v;cn_k=>zh-cn:cn_v;hk_k=>zh-hk:hk_v;zh-mo:mo_v}-", "ZH-TW:tw_v;ZH-MO:mo_v;cn_k⇒ZH-CN:cn_v;hk_k⇒ZH-HK:hk_v;");} } diff --git a/400_xowa/src/gplx/xowa/parsers/vnts/Vnt_flag_parser_tst.java b/400_xowa/src/gplx/xowa/parsers/vnts/Vnt_flag_parser_tst.java index 0332b3ed2..cddd80b71 100644 --- a/400_xowa/src/gplx/xowa/parsers/vnts/Vnt_flag_parser_tst.java +++ b/400_xowa/src/gplx/xowa/parsers/vnts/Vnt_flag_parser_tst.java @@ -1,43 +1,43 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.parsers.vnts; import gplx.*; import gplx.xowa.*; import gplx.xowa.parsers.*; import org.junit.*; import gplx.xowa.langs.vnts.*; public class Vnt_flag_parser_tst { private final Vnt_flag_parser_fxt fxt = new Vnt_flag_parser_fxt(); - @Test public void Basic() {fxt.Test_parse("D" , "D");} - @Test public void Multiple() {fxt.Test_parse("+;S;E" , "+;S;E");} - @Test public void Ws() {fxt.Test_parse(" + ; S ; E " , "+;S;E");} - @Test public void None() {fxt.Test_parse("" , "S");} - @Test public void Wrong() {fxt.Test_parse("XYZ" , "S");} - @Test public void Raw__limit() {fxt.Test_parse("R;S" , "R");} - @Test public void Name__limit() {fxt.Test_parse("N;S" , "N");} - @Test public void Del_limit() {fxt.Test_parse("-;S" , "-");} - @Test public void Title__also_macro_y() {fxt.Test_parse("T" , "H;T");} - @Test public void Title__also_macro_n() {fxt.Test_parse("T;S" , "S;T");} - @Test public void Hide__remove_all() {fxt.Test_parse("H;S" , "+;H");} - @Test public void Hide__keep_descrip() {fxt.Test_parse("H;S;D" , "+;H;D");} - @Test public void Hide__keep_title() {fxt.Test_parse("H;S;T" , "+;H;T");} - @Test public void Aout__also_show_all() {fxt.Test_parse("A" , "+;A;S");} - @Test public void Descrip__remove_show() {fxt.Test_parse("D;S" , "D");} - @Test public void Aout_w_descrip() {fxt.Test_parse("A;D;S" , "+;A;D");} - @Test public void Lang__one() {fxt.Test_parse("zh-hans" , "S;zh-hans");} - @Test public void Lang__many() {fxt.Test_parse("zh-cn;zh-hk" , "S;zh-cn;zh-hk");} - @Test public void Lang__many__ws() {fxt.Test_parse(" zh-cn ; zh-hk " , "S;zh-cn;zh-hk");} - @Test public void Lang__many__dupe() {fxt.Test_parse("zh-cn;zh-cn" , "S;zh-cn");} - @Test public void Lang__zap__codes() {fxt.Test_parse("+;S;zh-hans;" , "zh-hans");} + @Test public void Basic() {fxt.Test_parse("D" , "D");} + @Test public void Multiple() {fxt.Test_parse("+;S;E" , "+;S;E");} + @Test public void Ws() {fxt.Test_parse(" + ; S ; E " , "+;S;E");} + @Test public void None() {fxt.Test_parse("" , "S");} + @Test public void Wrong() {fxt.Test_parse("XYZ" , "S");} + @Test public void Raw__limit() {fxt.Test_parse("R;S" , "R");} + @Test public void Name__limit() {fxt.Test_parse("N;S" , "N");} + @Test public void Del_limit() {fxt.Test_parse("-;S" , "-");} + @Test public void Title__also_macro_y() {fxt.Test_parse("T" , "H;T");} + @Test public void Title__also_macro_n() {fxt.Test_parse("T;S" , "S;T");} + @Test public void Hide__remove_all() {fxt.Test_parse("H;S" , "+;H");} + @Test public void Hide__keep_descrip() {fxt.Test_parse("H;S;D" , "+;H;D");} + @Test public void Hide__keep_title() {fxt.Test_parse("H;S;T" , "+;H;T");} + @Test public void Aout__also_show_all() {fxt.Test_parse("A" , "+;A;S");} + @Test public void Descrip__remove_show() {fxt.Test_parse("D;S" , "D");} + @Test public void Aout_w_descrip() {fxt.Test_parse("A;D;S" , "+;A;D");} + @Test public void Lang__one() {fxt.Test_parse("zh-hans" , "S;zh-hans");} + @Test public void Lang__many() {fxt.Test_parse("zh-cn;zh-hk" , "S;zh-cn;zh-hk");} + @Test public void Lang__many__ws() {fxt.Test_parse(" zh-cn ; zh-hk " , "S;zh-cn;zh-hk");} + @Test public void Lang__many__dupe() {fxt.Test_parse("zh-cn;zh-cn" , "S;zh-cn");} + @Test public void Lang__zap__codes() {fxt.Test_parse("+;S;zh-hans;" , "zh-hans");} } class Vnt_flag_parser_fxt { private final Vnt_flag_parser parser = new Vnt_flag_parser(); diff --git a/400_xowa/src/gplx/xowa/parsers/vnts/Vnt_rule_parser__bidi_tst.java b/400_xowa/src/gplx/xowa/parsers/vnts/Vnt_rule_parser__bidi_tst.java index 3bcee3248..df85b20ee 100644 --- a/400_xowa/src/gplx/xowa/parsers/vnts/Vnt_rule_parser__bidi_tst.java +++ b/400_xowa/src/gplx/xowa/parsers/vnts/Vnt_rule_parser__bidi_tst.java @@ -13,13 +13,13 @@ The terms of each license can be found in the source code repository: GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt */ -package gplx.xowa.parsers.vnts; import gplx.*; import gplx.xowa.*; import gplx.xowa.parsers.*; -import org.junit.*; -public class Vnt_rule_parser__bidi_tst { - private final Vnt_rule_parser_fxt fxt = new Vnt_rule_parser_fxt(); - @Test public void Basic() {fxt.Test_parse("x1:v1;" , "x1:v1");} - @Test public void Ws() {fxt.Test_parse(" x1 : v1 ;" , "x1:v1");} - @Test public void Entity() {fxt.Test_parse("x1:a x2:b;x2:b;" , "x1:a x2:b" , "x2:b");} - @Test public void Unknown__nth() {fxt.Test_parse("x1:a;wx2:b;x2:b;" , "x1:a;wx2:b" , "x2:b");} - @Test public void Unknown__1st() {fxt.Test_parse("wx1:a;x1:b;" , "");} -} +package gplx.xowa.parsers.vnts; import gplx.*; import gplx.xowa.*; import gplx.xowa.parsers.*; +import org.junit.*; +public class Vnt_rule_parser__bidi_tst { + private final Vnt_rule_parser_fxt fxt = new Vnt_rule_parser_fxt(); + @Test public void Basic() {fxt.Test_parse("x1:v1;" , "x1:v1");} + @Test public void Ws() {fxt.Test_parse(" x1 : v1 ;" , "x1:v1");} + @Test public void Entity() {fxt.Test_parse("x1:a x2:b;x2:b;" , "x1:a x2:b" , "x2:b");} + @Test public void Unknown__nth() {fxt.Test_parse("x1:a;wx2:b;x2:b;" , "x1:a;wx2:b" , "x2:b");} + @Test public void Unknown__1st() {fxt.Test_parse("wx1:a;x1:b;" , "");} +} diff --git a/400_xowa/src/gplx/xowa/parsers/vnts/Vnt_rule_parser__undi_tst.java b/400_xowa/src/gplx/xowa/parsers/vnts/Vnt_rule_parser__undi_tst.java index 6fd73403e..c2266fffc 100644 --- a/400_xowa/src/gplx/xowa/parsers/vnts/Vnt_rule_parser__undi_tst.java +++ b/400_xowa/src/gplx/xowa/parsers/vnts/Vnt_rule_parser__undi_tst.java @@ -13,10 +13,10 @@ The terms of each license can be found in the source code repository: GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt */ -package gplx.xowa.parsers.vnts; import gplx.*; import gplx.xowa.*; import gplx.xowa.parsers.*; -import org.junit.*; -public class Vnt_rule_parser__undi_tst { - private final Vnt_rule_parser_fxt fxt = new Vnt_rule_parser_fxt(); - @Test public void One() {fxt.Test_parse("k1=>x1:v1;" , "x1:k1=v1");} - @Test public void Many() {fxt.Test_parse("k1=>x1:v1;k2=>x2:v2;" , "x1:k1=v1", "x2:k2=v2");} -} +package gplx.xowa.parsers.vnts; import gplx.*; import gplx.xowa.*; import gplx.xowa.parsers.*; +import org.junit.*; +public class Vnt_rule_parser__undi_tst { + private final Vnt_rule_parser_fxt fxt = new Vnt_rule_parser_fxt(); + @Test public void One() {fxt.Test_parse("k1=>x1:v1;" , "x1:k1=v1");} + @Test public void Many() {fxt.Test_parse("k1=>x1:v1;k2=>x2:v2;" , "x1:k1=v1", "x2:k2=v2");} +} diff --git a/400_xowa/src/gplx/xowa/parsers/xndes/Xop_xatr_whitelist_mgr_tst.java b/400_xowa/src/gplx/xowa/parsers/xndes/Xop_xatr_whitelist_mgr_tst.java index 4c41191aa..c55d369b8 100644 --- a/400_xowa/src/gplx/xowa/parsers/xndes/Xop_xatr_whitelist_mgr_tst.java +++ b/400_xowa/src/gplx/xowa/parsers/xndes/Xop_xatr_whitelist_mgr_tst.java @@ -25,7 +25,7 @@ import org.junit.Test; public class Xop_xatr_whitelist_mgr_tst { private final Xop_xatr_whitelist_fxt fxt = new Xop_xatr_whitelist_fxt(); @Before public void init() {fxt.Clear();} - @Test public void Basic() { + @Test public void Basic() { fxt.Whitelist(Xop_xnde_tag_.Tid__div , "style" , true); fxt.Whitelist(Xop_xnde_tag_.Tid__div , "xstyle" , false); fxt.Whitelist(Xop_xnde_tag_.Tid__div , "stylex" , false); @@ -36,11 +36,11 @@ public class Xop_xatr_whitelist_mgr_tst { fxt.Whitelist(Xop_xnde_tag_.Tid__data , "value" , true); fxt.Whitelist(Xop_xnde_tag_.Tid__data , "valuex" , false); } - @Test public void Role() { + @Test public void Role() { fxt.Whitelist(Xop_xnde_tag_.Tid__div , "role" , "presentation", true); fxt.Whitelist(Xop_xnde_tag_.Tid__div , "role" , "other", true); } - @Test public void Scrub() { + @Test public void Scrub() { fxt.Scrub_style_fail("expression"); fxt.Scrub_style_fail("filter:a"); fxt.Scrub_style_fail("filter\t \n:a"); diff --git a/400_xowa/src/gplx/xowa/parsers/xndes/Xop_xnde_wkr__basic_tst.java b/400_xowa/src/gplx/xowa/parsers/xndes/Xop_xnde_wkr__basic_tst.java index 3dc3489cb..37b339795 100644 --- a/400_xowa/src/gplx/xowa/parsers/xndes/Xop_xnde_wkr__basic_tst.java +++ b/400_xowa/src/gplx/xowa/parsers/xndes/Xop_xnde_wkr__basic_tst.java @@ -1,24 +1,24 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.parsers.xndes; import gplx.*; import gplx.xowa.*; import gplx.xowa.parsers.*; import org.junit.*; import gplx.xowa.wikis.nss.*; public class Xop_xnde_wkr__basic_tst { private final Xop_fxt fxt = new Xop_fxt(); @After public void term() {fxt.Init_para_n_();} - @Test public void Escape_lt() { // PURPOSE: some templates have unknown tags; PAGE:en.w:PHP + @Test public void Escape_lt() { // PURPOSE: some templates have unknown tags; PAGE:en.w:PHP fxt.Init_para_y_(); fxt.Test_parse_page_wiki_str("ab", String_.Concat_lines_nl_skip_last ( "

    a<?b" @@ -27,31 +27,31 @@ public class Xop_xnde_wkr__basic_tst { )); fxt.Init_para_n_(); } - @Test public void Inline() { + @Test public void Inline() { fxt.Test_parse_page_wiki("" , fxt.tkn_xnde_(0, 6).CloseMode_(Xop_xnde_tkn.CloseMode_inline).Name_rng_(1, 4)); } - @Test public void Pair() { + @Test public void Pair() { fxt.Test_parse_page_wiki("

    ", fxt.tkn_xnde_(0, 11).CloseMode_(Xop_xnde_tkn.CloseMode_pair).Name_rng_(1, 4)); } - @Test public void Pair_text() { + @Test public void Pair_text() { fxt.Test_parse_page_wiki("
    b
    ", fxt.tkn_xnde_(0, 12).Subs_(fxt.tkn_txt_(5, 6))); } - @Test public void Deep1_pair1() { + @Test public void Deep1_pair1() { fxt.Test_parse_page_wiki("
    ", fxt.tkn_xnde_(0, 22).Name_rng_(1, 4) .Subs_(fxt.tkn_xnde_(5, 16).Name_rng_(6, 9))); } - @Test public void Deep1_inline1() { + @Test public void Deep1_inline1() { fxt.Test_parse_page_wiki("
    ", fxt.tkn_xnde_(0, 17).Name_rng_(1, 4) .Subs_(fxt.tkn_xnde_(5, 11).Name_rng_(6, 9)) ); } - @Test public void Deep1_pair2() { + @Test public void Deep1_pair2() { fxt.Test_parse_page_wiki("
    ", fxt.tkn_xnde_(0, 33).Name_rng_(1, 4) .Subs_ ( fxt.tkn_xnde_( 5, 16).Name_rng_( 6, 9) , fxt.tkn_xnde_(16, 27).Name_rng_(17, 20) )); } - @Test public void Deep2_pair1() { + @Test public void Deep2_pair1() { fxt.Test_parse_page_wiki("
    ", fxt.tkn_xnde_(0, 33).Name_rng_(1, 4) .Subs_ ( fxt.tkn_xnde_( 5, 27).Name_rng_( 6, 9) @@ -59,93 +59,93 @@ public class Xop_xnde_wkr__basic_tst { ( fxt.tkn_xnde_(10, 21).Name_rng_(11, 14)) )); } - @Test public void Slash() {// b/c mw allows unquoted attributes + @Test public void Slash() {// b/c mw allows unquoted attributes fxt.Test_parse_page_wiki("a", fxt.tkn_xnde_(0, 15).Atrs_rng_(5, 7).Subs_(fxt.tkn_txt_(8, 9))); fxt.Test_parse_page_wiki("", fxt.tkn_xnde_(0, 15).Atrs_rng_(5, 13)); } - @Test public void Escaped() { + @Test public void Escaped() { fxt.Init_log_(Xop_xnde_log.Escaped_xnde).Test_parse_page_wiki("
    ", fxt.tkn_xnde_(0, 18).Subs_(fxt.tkn_bry_(5, 12)));// TIDY.dangling: tidy will correct dangling node; DATE:2014-07-22 } - @Test public void Xtn() { + @Test public void Xtn() { fxt.Test_parse_page_wiki("
    ", fxt.tkn_xnde_(0, 18).Subs_(fxt.tkn_txt_(6, 11))); // NOTE: no dangling nde b/c .Xtn skips } - @Test public void Xtn_ref() { + @Test public void Xtn_ref() { fxt.Test_parse_page_wiki("b", fxt.tkn_xnde_(0, 21).Name_rng_(1, 4).Atrs_rng_(5, 13).Subs_(fxt.tkn_txt_(14, 15))); } - @Test public void Lnki() { + @Test public void Lnki() { fxt.Test_parse_page_wiki("[[Image:a|b
    d]]" , fxt.tkn_lnki_().Ns_id_(Xow_ns_.Tid__file).Trg_tkn_(fxt.tkn_arg_nde_().Val_tkn_(fxt.tkn_arg_itm_(fxt.tkn_txt_(2, 7), fxt.tkn_colon_(7), fxt.tkn_txt_(8, 9)))) .Caption_tkn_(fxt.tkn_arg_nde_(10, 17).Val_tkn_(fxt.tkn_arg_itm_(fxt.tkn_txt_(10, 11), fxt.tkn_xnde_(11, 16), fxt.tkn_txt_(16, 17)))) ); } - @Test public void Br_converted_to_reguar_br() { + @Test public void Br_converted_to_reguar_br() { fxt.Test_parse_page_wiki("
    a" , fxt.tkn_xnde_(0, 5), fxt.tkn_txt_(5, 6)); fxt.Test_parse_page_wiki("
    a" , fxt.tkn_xnde_(0, 5), fxt.tkn_txt_(5, 6)); fxt.Test_parse_page_wiki("
    a" , fxt.tkn_xnde_(0, 6), fxt.tkn_txt_(6, 7)); } - @Test public void CaseSensitivity() { + @Test public void CaseSensitivity() { fxt.Test_parse_page_wiki("
    ", fxt.tkn_xnde_(0, 11).CloseMode_(Xop_xnde_tkn.CloseMode_pair).Name_rng_(1, 4)); } - @Test public void CaseSensitivity_xtn_1() { + @Test public void CaseSensitivity_xtn_1() { fxt.Test_parse_page_wiki_str ( "abc" , "b" ); } - @Test public void CaseSensitivity_xtn_2() { // PURPOSE: xtn end_tag may not match bgn_tag; EX: w:Ehrenfest_paradox; + @Test public void CaseSensitivity_xtn_2() { // PURPOSE: xtn end_tag may not match bgn_tag; EX: w:Ehrenfest_paradox; fxt.Test_parse_page_all_str("ac", String_.Concat_lines_nl ( "a[1]
      " , "
    1. ^ c
    2. " , "
    " )); } - @Test public void CaseSensitivity_xtn_3() {// PURPOSE: xtn xnde must do case-insensitive match DATE:2013-12-02 + @Test public void CaseSensitivity_xtn_3() {// PURPOSE: xtn xnde must do case-insensitive match DATE:2013-12-02 fxt.Test_parse_page_all_str ( "a b c" // should match not , "a b c" ); } - @Test public void Whitelist() { + @Test public void Whitelist() { fxt.Test_parse_page_all_str("", ""); } - @Test public void Whitelist_pre() { // PURPOSE:
    a
    somehow becoming a
    ; Template:Infobox_country; ISSUE: old xatr code being triggered; PURPOSE:(2) style being stripped when it shouldn't be + @Test public void Whitelist_pre() { // PURPOSE:
    a
    somehow becoming a; Template:Infobox_country; ISSUE: old xatr code being triggered; PURPOSE:(2) style being stripped when it shouldn't be fxt.Test_parse_page_all_str("
    a
    ", "
    a
    "); } - @Test public void Whitelist_style() { + @Test public void Whitelist_style() { fxt.Test_parse_page_all_str("
    ", "
    "); } - @Test public void Script() { // PURPOSE: nested script should (a) write attributes; (b) write close tag; DATE:2014-01-24 + @Test public void Script() { // PURPOSE: nested script should (a) write attributes; (b) write close tag; DATE:2014-01-24 fxt.Test_parse_page_all_str("", "<script src='a'>b</script>"); } - @Test public void Script_in_syntaxhighlight() { + @Test public void Script_in_syntaxhighlight() { fxt.Test_parse_page_all_str("", "
    <script>alert('fail');</script>
    "); } - @Test public void Html5_time() {// PURPOSE: HTML5; should output self (i.e.: must be whitelisted) + @Test public void Html5_time() {// PURPOSE: HTML5; should output self (i.e.: must be whitelisted) fxt.Test_parse_page_wiki_str("", ""); } - @Test public void Html5_bdi() {// PURPOSE: HTML5; should output self (i.e.: must be whitelisted); DATE:2013-12-07 + @Test public void Html5_bdi() {// PURPOSE: HTML5; should output self (i.e.: must be whitelisted); DATE:2013-12-07 fxt.Test_parse_page_wiki_str("a", "a"); } - @Test public void Html5_mark() {// PURPOSE: HTML5; should output self (i.e.: must be whitelisted); DATE:2014-01-03 + @Test public void Html5_mark() {// PURPOSE: HTML5; should output self (i.e.: must be whitelisted); DATE:2014-01-03 fxt.Test_parse_page_wiki_str("a", "a"); } - @Test public void Html5_mark_span() {// PURPOSE: should close tag; EX: zh.wikipedia.org/wiki/异体字; DATE:2014-01-03 + @Test public void Html5_mark_span() {// PURPOSE: should close tag; EX: zh.wikipedia.org/wiki/异体字; DATE:2014-01-03 fxt.Test_parse_page_wiki_str("a", "a"); } - @Test public void Html5_wbr() {// PURPOSE: HTML5; should output self (i.e.: must be whitelisted); DATE:2014-01-03 + @Test public void Html5_wbr() {// PURPOSE: HTML5; should output self (i.e.: must be whitelisted); DATE:2014-01-03 fxt.Test_parse_page_wiki_str("abc", "abc"); } - @Test public void Html5_bdo() {// PURPOSE: HTML5; should output self (i.e.: must be whitelisted); DATE:2014-01-03 + @Test public void Html5_bdo() {// PURPOSE: HTML5; should output self (i.e.: must be whitelisted); DATE:2014-01-03 fxt.Test_parse_page_wiki_str("a", "a"); } - @Test public void Pre_always_parsed() { // PURPOSE: pre should not interpret templates; DATE:2014-04-10 + @Test public void Pre_always_parsed() { // PURPOSE: pre should not interpret templates; DATE:2014-04-10 fxt.Init_defn_clear(); fxt.Init_defn_add("a", "a"); fxt.Init_defn_add("test", "
    {{a}}
    "); fxt.Test_parse_page_all_str("{{test}}", "
    {{a}}
    "); fxt.Init_defn_clear(); } - @Test public void Quote() {// PURPOSE: handle element; DATE:2015-05-29 + @Test public void Quote() {// PURPOSE: handle element; DATE:2015-05-29 fxt.Test_parse_page_wiki_str("a", "a"); } } diff --git a/400_xowa/src/gplx/xowa/parsers/xndes/Xop_xnde_wkr__blockquote_tst.java b/400_xowa/src/gplx/xowa/parsers/xndes/Xop_xnde_wkr__blockquote_tst.java index 0fd5ba7ad..f6530bd29 100644 --- a/400_xowa/src/gplx/xowa/parsers/xndes/Xop_xnde_wkr__blockquote_tst.java +++ b/400_xowa/src/gplx/xowa/parsers/xndes/Xop_xnde_wkr__blockquote_tst.java @@ -1,24 +1,24 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.parsers.xndes; import gplx.*; import gplx.xowa.*; import gplx.xowa.parsers.*; import org.junit.*; public class Xop_xnde_wkr__blockquote_tst { private final Xop_fxt fxt = new Xop_fxt(); @After public void term() {fxt.Init_para_n_();} - @Test public void Pre() { // PURPOSE: preserve leading spaces within blockquote; PAGE:en.w:Tenerife_airport_disaster + @Test public void Pre() { // PURPOSE: preserve leading spaces within blockquote; PAGE:en.w:Tenerife_airport_disaster fxt.Init_para_y_(); fxt.Test_parse_page_wiki_str(String_.Concat_lines_nl_skip_last ( "
    " @@ -31,7 +31,7 @@ public class Xop_xnde_wkr__blockquote_tst { )); fxt.Init_para_n_(); } - @Test public void Trailing_nls() { // PURPOSE: para/pre not working after blockquote; PAGE:en.w:Snappy_(software); DATE:2014-04-25 + @Test public void Trailing_nls() { // PURPOSE: para/pre not working after blockquote; PAGE:en.w:Snappy_(software); DATE:2014-04-25 fxt.Init_para_y_(); fxt.Test_parse_page_wiki_str(String_.Concat_lines_nl_skip_last ( "
    a" @@ -52,7 +52,7 @@ public class Xop_xnde_wkr__blockquote_tst { )); fxt.Init_para_n_(); } - @Test public void Dangling_multiple() { // PURPOSE: handle multiple dangling; PAGE:en.w:Ring_a_Ring_o'_Roses DATE:2014-06-26 + @Test public void Dangling_multiple() { // PURPOSE: handle multiple dangling; PAGE:en.w:Ring_a_Ring_o'_Roses DATE:2014-06-26 fxt.Test_parse_page_wiki_str("
    a
    b", "
    a
    b
    "); } } diff --git a/400_xowa/src/gplx/xowa/parsers/xndes/Xop_xnde_wkr__err_dangling_tst.java b/400_xowa/src/gplx/xowa/parsers/xndes/Xop_xnde_wkr__err_dangling_tst.java index fbf199589..e4d653d9d 100644 --- a/400_xowa/src/gplx/xowa/parsers/xndes/Xop_xnde_wkr__err_dangling_tst.java +++ b/400_xowa/src/gplx/xowa/parsers/xndes/Xop_xnde_wkr__err_dangling_tst.java @@ -1,57 +1,57 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.parsers.xndes; import gplx.*; import gplx.xowa.*; import gplx.xowa.parsers.*; import org.junit.*; import gplx.xowa.parsers.lists.*; public class Xop_xnde_wkr__err_dangling_tst { private final Xop_fxt fxt = new Xop_fxt(); @After public void term() {fxt.Init_para_n_();} - @Test public void Basic() { + @Test public void Basic() { fxt.Init_log_(Xop_xnde_log.Dangling_xnde) .Test_parse_page_wiki("
    ", fxt.tkn_xnde_(0, 5)); } - @Test public void Many() { + @Test public void Many() { fxt.Init_log_(Xop_xnde_log.Dangling_xnde, Xop_xnde_log.Dangling_xnde, Xop_xnde_log.Dangling_xnde) .Test_parse_page_wiki("
    ", fxt.tkn_xnde_(0, 15).Subs_(fxt.tkn_xnde_(5, 15).Subs_(fxt.tkn_xnde_(10, 15)))); } - @Test public void Nested() { + @Test public void Nested() { fxt.Test_parse_page_wiki_str ( "
    a
    " , "
    a
    " ); } - @Test public void Center() { + @Test public void Center() { fxt.Init_log_(Xop_xnde_log.Dangling_xnde).Test_parse_page_wiki("a
    b" , fxt.tkn_txt_(0, 1) , fxt.tkn_xnde_(1, 10).CloseMode_(Xop_xnde_tkn.CloseMode_open).Subs_(fxt.tkn_txt_(9, 10)) ); } - @Test public void P() { + @Test public void P() { fxt.Init_log_(Xop_xnde_log.Auto_closing_section).Test_parse_page_wiki("a

    b

    c

    " , fxt.tkn_txt_ (0, 1) , fxt.tkn_xnde_ (1, 4).Subs_(fxt.tkn_txt_(4, 5)) , fxt.tkn_xnde_ (5, 13).Subs_(fxt.tkn_txt_(8, 9)) ); } - @Test public void Alternating() { // PURPOSE: confirmation test for alternating dangling nodes; PAGE:en.w:Portal:Pornography/Selected_historical_image/Archive; DATE:2014-09-24 + @Test public void Alternating() { // PURPOSE: confirmation test for alternating dangling nodes; PAGE:en.w:Portal:Pornography/Selected_historical_image/Archive; DATE:2014-09-24 fxt.Test_parse_page_wiki_str ( "cde" , "cde" ); } - @Test public void Li() { // PURPOSE: auto-close
  • ; NOTE: no longer encloses in
      ; DATE:2014-06-26 + @Test public void Li() { // PURPOSE: auto-close
    • ; NOTE: no longer encloses in
        ; DATE:2014-06-26 fxt.Test_parse_page_wiki_str ( "
      • a
      • b" , String_.Concat_lines_nl_skip_last @@ -59,11 +59,11 @@ public class Xop_xnde_wkr__err_dangling_tst { , "
      • b
      • " )); } - @Test public void Br() { + @Test public void Br() { fxt.Test_parse_page_wiki("
        a" , fxt.tkn_xnde_(0, 4), fxt.tkn_txt_(4, 5)); fxt.Test_parse_page_wiki("a
        c", fxt.tkn_txt_(0, 1), fxt.tkn_xnde_(1, 12), fxt.tkn_txt_(12, 13)); } - @Test public void Td_and_td() { // PURPOSE: when "
  • a", 2nd should auto-close + @Test public void Td_and_td() { // PURPOSE: when "a", 2nd should auto-close fxt.Test_parse_page_wiki("
    a
    b
    " , fxt.tkn_tblw_tb_(0, 52).Subs_ ( fxt.tkn_tblw_tr_(7, 25).Subs_ @@ -76,7 +76,7 @@ public class Xop_xnde_wkr__err_dangling_tst { ) ); } - @Test public void Tblw_and_tr() {// PURPOSE:
    a
    " , fxt.tkn_tblw_tb_(0, 36).Subs_ ( fxt.tkn_tblw_tr_(7, 28).Subs_ @@ -110,7 +110,7 @@ public class Xop_xnde_wkr__err_dangling_tst { ) ); } - @Test public void Tblx_and_li() { // PURPOSE: should close list; see Stamp Act 1765 + @Test public void Tblx_and_li() { // PURPOSE: should close list; see Stamp Act 1765 fxt.Init_para_y_(); fxt.Test_parse_page_wiki_str(String_.Concat_lines_nl_skip_last ( " should close correctly; see Stamp Act 1765 + @Test public void Tblx_and_small() { // PURPOSE: should close correctly; see Stamp Act 1765 fxt.Init_para_y_(); fxt.Test_parse_page_wiki_str(String_.Concat_lines_nl_skip_last ( "
    " @@ -137,7 +137,7 @@ public class Xop_xnde_wkr__err_dangling_tst { ); fxt.Init_para_n_(); } - @Test public void Tblx_and_small() { // PURPOSE:
    " @@ -160,14 +160,14 @@ public class Xop_xnde_wkr__err_dangling_tst { ); fxt.Init_para_n_(); } - @Test public void Blockquote_and_p() { + @Test public void Blockquote_and_p() { fxt.Init_log_(Xop_xnde_log.Auto_closing_section).Test_parse_page_wiki("
    a

    b

    " , fxt.tkn_xnde_(0, 30).Subs_ ( fxt.tkn_txt_(12, 13) , fxt.tkn_xnde_(13, 17).Subs_(fxt.tkn_txt_(16, 17)) )); } - @Test public void List_and_b() { + @Test public void List_and_b() { fxt.Init_log_(Xop_xnde_log.Dangling_xnde).Test_parse_page_wiki("*a\n*" , fxt.tkn_list_bgn_(0, 1, Xop_list_tkn_.List_itmTyp_ul).List_path_(0) , fxt.tkn_xnde_(1, 7).Subs_(fxt.tkn_txt_(4, 5)) @@ -176,10 +176,10 @@ public class Xop_xnde_wkr__err_dangling_tst { , fxt.tkn_list_end_(7).List_path_(1) ); } - @Test public void Underline() { // PURPOSE: 2nd should auto-close; PAGE:en.b:Textbook_of_Psychiatry/Alcoholism_and_Psychoactive_Substance_Use_Disorders DATE:2014-09-05 + @Test public void Underline() { // PURPOSE: 2nd should auto-close; PAGE:en.b:Textbook_of_Psychiatry/Alcoholism_and_Psychoactive_Substance_Use_Disorders DATE:2014-09-05 fxt.Test_html_full_str("abc", "abc"); } - @Test public void Xtn_template() { // PURPOSE: dangling xtns within templates should be auto-closed inside template, not in calling page; PAGE:en.w:Provinces_and_territories_of_Canada DATE:2014-11-13 + @Test public void Xtn_template() { // PURPOSE: dangling xtns within templates should be auto-closed inside template, not in calling page; PAGE:en.w:Provinces_and_territories_of_Canada DATE:2014-11-13 fxt.Init_page_create("Template:A", "A"); fxt.Test_parse_page_all_str(String_.Concat_lines_nl_skip_last ( "{{A}}" @@ -193,7 +193,7 @@ public class Xop_xnde_wkr__err_dangling_tst { , " b" )); } - @Test public void Section_inline() { // PURPOSE.FIX:do not output trailing '' after '' PAGE:en.w:National_Popular_Vote_Interstate_Compact DATE:2017-04-10 + @Test public void Section_inline() { // PURPOSE.FIX:do not output trailing '' after '' PAGE:en.w:National_Popular_Vote_Interstate_Compact DATE:2017-04-10 fxt.Init_page_create("Template:Abc", "
    val
    "); fxt.Test_parse_page_tmpl_str(String_.Concat_lines_nl_skip_last ( "{{Abc}}" diff --git a/400_xowa/src/gplx/xowa/parsers/xndes/Xop_xnde_wkr__err_malformed_tst.java b/400_xowa/src/gplx/xowa/parsers/xndes/Xop_xnde_wkr__err_malformed_tst.java index 6043ba927..e2aeb73f6 100644 --- a/400_xowa/src/gplx/xowa/parsers/xndes/Xop_xnde_wkr__err_malformed_tst.java +++ b/400_xowa/src/gplx/xowa/parsers/xndes/Xop_xnde_wkr__err_malformed_tst.java @@ -1,30 +1,30 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.parsers.xndes; import gplx.*; import gplx.xowa.*; import gplx.xowa.parsers.*; import org.junit.*; public class Xop_xnde_wkr__err_malformed_tst { private final Xop_fxt fxt = new Xop_fxt(); @After public void term() {fxt.Init_para_n_();} - @Test public void Lt_only() { + @Test public void Lt_only() { fxt.Test_parse_page_wiki("<", fxt.tkn_txt_(0, 1)); } - @Test public void Eos_while_closing_tag() { + @Test public void Eos_while_closing_tag() { fxt.Init_log_(Xop_xnde_log.Eos_while_closing_tag).Test_parse_page_wiki("

    ; DATE:2014-01-18 + @Test public void End_tag_broken() { // chk that name_bgn is less than src_len else arrayIndex error; EX:

    ; DATE:2014-01-18 fxt.Wiki().Xtn_mgr().Init_by_wiki(fxt.Wiki()); fxt.Test_parse_page_all_str("

    ", String_.Concat_lines_nl_skip_last ( "

    " @@ -34,17 +34,17 @@ public class Xop_xnde_wkr__err_malformed_tst { , "
    " )); } - @Test public void Incomplete_tag_div() { // PURPOSE: handle broken tags; EX:
    -> <div a; DATE:2014-02-03 + @Test public void Incomplete_tag_div() { // PURPOSE: handle broken tags; EX:
    -> <div a; DATE:2014-02-03 fxt.Test_parse_page_all_str("
    ", "<div a
    "); // note that "
    " is literally printed; // TIDY.dangling: tidy will correct dangling node; DATE:2014-07-22 } - @Test public void Incomplete_tag_ref() {// PURPOSE: invalid tag shouldn't break parser; EX:w:Cullen_(surname); "http://www.surnamedb.com/Surname/Cullen to be ; EX: w:Exchange_value + @Test public void Inline_tag_fix() { // PURPOSE: force to be ; EX: w:Exchange_value fxt.Init_log_(Xop_xnde_log.No_inline); fxt.Test_parse_page_all_str("", ""); } - @Test public void Tblw() { // PURPOSE.fix: don't auto-close past tblw PAGE:ro.b:Pagina_principala DATE:2014-06-26 + @Test public void Tblw() { // PURPOSE.fix: don't auto-close past tblw PAGE:ro.b:Pagina_principala DATE:2014-06-26 fxt.Test_parse_page_all_str(String_.Concat_lines_nl_skip_last ( "
    " , "{|" // this should stop xnde search @@ -64,7 +64,7 @@ public class Xop_xnde_wkr__err_malformed_tst { , "
    " )); } - @Test public void Incomplete_tag() { // PURPOSE: handle incomplete tag sequences; DATE:2014-10-22 + @Test public void Incomplete_tag() { // PURPOSE: handle incomplete tag sequences; DATE:2014-10-22 fxt.Test_parse_page_all_str("<", "<"); fxt.Test_parse_page_all_str("" @@ -38,7 +38,7 @@ public class Xop_xnde_wkr__err_misc_tst { )); fxt.Init_para_n_(); } - @Test public void Div_should_not_pop_past_td() { // PURPOSE: extra
    should not close
    that is outside of
    ; PAGE:en.w:Rome en.w:Ankara + @Test public void Div_should_not_pop_past_td() { // PURPOSE: extra should not close
    that is outside of
    ; PAGE:en.w:Rome en.w:Ankara fxt.Init_para_y_(); fxt.Test_parse_page_wiki_str(String_.Concat_lines_nl_skip_last ( "" @@ -111,7 +111,7 @@ public class Xop_xnde_wkr__err_misc_tst { )); fxt.Init_para_n_(); } - @Test public void Xnde_pops() { // PURPOSE: somehow xnde pops upper nde; PAGE:en.w:Greek government debt crisis; "History of government debt" + @Test public void Xnde_pops() { // PURPOSE: somehow xnde pops upper nde; PAGE:en.w:Greek government debt crisis; "History of government debt" fxt.Test_parse_page_wiki_str(String_.Concat_lines_nl_skip_last ( "" , "{|" @@ -130,13 +130,13 @@ public class Xop_xnde_wkr__err_misc_tst { , "" )); } - @Test public void Err_inline_extension() { + @Test public void Err_inline_extension() { fxt.Test_parse_page_all_str ( "" , "" ); } - @Test public void Xnde_para() { // PURPOSE: buggy code caused

    to close everything; keeping test b/c of

    logic + @Test public void Xnde_para() { // PURPOSE: buggy code caused

    to close everything; keeping test b/c of

    logic fxt.Test_parse_page_wiki_str(String_.Concat_lines_nl_skip_last ( "

    " , "" @@ -167,28 +167,28 @@ public class Xop_xnde_wkr__err_misc_tst { ) ); } - @Test public void Sup_bug() { // PURPOSE: occurred at ref of UK; a {{cite web|url=http://www.abc.gov/{{dead link|date=December 2011}}|title=UK}} b + @Test public void Sup_bug() { // PURPOSE: occurred at ref of UK; a {{cite web|url=http://www.abc.gov/{{dead link|date=December 2011}}|title=UK}} b fxt.Test_parse_page_wiki_str("x y z", "x y z"); } - @Test public void Br_backslash() { // PURPOSE: allow ; EX:w:Mosquito; [[Acalyptratae|Acalyptratae]] + @Test public void Br_backslash() { // PURPOSE: allow ; EX:w:Mosquito; [[Acalyptratae|Acalyptratae]] fxt.Test_parse_page_all_str("", "
    "); } - @Test public void Tt_does_not_repeat() { // PURPOSE: handle a; EX:w:Domain name registry + @Test public void Tt_does_not_repeat() { // PURPOSE: handle a; EX:w:Domain name registry fxt.Test_parse_page_all_str("a", "a"); } - @Test public void Loose_xnde_names() { // PURPOSE: MW allows and other variations; EX:w:2012_in_film + @Test public void Loose_xnde_names() { // PURPOSE: MW allows and other variations; EX:w:2012_in_film fxt.Test_parse_page_all_str("a", "a"); } - @Test public void Anchor_nested() { + @Test public void Anchor_nested() { fxt.Test_parse_page_all_str("bcd [[e]] f", "b<a>c<a>d e f"); } - @Test public void Img_should_not_be_xtn() { // PURPOSE: marked as .xtn; unclosed was escaping rest of text; PAGE:de.w:Wikipedia:Technik/Archiv/2014 DATE:2014-11-06 + @Test public void Img_should_not_be_xtn() { // PURPOSE: marked as .xtn; unclosed was escaping rest of text; PAGE:de.w:Wikipedia:Technik/Archiv/2014 DATE:2014-11-06 fxt.Test_parse_page_all_str("''a''", "<img>a"); } - @Test public void Invalid__percent() { // PURPOSE: invalidate xml tags with %; EX:; PAGE:pl.w:Scynk_nadrzewny; DATE:2016-08-07 + @Test public void Invalid__percent() { // PURPOSE: invalidate xml tags with %; EX:; PAGE:pl.w:Scynk_nadrzewny; DATE:2016-08-07 fxt.Test_parse_page_all_str("a", "<b%>a"); // NOTE: should be literally printed as , not transformed to } - @Test public void Meta_link() { // PURPOSE: meta and link tags should not print; EX: ; PAGE:fr.s:La_Dispute; DATE:2017-05-28 + @Test public void Meta_link() { // PURPOSE: meta and link tags should not print; EX: ; PAGE:fr.s:La_Dispute; DATE:2017-05-28 fxt.Test_parse_page_all_str("", ""); } } diff --git a/400_xowa/src/gplx/xowa/parsers/xndes/Xop_xnde_wkr__include_basic_tst.java b/400_xowa/src/gplx/xowa/parsers/xndes/Xop_xnde_wkr__include_basic_tst.java index 0326a5c5e..1a64baa3a 100644 --- a/400_xowa/src/gplx/xowa/parsers/xndes/Xop_xnde_wkr__include_basic_tst.java +++ b/400_xowa/src/gplx/xowa/parsers/xndes/Xop_xnde_wkr__include_basic_tst.java @@ -1,44 +1,44 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.parsers.xndes; import gplx.*; import gplx.xowa.*; import gplx.xowa.parsers.*; import org.junit.*; public class Xop_xnde_wkr__include_basic_tst { private final Xop_fxt fxt = new Xop_fxt(); @Before public void init() {fxt.Reset();} - @Test public void Tmpl_includeonly() {fxt.Test_parse_tmpl_str_test("abc" , "{{test}}", "abc");} - @Test public void Tmpl_noinclude() {fxt.Test_parse_tmpl_str_test("abc" , "{{test}}", "ac");} - @Test public void Tmpl_onlyinclude() {fxt.Test_parse_tmpl_str_test("abc" , "{{test}}", "b");} - @Test public void Tmpl_onlyinclude_nest() {fxt.Test_parse_tmpl_str_test("{{#ifeq:y|y|abc|n}}" , "{{test}}", "b");} // PURPOSE: check that onlyinclude handles (a) inside {{#if}} function (old engine did not); and (b) that abc are correctly added together - @Test public void Tmpl_onlyinclude_page() {// PURPOSE: handle scenario similar to {{FA Number}} where # of articles is buried in page between onlyinclude tags; added noinclude as additional stress test + @Test public void Tmpl_includeonly() {fxt.Test_parse_tmpl_str_test("abc" , "{{test}}", "abc");} + @Test public void Tmpl_noinclude() {fxt.Test_parse_tmpl_str_test("abc" , "{{test}}", "ac");} + @Test public void Tmpl_onlyinclude() {fxt.Test_parse_tmpl_str_test("abc" , "{{test}}", "b");} + @Test public void Tmpl_onlyinclude_nest() {fxt.Test_parse_tmpl_str_test("{{#ifeq:y|y|abc|n}}" , "{{test}}", "b");} // PURPOSE: check that onlyinclude handles (a) inside {{#if}} function (old engine did not); and (b) that abc are correctly added together + @Test public void Tmpl_onlyinclude_page() {// PURPOSE: handle scenario similar to {{FA Number}} where # of articles is buried in page between onlyinclude tags; added noinclude as additional stress test fxt.Init_page_create("Transclude_1", "abcd"); fxt.Test_parse_tmpl_str_test("{{:Transclude_1}}" , "{{test}}", "b"); } - @Test public void Tmpl_onlyinclude_page2() { // PURPOSE: handle scenario similar to PS3 wherein onlyinclude was being skipped (somewhat correctly) but following text (
    ) was also included
    +	@Test public void Tmpl_onlyinclude_page2() {	// PURPOSE: handle scenario similar to PS3 wherein onlyinclude was being skipped (somewhat correctly) but following text (
    ) was also included
     		fxt.Init_page_create("Transclude_2", "abcde
    f
    g"); fxt.Test_parse_tmpl_str_test("{{:Transclude_2}}" , "{{test}}", "bcd"); } - @Test public void Tmpl_noinclude_unmatched() { // PURPOSE.fix: ignore unmatched ; EX:fi.w:Sergio_Leone; DATE:2014-05-02 + @Test public void Tmpl_noinclude_unmatched() { // PURPOSE.fix: ignore unmatched ; EX:fi.w:Sergio_Leone; DATE:2014-05-02 fxt.Test_parse_tmpl_str_test("{{{1|}}}", "{{test|a}}", "a"); // was "{{{test|" } - @Test public void Wiki_includeonly() {fxt.Test_parse_page_all_str("abc" , "ac");} - @Test public void Wiki_noinclude() {fxt.Test_parse_page_all_str("abc" , "abc");} - @Test public void Wiki_onlyinclude() {fxt.Test_parse_page_all_str("abc" , "abc");} - @Test public void Wiki_oi_io() {fxt.Test_parse_page_all_str("abcde" , "abde");} - @Test public void Wiki_oi_io_tblw() { + @Test public void Wiki_includeonly() {fxt.Test_parse_page_all_str("abc" , "ac");} + @Test public void Wiki_noinclude() {fxt.Test_parse_page_all_str("abc" , "abc");} + @Test public void Wiki_onlyinclude() {fxt.Test_parse_page_all_str("abc" , "abc");} + @Test public void Wiki_oi_io() {fxt.Test_parse_page_all_str("abcde" , "abde");} + @Test public void Wiki_oi_io_tblw() { fxt.Test_parse_page_all_str(String_.Concat_lines_nl_skip_last ( "" , "{|" diff --git a/400_xowa/src/gplx/xowa/parsers/xndes/Xop_xnde_wkr__include_uncommon_tst.java b/400_xowa/src/gplx/xowa/parsers/xndes/Xop_xnde_wkr__include_uncommon_tst.java index 2c4ea782c..c2783457a 100644 --- a/400_xowa/src/gplx/xowa/parsers/xndes/Xop_xnde_wkr__include_uncommon_tst.java +++ b/400_xowa/src/gplx/xowa/parsers/xndes/Xop_xnde_wkr__include_uncommon_tst.java @@ -1,27 +1,27 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.parsers.xndes; import gplx.*; import gplx.xowa.*; import gplx.xowa.parsers.*; import org.junit.*; public class Xop_xnde_wkr__include_uncommon_tst { private final Xop_fxt fxt = new Xop_fxt(); @Before public void init() {fxt.Reset();} - @Test public void Ex_Tmpl_io_oi() { // PURPOSE: not parsing internals; PAGE:en.w:[[Template:MONTHNAME]] + @Test public void Ex_Tmpl_io_oi() { // PURPOSE: not parsing internals; PAGE:en.w:[[Template:MONTHNAME]] fxt.Test_parse_tmpl_str_test("{{#if:{{{1}}}|a|b}}c", "{{test|1}}", "a"); } - @Test public void Ex_Tmpl_io_subst() { // PURPOSE: and @gplx.Internal protected subst; PAGE:en.w:[[Template:Dubious]] + @Test public void Ex_Tmpl_io_subst() { // PURPOSE: and @gplx.Internal protected subst; PAGE:en.w:[[Template:Dubious]] fxt.Init_defn_clear(); fxt.Init_defn_add("mwo_print", "{{{1}}}"); fxt.Init_defn_add("substcheck", "SUBST"); @@ -41,7 +41,7 @@ public class Xop_xnde_wkr__include_uncommon_tst { , "SUBST\n"); fxt.Init_defn_clear(); } - @Test public void Ex_Tmpl_noinclude_prm_1() { // PURPOSE: should not process @gplx.Internal protected tkns; PAGE:en.w:[[Template:See]] + @Test public void Ex_Tmpl_noinclude_prm_1() { // PURPOSE: should not process @gplx.Internal protected tkns; PAGE:en.w:[[Template:See]] fxt.Init_defn_clear(); fxt.Init_defn_add("mwo_print", "{{{1}}}{{{2}}}"); fxt.Test_parse_tmpl_str_test @@ -51,14 +51,14 @@ public class Xop_xnde_wkr__include_uncommon_tst { ); fxt.Init_defn_clear(); } - @Test public void Ex_Tmpl_noinclude_prm_2() { // PURPOSE: should not process default tkn; + @Test public void Ex_Tmpl_noinclude_prm_2() { // PURPOSE: should not process default tkn; fxt.Test_parse_tmpl_str_test ( "{{#if: {{{x|y}}} | visible | hidden}}" // {{#if: {{{x|y}}} -> {{#if: {{{x|}} -> hidden , "{{test}}" , "hidden" ); } - @Test public void Ex_Tmpl_noinclude2() { // PURPOSE: should be separate from tkns {{convert|50|km|0|abbr=on}} + @Test public void Ex_Tmpl_noinclude2() { // PURPOSE: should be separate from tkns {{convert|50|km|0|abbr=on}} fxt.Init_defn_clear(); fxt.Init_defn_add("mwo_print", "{{{1}}}{{{2}}}"); fxt.Test_parse_tmpl_str_test @@ -68,41 +68,41 @@ public class Xop_xnde_wkr__include_uncommon_tst { ); fxt.Init_defn_clear(); } - @Test public void Exception_incompleteTag_matchNext() { // PURPOSE: "bde" , "{{test}}" , "ae" ); } - @Test public void Exception_noCloseTag() { + @Test public void Exception_noCloseTag() { fxt.Test_parse_tmpl_str_test ( "abcde" , "{{test}}" , "a" ); } - @Test public void Exception_inline() { + @Test public void Exception_inline() { fxt.Test_parse_tmpl_str_test ( "abcde" , "{{test}}" , "abcde" ); } - @Test public void Exception_inline_2() { + @Test public void Exception_inline_2() { fxt.Test_parse_tmpl_str_test ( "abcde" , "{{test}}" , "abcde" ); } - @Test public void Defect_onlyinclude_inside_template() { // PURPOSE: was eating up next template; PAGE:en.w:Wikipedia:Featured_articles + @Test public void Defect_onlyinclude_inside_template() { // PURPOSE: was eating up next template; PAGE:en.w:Wikipedia:Featured_articles fxt.Test_parse_page_all_str ( "{{formatnum: 1}} {{formatnum:2}}" , "1 2" ); } - @Test public void Only_include_preserves_nl() { // PURPOSE: given "a\n{|\n", "{|" should be table; PAGE:en.w:Wikipedia:Reference_desk + @Test public void Only_include_preserves_nl() { // PURPOSE: given "a\n{|\n", "{|" should be table; PAGE:en.w:Wikipedia:Reference_desk fxt.Test_parse_page_all_str(String_.Concat_lines_nl ( "a" , "==b==" @@ -116,7 +116,7 @@ public class Xop_xnde_wkr__include_uncommon_tst { , "c" )); } - @Test public void Only_include_interprets_template() { // PURPOSE: should interpret templates + @Test public void Only_include_interprets_template() { // PURPOSE: should interpret templates fxt.Init_defn_clear(); fxt.Init_defn_add("test", "see_me"); fxt.Test_parse_page_all_str(String_.Concat_lines_nl @@ -130,29 +130,29 @@ public class Xop_xnde_wkr__include_uncommon_tst { , "c" )); } - @Test public void Include_only_in_template_name() {// PURPOSE: includeonly in tmpl_name should be ignored; EX:de.w:Wikipedia:Projektdiskussion; DATE:2014-01-24 + @Test public void Include_only_in_template_name() {// PURPOSE: includeonly in tmpl_name should be ignored; EX:de.w:Wikipedia:Projektdiskussion; DATE:2014-01-24 fxt.Init_defn_clear(); fxt.Init_defn_add("test", "abc"); fxt.Test_parse_page_all_str("{{test}}", "abc"); } - @Test public void Include_only_in_transcluded_page() {// PURPOSE: include only in transcluded page should be ignored; EX:de.w:Wikipedia:Projektdiskussion; DATE:2014-01-24; DATE:2014-05-10 + @Test public void Include_only_in_transcluded_page() {// PURPOSE: include only in transcluded page should be ignored; EX:de.w:Wikipedia:Projektdiskussion; DATE:2014-01-24; DATE:2014-05-10 fxt.Init_page_create("page", "abc"); // create page in main ns fxt.Test_parse_page_all_str("{{:safesubst:page}}", "abc"); // will become {{:page}} which should then transclude page } - @Test public void Include_only_subst_in_function() {// PURPOSE: includeonly and subst inside function should be ignored; PAGE:en.w:WikiProject_Articles_for_creation/BLD_Preload; DATE:2014-04-29 + @Test public void Include_only_subst_in_function() {// PURPOSE: includeonly and subst inside function should be ignored; PAGE:en.w:WikiProject_Articles_for_creation/BLD_Preload; DATE:2014-04-29 fxt.Test_parse_page_all_str("{{subst:#expr:0}}", "0"); } - @Test public void Hdr() { // PURPOSE: includeonly should be evaluated during template parse; EX: es.b:Billar/T�cnica/Clases_de_puentes; DATE:2014-02-12 + @Test public void Hdr() { // PURPOSE: includeonly should be evaluated during template parse; EX: es.b:Billar/T�cnica/Clases_de_puentes; DATE:2014-02-12 fxt.Test_parse_page_all_str("==A==", "

    A

    \n"); } -// @Test public void Noinclude_nested() { // PURPOSE: nested noincludes don't work; th.w:ISO_3166-1;DATE:2014-04-06 +// @Test public void Noinclude_nested() { // PURPOSE: nested noincludes don't work; th.w:ISO_3166-1;DATE:2014-04-06 // fxt.Init_defn_clear(); // fxt.Init_defn_add("test", "abcde"); // fxt.Test_parse_page_all_str("{{test}}", "ae"); // } -// @Test public void Wiki_includeonly_ignore() {fxt.Test_parse_wiki_text("[[abc]]", "[[ac]]");} // FUTURE: ttl parses by idx, and ignores includeonly: WHEN: upon encountering; may need to redo in other parsers? - @Test public void Defect_noinclude_inside_main() { // PURPOSE: inside main was not returning content; PAGE:en.w:Wikipedia:Featured_articles +// @Test public void Wiki_includeonly_ignore() {fxt.Test_parse_wiki_text("[[abc]]", "[[ac]]");} // FUTURE: ttl parses by idx, and ignores includeonly: WHEN: upon encountering; may need to redo in other parsers? + @Test public void Defect_noinclude_inside_main() { // PURPOSE: inside main was not returning content; PAGE:en.w:Wikipedia:Featured_articles fxt.Init_defn_clear(); fxt.Init_defn_add("Test_tmpl", "{{:Test_page}}"); fxt.Data_create("Test_page", "a{{#expr:1}}c"); @@ -162,7 +162,7 @@ public class Xop_xnde_wkr__include_uncommon_tst { ); fxt.Init_defn_clear(); } - @Test public void Pre_and_includeonly() { // PAGE:https://en.wikipedia.org/wiki/BSD_licenses DATE:2014-05-23 + @Test public void Pre_and_includeonly() { // PAGE:https://en.wikipedia.org/wiki/BSD_licenses DATE:2014-05-23 fxt.Init_defn_add("pre2", "
    >{{{1}}}
    "); fxt.Test_parse_page_all_str ( "{{pre2|a}}" @@ -170,7 +170,7 @@ public class Xop_xnde_wkr__include_uncommon_tst { ( "
    a
    " )); } -// @Test public void Pre_and_includeonly2() { +// @Test public void Pre_and_includeonly2() { // fxt.Init_defn_add("pre2", ">{{{1}}}
    "); // fxt.Test_parse_page_all_str // ( "{{pre2|a}}" @@ -178,10 +178,10 @@ public class Xop_xnde_wkr__include_uncommon_tst { // ( "
    a
    " // )); // } - @Test public void Noinclude_inline_w_space_inside_safesubst() { // PURPOSE: "" did not work with safesubst b/c of space; PAGE:en.w:Wikipedia:Featured_picture_candidates; DATE:2014-06-24 + @Test public void Noinclude_inline_w_space_inside_safesubst() { // PURPOSE: "" did not work with safesubst b/c of space; PAGE:en.w:Wikipedia:Featured_picture_candidates; DATE:2014-06-24 fxt.Test_parse_tmpl_str_test("{{SAFESUBST:#if:val_exists|y|n}}", "{{test}}", "y"); } - @Test public void Subst() {// PURPOSE: handle subst-includeonly-subst combination; PAGE:pt.w:Argentina DATE:2014-09-24 + @Test public void Subst() {// PURPOSE: handle subst-includeonly-subst combination; PAGE:pt.w:Argentina DATE:2014-09-24 fxt.Init_defn_clear(); fxt.Init_defn_add("test", "{{subst:#switch:1|1=y|default=n}}"); //fxt.Init_defn_add("test", "{{subst:#switch:1|1=y|default=n}}"); // keeping around for debugging purposes diff --git a/400_xowa/src/gplx/xowa/parsers/xndes/Xop_xnde_wkr__li_tst.java b/400_xowa/src/gplx/xowa/parsers/xndes/Xop_xnde_wkr__li_tst.java index 273e1becf..d7aaa8781 100644 --- a/400_xowa/src/gplx/xowa/parsers/xndes/Xop_xnde_wkr__li_tst.java +++ b/400_xowa/src/gplx/xowa/parsers/xndes/Xop_xnde_wkr__li_tst.java @@ -1,24 +1,24 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.parsers.xndes; import gplx.*; import gplx.xowa.*; import gplx.xowa.parsers.*; import org.junit.*; public class Xop_xnde_wkr__li_tst { private final Xop_fxt fxt = new Xop_fxt(); @After public void term() {fxt.Init_para_n_();} - @Test public void Inside_tblx() { // PURPOSE: auto-close
  • (EX: "
  • a
  • ") was causing 3rd
  • to close incorrectly + @Test public void Inside_tblx() { // PURPOSE: auto-close
  • (EX: "
  • a
  • ") was causing 3rd
  • to close incorrectly fxt.Test_parse_page_wiki_str ( "
    • a
    • b
    • c
    " , String_.Concat_lines_nl_skip_last @@ -34,7 +34,7 @@ public class Xop_xnde_wkr__li_tst { , "" )); } - @Test public void Li_nested_inside_ul() { // PURPOSE: nested li in ul should not be escaped; DATE:2013-12-04 + @Test public void Li_nested_inside_ul() { // PURPOSE: nested li in ul should not be escaped; DATE:2013-12-04 fxt.Test_parse_page_wiki_str ( "
    • a
      • b
    " , String_.Concat_lines_nl_skip_last @@ -43,7 +43,7 @@ public class Xop_xnde_wkr__li_tst { , "
  • b
  • " // note that
  • b becomes
  • <li>b but
    • b should stay the same )); } - @Test public void Empty_ignored() { + @Test public void Empty_ignored() { fxt.Test_parse_page_wiki_str(String_.Concat_lines_nl_skip_last ( "
        " , "
      • a" @@ -60,7 +60,7 @@ public class Xop_xnde_wkr__li_tst { , "
      " )); } - @Test public void Empty_ignored_error() { // PAGE:en.w:Sukhoi_Su-47; "*
    • " causes error b/c tries to close non-existent node + @Test public void Empty_ignored_error() { // PAGE:en.w:Sukhoi_Su-47; "* " causes error b/c tries to close non-existent node fxt.Test_parse_page_wiki_str(String_.Concat_lines_nl_skip_last ( "* a" , "* " @@ -73,7 +73,7 @@ public class Xop_xnde_wkr__li_tst { , "
    " )); } - @Test public void Insert_nl() {// PURPOSE:
  • should always be separated by nl, or else items will merge, creating long horizontal scroll bar; EX:w:Music + @Test public void Insert_nl() {// PURPOSE:
  • should always be separated by nl, or else items will merge, creating long horizontal scroll bar; EX:w:Music fxt.Init_para_y_(); fxt.Test_parse_page_all_str("
    • a
    • b
    " , String_.Concat_lines_nl_skip_last @@ -84,7 +84,7 @@ public class Xop_xnde_wkr__li_tst { )); fxt.Init_para_n_(); } - @Test public void Duplicate() { // PURPOSE: redundant li; EX: "*
  • "; PAGE:it.w:Milano#Bibliographie; DATE:2013-07-23 + @Test public void Duplicate() { // PURPOSE: redundant li; EX: "*
  • "; PAGE:it.w:Milano#Bibliographie; DATE:2013-07-23 fxt.Test_parse_page_all_str("*
  • x
  • ", String_.Concat_lines_nl_skip_last ( "
      " , "
    • " @@ -93,7 +93,7 @@ public class Xop_xnde_wkr__li_tst { , "
    " )); } - @Test public void Dangling_inside_xnde() { // PURPOSE.TIDY: handle "
  • a
  • b"; PAGE:ro.w:Pagina principala; DATE:2014-06-26 + @Test public void Dangling_inside_xnde() { // PURPOSE.TIDY: handle "
  • a
  • b"; PAGE:ro.w:Pagina principala; DATE:2014-06-26 fxt.Test_parse_page_all_str("
  • a
  • b", String_.Concat_lines_nl_skip_last ( "
  • a" , "
  • b
  • " // TIDY: will (a) move to 1st line diff --git a/400_xowa/src/gplx/xowa/parsers/xndes/Xop_xnde_wkr__nowiki_tst.java b/400_xowa/src/gplx/xowa/parsers/xndes/Xop_xnde_wkr__nowiki_tst.java index 454532400..e52f64b39 100644 --- a/400_xowa/src/gplx/xowa/parsers/xndes/Xop_xnde_wkr__nowiki_tst.java +++ b/400_xowa/src/gplx/xowa/parsers/xndes/Xop_xnde_wkr__nowiki_tst.java @@ -1,30 +1,30 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.parsers.xndes; import gplx.*; import gplx.xowa.*; import gplx.xowa.parsers.*; import org.junit.*; public class Xop_xnde_wkr__nowiki_tst { private final Xop_fxt fxt = new Xop_fxt(); @After public void term() {fxt.Init_para_n_();} - @Test public void Basic() { + @Test public void Basic() { fxt.Test_parse_page_wiki_str ( "''a''b" , "''a''b" ); } - @Test public void Template() { + @Test public void Template() { fxt.Init_para_y_(); fxt.Init_defn_add("nowiki_test", "#a"); fxt.Test_parse_page_all_str @@ -36,37 +36,37 @@ public class Xop_xnde_wkr__nowiki_tst { )); fxt.Init_para_n_(); } - @Test public void H2() { // PAGE:en.w:HTML + @Test public void H2() { // PAGE:en.w:HTML fxt.Test_parse_page_all_str ( "a

    b

    c" , String_.Concat_lines_nl_skip_last ( "a<h1>b<h6>c" )); } - @Test public void Lnke() { // PAGE:en.w:Doomsday_argument; [0, 1] + @Test public void Lnke() { // PAGE:en.w:Doomsday_argument; [0, 1] fxt.Test_parse_page_wiki_str("a [0, 1] b", "a [0, 1] b"); // NOTE: not "0" + Byte_.To_str(160) + "1"; depend on browser to translate   } - @Test public void Xatrs_val_text() { + @Test public void Xatrs_val_text() { fxt.Test_parse_page_all_str ( "
    a>b
    " , String_.Concat_lines_nl_skip_last ( "
    b
    " )); } - @Test public void Xatrs_val_quote() { + @Test public void Xatrs_val_quote() { fxt.Test_parse_page_all_str ( "
    d
    " , String_.Concat_lines_nl_skip_last ( "
    d
    " )); } - @Test public void Xatrs_eq() { + @Test public void Xatrs_eq() { fxt.Test_parse_page_all_str("
      =\"a\" class=\"b\">
    • d
    ", String_.Concat_lines_nl_skip_last ( "
      " , "
    • d
    " )); } - @Test public void Tblw_atr() {// PURPOSE: nowiki breaks token + @Test public void Tblw_atr() {// PURPOSE: nowiki breaks token fxt.Test_parse_page_all_str(String_.Concat_lines_nl_skip_last ( "{|style=\"background-color:#FFCC99\"" , "|a" @@ -81,12 +81,12 @@ public class Xop_xnde_wkr__nowiki_tst { , "" )); } - @Test public void Prex() { // PURPOSE: nowikis inside pre should be ignored; DATE:2013-03-30 + @Test public void Prex() { // PURPOSE: nowikis inside pre should be ignored; DATE:2013-03-30 fxt.Test_parse_page_all_str("
    a<b
    " , "
    a<b
    "); // basic fxt.Test_parse_page_all_str("
    a<b
    " , "
    a<nowiki><<nowiki>b
    "); // not closed fxt.Test_parse_page_all_str("
    abc
    " , "
    <nowiki>abc</nowiki>
    "); // nested; this is wrong, but leave for now; should be abc } - @Test public void Prew() { // PURPOSE: space inside nowiki should be ignored; ru.b:Rubyn DATE:2014-07-03 + @Test public void Prew() { // PURPOSE: space inside nowiki should be ignored; ru.b:Rubyn DATE:2014-07-03 fxt.Init_para_y_(); fxt.Test_parse_page_all_str(String_.Concat_lines_nl ( " a" @@ -99,7 +99,7 @@ public class Xop_xnde_wkr__nowiki_tst { ); fxt.Init_para_n_(); } - @Test public void Prew_2() { // PURPOSE: prew should continue over nowiki, even if no space DATE:2014-07-03 + @Test public void Prew_2() { // PURPOSE: prew should continue over nowiki, even if no space DATE:2014-07-03 fxt.Init_para_y_(); fxt.Test_parse_page_all_str(String_.Concat_lines_nl ( " a" @@ -112,15 +112,15 @@ public class Xop_xnde_wkr__nowiki_tst { ); fxt.Init_para_n_(); } - @Test public void Code() { // PURPOSE.fix:HtmlNcr-escaped refs were being ignored; caused by HtmlTidy fix for frwiki templates;DATE:2013-06-27 + @Test public void Code() { // PURPOSE.fix:HtmlNcr-escaped refs were being ignored; caused by HtmlTidy fix for frwiki templates;DATE:2013-06-27 fxt.Test_parse_page_all_str("|:", "|:"); } - @Test public void Brack_end() { // PURPOSE: check that "]" is escaped; PAGE:en.w:Tall_poppy_syndrome; DATE:2014-07-23 + @Test public void Brack_end() { // PURPOSE: check that "]" is escaped; PAGE:en.w:Tall_poppy_syndrome; DATE:2014-07-23 fxt.Test_parse_page_all_str ( "[[[A]]]" , "[A]"); // was showing up as [[[A]]] } - @Test public void Tblw_tr() { // PURPOSE: dash should be escaped in nowiki PAGE:de.w:Liste_von_Vereinen_und_Vereinigungen_von_Gläubigen_(römisch-katholische_Kirche) DATE:2015-01-08 + @Test public void Tblw_tr() { // PURPOSE: dash should be escaped in nowiki PAGE:de.w:Liste_von_Vereinen_und_Vereinigungen_von_Gläubigen_(römisch-katholische_Kirche) DATE:2015-01-08 fxt.Test_parse_page_all_str(String_.Concat_lines_nl_skip_last ( "{|" , "|-" diff --git a/400_xowa/src/gplx/xowa/parsers/xndes/Xop_xnde_wkr__tblx_tst.java b/400_xowa/src/gplx/xowa/parsers/xndes/Xop_xnde_wkr__tblx_tst.java index 547d071de..4257b77d5 100644 --- a/400_xowa/src/gplx/xowa/parsers/xndes/Xop_xnde_wkr__tblx_tst.java +++ b/400_xowa/src/gplx/xowa/parsers/xndes/Xop_xnde_wkr__tblx_tst.java @@ -1,24 +1,24 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.parsers.xndes; import gplx.*; import gplx.xowa.*; import gplx.xowa.parsers.*; import org.junit.*; public class Xop_xnde_wkr__tblx_tst { private final Xop_fxt fxt = new Xop_fxt(); @After public void term() {fxt.Init_para_n_();} - @Test public void Table() { + @Test public void Table() { fxt.Test_parse_page_wiki("a
    b
    c" , fxt.tkn_txt_ ( 0, 1) , fxt.tkn_tblw_tb_(1, 35).Subs_ @@ -29,7 +29,7 @@ public class Xop_xnde_wkr__tblx_tst { , fxt.tkn_txt_ (35, 36) ); } - @Test public void Ws_bgn() { // PURPOSE: some templates return leading ws; PAGE:en.w:UK + @Test public void Ws_bgn() { // PURPOSE: some templates return leading ws; PAGE:en.w:UK fxt.Init_para_y_(); fxt.Test_parse_page_wiki_str(String_.Concat_lines_nl_skip_last ( " " @@ -49,7 +49,7 @@ public class Xop_xnde_wkr__tblx_tst { )); fxt.Init_para_n_(); } - @Test public void Td_in_lnki_should_be_ignored() {// PURPOSE: \n| inside lnki should not be interpreted as table cell; EX: uk.w:Дніпро; DATE:2014-03-11 + @Test public void Td_in_lnki_should_be_ignored() {// PURPOSE: \n| inside lnki should not be interpreted as table cell; EX: uk.w:Дніпро; DATE:2014-03-11 fxt.Init_para_y_(); fxt.Test_parse_page_wiki_str(String_.Concat_lines_nl_skip_last ( "
    " @@ -66,7 +66,7 @@ public class Xop_xnde_wkr__tblx_tst { )); fxt.Init_para_n_(); } - @Test public void Nl() { + @Test public void Nl() { fxt.Init_para_y_(); fxt.Test_parse_page_wiki_str ( "\n\n\n\n\n
    " diff --git a/400_xowa/src/gplx/xowa/parsers/xndes/Xop_xnde_wkr__text_block_tst.java b/400_xowa/src/gplx/xowa/parsers/xndes/Xop_xnde_wkr__text_block_tst.java index 1cc42d491..476d0a837 100644 --- a/400_xowa/src/gplx/xowa/parsers/xndes/Xop_xnde_wkr__text_block_tst.java +++ b/400_xowa/src/gplx/xowa/parsers/xndes/Xop_xnde_wkr__text_block_tst.java @@ -1,36 +1,36 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.parsers.xndes; import gplx.*; import gplx.xowa.*; import gplx.xowa.parsers.*; import org.junit.*; public class Xop_xnde_wkr__text_block_tst { private final Xop_fxt fxt = new Xop_fxt(); @After public void term() {fxt.Init_para_n_();} - @Test public void Source_wikitext() { // PURPOSE.ASSERT: wikitext should be rendered literally; DATE:2014-03-11 + @Test public void Source_wikitext() { // PURPOSE.ASSERT: wikitext should be rendered literally; DATE:2014-03-11 fxt.Test_parse_page_wiki_str("''a''", "
    ''a''
    "); } - @Test public void Source_nowiki() { // PURPOSE.ASSERT: onlyinclude should be rendered literally; DATE:2014-03-11 + @Test public void Source_nowiki() { // PURPOSE.ASSERT: onlyinclude should be rendered literally; DATE:2014-03-11 fxt.Test_parse_page_wiki_str("a", "
    <onlyinclude>a</onlyinclude>
    "); } - @Test public void Source_escape() { + @Test public void Source_escape() { fxt.Test_parse_page_wiki_str("", "
    <b>
    "); } - @Test public void Source_escape_amp() { // PURPOSE: < should be rendered as &lt; PAGE:uk.b:HTML; DATE:2014-03-11 + @Test public void Source_escape_amp() { // PURPOSE: < should be rendered as &lt; PAGE:uk.b:HTML; DATE:2014-03-11 fxt.Test_parse_page_wiki_str("<", "
    &lt;
    "); } - @Test public void Source_pre() { // PURPOSE: handle pre; PAGE:en.w:Comment_(computer_programming); DATE:2014-06-23 + @Test public void Source_pre() { // PURPOSE: handle pre; PAGE:en.w:Comment_(computer_programming); DATE:2014-06-23 fxt.Init_para_y_(); fxt.Test_parse_page_wiki_str(String_.Concat_lines_nl_skip_last ( " " @@ -43,16 +43,16 @@ public class Xop_xnde_wkr__text_block_tst { )); fxt.Init_para_n_(); } - @Test public void Code_dangling() { // PAGE:en.w:HTML; <i> and <center> tags. There are + @Test public void Code_dangling() { // PAGE:en.w:HTML; <i> and <center> tags. There are fxt.Test_parse_page_wiki_str("abc", "abc"); } - @Test public void Code_do_not_escape() { // PURPOSE: was mistakenly marked as escape, causing inner tags to be rendered incorrectly; PAGE:en.w:UTF8 + @Test public void Code_do_not_escape() { // PURPOSE: was mistakenly marked as escape, causing inner tags to be rendered incorrectly; PAGE:en.w:UTF8 fxt.Test_parse_page_all_str ( "0100100" , "0100100" ); } - @Test public void Pre_and_html_chars() {// PURPOSE:
     should handle '"<> according to context
    +	@Test public void Pre_and_html_chars() {// PURPOSE: 
     should handle '"<> according to context
     		fxt.Test_parse_page_all_str("
    a	b
    " , "
    a	b
    "); // known ncr/dec; embed and depend on browser transforming; EX: de.w:Wikipedia:Technik/Skin/Werkstatt fxt.Test_parse_page_all_str("
    a�b
    " , "
    a&#9999999999;b
    "); // unknown ncr/dec; escape & (since browser cannot render); fxt.Test_parse_page_all_str("
    a&#af ;b
    " , "
    a&#af ;b
    "); // unknown ncr/dec 2 @@ -61,7 +61,7 @@ public class Xop_xnde_wkr__text_block_tst { fxt.Test_parse_page_all_str("
    a&apox;b
    " , "
    a&apox;b
    "); // unknown name; escape fxt.Test_parse_page_all_str("
    &\"<>
    " , "
    &"<>
    "); // no ncr or name; escape; needed for
    ; PAGE:en.w:Alt attribute } - @Test public void Pre_and_space() {// PURPOSE: make sure pre does not careate

    around it; also, make sure " a" is preserved; DATE:2014-02-20 + @Test public void Pre_and_space() {// PURPOSE: make sure pre does not careate

    around it; also, make sure " a" is preserved; DATE:2014-02-20 fxt.Init_para_y_(); fxt.Test_parse_page_wiki_str(String_.Concat_lines_nl_skip_last ( "
    "
    diff --git a/400_xowa/src/gplx/xowa/parsers/xndes/Xop_xnde_wkr__tidy_tst.java b/400_xowa/src/gplx/xowa/parsers/xndes/Xop_xnde_wkr__tidy_tst.java
    index 7cb8cd37a..db1006781 100644
    --- a/400_xowa/src/gplx/xowa/parsers/xndes/Xop_xnde_wkr__tidy_tst.java
    +++ b/400_xowa/src/gplx/xowa/parsers/xndes/Xop_xnde_wkr__tidy_tst.java
    @@ -1,40 +1,40 @@
    -/*
    -XOWA: the XOWA Offline Wiki Application
    -Copyright (C) 2012-2017 gnosygnu@gmail.com
    -
    -XOWA is licensed under the terms of the General Public License (GPL) Version 3,
    -or alternatively under the terms of the Apache License Version 2.0.
    -
    -You may use XOWA according to either of these licenses as is most appropriate
    -for your project on a case-by-case basis.
    -
    -The terms of each license can be found in the source code repository:
    -
    -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt
    -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt
    -*/
    +/*
    +XOWA: the XOWA Offline Wiki Application
    +Copyright (C) 2012-2017 gnosygnu@gmail.com
    +
    +XOWA is licensed under the terms of the General Public License (GPL) Version 3,
    +or alternatively under the terms of the Apache License Version 2.0.
    +
    +You may use XOWA according to either of these licenses as is most appropriate
    +for your project on a case-by-case basis.
    +
    +The terms of each license can be found in the source code repository:
    +
    +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt
    +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt
    +*/
     package gplx.xowa.parsers.xndes; import gplx.*; import gplx.xowa.*; import gplx.xowa.parsers.*;
     import org.junit.*;
     public class Xop_xnde_wkr__tidy_tst {
     	private final    Xop_fxt fxt = new Xop_fxt();
     	@After public void term() {fxt.Init_para_n_();}
    -	@Test  public void Sub_sup_autocorrect() {
    +	@Test public void Sub_sup_autocorrect() {
     		fxt.Test_parse_page_wiki_str("ab", "ab");
     		fxt.Test_parse_page_wiki_str("ab", "ab");
     	}
    -	@Test  public void Span_font_autocorrect() {	// PURPOSE: force  to close ; EX:w:Rupee; DATE:2014-04-07
    +	@Test public void Span_font_autocorrect() {	// PURPOSE: force  to close ; EX:w:Rupee; DATE:2014-04-07
     		fxt.Test_parse_page_wiki_str("ab", "ab");
     	}
    -	@Test  public void Move_ws_char() {
    +	@Test public void Move_ws_char() {
     		fxt.Test_parse_page_all_str("a b c", "a b c");
     	}
    -	@Test  public void Move_ws_ent() {
    +	@Test public void Move_ws_ent() {
     		fxt.Test_parse_page_all_str("a b c", "a b c");
     	}
    -	@Test  public void Ignore_empty_tags() {	// PURPOSE: ignore tag if marked ignore_empty; EX:uk.b:HTML; DATE:2014-03-12
    +	@Test public void Ignore_empty_tags() {	// PURPOSE: ignore tag if marked ignore_empty; EX:uk.b:HTML; DATE:2014-03-12
     		fxt.Test_parse_page_all_str("a
    b", "ab");
     	}
    -//		@Test  public void Escaped_div() {	// NOTE: WP 
    a
    b; MW:
    a
    b
    // REVISIT: 2012-05-11; WP does harder split-span +// @Test public void Escaped_div() { // NOTE: WP
    a
    b; MW:
    a
    b
    // REVISIT: 2012-05-11; WP does harder split-span // fxt.Init_log_(Xop_xnde_log.Auto_closing_section, Xop_xnde_log.Escaped_xnde).Test_parse_page_wiki("
    " // , fxt.tkn_xnde_(0, 17).Subs_ // ( fxt.tkn_xnde_(5, 11)) diff --git a/400_xowa/src/gplx/xowa/parsers/xndes/Xop_xnde_wkr__xatrs_tst.java b/400_xowa/src/gplx/xowa/parsers/xndes/Xop_xnde_wkr__xatrs_tst.java index 9cdde21e1..b0ef98587 100644 --- a/400_xowa/src/gplx/xowa/parsers/xndes/Xop_xnde_wkr__xatrs_tst.java +++ b/400_xowa/src/gplx/xowa/parsers/xndes/Xop_xnde_wkr__xatrs_tst.java @@ -1,52 +1,52 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.parsers.xndes; import gplx.*; import gplx.xowa.*; import gplx.xowa.parsers.*; import org.junit.*; public class Xop_xnde_wkr__xatrs_tst { private final Xop_fxt fxt = new Xop_fxt(); @After public void term() {fxt.Init_para_n_();} - @Test public void Inline() { + @Test public void Inline() { fxt.Test_parse_page_wiki("" , fxt.tkn_xnde_(0, 15).Atrs_rng_(5, 13)); fxt.Test_parse_page_wiki("" , fxt.tkn_xnde_(0, 21).Atrs_rng_(5, 19)); // ws } - @Test public void Bgn() { + @Test public void Bgn() { fxt.Test_parse_page_wiki("
    " , fxt.tkn_xnde_(0, 19).Atrs_rng_(5, 12)); // basic } - @Test public void Repeated() { // PURPOSE: if atr is repeated, take 1st, not last; EX: it.u:Dipartimento:Fisica_e_Astronomia; DATE:2014-02-09 + @Test public void Repeated() { // PURPOSE: if atr is repeated, take 1st, not last; EX: it.u:Dipartimento:Fisica_e_Astronomia; DATE:2014-02-09 fxt.Test_parse_page_all_str("a" , "a"); // two fxt.Test_parse_page_all_str("a" , "a"); // three } - @Test public void Non_ws() { // PURPOSE: is valid; symbols function as ws + @Test public void Non_ws() { // PURPOSE: is valid; symbols function as ws fxt.Test_parse_page_wiki("" , fxt.tkn_xnde_(0, 7).Atrs_rng_(3, 5)); } - @Test public void Invalid() { // PURPOSE: make sure brx does not match br + @Test public void Invalid() { // PURPOSE: make sure brx does not match br fxt.Test_parse_page_wiki("" , fxt.tkn_bry_(0, 1), fxt.tkn_txt_(1, 6)); } - @Test public void Id_encode() { + @Test public void Id_encode() { fxt.Test_parse_page_all_str("
    ", "
    "); } - @Test public void Lt_should_not_be_escaped_in_input() { // PURPOSE: options textboxes were escaped if input's value had "<"; DATE:2014-07-04 + @Test public void Lt_should_not_be_escaped_in_input() { // PURPOSE: options textboxes were escaped if input's value had "<"; DATE:2014-07-04 fxt.Page().Html_data().Html_restricted_n_(); fxt.Test_parse_page_wiki_str("", ""); // NOTE: do not call parse_page_all_str which will call Page.Clear and reset Restricted fxt.Page().Html_data().Html_restricted_y_(); } - @Test public void Style__decode() { // PURPOSE: style values should be decoded; PAGE:en.w:Boron; DATE:2015-07-29 + @Test public void Style__decode() { // PURPOSE: style values should be decoded; PAGE:en.w:Boron; DATE:2015-07-29 fxt.Test_parse_page_all_str("a", "a"); } -// @Test public void Unclosed() { // PURPOSE: unclosed atr should be treated as key, which should be ignored; PAGE:en.w:Palace of Versailles +// @Test public void Unclosed() { // PURPOSE: unclosed atr should be treated as key, which should be ignored; PAGE:en.w:Palace of Versailles // fxt.Test_parse_page_wiki_str(String_.Concat_lines_nl_skip_last // ( "a" // id="1� -> key named 'id="1�' which fails whitelist keys // , "" diff --git a/400_xowa/src/gplx/xowa/specials/Xow_special_wtr__base.java b/400_xowa/src/gplx/xowa/specials/Xow_special_wtr__base.java index 46a6b5261..b12803898 100644 --- a/400_xowa/src/gplx/xowa/specials/Xow_special_wtr__base.java +++ b/400_xowa/src/gplx/xowa/specials/Xow_special_wtr__base.java @@ -1,18 +1,18 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.specials; import gplx.*; import gplx.xowa.*; import gplx.langs.mustaches.*; import gplx.xowa.wikis.pages.*; public abstract class Xow_special_wtr__base { @@ -28,7 +28,7 @@ public abstract class Xow_special_wtr__base { Bld_tags(app, addon_dir, page_data); page_data.Apply(page); } - @gplx.Virtual protected byte[] Bld_html_body(Io_url addon_dir, gplx.langs.mustaches.Mustache_doc_itm itm) { + protected byte[] Bld_html_body(Io_url addon_dir, gplx.langs.mustaches.Mustache_doc_itm itm) { byte[] tmpl = Io_mgr.Instance.LoadFilBry(this.Get_mustache_fil(addon_dir)); return gplx.langs.mustaches.Mustache_wtr_.Write_to_bry(Bry_bfr_.New(), tmpl, itm); } @@ -37,7 +37,7 @@ public abstract class Xow_special_wtr__base { protected abstract Io_url Get_mustache_fil(Io_url addon_dir); protected abstract Mustache_doc_itm Bld_mustache_root(Xoa_app app); protected abstract void Bld_tags(Xoa_app app, Io_url addon_dir, Xopage_html_data data); - @gplx.Virtual protected void Handle_invalid(Xoa_app app, Xoa_page page, Xow_special_page special) { + protected void Handle_invalid(Xoa_app app, Xoa_page page, Xow_special_page special) { new Xopage_html_data(special.Special__meta().Display_ttl(), Bry_.new_a7("Not available")).Apply(page); } } diff --git a/400_xowa/src/gplx/xowa/specials/allPages/Xows_page_allpages_tst.java b/400_xowa/src/gplx/xowa/specials/allPages/Xows_page_allpages_tst.java index 1f8090f21..e5f8fac61 100644 --- a/400_xowa/src/gplx/xowa/specials/allPages/Xows_page_allpages_tst.java +++ b/400_xowa/src/gplx/xowa/specials/allPages/Xows_page_allpages_tst.java @@ -1,25 +1,25 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.specials.allPages; import gplx.*; import gplx.xowa.*; import gplx.xowa.specials.*; import org.junit.*; import gplx.core.net.*; import gplx.core.net.qargs.*; import gplx.xowa.wikis.data.tbls.*; import gplx.xowa.wikis.nss.*; import gplx.xowa.wikis.tdbs.hives.*; public class Xows_page_allpages_tst { @Before public void init() {fxt.Clear();} private Xows_page_allpages_fxt fxt = new Xows_page_allpages_fxt(); - @Test public void Build_data() { + @Test public void Build_data() { Xow_hive_mgr_fxt.Ttls_create_rng(fxt.Wiki(), 5, 7); fxt.Clear().Init_ttl_leaf("/B1").Expd_prv("A3").Expd_nxt("B6").Expd_ttls("B1", "B2", "B3", "B4", "B5").Test_build_data(); // SpecialPage:AllPages/B1 fxt.Clear().Init_arg("from", "B1").Expd_prv("A3").Expd_nxt("B6").Expd_ttls("B1", "B2", "B3", "B4", "B5").Test_build_data(); // single file @@ -30,7 +30,7 @@ public class Xows_page_allpages_tst { fxt.Clear().Init_arg("from", "B1").Init_arg("hideredirects", "1").Expd_prv("A0").Expd_nxt("C4").Expd_ttls("B2", "B4", "B6", "C0", "C2").Test_build_data(); // hide redirects fxt.Clear().Init_arg("from", "A6").Expd_prv("A0").Expd_nxt("E1").Init_itms_per_page(23).Expd_ttls("A6", "B0", "B1", "B2", "B3", "B4", "B5", "B6", "C0", "C1", "C2", "C3", "C4", "C5", "C6", "D0", "D1", "D2", "D3", "D4", "D5", "D6", "E0").Test_build_data(); // overflow rhs x2 } - @Test public void Build_html_main() { + @Test public void Build_html_main() { Xow_hive_mgr_fxt.Ttls_create_rng(fxt.Wiki(), 5, 7); fxt.Clear().Init_arg("from", "B2").Init_itms_per_page(5).Test_build_html(String_.Concat_lines_nl ( "" @@ -61,7 +61,7 @@ public class Xows_page_allpages_tst { , "" )); } - @Test public void Build_html_redirect() { + @Test public void Build_html_redirect() { Xow_hive_mgr_fxt.Ttls_create_rng(fxt.Wiki(), 1, 7); fxt.Clear().Init_arg("from", "A2").Init_arg("hideredirects", "1").Init_itms_per_page(2).Test_build_html(String_.Concat_lines_nl ( "
    " @@ -87,7 +87,7 @@ public class Xows_page_allpages_tst { , "" )); } - @Test public void Build_html_ns() { + @Test public void Build_html_ns() { Xow_hive_mgr_fxt.Ttls_create_rng(fxt.Wiki(), fxt.Wiki().Ns_mgr().Ns_template(), 1, 7); fxt.Clear().Init_arg("from", "A2").Init_arg("namespace", "10").Init_itms_per_page(2).Test_build_html(String_.Concat_lines_nl ( "
    " @@ -113,7 +113,7 @@ public class Xows_page_allpages_tst { , "" )); } - @Test public void Misc() { + @Test public void Misc() { Xow_hive_mgr_fxt.Ttls_create_rng(fxt.Wiki(), fxt.Wiki().Ns_mgr().Ns_template(), 1, 7); fxt.Clear().Init_arg("from", "Template:B1").Expd_arg("from", "B1").Expd_arg("namespace", "10").Test_build_data(); // extract ns from ttl fxt.Clear().Init_arg("from", "Template:B1").Expd_display_ttl("All pages").Expd_address_page("Special:AllPages").Test_special_gen(); // display ttl diff --git a/400_xowa/src/gplx/xowa/specials/nearby/Nearby_mgr_tst.java b/400_xowa/src/gplx/xowa/specials/nearby/Nearby_mgr_tst.java index f13adb913..12dc46f05 100644 --- a/400_xowa/src/gplx/xowa/specials/nearby/Nearby_mgr_tst.java +++ b/400_xowa/src/gplx/xowa/specials/nearby/Nearby_mgr_tst.java @@ -1,40 +1,40 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.specials.nearby; import gplx.*; import gplx.xowa.*; import gplx.xowa.specials.*; import org.junit.*; public class Nearby_mgr_tst { @Before public void init() {fxt.Clear();} Nearby_mgr_fxt fxt = new Nearby_mgr_fxt(); - @Test public void Basic() { + @Test public void Basic() { fxt.Init_page("A", "[[B]]"); fxt.Test_find("A", "B", "A|B"); } - @Test public void Shortest() { + @Test public void Shortest() { fxt.Init_page("A", "[[B]]"); fxt.Init_page("B", "[[C]] [[D]]"); fxt.Init_page("C", "[[D]]"); fxt.Test_find("A", "D", "A|B|D"); fxt.Init_results_max(2).Test_find("A", "D", "A|B|D", "A|B|C|D"); } - @Test public void Circular() { + @Test public void Circular() { fxt.Init_page("A", "[[B]]"); fxt.Init_page("B", "[[C]]"); fxt.Init_page("C", "[[A]]"); fxt.Test_find("A", "D", ""); } - @Test public void Page_doesnt_exist() { + @Test public void Page_doesnt_exist() { fxt.Init_page("A", "[[B]]"); fxt.Test_find("A", "C", ""); } diff --git a/400_xowa/src/gplx/xowa/specials/statistics/Xop_statistics_page_tst.java b/400_xowa/src/gplx/xowa/specials/statistics/Xop_statistics_page_tst.java index 5def6f603..b2a74465c 100644 --- a/400_xowa/src/gplx/xowa/specials/statistics/Xop_statistics_page_tst.java +++ b/400_xowa/src/gplx/xowa/specials/statistics/Xop_statistics_page_tst.java @@ -1,23 +1,23 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.specials.statistics; import gplx.*; import gplx.xowa.*; import gplx.xowa.specials.*; import org.junit.*; public class Xop_statistics_page_tst { @Before public void init() {fxt.Clear();} private Xop_statistics_page_fxt fxt = new Xop_statistics_page_fxt(); - @Test public void Basic() { + @Test public void Basic() { fxt.Test_html(String_.Concat_lines_nl_skip_last ( "
    " , "
    " diff --git a/400_xowa/src/gplx/xowa/users/Xou_user_tst.java b/400_xowa/src/gplx/xowa/users/Xou_user_tst.java index 3da511b04..acbfa0a82 100644 --- a/400_xowa/src/gplx/xowa/users/Xou_user_tst.java +++ b/400_xowa/src/gplx/xowa/users/Xou_user_tst.java @@ -1,23 +1,23 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.users; import gplx.*; import gplx.xowa.*; import org.junit.*; import gplx.xowa.wikis.xwikis.*; public class Xou_user_tst { private final Xou_user_fxt fxt = new Xou_user_fxt(); - @Test public void Available_from_fsys() { + @Test public void Available_from_fsys() { Io_mgr.Instance.CreateDir(fxt.App().Fsys_mgr().Wiki_dir().GenSubDir("en.wikipedia.org")); fxt.App().Usere().Available_from_fsys(); fxt.Test_xwikis diff --git a/400_xowa/src/gplx/xowa/users/data/Xoud_opt_scope_tst.java b/400_xowa/src/gplx/xowa/users/data/Xoud_opt_scope_tst.java index 3c3caf565..eda6ed671 100644 --- a/400_xowa/src/gplx/xowa/users/data/Xoud_opt_scope_tst.java +++ b/400_xowa/src/gplx/xowa/users/data/Xoud_opt_scope_tst.java @@ -1,25 +1,25 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.users.data; import gplx.*; import gplx.xowa.*; import gplx.xowa.users.*; import org.junit.*; import gplx.xowa.langs.*; import gplx.xowa.wikis.domains.*; public class Xoud_opt_scope_tst { private Xoud_opt_scope_fxt fxt = new Xoud_opt_scope_fxt(); @Before public void init() {fxt.Clear();} - @Test public void Basic() { + @Test public void Basic() { fxt.Test_parse("en.w" , fxt.Make(Xol_lang_stub_.Id_en, Xow_domain_tid_.Tid__wikipedia)); fxt.Test_parse("en.*" , fxt.Make(Xol_lang_stub_.Id_en, Xoud_opt_scope.Type_id_wildcard)); fxt.Test_parse("*.w" , fxt.Make(Xoud_opt_scope.Lang_id_wildcard, Xow_domain_tid_.Tid__wikipedia)); diff --git a/400_xowa/src/gplx/xowa/users/data/Xoud_regy_tbl.java b/400_xowa/src/gplx/xowa/users/data/Xoud_regy_tbl.java index 56476d970..605ad4b3b 100644 --- a/400_xowa/src/gplx/xowa/users/data/Xoud_regy_tbl.java +++ b/400_xowa/src/gplx/xowa/users/data/Xoud_regy_tbl.java @@ -1,18 +1,18 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.users.data; import gplx.*; import gplx.xowa.*; import gplx.xowa.users.*; import gplx.dbs.*; import gplx.dbs.qrys.*; import gplx.dbs.metas.*; import gplx.dbs.metas.updates.*; public class Xoud_regy_tbl { @@ -37,19 +37,19 @@ public class Xoud_regy_tbl { } return this; } private Db_conn conn; - @gplx.Virtual public void Insert(String grp, String key, String val) { + public void Insert(String grp, String key, String val) { if (stmt_insert == null) stmt_insert = Db_stmt_.new_insert_(conn, Tbl_name, Flds__all); stmt_insert.Clear().Val_str(grp).Val_str(key).Val_str(val).Exec_insert(); } - @gplx.Virtual public void Update(String grp, String key, String val) { + public void Update(String grp, String key, String val) { if (stmt_update == null) stmt_update = Db_stmt_.new_update_(conn, Tbl_name, String_.Ary(Fld_regy_grp, Fld_regy_key), Fld_regy_val); stmt_update.Clear().Val_str(val).Val_str(grp).Val_str(key).Exec_update(); } - @gplx.Virtual public void Delete(String grp, String key) { + public void Delete(String grp, String key) { if (stmt_delete == null) stmt_delete = Db_stmt_.new_delete_(conn, Tbl_name, Fld_regy_grp, Fld_regy_key); stmt_delete.Clear().Val_str(grp).Val_str(key).Exec_delete(); } - @gplx.Virtual public void Select_by_grp(List_adp rv, String grp) { + public void Select_by_grp(List_adp rv, String grp) { if (stmt_select_grp == null) stmt_select_grp = Db_stmt_.new_select_as_rdr(conn, Db_qry__select_in_tbl.new_(Tbl_name, String_.Ary(Fld_regy_grp), Flds__all, Db_qry__select_in_tbl.Order_by_null)); Db_rdr rdr = stmt_select_grp.Clear().Val_str(grp).Exec_select__rls_manual(); try { @@ -60,7 +60,7 @@ public class Xoud_regy_tbl { } finally {rdr.Rls();} } - @gplx.Virtual public String Select_val(String grp, String key) { + public String Select_val(String grp, String key) { if (stmt_select_key == null) stmt_select_key = Db_stmt_.new_select_as_rdr(conn, Db_qry__select_in_tbl.new_(Tbl_name, String_.Ary(Fld_regy_grp, Fld_regy_key), Flds__all, Db_qry__select_in_tbl.Order_by_null)); Db_rdr rdr = stmt_select_key.Clear().Val_str(Fld_regy_grp, grp).Val_str(Fld_regy_key, key).Exec_select__rls_manual(); String rv = null; diff --git a/400_xowa/src/gplx/xowa/users/history/Xou_history_mgr_tst.java b/400_xowa/src/gplx/xowa/users/history/Xou_history_mgr_tst.java index 1516b7cb2..c9e11fb43 100644 --- a/400_xowa/src/gplx/xowa/users/history/Xou_history_mgr_tst.java +++ b/400_xowa/src/gplx/xowa/users/history/Xou_history_mgr_tst.java @@ -1,24 +1,24 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.users.history; import gplx.*; import gplx.xowa.*; import gplx.xowa.users.*; import org.junit.*; public class Xou_history_mgr_tst { private Xou_history_mgr_fxt fxt = new Xou_history_mgr_fxt(); @Before public void init() {fxt.Clear();} - @Test public void Archive() { + @Test public void Archive() { Datetime_now.Manual_y_(); // NOTE: each DateTime_.Now() advances clock by 1 min; adding a new Datetime_now.Get() anywhere will throw off times on this test; DATE:2014-04-01 fxt.Invk(Xou_history_mgr.Invk_current_itms_max_, 4).Invk(Xou_history_mgr.Invk_current_itms_reset_, 2); fxt.Add_many("A", "B", "C", "D", "E"); @@ -30,17 +30,17 @@ public class Xou_history_mgr_tst { , "20010101 000100.000|20010101 000100.000|1|en.wikipedia.org|A" )); } - @Test public void Normalize() { + @Test public void Normalize() { fxt.Clear(); fxt.Add_many("Category:A_B", "Category:A B", "Category:a B", "Category:_A B_"); fxt.List_tst("Category:A_B"); } - @Test public void Args() { + @Test public void Args() { fxt.Clear(); fxt.Add_one("Special:AllPages", "?from=A"); fxt.List_tst("Special:AllPages?from=A"); } - @Test public void Remove_nl() { + @Test public void Remove_nl() { fxt.Clear(); fxt.Add_many("Category:A?pagefrom=B\nB"); fxt.List_tst("Category:A?pagefrom=B"); diff --git a/400_xowa/src/gplx/xowa/users/wikis/Xofs_url_itm_parser_tst.java b/400_xowa/src/gplx/xowa/users/wikis/Xofs_url_itm_parser_tst.java index ebbeebdc2..5113c2c7d 100644 --- a/400_xowa/src/gplx/xowa/users/wikis/Xofs_url_itm_parser_tst.java +++ b/400_xowa/src/gplx/xowa/users/wikis/Xofs_url_itm_parser_tst.java @@ -1,26 +1,26 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.users.wikis; import gplx.*; import gplx.xowa.*; import gplx.xowa.users.*; import org.junit.*; import gplx.core.envs.*; public class Xofs_url_itm_parser_tst { @Before public void init() {fxt.Clear();} private Xofs_url_itm_parser_fxt fxt = new Xofs_url_itm_parser_fxt(); - @Test public void Custom() {fxt.Test_parse_custom("/xowa/wiki/en.wikipedia.org/");} - @Test public void Lnx() {fxt.Init_dir_spr_lnx().Init_name("xowa", "/xowa") .Test_parse("xowa-fs://~{xowa}/bin/any/", "/xowa/bin/any/");} - @Test public void Wnt() {fxt.Init_dir_spr_wnt().Init_name("xowa", "C:\\xowa") .Test_parse("xowa-fs://~{xowa}/bin/any/", "C:\\xowa\\bin\\any\\");} - @Test public void Outliers() { + @Test public void Custom() {fxt.Test_parse_custom("/xowa/wiki/en.wikipedia.org/");} + @Test public void Lnx() {fxt.Init_dir_spr_lnx().Init_name("xowa", "/xowa") .Test_parse("xowa-fs://~{xowa}/bin/any/", "/xowa/bin/any/");} + @Test public void Wnt() {fxt.Init_dir_spr_wnt().Init_name("xowa", "C:\\xowa") .Test_parse("xowa-fs://~{xowa}/bin/any/", "C:\\xowa\\bin\\any\\");} + @Test public void Outliers() { fxt.Init_name("xowa", "/xowa"); fxt.Test_parse("xowa-fs://ab" , "ab"); // no subst fxt.Test_parse("xowa-fs://a~b" , "a~b"); // tilde diff --git a/400_xowa/src/gplx/xowa/wikis/data/tbls/Xowd_page_itm_tst.java b/400_xowa/src/gplx/xowa/wikis/data/tbls/Xowd_page_itm_tst.java index faa27abc1..591c336d6 100644 --- a/400_xowa/src/gplx/xowa/wikis/data/tbls/Xowd_page_itm_tst.java +++ b/400_xowa/src/gplx/xowa/wikis/data/tbls/Xowd_page_itm_tst.java @@ -1,23 +1,23 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.wikis.data.tbls; import gplx.*; import gplx.xowa.*; import gplx.xowa.wikis.*; import gplx.xowa.wikis.data.*; import org.junit.*; import gplx.xowa.wikis.data.tbls.*; import gplx.xowa.wikis.nss.*; public class Xowd_page_itm_tst { @Before public void init() {fxt.Init();} private Xowd_page_itm_fxt fxt = new Xowd_page_itm_fxt(); - @Test public void Ttl_() { + @Test public void Ttl_() { fxt.Test_ttl_("User_talk:A", Xow_ns_.Tid__user_talk, "A"); fxt.Test_ttl_("User talk:A", Xow_ns_.Tid__user_talk, "A"); } diff --git a/400_xowa/src/gplx/xowa/wikis/data/tbls/Xowd_page_tbl_tst.java b/400_xowa/src/gplx/xowa/wikis/data/tbls/Xowd_page_tbl_tst.java index 8f07ccfa9..4ef97cb98 100644 --- a/400_xowa/src/gplx/xowa/wikis/data/tbls/Xowd_page_tbl_tst.java +++ b/400_xowa/src/gplx/xowa/wikis/data/tbls/Xowd_page_tbl_tst.java @@ -1,23 +1,23 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.wikis.data.tbls; import gplx.*; import gplx.xowa.*; import gplx.xowa.wikis.*; import gplx.xowa.wikis.data.*; import org.junit.*; import gplx.xowa.bldrs.*; import gplx.xowa.addons.wikis.ctgs.*; import gplx.dbs.*; import gplx.xowa.wikis.data.tbls.*; public class Xowd_page_tbl_tst { private Xowd_page_tbl_fxt fxt = new Xowd_page_tbl_fxt(); - @Test public void Find_search_end() { + @Test public void Find_search_end() { fxt.Test_find_search_end("ab", "ac"); fxt.Test_find_search_end("ab%", "ac%"); } diff --git a/400_xowa/src/gplx/xowa/wikis/domains/Xow_abrv_wm_tst.java b/400_xowa/src/gplx/xowa/wikis/domains/Xow_abrv_wm_tst.java index 6b1916a32..fcded0154 100644 --- a/400_xowa/src/gplx/xowa/wikis/domains/Xow_abrv_wm_tst.java +++ b/400_xowa/src/gplx/xowa/wikis/domains/Xow_abrv_wm_tst.java @@ -1,23 +1,23 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.wikis.domains; import gplx.*; import gplx.xowa.*; import gplx.xowa.wikis.*; import org.junit.*; import gplx.xowa.langs.*; public class Xow_abrv_wm_tst { private Xow_abrv_wm_fxt fxt = new Xow_abrv_wm_fxt(); - @Test public void Parse() { + @Test public void Parse() { fxt.Test_parse("foundationwiki" , Xol_lang_stub_.Id__intl , Xow_domain_tid_.Tid__wmfblog); fxt.Test_parse("wikidatawiki" , Xol_lang_stub_.Id__intl , Xow_domain_tid_.Tid__wikidata); fxt.Test_parse("mediawikiwiki" , Xol_lang_stub_.Id__intl , Xow_domain_tid_.Tid__mediawiki); @@ -37,34 +37,34 @@ public class Xow_abrv_wm_tst { fxt.Test_parse_null("unknown"); fxt.Test_parse("plwikimedia" , Xol_lang_stub_.Id_pl , Xow_domain_tid_.Tid__wikimedia); } - @Test public void Parse_override() { + @Test public void Parse_override() { fxt.Test_parse("arwikimedia" , Xol_lang_stub_.Id_es , Xow_domain_tid_.Tid__wikimedia); fxt.Test_parse("ukwikimedia" , Xol_lang_stub_.Id_uk , Xow_domain_tid_.Tid__wikimedia); } - @Test public void To_domain_itm() { + @Test public void To_domain_itm() { fxt.Test_to_domain_itm("enwiki" , "en" , "en.wikipedia.org"); fxt.Test_to_domain_itm("zh_yuewiki" , "zh-yue" , "zh-yue.wikipedia.org"); } - @Test public void To_domain_bry() { + @Test public void To_domain_bry() { fxt.Test_to_domain_bry("enwiki" , "en.wikipedia.org"); fxt.Test_to_domain_bry("zh_yuewiki" , "zh-yue.wikipedia.org"); fxt.Test_to_domain_bry("arwikimedia", "ar.wikimedia.org"); fxt.Test_to_domain_bry("ukwikimedia", "ua.wikimedia.org"); } - @Test public void To_abrv() { + @Test public void To_abrv() { fxt.Test_to_abrv("simple.wikipedia.org" , "simplewiki"); fxt.Test_to_abrv("en.wikipedia.org" , "enwiki"); fxt.Test_to_abrv("commons.wikimedia.org" , "commonswiki"); } - @Test public void To_abrv_by_lang() { + @Test public void To_abrv_by_lang() { fxt.Test_to_abrv_by_lang("en", Xow_domain_tid_.Tid__wikipedia, "enwiki"); } - @Test public void Wikimania() { + @Test public void Wikimania() { fxt.Test_parse("wikimaniawiki", Xol_lang_stub_.Id__intl, Xow_domain_tid_.Tid__wikimania); fxt.Test_to_domain_itm("wikimaniawiki", "", "wikimania.wikimedia.org"); fxt.Test_to_abrv("wikimania.wikimedia.org", "wikimaniawiki"); } - @Test public void Wikisources() { + @Test public void Wikisources() { fxt.Test_parse("sourceswiki", Xol_lang_stub_.Id_en, Xow_domain_tid_.Tid__wikisource_org); fxt.Test_to_domain_itm("sourceswiki", "", "wikisource.org"); fxt.Test_to_abrv("wikisource.org", "sourceswiki"); diff --git a/400_xowa/src/gplx/xowa/wikis/domains/Xow_abrv_xo__tst.java b/400_xowa/src/gplx/xowa/wikis/domains/Xow_abrv_xo__tst.java index 1ac4659e2..ad2e207a5 100644 --- a/400_xowa/src/gplx/xowa/wikis/domains/Xow_abrv_xo__tst.java +++ b/400_xowa/src/gplx/xowa/wikis/domains/Xow_abrv_xo__tst.java @@ -1,23 +1,23 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.wikis.domains; import gplx.*; import gplx.xowa.*; import gplx.xowa.wikis.*; import org.junit.*; public class Xow_abrv_xo__tst { @Before public void init() {fxt.Clear();} private final Xow_abrv_xo__fxt fxt = new Xow_abrv_xo__fxt(); - @Test public void Basic() { + @Test public void Basic() { fxt.Test("en.wikipedia.org" , "en.w"); // multi.enwiki fxt.Test("fr.wiktionary.org" , "fr.d"); // multi.frwiktionary fxt.Test("commons.wikimedia.org" , "c"); // important.unique.commons diff --git a/400_xowa/src/gplx/xowa/wikis/domains/Xow_domain_itm_tst.java b/400_xowa/src/gplx/xowa/wikis/domains/Xow_domain_itm_tst.java index c2ffbbe5f..072a62662 100644 --- a/400_xowa/src/gplx/xowa/wikis/domains/Xow_domain_itm_tst.java +++ b/400_xowa/src/gplx/xowa/wikis/domains/Xow_domain_itm_tst.java @@ -1,37 +1,37 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.wikis.domains; import gplx.*; import gplx.xowa.*; import gplx.xowa.wikis.*; import org.junit.*; import gplx.core.tests.*; public class Xow_domain_itm_tst { private final Xow_domain_fxt fxt = new Xow_domain_fxt(); - @Test public void Parse_en_wikipedia() {fxt.Test_parse("en.wikipedia.org" , "en" , "en" , Xow_domain_tid_.Tid__wikipedia);} - @Test public void Parse_fr_wikipedia() {fxt.Test_parse("fr.wikipedia.org" , "fr" , "fr" , Xow_domain_tid_.Tid__wikipedia);} - @Test public void Parse_en_wiktionary() {fxt.Test_parse("en.wiktionary.org" , "en" , "en" , Xow_domain_tid_.Tid__wiktionary);} - @Test public void Parse_zh_classical_wikipedia() {fxt.Test_parse("zh-classical.wikipedia.org" , "zh-classical" , "lzh" , Xow_domain_tid_.Tid__wikipedia);} - @Test public void Parse_commons() {fxt.Test_parse("commons.wikimedia.org" , "" , "" , Xow_domain_tid_.Tid__commons);} - @Test public void Parse_species() {fxt.Test_parse("species.wikimedia.org" , "" , "" , Xow_domain_tid_.Tid__species);} - @Test public void Parse_ru_wikimedia_org() {fxt.Test_parse("ru.wikimedia.org" , "ru" , "ru" , Xow_domain_tid_.Tid__wikimedia);} - @Test public void Parse_home() {fxt.Test_parse("home" , "" , "" , Xow_domain_tid_.Tid__home);} - @Test public void Parse_other() {fxt.Test_parse("other.wiki" , "" , "" , Xow_domain_tid_.Tid__other);} - @Test public void Parse_ua_wikimedia_org() {fxt.Test_parse("ua.wikimedia.org" , "ua" , "uk" , Xow_domain_tid_.Tid__wikimedia);} - @Test public void Parse_ar_wikimedia_org() {fxt.Test_parse("ar.wikimedia.org" , "ar" , "es" , Xow_domain_tid_.Tid__wikimedia);} - @Test public void Parse_wikimania() {fxt.Test_parse("wikimania.wikimedia.org" , "" , "" , Xow_domain_tid_.Tid__wikimania);} - @Test public void Parse_wikisource_org() {fxt.Test_parse("wikisource.org" , "" , "" , Xow_domain_tid_.Tid__wikisource_org);} - @Test public void Parse_blank() {fxt.Test_parse("" , "" , "" , Xow_domain_tid_.Tid__other);} - @Test public void Match_lang() { + @Test public void Parse_en_wikipedia() {fxt.Test_parse("en.wikipedia.org" , "en" , "en" , Xow_domain_tid_.Tid__wikipedia);} + @Test public void Parse_fr_wikipedia() {fxt.Test_parse("fr.wikipedia.org" , "fr" , "fr" , Xow_domain_tid_.Tid__wikipedia);} + @Test public void Parse_en_wiktionary() {fxt.Test_parse("en.wiktionary.org" , "en" , "en" , Xow_domain_tid_.Tid__wiktionary);} + @Test public void Parse_zh_classical_wikipedia() {fxt.Test_parse("zh-classical.wikipedia.org" , "zh-classical" , "lzh" , Xow_domain_tid_.Tid__wikipedia);} + @Test public void Parse_commons() {fxt.Test_parse("commons.wikimedia.org" , "" , "" , Xow_domain_tid_.Tid__commons);} + @Test public void Parse_species() {fxt.Test_parse("species.wikimedia.org" , "" , "" , Xow_domain_tid_.Tid__species);} + @Test public void Parse_ru_wikimedia_org() {fxt.Test_parse("ru.wikimedia.org" , "ru" , "ru" , Xow_domain_tid_.Tid__wikimedia);} + @Test public void Parse_home() {fxt.Test_parse("home" , "" , "" , Xow_domain_tid_.Tid__home);} + @Test public void Parse_other() {fxt.Test_parse("other.wiki" , "" , "" , Xow_domain_tid_.Tid__other);} + @Test public void Parse_ua_wikimedia_org() {fxt.Test_parse("ua.wikimedia.org" , "ua" , "uk" , Xow_domain_tid_.Tid__wikimedia);} + @Test public void Parse_ar_wikimedia_org() {fxt.Test_parse("ar.wikimedia.org" , "ar" , "es" , Xow_domain_tid_.Tid__wikimedia);} + @Test public void Parse_wikimania() {fxt.Test_parse("wikimania.wikimedia.org" , "" , "" , Xow_domain_tid_.Tid__wikimania);} + @Test public void Parse_wikisource_org() {fxt.Test_parse("wikisource.org" , "" , "" , Xow_domain_tid_.Tid__wikisource_org);} + @Test public void Parse_blank() {fxt.Test_parse("" , "" , "" , Xow_domain_tid_.Tid__other);} + @Test public void Match_lang() { fxt.Test__match_lang_y("en", "en.wikipedia.org", "en.wiktionary.org", "simple.wikipedia.org", "species.wikimedia.org", "www.wikidata.org", "commons.wikimedia.org"); fxt.Test__match_lang_y("fr", "fr.wikipedia.org", "fr.wiktionary.org"); fxt.Test__match_lang_y("zh", "zh-classical.wikipedia.org"); diff --git a/400_xowa/src/gplx/xowa/wikis/domains/Xow_domain_uid__tst.java b/400_xowa/src/gplx/xowa/wikis/domains/Xow_domain_uid__tst.java index 2807be403..9e9d5e516 100644 --- a/400_xowa/src/gplx/xowa/wikis/domains/Xow_domain_uid__tst.java +++ b/400_xowa/src/gplx/xowa/wikis/domains/Xow_domain_uid__tst.java @@ -1,23 +1,23 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.wikis.domains; import gplx.*; import gplx.xowa.*; import gplx.xowa.wikis.*; import org.junit.*; public class Xow_domain_uid__tst { @Before public void init() {fxt.Clear();} private final Xow_domain_uid__fxt fxt = new Xow_domain_uid__fxt(); - @Test public void Basic() { + @Test public void Basic() { fxt.Test(Xow_domain_uid_.Tid_commons , "commons.wikimedia.org" , "", Xow_domain_tid_.Tid__commons); fxt.Test(100 , "en.wikipedia.org" , "en", Xow_domain_tid_.Tid__wikipedia); } diff --git a/400_xowa/src/gplx/xowa/wikis/modules/Xow_module_base.java b/400_xowa/src/gplx/xowa/wikis/modules/Xow_module_base.java index 3ec41cbfe..ed3833f5a 100644 --- a/400_xowa/src/gplx/xowa/wikis/modules/Xow_module_base.java +++ b/400_xowa/src/gplx/xowa/wikis/modules/Xow_module_base.java @@ -13,16 +13,16 @@ The terms of each license can be found in the source code repository: GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt */ -package gplx.xowa.wikis.modules; import gplx.*; import gplx.xowa.*; import gplx.xowa.wikis.*; -public class Xow_module_base implements Gfo_invk { - public byte Enabled() {return enabled;} private byte enabled = Bool_.__byte; - public boolean Enabled_y() {return enabled == Bool_.Y_byte;} - public boolean Enabled_n() {return enabled == Bool_.N_byte;} - @gplx.Virtual public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) { - if (ctx.Match(k, Invk_enabled)) return Yn.To_nullable_str(enabled); - else if (ctx.Match(k, Invk_enabled_)) enabled = Yn.To_nullable_byte(m.ReadStr("v")); - else return Gfo_invk_.Rv_unhandled; - return this; - } - private static final String Invk_enabled = "enabled", Invk_enabled_ = "enabled_"; -} +package gplx.xowa.wikis.modules; import gplx.*; import gplx.xowa.*; import gplx.xowa.wikis.*; +public class Xow_module_base implements Gfo_invk { + public byte Enabled() {return enabled;} private byte enabled = Bool_.__byte; + public boolean Enabled_y() {return enabled == Bool_.Y_byte;} + public boolean Enabled_n() {return enabled == Bool_.N_byte;} + public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) { + if (ctx.Match(k, Invk_enabled)) return Yn.To_nullable_str(enabled); + else if (ctx.Match(k, Invk_enabled_)) enabled = Yn.To_nullable_byte(m.ReadStr("v")); + else return Gfo_invk_.Rv_unhandled; + return this; + } + private static final String Invk_enabled = "enabled", Invk_enabled_ = "enabled_"; +} diff --git a/400_xowa/src/gplx/xowa/wikis/nss/Xow_ns_mgr_tst.java b/400_xowa/src/gplx/xowa/wikis/nss/Xow_ns_mgr_tst.java index 95c027793..b08fd6922 100644 --- a/400_xowa/src/gplx/xowa/wikis/nss/Xow_ns_mgr_tst.java +++ b/400_xowa/src/gplx/xowa/wikis/nss/Xow_ns_mgr_tst.java @@ -1,30 +1,30 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.wikis.nss; import gplx.*; import gplx.xowa.*; import gplx.xowa.wikis.*; import org.junit.*; import gplx.xowa.langs.cases.*; public class Xow_ns_mgr_tst { @Before public void init() {fxt.Clear();} private Xow_ns_mgr_fxt fxt = new Xow_ns_mgr_fxt(); - @Test public void Basic() {fxt.ini_ns_(-2, 0, 1).run_Ords_sort().tst_Ords(-2, -100, 0, 1);} - @Test public void Talk_skip() {fxt.ini_ns_(-2, 0, 2, 3).run_Ords_sort().tst_Ords(-2, -100, 0, 1, 2, 3);} - @Test public void Subj_skip() {fxt.ini_ns_(-2, 1, 2, 3).run_Ords_sort().tst_Ords(-2, -100, 0, 1, 2, 3);} - @Test public void Out_of_order() {fxt.ini_ns_(3, 1, 2, -2).run_Ords_sort().tst_Ords(-2, -100, 0, 1, 2, 3);} - @Test public void Skip_odd() {fxt.ini_ns_(-2, 1, 3).run_Ords_sort().tst_Ords(-2, -100, 0, 1, 2, 3);} - @Test public void Skip_even() {fxt.ini_ns_(-2, 2, 4).run_Ords_sort().tst_Ords(-2, -100, 2, 3, 4, 5);} - @Test public void Ns_alias() { + @Test public void Basic() {fxt.ini_ns_(-2, 0, 1).run_Ords_sort().tst_Ords(-2, -100, 0, 1);} + @Test public void Talk_skip() {fxt.ini_ns_(-2, 0, 2, 3).run_Ords_sort().tst_Ords(-2, -100, 0, 1, 2, 3);} + @Test public void Subj_skip() {fxt.ini_ns_(-2, 1, 2, 3).run_Ords_sort().tst_Ords(-2, -100, 0, 1, 2, 3);} + @Test public void Out_of_order() {fxt.ini_ns_(3, 1, 2, -2).run_Ords_sort().tst_Ords(-2, -100, 0, 1, 2, 3);} + @Test public void Skip_odd() {fxt.ini_ns_(-2, 1, 3).run_Ords_sort().tst_Ords(-2, -100, 0, 1, 2, 3);} + @Test public void Skip_even() {fxt.ini_ns_(-2, 2, 4).run_Ords_sort().tst_Ords(-2, -100, 2, 3, 4, 5);} + @Test public void Ns_alias() { fxt.Ns_mgr().Aliases_clear(); fxt.Ns_mgr().Add_new(Xow_ns_.Tid__template, "Template"); fxt.Ns_mgr().Aliases_add(Xow_ns_.Tid__template, "Templatex"); @@ -32,7 +32,7 @@ public class Xow_ns_mgr_tst { byte[] name = Bry_.new_a7("Templatex:Abc"); Tfds.Eq(10, fxt.Ns_mgr().Tmpls_get_w_colon(name, 0, name.length)); } - @Test public void Utf8() {// PURPOSE: handle different casings for ns_names; PAGE:ru.w:Портрет_итальянского_Ренессанса DATE:2014-07-04 + @Test public void Utf8() {// PURPOSE: handle different casings for ns_names; PAGE:ru.w:Портрет_итальянского_Ренессанса DATE:2014-07-04 Xow_ns_mgr ns_mgr = new Xow_ns_mgr(Xol_case_mgr_.U8()); ns_mgr.Add_new(1234, "Test"); ns_mgr.Add_new(1235, "файл"); diff --git a/400_xowa/src/gplx/xowa/wikis/nss/Xow_ns_tst.java b/400_xowa/src/gplx/xowa/wikis/nss/Xow_ns_tst.java index 72c269cb2..a1df520e8 100644 --- a/400_xowa/src/gplx/xowa/wikis/nss/Xow_ns_tst.java +++ b/400_xowa/src/gplx/xowa/wikis/nss/Xow_ns_tst.java @@ -1,23 +1,23 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.wikis.nss; import gplx.*; import gplx.xowa.*; import gplx.xowa.wikis.*; import org.junit.*; -public class Xow_ns_tst { +public class Xow_ns_tst { @Before public void init() {fxt.Clear();} private Xow_ns_fxt fxt = new Xow_ns_fxt(); - @Test public void Category() { + @Test public void Category() { fxt .Expd_id_subjId_(Xow_ns_.Tid__category) .Expd_id_talkId_(Xow_ns_.Tid__category_talk) .Expd_id_subj_(Bool_.Y) @@ -25,7 +25,7 @@ public class Xow_ns_tst { .Test(Xow_ns_.Tid__category) ; } - @Test public void Category_talk() { + @Test public void Category_talk() { fxt .Expd_id_subjId_(Xow_ns_.Tid__category) .Expd_id_talkId_(Xow_ns_.Tid__category_talk) .Expd_id_subj_(Bool_.N) @@ -33,7 +33,7 @@ public class Xow_ns_tst { .Test(Xow_ns_.Tid__category_talk) ; } - @Test public void Special() { + @Test public void Special() { fxt .Expd_id_subjId_(Xow_ns_.Tid__special) .Expd_id_talkId_(Xow_ns_.Tid__special) .Expd_id_subj_(Bool_.Y) diff --git a/400_xowa/src/gplx/xowa/wikis/pages/redirects/Xopg_redirect_mgr__tst.java b/400_xowa/src/gplx/xowa/wikis/pages/redirects/Xopg_redirect_mgr__tst.java index c5e1eeca5..6a2f05567 100644 --- a/400_xowa/src/gplx/xowa/wikis/pages/redirects/Xopg_redirect_mgr__tst.java +++ b/400_xowa/src/gplx/xowa/wikis/pages/redirects/Xopg_redirect_mgr__tst.java @@ -1,26 +1,26 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.wikis.pages.redirects; import gplx.*; import gplx.xowa.*; import gplx.xowa.wikis.*; import gplx.xowa.wikis.pages.*; import org.junit.*; import gplx.core.tests.*; import gplx.xowa.specials.*; public class Xopg_redirect_mgr__tst { @Before public void init() {fxt.Clear();} private final Xopg_redirect_mgr__fxt fxt = new Xopg_redirect_mgr__fxt(); - @Test public void Basic() { + @Test public void Basic() { fxt.Test__Itms__add__special(fxt.Make_meta("XowaTest"), Keyval_.Ary_empty, fxt.Make__itm("en.wikipedia.org/wiki/Special:XowaTest", "Special:XowaTest", null)); } - @Test public void Args() { + @Test public void Args() { fxt.Test__Itms__add__special ( fxt.Make_meta("XowaTest"), Keyval_.Ary(Keyval_.new_("k1", "v1"), Keyval_.new_("k2", "v2"), Keyval_.new_("k3", "v3")) , fxt.Make__itm("en.wikipedia.org/wiki/Special:XowaTest?k1=v1&k2=v2&k3=v3", "Special:XowaTest", null) diff --git a/400_xowa/src/gplx/xowa/wikis/tdbs/Xotdb_fsys_mgr_tst.java b/400_xowa/src/gplx/xowa/wikis/tdbs/Xotdb_fsys_mgr_tst.java index ff8d36c78..e54e449b8 100644 --- a/400_xowa/src/gplx/xowa/wikis/tdbs/Xotdb_fsys_mgr_tst.java +++ b/400_xowa/src/gplx/xowa/wikis/tdbs/Xotdb_fsys_mgr_tst.java @@ -1,24 +1,24 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.wikis.tdbs; import gplx.*; import gplx.xowa.*; import gplx.xowa.wikis.*; import org.junit.*; import gplx.xowa.wikis.tdbs.*; import gplx.xowa.wikis.nss.*; public class Xotdb_fsys_mgr_tst { @Before public void init() {fxt.Clear();} private final Xow_fsys_mgr_fxt fxt = new Xow_fsys_mgr_fxt(); - @Test public void Basic() { + @Test public void Basic() { fxt.Zip_(Xotdb_dir_info_.Tid_page, Bool_.N).Url_ns_fil(Xotdb_dir_info_.Tid_page, Xow_ns_.Tid__main, 123, "mem/xowa/wiki/en.wikipedia.org/ns/000/page/00/00/00/01/0000000123.xdat"); fxt.Zip_(Xotdb_dir_info_.Tid_page, Bool_.Y).Url_ns_fil(Xotdb_dir_info_.Tid_page, Xow_ns_.Tid__main, 123, "mem/xowa/wiki/en.wikipedia.org/ns/000/page_zip/00/00/00/01/0000000123.zip"); } diff --git a/400_xowa/src/gplx/xowa/wikis/tdbs/hives/Xob_hive_mgr_tst.java b/400_xowa/src/gplx/xowa/wikis/tdbs/hives/Xob_hive_mgr_tst.java index e5ae8a86b..a6f0061f5 100644 --- a/400_xowa/src/gplx/xowa/wikis/tdbs/hives/Xob_hive_mgr_tst.java +++ b/400_xowa/src/gplx/xowa/wikis/tdbs/hives/Xob_hive_mgr_tst.java @@ -13,15 +13,15 @@ The terms of each license can be found in the source code repository: GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt */ -package gplx.xowa.wikis.tdbs.hives; import gplx.*; import gplx.xowa.*; import gplx.xowa.wikis.*; import gplx.xowa.wikis.tdbs.*; -import org.junit.*; -public class Xob_hive_mgr_tst { - Xow_hive_mgr_fxt fxt = new Xow_hive_mgr_fxt(); - @Before public void init() {fxt.Clear();} - @Test public void Drilldown() { -// fxt.Files_create_range(10, 10); -// fxt.Drilldown("A00", "J09", "A00", "B09", "C00", "D09", "E00", "F09", "G00", "H09", "I00", "J09"); -// fxt.Drilldown("E00", "F09", "E00", "E03", "E04", "E07", "E08", "F01", "F02", "F05", "F06", "F09"); -// fxt.Drilldown("E08", "F01", "E08", "E09", "F00", "F01"); - } -} +package gplx.xowa.wikis.tdbs.hives; import gplx.*; import gplx.xowa.*; import gplx.xowa.wikis.*; import gplx.xowa.wikis.tdbs.*; +import org.junit.*; +public class Xob_hive_mgr_tst { + Xow_hive_mgr_fxt fxt = new Xow_hive_mgr_fxt(); + @Before public void init() {fxt.Clear();} + @Test public void Drilldown() { +// fxt.Files_create_range(10, 10); +// fxt.Drilldown("A00", "J09", "A00", "B09", "C00", "D09", "E00", "F09", "G00", "H09", "I00", "J09"); +// fxt.Drilldown("E00", "F09", "E00", "E03", "E04", "E07", "E08", "F01", "F02", "F05", "F06", "F09"); +// fxt.Drilldown("E08", "F01", "E08", "E09", "F00", "F01"); + } +} diff --git a/400_xowa/src/gplx/xowa/wikis/tdbs/hives/Xowd_hive_mgr_tst.java b/400_xowa/src/gplx/xowa/wikis/tdbs/hives/Xowd_hive_mgr_tst.java index d3acdf7e5..46d4e62b2 100644 --- a/400_xowa/src/gplx/xowa/wikis/tdbs/hives/Xowd_hive_mgr_tst.java +++ b/400_xowa/src/gplx/xowa/wikis/tdbs/hives/Xowd_hive_mgr_tst.java @@ -1,38 +1,38 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.wikis.tdbs.hives; import gplx.*; import gplx.xowa.*; import gplx.xowa.wikis.*; import gplx.xowa.wikis.tdbs.*; import org.junit.*; import gplx.xowa.wikis.nss.*; public class Xowd_hive_mgr_tst { Xowd_hive_mgr_fxt fxt = new Xowd_hive_mgr_fxt(); @Before public void init() {fxt.Clear();} - @Test public void Create() { + @Test public void Create() { fxt.Create("A", "A|A data\n") .Tst_reg(String_.Concat_lines_nl("0|A|A|1")) .Tst_fil(0, String_.Concat("!!!!*|\n", "A|A data\n")) ; } - @Test public void Create_2() { + @Test public void Create_2() { fxt .Create("A", "A|1\n") .Create("B", "B|12\n") .Tst_reg(String_.Concat_lines_nl("0|A|B|2")) .Tst_fil(0, String_.Concat("!!!!%|!!!!&|\n", "A|1\n", "B|12\n")) ; } - @Test public void Create_3() { + @Test public void Create_3() { fxt .Create("A", "A|1\n") .Create("B", "B|12\n") .Create("C", "C|123\n") @@ -40,7 +40,7 @@ public class Xowd_hive_mgr_tst { .Tst_fil(0, String_.Concat("!!!!%|!!!!&|!!!!'|\n", "A|1\n", "B|12\n", "C|123\n")) ; } - @Test public void Create_sort() { + @Test public void Create_sort() { fxt .Create_and_sort("C", "C|1\n") .Create_and_sort("A", "A|12\n") .Create_and_sort("B", "B|123\n") @@ -48,7 +48,7 @@ public class Xowd_hive_mgr_tst { .Tst_fil(0, String_.Concat("!!!!&|!!!!'|!!!!%|\n", "A|12\n", "B|123\n", "C|1\n")) ; } - @Test public void Update() { + @Test public void Update() { fxt .Create("A", "A|A data\n") .Create("B", "B|B data\n") .Create("C", "C|C data\n") diff --git a/400_xowa/src/gplx/xowa/wikis/tdbs/hives/Xowd_regy_mgr__tst.java b/400_xowa/src/gplx/xowa/wikis/tdbs/hives/Xowd_regy_mgr__tst.java index 3361947ae..af4c0d860 100644 --- a/400_xowa/src/gplx/xowa/wikis/tdbs/hives/Xowd_regy_mgr__tst.java +++ b/400_xowa/src/gplx/xowa/wikis/tdbs/hives/Xowd_regy_mgr__tst.java @@ -1,28 +1,28 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.wikis.tdbs.hives; import gplx.*; import gplx.xowa.*; import gplx.xowa.wikis.*; import gplx.xowa.wikis.tdbs.*; import org.junit.*; import gplx.core.lists.*; public class Xowd_regy_mgr__tst implements ComparerAble { - @Test public void Basic() { + @Test public void Basic() { String[] slotAry = new String[] {"b", "e", "h"}; // 0=b 1=e 2=h tst_FindSlot(slotAry, "f", "h"); // f -> 1 2 -> 2 tst_FindSlot(slotAry, "c", "e"); // c -> -1 1 -> 0 -> 0 1 -> 1 tst_FindSlot(slotAry, "a", "b"); // a -> -1 1 -> 0 -> -1 0 -> 0 } - @Test public void Null() { + @Test public void Null() { String[] slotAry = new String[] {"b", "g", "l", "q", "v", null}; tst_FindSlot(slotAry, "a", "b"); tst_FindSlot(slotAry, "b", "b"); diff --git a/400_xowa/src/gplx/xowa/wikis/tdbs/hives/Xowd_regy_mgr_tst.java b/400_xowa/src/gplx/xowa/wikis/tdbs/hives/Xowd_regy_mgr_tst.java index 90f549473..b10a13366 100644 --- a/400_xowa/src/gplx/xowa/wikis/tdbs/hives/Xowd_regy_mgr_tst.java +++ b/400_xowa/src/gplx/xowa/wikis/tdbs/hives/Xowd_regy_mgr_tst.java @@ -1,35 +1,35 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.wikis.tdbs.hives; import gplx.*; import gplx.xowa.*; import gplx.xowa.wikis.*; import gplx.xowa.wikis.tdbs.*; import org.junit.*; public class Xowd_regy_mgr_tst { Xowd_regy_mgr_fxt fxt = new Xowd_regy_mgr_fxt(); @Before public void init() {fxt.Clear();} - @Test public void Create_cur_is_empty() {fxt.Create("A").Save().Tst_file(String_.Concat_lines_nl("0|A|A|1"));} - @Test public void Create_cur_has_one() {fxt.Load(String_.Concat_lines_nl("0|A|A|1")).Create("B").Save().Tst_file(String_.Concat_lines_nl("0|A|A|1", "1|B|B|1"));} - @Test public void Update_1st_end() {fxt.Load(String_.Concat_lines_nl("0|B|B|1")).Update_add(0, "C").Save().Tst_file(String_.Concat_lines_nl("0|B|C|2"));} - @Test public void Update_1st_bgn() {fxt.Load(String_.Concat_lines_nl("0|B|B|1")).Update_add(0, "A").Save().Tst_file(String_.Concat_lines_nl("0|A|B|2"));} - @Test public void Update_mid() {fxt.Load(String_.Concat_lines_nl("0|B|D|2")).Update_add(0, "C").Save().Tst_file(String_.Concat_lines_nl("0|B|D|3"));} - @Test public void Update_bgn() {fxt.Load(String_.Concat_lines_nl("0|B|D|2")).Update_add(0, "A").Save().Tst_file(String_.Concat_lines_nl("0|A|D|3"));} - @Test public void Update_end() {fxt.Load(String_.Concat_lines_nl("0|B|D|2")).Update_add(0, "E").Save().Tst_file(String_.Concat_lines_nl("0|B|E|3"));} - @Test public void Update_change_bgn() {fxt.Load(String_.Concat_lines_nl("0|B|D|2")).Update_change(0, "B", "A").Save().Tst_file(String_.Concat_lines_nl("0|A|D|2"));} - @Test public void Update_change_end() {fxt.Load(String_.Concat_lines_nl("0|B|D|2")).Update_change(0, "D", "E").Save().Tst_file(String_.Concat_lines_nl("0|B|E|2"));} - @Test public void Update_change_mid() {fxt.Load(String_.Concat_lines_nl("0|B|D|2")).Update_change(0, "C1", "C2").Save().Tst_file(String_.Concat_lines_nl("0|B|D|2"));} - @Test public void Find_none() {fxt.Tst_find("A", Xowd_regy_mgr.Regy_null);} - @Test public void Find_existing() { + @Test public void Create_cur_is_empty() {fxt.Create("A").Save().Tst_file(String_.Concat_lines_nl("0|A|A|1"));} + @Test public void Create_cur_has_one() {fxt.Load(String_.Concat_lines_nl("0|A|A|1")).Create("B").Save().Tst_file(String_.Concat_lines_nl("0|A|A|1", "1|B|B|1"));} + @Test public void Update_1st_end() {fxt.Load(String_.Concat_lines_nl("0|B|B|1")).Update_add(0, "C").Save().Tst_file(String_.Concat_lines_nl("0|B|C|2"));} + @Test public void Update_1st_bgn() {fxt.Load(String_.Concat_lines_nl("0|B|B|1")).Update_add(0, "A").Save().Tst_file(String_.Concat_lines_nl("0|A|B|2"));} + @Test public void Update_mid() {fxt.Load(String_.Concat_lines_nl("0|B|D|2")).Update_add(0, "C").Save().Tst_file(String_.Concat_lines_nl("0|B|D|3"));} + @Test public void Update_bgn() {fxt.Load(String_.Concat_lines_nl("0|B|D|2")).Update_add(0, "A").Save().Tst_file(String_.Concat_lines_nl("0|A|D|3"));} + @Test public void Update_end() {fxt.Load(String_.Concat_lines_nl("0|B|D|2")).Update_add(0, "E").Save().Tst_file(String_.Concat_lines_nl("0|B|E|3"));} + @Test public void Update_change_bgn() {fxt.Load(String_.Concat_lines_nl("0|B|D|2")).Update_change(0, "B", "A").Save().Tst_file(String_.Concat_lines_nl("0|A|D|2"));} + @Test public void Update_change_end() {fxt.Load(String_.Concat_lines_nl("0|B|D|2")).Update_change(0, "D", "E").Save().Tst_file(String_.Concat_lines_nl("0|B|E|2"));} + @Test public void Update_change_mid() {fxt.Load(String_.Concat_lines_nl("0|B|D|2")).Update_change(0, "C1", "C2").Save().Tst_file(String_.Concat_lines_nl("0|B|D|2"));} + @Test public void Find_none() {fxt.Tst_find("A", Xowd_regy_mgr.Regy_null);} + @Test public void Find_existing() { fxt.Load(String_.Concat_lines_nl ( "0|B|D|3" , "1|E|G|3" @@ -41,7 +41,7 @@ public class Xowd_regy_mgr_tst { .Tst_find("Da", 1) ; } - @Test public void Find_existing_null() { + @Test public void Find_existing_null() { fxt.Load(String_.Concat_lines_nl ( "0|B|D|3" , "1|D|H|0" diff --git a/400_xowa/src/gplx/xowa/wikis/tdbs/metas/Xof_meta_fil_tst.java b/400_xowa/src/gplx/xowa/wikis/tdbs/metas/Xof_meta_fil_tst.java index 4f008c73c..f9517e282 100644 --- a/400_xowa/src/gplx/xowa/wikis/tdbs/metas/Xof_meta_fil_tst.java +++ b/400_xowa/src/gplx/xowa/wikis/tdbs/metas/Xof_meta_fil_tst.java @@ -13,15 +13,15 @@ The terms of each license can be found in the source code repository: GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt */ -package gplx.xowa.wikis.tdbs.metas; import gplx.*; import gplx.xowa.*; import gplx.xowa.wikis.*; import gplx.xowa.wikis.tdbs.*; -import org.junit.*; import gplx.xowa.files.*; -public class Xof_meta_fil_tst { - Xof_meta_fil_fxt fxt = new Xof_meta_fil_fxt(); - @Before public void init() {fxt.Ini();} - @Test public void Bld_url() {fxt.Bld_url("mem/root/", "abcdef", 3, "mem/root/a/b/abc.csv");} -} -class Xof_meta_fil_fxt { - byte[] md5_(byte[] name) {return Xof_file_wkr_.Md5(name);} - public void Ini() {} - public void Bld_url(String root, String md5, int depth, String expd) {Tfds.Eq(expd, Xof_meta_fil.Bld_url(Io_url_.new_dir_(root), Bry_.new_a7(md5), depth).Raw());} -} +package gplx.xowa.wikis.tdbs.metas; import gplx.*; import gplx.xowa.*; import gplx.xowa.wikis.*; import gplx.xowa.wikis.tdbs.*; +import org.junit.*; import gplx.xowa.files.*; +public class Xof_meta_fil_tst { + Xof_meta_fil_fxt fxt = new Xof_meta_fil_fxt(); + @Before public void init() {fxt.Ini();} + @Test public void Bld_url() {fxt.Bld_url("mem/root/", "abcdef", 3, "mem/root/a/b/abc.csv");} +} +class Xof_meta_fil_fxt { + byte[] md5_(byte[] name) {return Xof_file_wkr_.Md5(name);} + public void Ini() {} + public void Bld_url(String root, String md5, int depth, String expd) {Tfds.Eq(expd, Xof_meta_fil.Bld_url(Io_url_.new_dir_(root), Bry_.new_a7(md5), depth).Raw());} +} diff --git a/400_xowa/src/gplx/xowa/wikis/tdbs/metas/Xof_meta_mgr_tst.java b/400_xowa/src/gplx/xowa/wikis/tdbs/metas/Xof_meta_mgr_tst.java index 4da87fd00..3f82faae7 100644 --- a/400_xowa/src/gplx/xowa/wikis/tdbs/metas/Xof_meta_mgr_tst.java +++ b/400_xowa/src/gplx/xowa/wikis/tdbs/metas/Xof_meta_mgr_tst.java @@ -1,18 +1,18 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.wikis.tdbs.metas; import gplx.*; import gplx.xowa.*; import gplx.xowa.wikis.*; import gplx.xowa.wikis.tdbs.*; import org.junit.*; import gplx.core.primitives.*; @@ -20,11 +20,11 @@ import gplx.gfui.*; import gplx.xowa.files.*; public class Xof_meta_mgr_tst { Xof_file_regy_fxt fxt = new Xof_file_regy_fxt(); @Before public void init() {fxt.Ini();} - @Test public void Set_one() { + @Test public void Set_one() { fxt .Set("A.png", 440, 400, true, "440,400", "220,200") .tst_Save("mem/xowa/file/#meta/en.wikipedia.org/7/70.csv", "A.png|y||1?440,400|1?440,400;1?220,200"); } - @Test public void Set_many() { + @Test public void Set_many() { fxt .Set("A.png" , 440, 400, true, "440,400", "220,200") .Set("Cabbage.jpg" , 640, 456, false, "220,200", "200,180") .tst_Save("mem/xowa/file/#meta/en.wikipedia.org/7/70.csv" @@ -32,7 +32,7 @@ public class Xof_meta_mgr_tst { , "Cabbage.jpg|y||2?640,456|1?220,200;1?200,180" ); } - @Test public void Load_and_add() { + @Test public void Load_and_add() { fxt.Save_fil("mem/xowa/file/#meta/en.wikipedia.org/7/70.csv" , "A.png|y||1?440,400|" , "Cabbage.jpg|y||2?640,456|1?440,220;1?220,200" @@ -44,7 +44,7 @@ public class Xof_meta_mgr_tst { , "Wooden_hourglass_3.jpg|y||2?967,1959|1?220,200" ); } - @Test public void Load_and_update() { + @Test public void Load_and_update() { fxt.Save_fil("mem/xowa/file/#meta/en.wikipedia.org/7/70.csv" , "A.png|y||0?440,400|" , "Cabbage.jpg|y||2?640,456|1?440,400;1?220,200" diff --git a/400_xowa/src/gplx/xowa/wikis/tdbs/metas/Xof_meta_thumb_parser_tst.java b/400_xowa/src/gplx/xowa/wikis/tdbs/metas/Xof_meta_thumb_parser_tst.java index 804db0228..4c2ed7512 100644 --- a/400_xowa/src/gplx/xowa/wikis/tdbs/metas/Xof_meta_thumb_parser_tst.java +++ b/400_xowa/src/gplx/xowa/wikis/tdbs/metas/Xof_meta_thumb_parser_tst.java @@ -1,26 +1,26 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.wikis.tdbs.metas; import gplx.*; import gplx.xowa.*; import gplx.xowa.wikis.*; import gplx.xowa.wikis.tdbs.*; import org.junit.*; import gplx.core.strings.*; public class Xof_meta_thumb_parser_tst { Xof_meta_thumb_parser parser = new Xof_meta_thumb_parser(); - @Test public void Exists_y() {Tst_parse("1?45,40", itm_y_(45, 40));} - @Test public void Exists_n() {Tst_parse("0?45,40", itm_n_(45, 40));} - @Test public void Many() {Tst_parse("1?45,40;0?90,80", itm_y_(45, 40), itm_n_(90, 80));} - @Test public void Seek() {Tst_parse("1?45,40@2,3,4", itm_y_(45, 40, 2, 3, 4));} + @Test public void Exists_y() {Tst_parse("1?45,40", itm_y_(45, 40));} + @Test public void Exists_n() {Tst_parse("0?45,40", itm_n_(45, 40));} + @Test public void Many() {Tst_parse("1?45,40;0?90,80", itm_y_(45, 40), itm_n_(90, 80));} + @Test public void Seek() {Tst_parse("1?45,40@2,3,4", itm_y_(45, 40, 2, 3, 4));} private void Tst_parse(String raw_str, Xof_meta_thumb... expd) { byte[] raw = Bry_.new_a7(raw_str); parser.Parse_ary(raw, 0, raw.length); diff --git a/400_xowa/src/gplx/xowa/wikis/tdbs/utils/Xos_url_gen_tst.java b/400_xowa/src/gplx/xowa/wikis/tdbs/utils/Xos_url_gen_tst.java index 901cee3f1..c4d2fa3f4 100644 --- a/400_xowa/src/gplx/xowa/wikis/tdbs/utils/Xos_url_gen_tst.java +++ b/400_xowa/src/gplx/xowa/wikis/tdbs/utils/Xos_url_gen_tst.java @@ -13,18 +13,18 @@ The terms of each license can be found in the source code repository: GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt */ -package gplx.xowa.wikis.tdbs.utils; import gplx.*; import gplx.xowa.*; import gplx.xowa.wikis.*; import gplx.xowa.wikis.tdbs.*; -import org.junit.*; -import gplx.core.ios.*; -public class Xos_url_gen_tst { - @Test public void Url_gen() { - tst_url_gen("mem/root/", 0, "mem/root/00/00/00/00/0000000000.csv"); - tst_url_gen("mem/root/", 99, "mem/root/00/00/00/00/0000000099.csv"); - tst_url_gen("mem/root/", 1234567890, "mem/root/12/34/56/78/1234567890.csv"); - } - private void tst_url_gen(String root_str, int idx, String expd) { - Io_url root = Io_url_.mem_fil_(root_str); - Io_url actl_url = Xos_url_gen.bld_fil_(root, idx, Bry_.new_a7(".csv")); - Tfds.Eq(expd, actl_url.Xto_api()); - } -} +package gplx.xowa.wikis.tdbs.utils; import gplx.*; import gplx.xowa.*; import gplx.xowa.wikis.*; import gplx.xowa.wikis.tdbs.*; +import org.junit.*; +import gplx.core.ios.*; +public class Xos_url_gen_tst { + @Test public void Url_gen() { + tst_url_gen("mem/root/", 0, "mem/root/00/00/00/00/0000000000.csv"); + tst_url_gen("mem/root/", 99, "mem/root/00/00/00/00/0000000099.csv"); + tst_url_gen("mem/root/", 1234567890, "mem/root/12/34/56/78/1234567890.csv"); + } + private void tst_url_gen(String root_str, int idx, String expd) { + Io_url root = Io_url_.mem_fil_(root_str); + Io_url actl_url = Xos_url_gen.bld_fil_(root, idx, Bry_.new_a7(".csv")); + Tfds.Eq(expd, actl_url.Xto_api()); + } +} diff --git a/400_xowa/src/gplx/xowa/wikis/tdbs/xdats/Xob_xdat_file_tst.java b/400_xowa/src/gplx/xowa/wikis/tdbs/xdats/Xob_xdat_file_tst.java index f79797209..2ece49b58 100644 --- a/400_xowa/src/gplx/xowa/wikis/tdbs/xdats/Xob_xdat_file_tst.java +++ b/400_xowa/src/gplx/xowa/wikis/tdbs/xdats/Xob_xdat_file_tst.java @@ -1,22 +1,22 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.wikis.tdbs.xdats; import gplx.*; import gplx.xowa.*; import gplx.xowa.wikis.*; import gplx.xowa.wikis.tdbs.*; import org.junit.*; import gplx.core.strings.*; import gplx.xowa.wikis.tdbs.hives.*; public class Xob_xdat_file_tst { - @Test public void Find() { + @Test public void Find() { Xob_xdat_file rdr = rdr_("!!!!%|!!!!%|!!!!%|!!!!%|!!!!%|", "0|b", "1|d", "2|f", "3|h", "4|j"); tst_ReadAt(rdr, 0, "0|b"); tst_ReadAt(rdr, 1, "1|d"); @@ -29,7 +29,7 @@ public class Xob_xdat_file_tst { tst_Find(rdr, "c", 1, false); tst_Find(rdr, "k", 4, false); } - @Test public void Update() { + @Test public void Update() { Xob_xdat_file rdr = rdr_("!!!!%|!!!!%|!!!!%|!!!!%|!!!!%|", "0|b", "1|d", "2|f", "3|h", "4|j"); tst_Update(rdr, 3, "3|h1\n", String_.Concat_lines_nl_skip_last ( "!!!!%|!!!!%|!!!!%|!!!!&|!!!!%|" @@ -41,7 +41,7 @@ public class Xob_xdat_file_tst { , "" )); } - @Test public void Insert() { + @Test public void Insert() { Xob_xdat_file rdr = rdr_("!!!!%|!!!!%|!!!!%|!!!!%|!!!!%|", "0|b", "1|d", "2|f", "3|h", "4|j"); tst_Insert(rdr, "5|k\n", String_.Concat_lines_nl_skip_last ( "!!!!%|!!!!%|!!!!%|!!!!%|!!!!%|!!!!%|" @@ -54,7 +54,7 @@ public class Xob_xdat_file_tst { , "" )); } - @Test public void Sort() { + @Test public void Sort() { Xob_xdat_file rdr = rdr_("!!!!%|!!!!%|!!!!%|!!!!%|!!!!%|", "4|j", "2|f", "0|b", "1|d", "3|h"); Bry_comparer_bgn_eos comparer = new Bry_comparer_bgn_eos(2); tst_Sort(rdr, comparer, String_.Concat_lines_nl_skip_last @@ -67,7 +67,7 @@ public class Xob_xdat_file_tst { , "" )); } - @Test public void Rebuild_header() { + @Test public void Rebuild_header() { String orig = String_.Concat_lines_nl("" , "4|j", "2|f", "0|b", "1|d", "3|h"); String expd = String_.Concat_lines_nl("!!!!%|!!!!%|!!!!%|!!!!%|!!!!%|" , "4|j", "2|f", "0|b", "1|d", "3|h"); Rebuild_header_tst(orig, expd); diff --git a/400_xowa/src/gplx/xowa/wikis/tdbs/xdats/Xob_xdat_file_wtr_tst.java b/400_xowa/src/gplx/xowa/wikis/tdbs/xdats/Xob_xdat_file_wtr_tst.java index 4e86b470f..8b273ba66 100644 --- a/400_xowa/src/gplx/xowa/wikis/tdbs/xdats/Xob_xdat_file_wtr_tst.java +++ b/400_xowa/src/gplx/xowa/wikis/tdbs/xdats/Xob_xdat_file_wtr_tst.java @@ -1,22 +1,22 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.wikis.tdbs.xdats; import gplx.*; import gplx.xowa.*; import gplx.xowa.wikis.*; import gplx.xowa.wikis.tdbs.*; import org.junit.*; public class Xob_xdat_file_wtr_tst { - @Test public void Write() { + @Test public void Write() { Io_mgr.Instance.InitEngine_mem(); Io_url dir = Io_url_.mem_dir_("mem/dir"); Xob_xdat_file_wtr wtr = Xob_xdat_file_wtr.new_file_(1000, dir); diff --git a/400_xowa/src/gplx/xowa/wikis/ttls/Xoa_ttl__err_tst.java b/400_xowa/src/gplx/xowa/wikis/ttls/Xoa_ttl__err_tst.java index 7d15326a7..6fffb57dd 100644 --- a/400_xowa/src/gplx/xowa/wikis/ttls/Xoa_ttl__err_tst.java +++ b/400_xowa/src/gplx/xowa/wikis/ttls/Xoa_ttl__err_tst.java @@ -1,28 +1,28 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.wikis.ttls; import gplx.*; import gplx.xowa.*; import gplx.xowa.wikis.*; import org.junit.*; public class Xoa_ttl__err_tst { @Before public void init() {fxt.Clear();} private final Xoa_ttl_fxt fxt = new Xoa_ttl_fxt(); - @Test public void Invalid__angle() {fxt.Parse("").Expd_page_txt("Ab").Test();} - @Test public void Comment_eos() {fxt.Init_ttl("Ab").Expd_page_txt("Ab").Test();} + @Test public void Comment_eos() {fxt.Init_ttl("Ab + @Test public void Err_comment() { // PURPOSE: comment was being rendered; PAGE:en.w:Perpetual motion; raw_src = "b"; fxt.Test_parse_page_wiki(String_.Concat_lines_nl_skip_last ( "" @@ -130,7 +130,7 @@ public class Gallery_xnde_tst { ) ); } - @Test public void Misc_atr() { // make sure misc attribute doesn't fail + @Test public void Misc_atr() { // make sure misc attribute doesn't fail raw_src = "b"; fxt.Test_parse_page_wiki("File:A.png|" + raw_src + "" , fxt.tkn_xnde_().Xnde_tagId_(Xop_xnde_tag_.Tid__gallery).Xnde_xtn_ diff --git a/400_xowa/src/gplx/xowa/xtns/geoCrumbs/Geoc_isin_func_tst.java b/400_xowa/src/gplx/xowa/xtns/geoCrumbs/Geoc_isin_func_tst.java index 1f0c0cfba..057e82189 100644 --- a/400_xowa/src/gplx/xowa/xtns/geoCrumbs/Geoc_isin_func_tst.java +++ b/400_xowa/src/gplx/xowa/xtns/geoCrumbs/Geoc_isin_func_tst.java @@ -1,23 +1,23 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.xtns.geoCrumbs; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*; import org.junit.*; public class Geoc_isin_func_tst { @Before public void init() {fxt.Reset();} private Geoc_isin_func_fxt fxt = new Geoc_isin_func_fxt(); - @Test public void Basic() { + @Test public void Basic() { fxt.Test_parse("{{#isin:A}}", "A"); } } diff --git a/400_xowa/src/gplx/xowa/xtns/geodata/Geo_coordinates_func_tst.java b/400_xowa/src/gplx/xowa/xtns/geodata/Geo_coordinates_func_tst.java index 074f5f9e0..b7ab0bded 100644 --- a/400_xowa/src/gplx/xowa/xtns/geodata/Geo_coordinates_func_tst.java +++ b/400_xowa/src/gplx/xowa/xtns/geodata/Geo_coordinates_func_tst.java @@ -13,10 +13,10 @@ The terms of each license can be found in the source code repository: GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt */ -package gplx.xowa.xtns.geodata; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*; -import org.junit.*; -public class Geo_coordinates_func_tst { - private final Xop_fxt fxt = new Xop_fxt(); - @Before public void init() {fxt.Reset();} - @Test public void Basic() {fxt.Test_parse_tmpl_str_test("{{#coordinates:1|2}}" , "{{test}}" , "");} -} +package gplx.xowa.xtns.geodata; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*; +import org.junit.*; +public class Geo_coordinates_func_tst { + private final Xop_fxt fxt = new Xop_fxt(); + @Before public void init() {fxt.Reset();} + @Test public void Basic() {fxt.Test_parse_tmpl_str_test("{{#coordinates:1|2}}" , "{{test}}" , "");} +} diff --git a/400_xowa/src/gplx/xowa/xtns/graphs/Graph_html_tst.java b/400_xowa/src/gplx/xowa/xtns/graphs/Graph_html_tst.java index e465e9099..3cfa387ad 100644 --- a/400_xowa/src/gplx/xowa/xtns/graphs/Graph_html_tst.java +++ b/400_xowa/src/gplx/xowa/xtns/graphs/Graph_html_tst.java @@ -1,18 +1,18 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.xtns.graphs; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*; import org.junit.*; import gplx.core.tests.*; public class Graph_html_tst { @@ -20,7 +20,7 @@ public class Graph_html_tst { @Before public void init() { fxt.Reset(); } - @Test public void Basic() { + @Test public void Basic() { fxt.Parser_fxt().Test_html_full_str(String_.Concat_lines_nl_skip_last ( "" , "{" @@ -39,17 +39,17 @@ public class Graph_html_tst { , "" )); } - @Test public void Wikirawupload() { + @Test public void Wikirawupload() { String wtxt = fxt.Wikirawupload__wtxt(); fxt.Test__hview(wtxt, fxt.Hdump_n_().Wikirawupload__html(Bool_.Y)); fxt.Test__hdump(wtxt, fxt.Hdump_y_().Wikirawupload__html(Bool_.N), fxt.Wikirawupload__html(Bool_.Y)); } - @Test public void Literal_XOWA_ROOT() { + @Test public void Literal_XOWA_ROOT() { String wtxt = fxt.Literal_XOWA_ROOT__wtxt(); fxt.Test__hview(wtxt, fxt.Hdump_n_().Literal_XOWA_ROOT__html(Bool_.Y)); fxt.Test__hdump(wtxt, fxt.Hdump_y_().Literal_XOWA_ROOT__html(Bool_.N), fxt.Literal_XOWA_ROOT__html(Bool_.Y)); } - @Test public void Error__missing_endquote() { + @Test public void Error__missing_endquote() { fxt.Test__hload(String_.Concat_lines_nl_skip_last ( "
    " , "{" @@ -59,7 +59,7 @@ public class Graph_html_tst { , "
    " )); } - @Test public void Error__invalid() { + @Test public void Error__invalid() { fxt.Test__hload(String_.Concat_lines_nl_skip_last ( "
    " , "{" diff --git a/400_xowa/src/gplx/xowa/xtns/graphs/Graph_json_save_mgr__tst.java b/400_xowa/src/gplx/xowa/xtns/graphs/Graph_json_save_mgr__tst.java index 1c3f5efb7..91ee84e31 100644 --- a/400_xowa/src/gplx/xowa/xtns/graphs/Graph_json_save_mgr__tst.java +++ b/400_xowa/src/gplx/xowa/xtns/graphs/Graph_json_save_mgr__tst.java @@ -1,18 +1,18 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.xtns.graphs; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*; import org.junit.*; import gplx.core.tests.*; import gplx.xowa.files.*; import gplx.xowa.parsers.*; @@ -20,22 +20,22 @@ import gplx.xowa.parsers.lnkis.*; import gplx.xowa.parsers.lnkis.files.*; public class Graph_json_save_mgr__tst { private final Graph_json_save_mgr__fxt fxt = new Graph_json_save_mgr__fxt(); @Before public void init() {fxt.Clear();} - @Test public void Xowa_file() { + @Test public void Xowa_file() { fxt.Test__parse("a-{XOWA_ROOT}-z", "a-{XOWA_ROOT}{XOWA_ROOT}-z"); } - @Test public void Missing_wikirawupload() { + @Test public void Missing_wikirawupload() { fxt .Expd__err("missing wikirawupload") .Test__parse("a-file:///mem/xowa/-z"); } - @Test public void Missing_endquote() { + @Test public void Missing_endquote() { fxt .Expd__err("missing endquote") .Test__parse("a-\"wikirawupload:file:///mem/xowa/-z"); } - @Test public void Invalid_img_src() { + @Test public void Invalid_img_src() { fxt .Expd__err("invalid file_path") .Test__parse("a-\"wikirawupload:file:///mem/xowa/invalid-z\""); } - @Test public void File() { + @Test public void File() { fxt .Expd__file(Bool_.Y, Bool_.Y, "A.png") .Test__parse ( "a-\"wikirawupload:file:///mem/xowa/file/commons.wikimedia.org/orig/7/0/1/c/A.png\"-z" diff --git a/400_xowa/src/gplx/xowa/xtns/graphs/Json_fmtr_tst.java b/400_xowa/src/gplx/xowa/xtns/graphs/Json_fmtr_tst.java index 96eb1118a..2b756a5ef 100644 --- a/400_xowa/src/gplx/xowa/xtns/graphs/Json_fmtr_tst.java +++ b/400_xowa/src/gplx/xowa/xtns/graphs/Json_fmtr_tst.java @@ -1,23 +1,23 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.xtns.graphs; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*; import org.junit.*; import gplx.core.tests.*; public class Json_fmtr_tst { private final Json_fmtr_fxt fxt = new Json_fmtr_fxt(); - @Test public void Comments() { + @Test public void Comments() { // basic: // \n fxt.Test_clean("a//b\nc", "ac"); @@ -37,7 +37,7 @@ public class Json_fmtr_tst { fxt.Test_clean("\"a\\\"/*b*/c\""); } - @Test public void Trailing_commas() { + @Test public void Trailing_commas() { // remove: ] fxt.Test_clean("[a,]", "[a]"); diff --git a/400_xowa/src/gplx/xowa/xtns/hieros/Hiero_html_mgr_tst.java b/400_xowa/src/gplx/xowa/xtns/hieros/Hiero_html_mgr_tst.java index a37d21584..b2499479b 100644 --- a/400_xowa/src/gplx/xowa/xtns/hieros/Hiero_html_mgr_tst.java +++ b/400_xowa/src/gplx/xowa/xtns/hieros/Hiero_html_mgr_tst.java @@ -1,18 +1,18 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.xtns.hieros; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*; import org.junit.*; public class Hiero_html_mgr_tst { @@ -22,7 +22,7 @@ public class Hiero_html_mgr_tst { fxt = html_fxt.Hiero_fxt(); fxt.Reset(); } - @Test public void Empty() { + @Test public void Empty() { fxt.Test_html_full_str ( "" , String_.Concat_lines_nl_skip_last @@ -35,12 +35,12 @@ public class Hiero_html_mgr_tst { , "
    " )); } - @Test public void Glyph_1() { + @Test public void Glyph_1() { String wtxt = html_fxt.Glyph_1__wtxt(); html_fxt.Test__hview(wtxt, html_fxt.Hdump_n_().Glyph_1__html(Bool_.Y)); html_fxt.Test__hdump(wtxt, html_fxt.Hdump_y_().Glyph_1__html(Bool_.N), html_fxt.Glyph_1__html(Bool_.Y)); } - @Test public void Mirrored() { + @Test public void Mirrored() { fxt.Init_hiero_A1_B1(); fxt.Test_html_full_str ( "A1\\" @@ -60,7 +60,7 @@ public class Hiero_html_mgr_tst { , "
    " )); } - @Test public void Glyph_2() { + @Test public void Glyph_2() { fxt.Init_hiero_A1_B1(); fxt.Test_html_full_str("A1-B1", String_.Concat_lines_nl_skip_last ( "" @@ -81,7 +81,7 @@ public class Hiero_html_mgr_tst { , "
    " )); } - @Test public void Void_half() { + @Test public void Void_half() { fxt.Init_hiero_A1_B1(); fxt.Test_html_full_str ( "A1 . B1" @@ -112,7 +112,7 @@ public class Hiero_html_mgr_tst { , "
    " )); } - @Test public void Void_full() { + @Test public void Void_full() { fxt.Init_hiero_A1_B1(); fxt.Test_html_full_str ( "A1 .. B1" @@ -143,7 +143,7 @@ public class Hiero_html_mgr_tst { , "" )); } - @Test public void New_line() { + @Test public void New_line() { fxt.Init_hiero_A1_B1(); fxt.Test_html_full_str ( "A1 ! B1" @@ -170,12 +170,12 @@ public class Hiero_html_mgr_tst { , "" )); } - @Test public void Cartouche() { + @Test public void Cartouche() { String wtxt = html_fxt.Cartouche__wtxt(); html_fxt.Test__hview(wtxt, html_fxt.Hdump_n_().Cartouche__html(Bool_.Y)); html_fxt.Test__hdump(wtxt, html_fxt.Hdump_y_().Cartouche__html(Bool_.N), html_fxt.Cartouche__html(Bool_.Y)); } - @Test public void Superposition_regular() { + @Test public void Superposition_regular() { fxt.Init_hiero_A1_B1(); fxt.Test_html_full_str("A1:B1", String_.Concat_lines_nl_skip_last ( "" @@ -195,7 +195,7 @@ public class Hiero_html_mgr_tst { , "
    " )); } - @Test public void Superposition_phoneme() { + @Test public void Superposition_phoneme() { fxt.Init_hiero_p_t(); fxt.Test_html_full_str("t:p", String_.Concat_lines_nl_skip_last ( "" @@ -215,7 +215,7 @@ public class Hiero_html_mgr_tst { , "
    " )); } - @Test public void Superposition_prefab() { + @Test public void Superposition_prefab() { fxt.Init_hiero_a_A1(); fxt.Test_html_full_str("a:A1", String_.Concat_lines_nl_skip_last ( "" @@ -233,7 +233,7 @@ public class Hiero_html_mgr_tst { , "
    " )); } - @Test public void Juxtaposition_regular() { + @Test public void Juxtaposition_regular() { fxt.Init_hiero_A1_B1(); fxt.Test_html_full_str("A1*B1", String_.Concat_lines_nl_skip_last ( "" @@ -252,7 +252,7 @@ public class Hiero_html_mgr_tst { , "
    " )); } - @Test public void Juxtaposition_phoneme() { + @Test public void Juxtaposition_phoneme() { fxt.Init_hiero_p_t(); fxt.Test_html_full_str("t*p", String_.Concat_lines_nl_skip_last ( "" @@ -271,7 +271,7 @@ public class Hiero_html_mgr_tst { , "
    " )); } - @Test public void Juxtaposition_prefab() { + @Test public void Juxtaposition_prefab() { fxt.Init_hiero_a_A1(); fxt.Test_html_full_str("a*A1", String_.Concat_lines_nl_skip_last ( "" @@ -289,7 +289,7 @@ public class Hiero_html_mgr_tst { , "
    " )); } - @Test public void Para_if_text() {// PURPOSE: check that paras are handled correctly; EX: w:Hieroglyphics; DATE:2014-04-23 + @Test public void Para_if_text() {// PURPOSE: check that paras are handled correctly; EX: w:Hieroglyphics; DATE:2014-04-23 fxt.Fxt().Init_para_y_(); fxt.Test_html_full_str(String_.Concat_lines_nl_skip_last ( "a" // should always be in

    @@ -311,7 +311,7 @@ public class Hiero_html_mgr_tst { )); fxt.Fxt().Init_para_n_(); } - @Test public void Para_skip_if_list() {// PURPOSE: do not add para if in list; EX:de.d:Damascus; DATE:2014-06-06 + @Test public void Para_skip_if_list() {// PURPOSE: do not add para if in list; EX:de.d:Damascus; DATE:2014-06-06 fxt.Fxt().Init_para_y_(); fxt.Test_html_full_str(String_.Concat_lines_nl_skip_last ( ": a" // a should not be in para diff --git a/400_xowa/src/gplx/xowa/xtns/hieros/Hiero_mw_tables_parser_tst.java b/400_xowa/src/gplx/xowa/xtns/hieros/Hiero_mw_tables_parser_tst.java index 69d3767c8..a34c4dfa7 100644 --- a/400_xowa/src/gplx/xowa/xtns/hieros/Hiero_mw_tables_parser_tst.java +++ b/400_xowa/src/gplx/xowa/xtns/hieros/Hiero_mw_tables_parser_tst.java @@ -1,24 +1,24 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.xtns.hieros; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*; import org.junit.*; import gplx.core.intls.*; public class Hiero_mw_tables_parser_tst { @Before public void init() {fxt.Reset();} private Hiero_mw_tables_parser_fxt fxt = new Hiero_mw_tables_parser_fxt(); - @Test public void Basic() {// DATE:2014-04-19 + @Test public void Basic() {// DATE:2014-04-19 fxt.Test_bld_all ( String_.Concat_lines_nl_skip_last ( "$wh_prefabs = array(" diff --git a/400_xowa/src/gplx/xowa/xtns/hieros/Hiero_parser_tst.java b/400_xowa/src/gplx/xowa/xtns/hieros/Hiero_parser_tst.java index 0d059b588..55df7065b 100644 --- a/400_xowa/src/gplx/xowa/xtns/hieros/Hiero_parser_tst.java +++ b/400_xowa/src/gplx/xowa/xtns/hieros/Hiero_parser_tst.java @@ -1,23 +1,23 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.xtns.hieros; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*; import org.junit.*; public class Hiero_parser_tst { @Before public void init() {fxt.Reset();} private Hiero_parser_fxt fxt = new Hiero_parser_fxt(); - @Test public void Separator() { + @Test public void Separator() { String[][] expd = new String[][] {fxt.block_("A1"), fxt.block_("B1")}; fxt.Test_parse("A1 B1" , expd); // space fxt.Test_parse("A1-B1" , expd); // dash diff --git a/400_xowa/src/gplx/xowa/xtns/imaps/Imap_base_fxt.java b/400_xowa/src/gplx/xowa/xtns/imaps/Imap_base_fxt.java index 3795aacb0..c74017f1f 100644 --- a/400_xowa/src/gplx/xowa/xtns/imaps/Imap_base_fxt.java +++ b/400_xowa/src/gplx/xowa/xtns/imaps/Imap_base_fxt.java @@ -1,25 +1,25 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.xtns.imaps; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*; import gplx.core.primitives.*; import gplx.xowa.parsers.*; import gplx.xowa.xtns.imaps.itms.*; public class Imap_base_fxt { protected Xoae_app app; protected Xowe_wiki wiki; - @gplx.Virtual public void Reset() { + public void Reset() { app = Xoa_app_fxt.Make__app__edit(); wiki = Xoa_app_fxt.Make__wiki__edit(app); wiki.Parser_mgr().Ctx().Para().Enabled_n_(); diff --git a/400_xowa/src/gplx/xowa/xtns/imaps/Imap_parser_tst.java b/400_xowa/src/gplx/xowa/xtns/imaps/Imap_parser_tst.java index 20357f933..71f4d8cb8 100644 --- a/400_xowa/src/gplx/xowa/xtns/imaps/Imap_parser_tst.java +++ b/400_xowa/src/gplx/xowa/xtns/imaps/Imap_parser_tst.java @@ -1,38 +1,38 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.xtns.imaps; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*; import org.junit.*; import gplx.core.primitives.*; import gplx.xowa.parsers.*; import gplx.xowa.xtns.imaps.itms.*; public class Imap_parser_tst { @Before public void init() {fxt.Reset();} private Imap_parser_fxt fxt = new Imap_parser_fxt(); - @Test public void Rect_pass() {fxt.Test_shape("rect 1 2 3 4 [[A]]" , fxt.itm_rect_("[[A]]", 1, 2, 3, 4));} - @Test public void Rect_pass_many() {fxt.Test_shape("rect 1 2 3 4 5 6[[A]]" , fxt.itm_rect_("[[A]]", 1, 2, 3, 4));} // PURPOSE: MW allows extra points to be passed; PAGE:en.w:Kilauea DATE:2014-07-28 - @Test public void Rect_pass_invalid() {fxt.Test_shape("rect 1 2 3 4 a b [[A]]" , fxt.itm_rect_("[[A]]", 1, 2, 3, 4));} // PURPOSE: MW only scans first 4 tokens for numbers; PAGE:de.w:Wilhelm_Angele DATE:2014-10-30 - @Test public void Circle_pass() {fxt.Test_shape("circle 1 2 3 [[A]]" , fxt.itm_circle_("[[A]]", 1, 2, 3));} - @Test public void Poly_pass() {fxt.Test_shape("poly 1 2 3 4 5 6 [[A]]" , fxt.itm_poly_("[[A]]", 1, 2, 3, 4, 5, 6));} - @Test public void Poly_pass_chars() {fxt.Test_shape("poly a b [[A]]" , fxt.itm_poly_("[[A]]", 0, 0));} // PURPOSE: non-numeric should be converted to 0; PAGE:uk.w:Стратосфера; DATE:2014-07-26 - @Test public void Poly_pass_chars_2() {fxt.Test_shape("poly 1a 2a [[A]]" , fxt.itm_poly_("[[A]]", 0, 0));} // PURPOSE: non-numeric should be converted to 0; PAGE:ru.w:Системный_блок; DATE:2014-10-22 - @Test public void Poly_pass_dots() {fxt.Test_shape("poly 1.2 3.4 [[A]]" , fxt.itm_poly_("[[A]]", 1.2d, 3.4d));} // PURPOSE: make sure decimals are handled correctly - @Test public void Poly_pass_commas() {fxt.Test_shape("poly 1, 2, 3, 4 [[A]]" , fxt.itm_poly_("[[A]]", 1, 2, 3, 4));} // PURPOSE: commas should be ignored; PAGE:de.w:Kaimnitz; DATE:2014-08-05 - @Test public void Poly_pass_commas_2() {fxt.Test_shape("poly 1,2 3,4 [[A]]" , fxt.itm_poly_("[[A]]", 1, 3));} // PURPOSE: commas should be ignored for purpose of parse; PAGE:fr.w:Gouesnou; DATE:2014-08-12 - @Test public void Poly_pass_commas_3() {fxt.Test_shape("poly ,1 2 [[A]]" , fxt.itm_poly_("[[A]]", 1, 2));} // PURPOSE: do not fail if comma is at start of number; PAGE:en.w:Area_codes_281,_346,_713,_and_832; DATE:2015-07-31 - @Test public void Rect_fail() {fxt.Test_shape_err("rect 1 2 3 [[A]]" , "imagemap_missing_coord");} - @Test public void Circle_fail() {fxt.Test_shape_err("circle 1 2 [[A]]" , "imagemap_missing_coord");} - @Test public void Poly_fail_odd() {fxt.Test_shape_err("poly 1 2 3 [[A]]" , "imagemap_poly_odd");} - @Test public void Poly_fail_zero() {fxt.Test_shape_err("poly [[A]]" , "imagemap_missing_coord");} - @Test public void Circle_fail_invalid() {fxt.Test_shape_err("rect 1 2..3 4 [[A]]" , "imagemap_invalid_coord");} + @Test public void Rect_pass() {fxt.Test_shape("rect 1 2 3 4 [[A]]" , fxt.itm_rect_("[[A]]", 1, 2, 3, 4));} + @Test public void Rect_pass_many() {fxt.Test_shape("rect 1 2 3 4 5 6[[A]]" , fxt.itm_rect_("[[A]]", 1, 2, 3, 4));} // PURPOSE: MW allows extra points to be passed; PAGE:en.w:Kilauea DATE:2014-07-28 + @Test public void Rect_pass_invalid() {fxt.Test_shape("rect 1 2 3 4 a b [[A]]" , fxt.itm_rect_("[[A]]", 1, 2, 3, 4));} // PURPOSE: MW only scans first 4 tokens for numbers; PAGE:de.w:Wilhelm_Angele DATE:2014-10-30 + @Test public void Circle_pass() {fxt.Test_shape("circle 1 2 3 [[A]]" , fxt.itm_circle_("[[A]]", 1, 2, 3));} + @Test public void Poly_pass() {fxt.Test_shape("poly 1 2 3 4 5 6 [[A]]" , fxt.itm_poly_("[[A]]", 1, 2, 3, 4, 5, 6));} + @Test public void Poly_pass_chars() {fxt.Test_shape("poly a b [[A]]" , fxt.itm_poly_("[[A]]", 0, 0));} // PURPOSE: non-numeric should be converted to 0; PAGE:uk.w:Стратосфера; DATE:2014-07-26 + @Test public void Poly_pass_chars_2() {fxt.Test_shape("poly 1a 2a [[A]]" , fxt.itm_poly_("[[A]]", 0, 0));} // PURPOSE: non-numeric should be converted to 0; PAGE:ru.w:Системный_блок; DATE:2014-10-22 + @Test public void Poly_pass_dots() {fxt.Test_shape("poly 1.2 3.4 [[A]]" , fxt.itm_poly_("[[A]]", 1.2d, 3.4d));} // PURPOSE: make sure decimals are handled correctly + @Test public void Poly_pass_commas() {fxt.Test_shape("poly 1, 2, 3, 4 [[A]]" , fxt.itm_poly_("[[A]]", 1, 2, 3, 4));} // PURPOSE: commas should be ignored; PAGE:de.w:Kaimnitz; DATE:2014-08-05 + @Test public void Poly_pass_commas_2() {fxt.Test_shape("poly 1,2 3,4 [[A]]" , fxt.itm_poly_("[[A]]", 1, 3));} // PURPOSE: commas should be ignored for purpose of parse; PAGE:fr.w:Gouesnou; DATE:2014-08-12 + @Test public void Poly_pass_commas_3() {fxt.Test_shape("poly ,1 2 [[A]]" , fxt.itm_poly_("[[A]]", 1, 2));} // PURPOSE: do not fail if comma is at start of number; PAGE:en.w:Area_codes_281,_346,_713,_and_832; DATE:2015-07-31 + @Test public void Rect_fail() {fxt.Test_shape_err("rect 1 2 3 [[A]]" , "imagemap_missing_coord");} + @Test public void Circle_fail() {fxt.Test_shape_err("circle 1 2 [[A]]" , "imagemap_missing_coord");} + @Test public void Poly_fail_odd() {fxt.Test_shape_err("poly 1 2 3 [[A]]" , "imagemap_poly_odd");} + @Test public void Poly_fail_zero() {fxt.Test_shape_err("poly [[A]]" , "imagemap_missing_coord");} + @Test public void Circle_fail_invalid() {fxt.Test_shape_err("rect 1 2..3 4 [[A]]" , "imagemap_invalid_coord");} } class Imap_parser_fxt extends Imap_base_fxt { private Imap_parser parser; diff --git a/400_xowa/src/gplx/xowa/xtns/imaps/htmls/Imap_html__hview__tst.java b/400_xowa/src/gplx/xowa/xtns/imaps/htmls/Imap_html__hview__tst.java index 1cb43c98a..7162338b6 100644 --- a/400_xowa/src/gplx/xowa/xtns/imaps/htmls/Imap_html__hview__tst.java +++ b/400_xowa/src/gplx/xowa/xtns/imaps/htmls/Imap_html__hview__tst.java @@ -1,31 +1,31 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.xtns.imaps.htmls; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*; import gplx.xowa.xtns.imaps.*; import org.junit.*; import gplx.xowa.langs.*; import gplx.xowa.langs.msgs.*; public class Imap_html__hview__tst { private final Imap_html__fxt fxt = new Imap_html__fxt(); - @Test public void Basic() { + @Test public void Basic() { String wtxt = fxt.Basic__wtxt(); fxt.Test__hview(wtxt, fxt.Hdump_n_().Basic__html(Bool_.Y)); fxt.Test__hdump(wtxt, fxt.Hdump_y_().Basic__html(Bool_.N), fxt.Basic__html(Bool_.Y), fxt.Basic__fsdb()); } - @Test public void Caption_xml() { // PURPOSE: xnde in caption was being escaped; PAGE:en.w:Council_of_Europe; DATE:2014-07-25 + @Test public void Caption_xml() { // PURPOSE: xnde in caption was being escaped; PAGE:en.w:Council_of_Europe; DATE:2014-07-25 fxt.Test_html_full_frag("File:A.png|thumb|c\n", "c"); } - @Test public void Default() { + @Test public void Default() { fxt.Test_html_full_str(String_.Concat_lines_nl_skip_last ( "" , "File:A.png|thumb|123px|a1" @@ -48,12 +48,12 @@ public class Imap_html__hview__tst { , "

    " )); } - @Test public void Desc() { + @Test public void Desc() { String wtxt = fxt.Desc__wtxt(); fxt.Test__hview(wtxt, fxt.Hdump_n_().Desc__html(Bool_.Y)); fxt.Test__hdump(wtxt, fxt.Hdump_y_().Desc__html(Bool_.N), fxt.Desc__html(Bool_.Y), fxt.Basic__fsdb()); } - @Test public void Lnke() { // PURPOSE: handle shapes with lnke; PAGE:en.w:Cholesterolt DATE:2014-07-25 + @Test public void Lnke() { // PURPOSE: handle shapes with lnke; PAGE:en.w:Cholesterolt DATE:2014-07-25 fxt.Test_html_full_str(String_.Concat_lines_nl_skip_last ( "" , "File:A.png|thumb|123px|a1" @@ -76,7 +76,7 @@ public class Imap_html__hview__tst { , "
    " )); } - @Test public void Err_trailing_ws() { // PURPOSE: empty 1st line causes failure + @Test public void Err_trailing_ws() { // PURPOSE: empty 1st line causes failure fxt.Test_html_full_frag(String_.Concat_lines_nl_skip_last ( " " , "File:A.png|thumb|test_caption" @@ -84,12 +84,12 @@ public class Imap_html__hview__tst { ), "test_caption" // no error if test_caption appears; ); } - @Test public void Para_omitted() { // PURPOSE: imagemap should not be automatically enclosed in para; PAGE:cs.w:Seznam_clenu_ctrn�ct�ho_Knesetu; DATE:2014-05-08; + @Test public void Para_omitted() { // PURPOSE: imagemap should not be automatically enclosed in para; PAGE:cs.w:Seznam_clenu_ctrn�ct�ho_Knesetu; DATE:2014-05-08; fxt.Fxt().Init_para_y_(); fxt.Test_html_full_str("File:A.png a", fxt.Frag_html_full() + " a"); // NOTE: "a" no longer enclosed in

    ; DATE:2014-07-25 fxt.Fxt().Init_para_n_(); } - @Test public void Xnde_double_pipe() {// PURPOSE: if || is inside table and imagemap, treat as lnki; EX:w:United_States_presidential_election,_1992; DATE:2014-03-29; DATE:2014-05-06 + @Test public void Xnde_double_pipe() {// PURPOSE: if || is inside table and imagemap, treat as lnki; EX:w:United_States_presidential_election,_1992; DATE:2014-03-29; DATE:2014-05-06 fxt.Test_html_full_str(String_.Concat_lines_nl_skip_last ( "{|" , "|-" @@ -114,11 +114,11 @@ public class Imap_html__hview__tst { ) ); } - @Test public void Template_image() { // PURPOSE: handle templates in caption; PAGE:en.w:Kilauea; DATE:2014-07-27 + @Test public void Template_image() { // PURPOSE: handle templates in caption; PAGE:en.w:Kilauea; DATE:2014-07-27 fxt.Fxt().Init_page_create("Template:Test_template", "xyz"); fxt.Test_html_full_frag("File:A.png|thumb|{{Test_template}}\n", "xyz"); } - @Test public void Template_shape() { // PURPOSE: handle templates in shape; PAGE:fr.w:Arrondissements_de_Lyon DATE:2014-08-12 + @Test public void Template_shape() { // PURPOSE: handle templates in shape; PAGE:fr.w:Arrondissements_de_Lyon DATE:2014-08-12 fxt.Fxt().Init_page_create("Template:B1", "b1"); // note that an xnde is a better example as it will throw ArrayOutOfBounds error fxt.Test_html_full_str(String_.Concat_lines_nl_skip_last ( "" @@ -142,7 +142,7 @@ public class Imap_html__hview__tst { , "

    " )); } - @Test public void Template_multi_line() { // PURPOSE: handle multiple-line captions; PAGE:en.w:Archaea; DATE:2014-08-22 + @Test public void Template_multi_line() { // PURPOSE: handle multiple-line captions; PAGE:en.w:Archaea; DATE:2014-08-22 fxt.Test_html_full_frag(String_.Concat_lines_nl_skip_last ( "" , "File:A.png|thumb|text" diff --git a/400_xowa/src/gplx/xowa/xtns/imaps/htmls/Imap_shapes_arg_tst.java b/400_xowa/src/gplx/xowa/xtns/imaps/htmls/Imap_shapes_arg_tst.java index 2e270a13e..3b5fc2a14 100644 --- a/400_xowa/src/gplx/xowa/xtns/imaps/htmls/Imap_shapes_arg_tst.java +++ b/400_xowa/src/gplx/xowa/xtns/imaps/htmls/Imap_shapes_arg_tst.java @@ -1,25 +1,25 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.xtns.imaps.htmls; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*; import gplx.xowa.xtns.imaps.*; import org.junit.*; import gplx.xowa.xtns.imaps.itms.*; public class Imap_shapes_arg_tst { @Before public void init() {fxt.Reset();} private Imap_shapes_arg_fxt fxt = new Imap_shapes_arg_fxt(); - @Test public void Rect() {fxt.Test_shape_html(fxt.itm_rect_("[[A|b]]", 1, 2, 3, 4), "\n \"b\"");} - @Test public void Circle() {fxt.Test_shape_html(fxt.itm_circle_("[[A|b]]", 1, 2, 3 ), "\n \"b\"");} - @Test public void Poly() {fxt.Test_shape_html(fxt.itm_poly_("[[A|b]]", 1, 2, 3, 4), "\n \"b\"");} + @Test public void Rect() {fxt.Test_shape_html(fxt.itm_rect_("[[A|b]]", 1, 2, 3, 4), "\n \"b\"");} + @Test public void Circle() {fxt.Test_shape_html(fxt.itm_circle_("[[A|b]]", 1, 2, 3 ), "\n \"b\"");} + @Test public void Poly() {fxt.Test_shape_html(fxt.itm_poly_("[[A|b]]", 1, 2, 3, 4), "\n \"b\"");} } class Imap_shapes_arg_fxt extends Imap_base_fxt { public void Test_shape_html(Imap_part_shape shape, String expd) { diff --git a/400_xowa/src/gplx/xowa/xtns/indicators/Indicator_html_bldr_tst.java b/400_xowa/src/gplx/xowa/xtns/indicators/Indicator_html_bldr_tst.java index cdd3bd08d..fa8776613 100644 --- a/400_xowa/src/gplx/xowa/xtns/indicators/Indicator_html_bldr_tst.java +++ b/400_xowa/src/gplx/xowa/xtns/indicators/Indicator_html_bldr_tst.java @@ -1,23 +1,23 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.xtns.indicators; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*; import org.junit.*; import gplx.xowa.xtns.indicators.*; public class Indicator_html_bldr_tst { @Before public void init() {fxt.Clear();} private Indicator_html_bldr_fxt fxt = new Indicator_html_bldr_fxt(); - @Test public void Basic() { + @Test public void Basic() { fxt.Init_indicator("a", "a1"); fxt.Init_indicator("b", "b1"); fxt.Test_bld(String_.Concat_lines_nl_skip_last @@ -28,7 +28,7 @@ public class Indicator_html_bldr_tst { , "
    " )); } - @Test public void Multiple_ignore() { + @Test public void Multiple_ignore() { fxt.Init_indicator("a", "a1"); fxt.Init_indicator("a", "a2"); fxt.Test_bld(String_.Concat_lines_nl_skip_last diff --git a/400_xowa/src/gplx/xowa/xtns/indicators/Indicator_xnde_tst.java b/400_xowa/src/gplx/xowa/xtns/indicators/Indicator_xnde_tst.java index 13f22c4c5..ff06bc5d2 100644 --- a/400_xowa/src/gplx/xowa/xtns/indicators/Indicator_xnde_tst.java +++ b/400_xowa/src/gplx/xowa/xtns/indicators/Indicator_xnde_tst.java @@ -13,11 +13,11 @@ The terms of each license can be found in the source code repository: GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt */ -package gplx.xowa.xtns.indicators; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*; -import org.junit.*; -public class Indicator_xnde_tst { - @Before public void init() {fxt.Reset();} private final Xop_fxt fxt = new Xop_fxt(); - @Test public void Basic() { - fxt.Test_parse_page_all_str("test", ""); - } -} +package gplx.xowa.xtns.indicators; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*; +import org.junit.*; +public class Indicator_xnde_tst { + @Before public void init() {fxt.Reset();} private final Xop_fxt fxt = new Xop_fxt(); + @Test public void Basic() { + fxt.Test_parse_page_all_str("test", ""); + } +} diff --git a/400_xowa/src/gplx/xowa/xtns/inputBox/Xtn_inputbox_nde_tst.java b/400_xowa/src/gplx/xowa/xtns/inputBox/Xtn_inputbox_nde_tst.java index b0adaab5b..b7ac650c5 100644 --- a/400_xowa/src/gplx/xowa/xtns/inputBox/Xtn_inputbox_nde_tst.java +++ b/400_xowa/src/gplx/xowa/xtns/inputBox/Xtn_inputbox_nde_tst.java @@ -13,11 +13,11 @@ The terms of each license can be found in the source code repository: GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt */ -package gplx.xowa.xtns.inputBox; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*; -import org.junit.*; -public class Xtn_inputbox_nde_tst { - private final Xop_fxt fxt = new Xop_fxt(); - @Test public void Basic() { - fxt.Test_parse_page_wiki_str("abc", "ac"); - } -} +package gplx.xowa.xtns.inputBox; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*; +import org.junit.*; +public class Xtn_inputbox_nde_tst { + private final Xop_fxt fxt = new Xop_fxt(); + @Test public void Basic() { + fxt.Test_parse_page_wiki_str("abc", "ac"); + } +} diff --git a/400_xowa/src/gplx/xowa/xtns/insiders/Insider_func_tst.java b/400_xowa/src/gplx/xowa/xtns/insiders/Insider_func_tst.java index 9c278eec5..ce0e2f381 100644 --- a/400_xowa/src/gplx/xowa/xtns/insiders/Insider_func_tst.java +++ b/400_xowa/src/gplx/xowa/xtns/insiders/Insider_func_tst.java @@ -1,23 +1,23 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.xtns.insiders; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*; import org.junit.*; public class Insider_func_tst { @Before public void init() {fxt.Reset();} private Insider_func_fxt fxt = new Insider_func_fxt(); - @Test public void Basic() { + @Test public void Basic() { fxt.Test_parse("{{#insider:A}}x{{#insider:B}}", "x", "A", "B"); } } diff --git a/400_xowa/src/gplx/xowa/xtns/insiders/Insider_html_bldr_tst.java b/400_xowa/src/gplx/xowa/xtns/insiders/Insider_html_bldr_tst.java index a65463b20..680b840d9 100644 --- a/400_xowa/src/gplx/xowa/xtns/insiders/Insider_html_bldr_tst.java +++ b/400_xowa/src/gplx/xowa/xtns/insiders/Insider_html_bldr_tst.java @@ -1,23 +1,23 @@ -/* -XOWA: the XOWA Offline Wiki Application -Copyright (C) 2012-2017 gnosygnu@gmail.com - -XOWA is licensed under the terms of the General Public License (GPL) Version 3, -or alternatively under the terms of the Apache License Version 2.0. - -You may use XOWA according to either of these licenses as is most appropriate -for your project on a case-by-case basis. - -The terms of each license can be found in the source code repository: - -GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt -Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt -*/ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ package gplx.xowa.xtns.insiders; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*; import org.junit.*; public class Insider_html_bldr_tst { @Before public void init() {fxt.Clear();} private Insider_html_bldr_fxt fxt = new Insider_html_bldr_fxt(); - @Test public void Basic() { + @Test public void Basic() { fxt.Init_insider("A_1"); fxt.Test_bld(String_.Concat_lines_nl_skip_last ( "