-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdevelopTest_core.cs
More file actions
81 lines (71 loc) · 2.57 KB
/
developTest_core.cs
File metadata and controls
81 lines (71 loc) · 2.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Sercher;
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Linq;
namespace developTest_core
{
[TestClass]
public class UnitTest1
{
[TestMethod]
public void TestMethod1()
{
LinkedList<String> nodes = new LinkedList<string>();
nodes.AddLast("192.168.2.1:8080");
nodes.AddLast("192.168.2.2:8080");
nodes.AddLast("192.168.2.3:8080");
nodes.AddLast("192.168.2.4:8080");
//ConsistentHashLoadBalance consistentHash = new ConsistentHashLoadBalance(nodes, 160);
//nsistentHash.printTreeNode();
}
[TestMethod]
public void TesGethash()
{
// ConsistentHashLoadBalance consistentHash = new ConsistentHashLoadBalance();
// consistentHash.GetHashByWorld("我都");
}
public void mongodbtest()
{
}
[TestMethod]
public void testjiebaSegmenter()
{
// var text = Peripheral.BeforeEncodingClass.GetText(File.ReadAllBytes("Www.Chnxp.Com.Cn 黑魔导.txt"));
// var u= PeripheralTool.Peripheral.Segmenter(text);
}
[TestMethod]
public void TestIndex()
{
Config.Init(true);
foreach (var path in Directory.GetFiles(@"C:\Users\yjdcb\Desktop\temp", "*.*", SearchOption.AllDirectories)
.Where(x => x.LastIndexOf(".txt") != -1
|| x.LastIndexOf(".doc") != -1
|| x.LastIndexOf(".xls") != -1
|| x.LastIndexOf(".xhtml") != -1
))
(new DocumentDB { DbName = "mydb", Ip = "WIN-T9ASCBISP3P\\MYSQL" }).UploadDocument(new Document() { hasIndexed = "no", Name = new FileInfo(path).Name, Url = path });
var se = new SercherServerBase();
se.BuildSercherIndexToSQLDB();
}
[TestMethod]
public void TestPretreatment()
{
//SercherServerBase.Pretreatment(new Document { Name = "text", Url = @"C:\Users\yjdcb\Desktop\行测笔记.docx" });
var r= SercherServerBase.Pretreatment(new Document { Name = "text", Url = @"C:\Users\yjdcb\OneDrive\Documents\heart of woods.xlsx" });
}
[TestMethod]
public void TestSearcher()
{
Config.Init();
var list= new SercherServerBase().Searcher("头上");
}
[TestMethod]
public void TestInit()
{
Config.Init();
}
}
}