mirror of
https://github.com/gnosygnu/xowa.git
synced 2026-03-02 03:49:30 +00:00
Html: Move get_elem_val to xo.elem
This commit is contained in:
50
140_dbs/tst/gplx/dbs/orderBys/OrderBys_base_tst.java
Normal file
50
140_dbs/tst/gplx/dbs/orderBys/OrderBys_base_tst.java
Normal file
@@ -0,0 +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
|
||||
*/
|
||||
package gplx.dbs.orderBys; import gplx.*; import gplx.dbs.*;
|
||||
import org.junit.*; import gplx.dbs.qrys.*;
|
||||
public abstract class OrderBys_base_tst {
|
||||
@Before public void setup() {
|
||||
conn = provider_();
|
||||
fx.Conn_(conn);
|
||||
Db_qry_delete.new_("dbs_crud_ops").Exec_qry(conn);
|
||||
} protected Db_conn_fxt fx = new Db_conn_fxt();
|
||||
@After public void teardown() {conn.Rls_conn();}
|
||||
protected abstract Db_conn provider_(); protected Db_conn conn;
|
||||
protected void Basic_hook() {
|
||||
fx.tst_ExecDml(1, new Db_qry_insert("dbs_crud_ops").Val_int("id", 1).Val_str("name", "you"));
|
||||
fx.tst_ExecDml(1, new Db_qry_insert("dbs_crud_ops").Val_int("id", 0).Val_str("name", "me"));
|
||||
|
||||
fx.tst_ExecRdr(2, new Db_qry__select_cmd().From_("dbs_crud_ops").Order_("id", true));
|
||||
fx.tst_RowAry(0, 0, "me");
|
||||
fx.tst_RowAry(1, 1, "you");
|
||||
|
||||
fx.tst_ExecRdr(2, new Db_qry__select_cmd().From_("dbs_crud_ops").Order_("id", false));
|
||||
fx.tst_RowAry(0, 1, "you");
|
||||
fx.tst_RowAry(1, 0, "me");
|
||||
}
|
||||
protected void SameVals_hook() {
|
||||
fx.tst_ExecDml(1, new Db_qry_insert("dbs_crud_ops").Val_int("id", 0).Val_str("name", "me"));
|
||||
fx.tst_ExecDml(1, new Db_qry_insert("dbs_crud_ops").Val_int("id", 0).Val_str("name", "you"));
|
||||
|
||||
fx.tst_ExecRdr(2, new Db_qry__select_cmd().From_("dbs_crud_ops").Order_("id", true));
|
||||
fx.tst_RowAry(0, 0, "me");
|
||||
fx.tst_RowAry(1, 0, "you");
|
||||
|
||||
fx.tst_ExecRdr(2, new Db_qry__select_cmd().From_("dbs_crud_ops").Order_("id", false));
|
||||
fx.tst_RowAry(0, 0, "me");
|
||||
fx.tst_RowAry(1, 0, "you");
|
||||
}
|
||||
}
|
||||
36
140_dbs/tst/gplx/dbs/orderBys/OrderBys_tdb_tst.java
Normal file
36
140_dbs/tst/gplx/dbs/orderBys/OrderBys_tdb_tst.java
Normal file
@@ -0,0 +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.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() {
|
||||
Basic_hook();
|
||||
}
|
||||
@Test public void SameVals() {
|
||||
SameVals_hook();
|
||||
}
|
||||
}
|
||||
//namespace gplx.dbs.crudOps {
|
||||
// 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() {
|
||||
// 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());
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
Reference in New Issue
Block a user