/**
* @copyright
* ====================================================================
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
* ====================================================================
* @endcopyright
*/
package org.apache.subversion.javahl;
import org.apache.subversion.javahl.callback.*;
import org.apache.subversion.javahl.types.*;
import java.io.File;
import java.io.FileOutputStream;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.PrintWriter;
import java.io.ByteArrayOutputStream;
import java.io.UnsupportedEncodingException;
import java.text.ParseException;
import java.util.Collection;
import java.util.Arrays;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.Map;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
/**
* Tests the basic functionality of javahl binding (inspired by the
* tests in subversion/tests/cmdline/basic_tests.py).
*/
public class BasicTests extends SVNTests
{
/**
* Base name of all our tests.
*/
public final static String testName = "basic_test";
public BasicTests()
{
init();
}
public BasicTests(String name)
{
super(name);
init();
}
/**
* Initialize the testBaseName and the testCounter, if this is the
* first test of this class.
*/
private void init()
{
if (!testName.equals(testBaseName))
{
testCounter = 0;
testBaseName = testName;
}
}
/**
* Test LogDate().
* @throws Throwable
*/
public void testLogDate() throws Throwable
{
String goodDate = "2007-10-04T03:00:52.134992Z";
String badDate = "2008-01-14";
LogDate logDate;
try
{
logDate = new LogDate(goodDate);
assertEquals(1191466852134992L, logDate.getTimeMicros());
} catch (ParseException e) {
fail("Failed to parse date " + goodDate);
}
try
{
logDate = new LogDate(badDate);
fail("Failed to throw exception on bad date " + badDate);
} catch (ParseException e) {
}
}
/**
* Test SVNClient.getVersion().
* @throws Throwable
*/
public void testVersion() throws Throwable
{
try
{
Version version = client.getVersion();
String versionString = version.toString();
if (versionString == null || versionString.trim().length() == 0)
{
throw new Exception("Version string empty");
}
}
catch (Exception e)
{
fail("Version should always be available unless the " +
"native libraries failed to initialize: " + e);
}
}
/**
* Test SVNClient.getVersionExtended().
* @throws Throwable
*/
public void testVersionExtendedQuiet() throws Throwable
{
try
{
VersionExtended vx = client.getVersionExtended(false);
String result = vx.getBuildDate();
if (result == null || result.trim().length() == 0)
throw new Exception("Build date empty");
result = vx.getBuildTime();
if (result == null || result.trim().length() == 0)
throw new Exception("Build time empty");
result = vx.getBuildHost();
if (result == null || result.trim().length() == 0)
throw new Exception("Build host empty");
result = vx.getCopyright();
if (result == null || result.trim().length() == 0)
throw new Exception("Copyright empty");
}
catch (Exception e)
{
fail("VersionExtended should always be available unless the " +
"native libraries failed to initialize: " + e);
}
}
/**
* Test SVNClient.getVersionExtended().
* @throws Throwable
*/
public void testVersionExtendedVerbose() throws Throwable
{
try
{
VersionExtended vx = client.getVersionExtended(true);
String result = vx.getRuntimeHost();
if (result == null || result.trim().length() == 0)
throw new Exception("Runtime host empty");
// OS name is allowed to be null, but not empty
result = vx.getRuntimeOSName();
if (result != null && result.trim().length() == 0)
throw new Exception("Runtime OS name empty");
java.util.Iterator<VersionExtended.LinkedLib> ikl;
ikl = vx.getLinkedLibs();
if (ikl.hasNext())
{
VersionExtended.LinkedLib lib = ikl.next();
result = lib.getName();
if (result == null || result.trim().length() == 0)
throw new Exception("Linked lib name empty");
result = lib.getCompiledVersion();
if (result == null || result.trim().length() == 0)
throw new Exception("Linked lib compiled version empty");
// Runtime version is allowed to be null, but not empty
result = lib.getRuntimeVersion();
if (result != null && result.trim().length() == 0)
throw new Exception("Linked lib runtime version empty");
}
java.util.Iterator<VersionExtended.LoadedLib> ill;
ill = vx.getLoadedLibs();
if (ill.hasNext())
{
VersionExtended.LoadedLib lib = ill.next();
result = lib.getName();
if (result == null || result.trim().length() == 0)
throw new Exception("Loaded lib name empty");
// Version is allowed to be null, but not empty
result = lib.getVersion();
if (result != null && result.trim().length() == 0)
throw new Exception("Loaded lib version empty");
}
}
catch (Exception e)
{
fail("VersionExtended should always be available unless the " +
"native libraries failed to initialize: " + e);
}
}
/**
* Test the JNIError class functionality
* @throws Throwable
*/
public void testJNIError() throws Throwable
{
// build the test setup.
OneTest thisTest = new OneTest();
// Create a client, dispose it, then try to use it later
ISVNClient tempclient = new SVNClient();
tempclient.dispose();
// create Y and Y/Z directories in the repository
addExpectedCommitItem(null, thisTest.getUrl().toString(), "Y", NodeKind.none,
CommitItemStateFlags.Add);
Set<String> urls = new HashSe
没有合适的资源?快使用搜索试试~ 我知道了~
subversion64 windows版,可在windows下一键安装
共1613个文件
c:454个
py:234个
h:231个
1星 需积分: 50 21 下载量 19 浏览量
2017-08-29
16:29:36
上传
评论
收藏 8.2MB ZIP 举报
温馨提示
subversion64 windows版,可在windows下一键安装
资源推荐
资源详情
资源评论
收起资源包目录
subversion64 windows版,可在windows下一键安装 (1613个子文件)
svnrdump.1 2KB
svnversion.1 2KB
svnadmin.1 2KB
svndumpfilter.1 2KB
svnlook.1 2KB
svnsync.1 2KB
svn.1 2KB
svnmucc.1 2KB
3449_spurious_v1 176B
3449_spurious_v2 181B
3449_spurious_v3 181B
svnserve.conf.5 4KB
svnserve.8 5KB
configure.ac 53KB
bash_completion 45KB
bash_completion_test 5KB
run.bat 3KB
svnbuild.bat 2KB
svncheck.bat 2KB
svnbuild.bat 2KB
svncheck.bat 2KB
config.bat 1KB
do_all.bat 1KB
svnclean.bat 1KB
svnclean.bat 1KB
svnlog.bat 1KB
svnlog.bat 1KB
svneditor.bat 1KB
theta.bin 1KB
BUGS 96B
format_16.tar.bz2 37KB
format_15.tar.bz2 37KB
format_14.tar.bz2 37KB
format_12a.tar.bz2 36KB
format_12b.tar.bz2 36KB
format_13.tar.bz2 36KB
upgrade_absent_repos.tar.bz2 9KB
format_28.tar.bz2 6KB
upgrade_from_1_7_wc.tar.bz2 6KB
upgrade_tc.tar.bz2 5KB
upgrade_1_0.tar.bz2 4KB
upgrade_with_externals.tar.bz2 3KB
wc-3x-1.4.6.tar.bz2 3KB
wc-3x-1.4.0.tar.bz2 3KB
iprops_upgrade_nonroot.tar.bz2 3KB
wc-3x-1.6.12.tar.bz2 3KB
upgrade_1_7_dir_external.tar.bz2 3KB
iprops_upgrade_root.tar.bz2 3KB
logs_left_1_5.tar.bz2 2KB
upgrade_file_externals.tar.bz2 2KB
delete-in-copy.tar.bz2 2KB
upgrade_wcprops.tar.bz2 2KB
basic_upgrade.tar.bz2 2KB
upgrade_1_5.tar.bz2 2KB
upgrade_with_scheduled_change.tar.bz2 2KB
changelist_upgrade_1_6.tar.bz2 2KB
upgrade_not_present_replaced.tar.bz2 2KB
upgrade_missing_replaced.tar.bz2 2KB
upgrade_absent.tar.bz2 1KB
tree-replace1.tar.bz2 1KB
tree-replace2.tar.bz2 1KB
missing-dirs.tar.bz2 1KB
replaced-files.tar.bz2 1KB
iprops_upgrade_nonroot1_6.tar.bz2 905B
upgrade_locked.tar.bz2 855B
add_add_del_del_tc.tar.bz2 838B
iprops_upgrade_root1_6.tar.bz2 832B
wc-delete.tar.bz2 814B
add_add_x2.tar.bz2 782B
depth_exclude.tar.bz2 636B
depth_exclude_2.tar.bz2 527B
dirs-only.tar.bz2 479B
wc_db.c 563KB
merge.c 531KB
fs_fs.c 414KB
op-depth-test.c 328KB
update_editor.c 216KB
fs-test.c 197KB
tree.c 188KB
deprecated.c 167KB
repos.c 164KB
tree.c 157KB
io.c 154KB
serve.c 135KB
repos-test.c 133KB
svn.c 132KB
swigutil_py.c 128KB
update.c 119KB
conflicts.c 118KB
swigutil_rb.c 115KB
diff_editor.c 113KB
diff.c 109KB
patch.c 108KB
status.c 108KB
dirent_uri-test.c 107KB
deprecated.c 107KB
wc_db_update_move.c 107KB
entries.c 105KB
client.c 105KB
fsfs-reorg.c 103KB
共 1613 条
- 1
- 2
- 3
- 4
- 5
- 6
- 17
资源评论
- strugglesnail2017-09-13这是解压版的,不是安装版的
dengjingyuan
- 粉丝: 3
- 资源: 10
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功