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

Refactor: @Test whitespace clean-up and other corelib changes

This commit is contained in:
gnosygnu
2021-11-28 08:16:54 -05:00
parent 2a4abd8f75
commit b0082fd231
1059 changed files with 23816 additions and 21909 deletions

View File

@@ -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");

View File

@@ -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);

View File

@@ -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();
}
}

View File

@@ -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();
//

View File

@@ -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();
}
}

View File

@@ -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);

View File

@@ -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);

View File

@@ -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();
}
}

View File

@@ -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");

View File

@@ -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);

View File

@@ -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

View File

@@ -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());
}
}

View File

@@ -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);

View File

@@ -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");

View File

@@ -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/");
}

View File

@@ -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");
}
}

View File

@@ -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"));
}

View File

@@ -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);
}

View File

@@ -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)

View File

@@ -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_("<title id=\"1\" name=\"first\" profiled=\"false\" />");
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>"

View File

@@ -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 {
, "</title>", 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 {
, "</titles>", 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 {
, "</title>", String_.CrLf
);
}
@Test public void AtrsWithNesting() {
@Test public void AtrsWithNesting() {
wtr.WriteNodeBgn("title");
wtr.WriteData("id", 1);
wtr.WriteData("name", "first");