mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
add session
This commit is contained in:
@@ -16,7 +16,7 @@ import org.apache.commons.net.ftp.FTPSClient;
|
||||
import org.dromara.hutool.core.io.IoUtil;
|
||||
import org.dromara.hutool.core.io.file.FileUtil;
|
||||
import org.dromara.hutool.core.lang.Console;
|
||||
import org.dromara.hutool.extra.ssh.Sftp;
|
||||
import org.dromara.hutool.extra.ssh.engine.jsch.Sftp;
|
||||
import org.junit.jupiter.api.Disabled;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
|
@@ -12,13 +12,13 @@
|
||||
|
||||
package org.dromara.hutool.extra.pinyin;
|
||||
|
||||
import org.dromara.hutool.extra.pinyin.engine.bopomofo4j.Bopomofo4jEngine;
|
||||
import org.dromara.hutool.extra.pinyin.engine.PinyinEngine;
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
public class Bopomofo4jTest {
|
||||
|
||||
final Bopomofo4jEngine engine = new Bopomofo4jEngine();
|
||||
final PinyinEngine engine = PinyinUtil.createEngine("bopomofo4j");
|
||||
|
||||
@Test
|
||||
public void getFirstLetterByBopomofo4jTest(){
|
||||
|
@@ -12,13 +12,13 @@
|
||||
|
||||
package org.dromara.hutool.extra.pinyin;
|
||||
|
||||
import org.dromara.hutool.extra.pinyin.engine.houbbpinyin.HoubbPinyinEngine;
|
||||
import org.dromara.hutool.extra.pinyin.engine.PinyinEngine;
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
public class HoubbPinyinTest {
|
||||
|
||||
final HoubbPinyinEngine engine = new HoubbPinyinEngine();
|
||||
final PinyinEngine engine = PinyinUtil.createEngine("houbb");
|
||||
|
||||
@Test
|
||||
public void getFirstLetterTest(){
|
||||
|
@@ -12,13 +12,13 @@
|
||||
|
||||
package org.dromara.hutool.extra.pinyin;
|
||||
|
||||
import org.dromara.hutool.extra.pinyin.engine.jpinyin.JPinyinEngine;
|
||||
import org.dromara.hutool.extra.pinyin.engine.PinyinEngine;
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
public class JpinyinTest {
|
||||
|
||||
final JPinyinEngine engine = new JPinyinEngine();
|
||||
final PinyinEngine engine = PinyinUtil.createEngine("jpinyin");
|
||||
|
||||
@Test
|
||||
public void getFirstLetterByPinyin4jTest(){
|
||||
|
@@ -12,13 +12,13 @@
|
||||
|
||||
package org.dromara.hutool.extra.pinyin;
|
||||
|
||||
import org.dromara.hutool.extra.pinyin.engine.pinyin4j.Pinyin4jEngine;
|
||||
import org.dromara.hutool.extra.pinyin.engine.PinyinEngine;
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
public class Pinyin4jTest {
|
||||
|
||||
final Pinyin4jEngine engine = new Pinyin4jEngine();
|
||||
final PinyinEngine engine = PinyinUtil.createEngine("pinyin4j");
|
||||
|
||||
@Test
|
||||
public void getFirstLetterByPinyin4jTest(){
|
||||
|
@@ -12,13 +12,13 @@
|
||||
|
||||
package org.dromara.hutool.extra.pinyin;
|
||||
|
||||
import org.dromara.hutool.extra.pinyin.engine.tinypinyin.TinyPinyinEngine;
|
||||
import org.dromara.hutool.extra.pinyin.engine.PinyinEngine;
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
public class TinyPinyinTest {
|
||||
|
||||
final TinyPinyinEngine engine = new TinyPinyinEngine();
|
||||
final PinyinEngine engine = PinyinUtil.createEngine("tinypinyin");
|
||||
|
||||
@Test
|
||||
public void getFirstLetterByPinyin4jTest(){
|
||||
|
@@ -15,6 +15,8 @@ package org.dromara.hutool.extra.ssh;
|
||||
import org.dromara.hutool.core.io.IoUtil;
|
||||
import org.dromara.hutool.core.lang.Console;
|
||||
import com.jcraft.jsch.Session;
|
||||
import org.dromara.hutool.extra.ssh.engine.jsch.JschUtil;
|
||||
import org.dromara.hutool.extra.ssh.engine.jsch.Sftp;
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
import org.junit.jupiter.api.Disabled;
|
||||
import org.junit.jupiter.api.Test;
|
||||
@@ -74,7 +76,7 @@ public class JschUtilTest {
|
||||
Console.log("isConnected " + sftp.getClient().isConnected());
|
||||
Console.log("打印pwd: " + sftp.pwd());
|
||||
Console.log("cd / : " + sftp.cd("/"));
|
||||
}catch (final JschRuntimeException e) {
|
||||
}catch (final SshException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
|
@@ -13,6 +13,7 @@
|
||||
package org.dromara.hutool.extra.ssh;
|
||||
|
||||
import org.dromara.hutool.core.util.CharsetUtil;
|
||||
import org.dromara.hutool.extra.ssh.engine.sshj.SshjSftp;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Disabled;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
@@ -14,14 +14,6 @@ package org.dromara.hutool.extra.tokenizer;
|
||||
|
||||
import org.dromara.hutool.core.collection.iter.IterUtil;
|
||||
import org.dromara.hutool.extra.tokenizer.engine.TokenizerEngine;
|
||||
import org.dromara.hutool.extra.tokenizer.engine.analysis.SmartcnEngine;
|
||||
import org.dromara.hutool.extra.tokenizer.engine.hanlp.HanLPEngine;
|
||||
import org.dromara.hutool.extra.tokenizer.engine.ikanalyzer.IKAnalyzerEngine;
|
||||
import org.dromara.hutool.extra.tokenizer.engine.jcseg.JcsegEngine;
|
||||
import org.dromara.hutool.extra.tokenizer.engine.jieba.JiebaEngine;
|
||||
import org.dromara.hutool.extra.tokenizer.engine.mmseg.MmsegEngine;
|
||||
import org.dromara.hutool.extra.tokenizer.engine.mynlp.MynlpEngine;
|
||||
import org.dromara.hutool.extra.tokenizer.engine.word.WordEngine;
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
@@ -51,7 +43,7 @@ public class TokenizerUtilTest {
|
||||
|
||||
@Test
|
||||
public void hanlpTest() {
|
||||
final TokenizerEngine engine = new HanLPEngine();
|
||||
final TokenizerEngine engine = TokenizerUtil.createEngine("hanlp");
|
||||
final Result result = engine.parse(text);
|
||||
final String resultStr = IterUtil.join(result, " ");
|
||||
Assertions.assertEquals("这 两 个 方法 的 区别 在于 返回 值", resultStr);
|
||||
@@ -59,7 +51,7 @@ public class TokenizerUtilTest {
|
||||
|
||||
@Test
|
||||
public void ikAnalyzerTest() {
|
||||
final TokenizerEngine engine = new IKAnalyzerEngine();
|
||||
final TokenizerEngine engine = TokenizerUtil.createEngine("IKAnalyzer");
|
||||
final Result result = engine.parse(text);
|
||||
final String resultStr = IterUtil.join(result, " ");
|
||||
Assertions.assertEquals("这两个 方法 的 区别 在于 返回值", resultStr);
|
||||
@@ -67,14 +59,14 @@ public class TokenizerUtilTest {
|
||||
|
||||
@Test
|
||||
public void jcsegTest() {
|
||||
final TokenizerEngine engine = new JcsegEngine();
|
||||
final TokenizerEngine engine = TokenizerUtil.createEngine("Jcseg");
|
||||
final Result result = engine.parse(text);
|
||||
checkResult(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void jiebaTest() {
|
||||
final TokenizerEngine engine = new JiebaEngine();
|
||||
final TokenizerEngine engine = TokenizerUtil.createEngine("Jieba");
|
||||
final Result result = engine.parse(text);
|
||||
final String resultStr = IterUtil.join(result, " ");
|
||||
Assertions.assertEquals("这 两个 方法 的 区别 在于 返回值", resultStr);
|
||||
@@ -82,14 +74,14 @@ public class TokenizerUtilTest {
|
||||
|
||||
@Test
|
||||
public void mmsegTest() {
|
||||
final TokenizerEngine engine = new MmsegEngine();
|
||||
final TokenizerEngine engine = TokenizerUtil.createEngine("Mmseg");
|
||||
final Result result = engine.parse(text);
|
||||
checkResult(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void smartcnTest() {
|
||||
final TokenizerEngine engine = new SmartcnEngine();
|
||||
final TokenizerEngine engine = TokenizerUtil.createEngine("Smartcn");
|
||||
final Result result = engine.parse(text);
|
||||
final String resultStr = IterUtil.join(result, " ");
|
||||
Assertions.assertEquals("这 两 个 方法 的 区别 在于 返回 值", resultStr);
|
||||
@@ -97,7 +89,7 @@ public class TokenizerUtilTest {
|
||||
|
||||
@Test
|
||||
public void wordTest() {
|
||||
final TokenizerEngine engine = new WordEngine();
|
||||
final TokenizerEngine engine = TokenizerUtil.createEngine("Word");
|
||||
final Result result = engine.parse(text);
|
||||
final String resultStr = IterUtil.join(result, " ");
|
||||
Assertions.assertEquals("这两个 方法 的 区别 在于 返回值", resultStr);
|
||||
@@ -105,7 +97,7 @@ public class TokenizerUtilTest {
|
||||
|
||||
@Test
|
||||
public void mynlpTest() {
|
||||
final TokenizerEngine engine = new MynlpEngine();
|
||||
final TokenizerEngine engine = TokenizerUtil.createEngine("Mynlp");
|
||||
final Result result = engine.parse(text);
|
||||
final String resultStr = IterUtil.join(result, " ");
|
||||
Assertions.assertEquals("这 两个 方法 的 区别 在于 返回 值", resultStr);
|
||||
|
Reference in New Issue
Block a user