1
0
mirror of https://github.com/gnosygnu/xowa.git synced 2026-03-02 03:49:30 +00:00

Refactor: Pull more classes into baselib

This commit is contained in:
gnosygnu
2021-12-19 16:19:19 -05:00
parent 48559edffe
commit 0e80d7ef6d
7999 changed files with 1375876 additions and 1365947 deletions

View File

@@ -1,20 +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.dbs.joins; import gplx.*; import gplx.dbs.*;
import org.junit.*; import gplx.core.gfo_ndes.*; import gplx.dbs.qrys.*; import gplx.dbs.sqls.*; import gplx.core.stores.*;
/*
XOWA: the XOWA Offline Wiki Application
Copyright (C) 2012-2017 gnosygnu@gmail.com
XOWA is licensed under the terms of the General Public License (GPL) Version 3,
or alternatively under the terms of the Apache License Version 2.0.
You may use XOWA according to either of these licenses as is most appropriate
for your project on a case-by-case basis.
The terms of each license can be found in the source code repository:
GPLv3 License: 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.dbs.*;
import gplx.frameworks.tests.GfoTstr;
import org.junit.*; import gplx.core.gfo_ndes.*; import gplx.dbs.qrys.*;
import gplx.core.stores.*;
public abstract class Joins_base_tst {
protected Db_conn conn;
@Before public void setup() {
@@ -34,9 +36,9 @@ public abstract class Joins_base_tst {
DataRdr rdr = conn.Exec_qry_as_old_rdr(select);
GfoNde table = GfoNde_.rdr_(rdr);
Tfds.Eq(table.Subs().Count(), 2);
Tfds.Eq(table.Subs().FetchAt_asGfoNde(0).Read("join_data"), "data0");
Tfds.Eq(table.Subs().FetchAt_asGfoNde(1).Read("join_data"), "data1");
GfoTstr.EqObj(table.Subs().Count(), 2);
GfoTstr.EqObj(table.Subs().FetchAt_asGfoNde(0).Read("join_data"), "data0");
GfoTstr.EqObj(table.Subs().FetchAt_asGfoNde(1).Read("join_data"), "data1");
}
protected abstract Db_conn provider_();
}

View File

@@ -13,7 +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.joins; import gplx.*; import gplx.dbs.*;
package gplx.dbs.joins; import gplx.dbs.*;
import gplx.frameworks.tests.GfoTstr;
import gplx.types.errs.ErrUtl;
import gplx.types.basics.utls.StringUtl;
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");}
@@ -22,8 +25,8 @@ public class Joins_tdb_tst extends Joins_base_tst {
InnerJoin_hook();
}
catch (Exception exc) {
if (String_.Has(Err_.Message_lang(exc), "joins not supported for tdbs")) return;
if (StringUtl.Has(ErrUtl.Message(exc), "joins not supported for tdbs")) return;
}
Tfds.Fail("'joins not supported for tdbs' error not thrown");
GfoTstr.Fail("'joins not supported for tdbs' error not thrown");
}
}