Skip to content

Commit b164116

Browse files
committed
Merge branch 'KeyPrefix'
# Conflicts: # BeetleX.Redis.XUnitTest/DBTester.cs
2 parents bf4bd7f + a08b0d4 commit b164116

File tree

137 files changed

+205
-210
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

137 files changed

+205
-210
lines changed

BeetleX.Redis.XUnitTest/DBMessagePackTester.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public class DBMessagePackTester
1414
public DBMessagePackTester(ITestOutputHelper output)
1515
{
1616
this.Console = output;
17-
DB.Host.AddWriteHost("192.168.2.19");
17+
DB.Host.AddWriteHost("localhost");
1818
}
1919

2020
private RedisDB DB = new RedisDB(0, new MessagePackFormater());

BeetleX.Redis.XUnitTest/DBTester.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,12 @@ public DBTester(ITestOutputHelper output)
1717
{
1818
this.Console = output;
1919
//DB.Host.AddWriteHost("192.168.2.19", 6378, true);
20+
<<<<<<< HEAD
2021
DB.Host.AddWriteHost("192.168.2.19", 6379);
22+
=======
23+
DB.Host.AddWriteHost("127.0.0.1");
24+
DB.KeyPrefix = "bbq";
25+
>>>>>>> KeyPrefix
2126

2227
}
2328

@@ -183,7 +188,7 @@ public async void Keys()
183188
await DB.Flushall();
184189
var mset = await DB.MSet(("one", 1), ("tow", 2), ("three", 2), ("four", 4));
185190
Write(mset);
186-
var keys = await DB.Keys("*o*");
191+
var keys = await DB.Keys("*");
187192
Write(keys);
188193
keys = await DB.Keys("t??");
189194
Write(keys);

BeetleX.Redis.XUnitTest/GEOTester.cs

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -23,29 +23,6 @@ public GEOTester(ITestOutputHelper output)
2323

2424
public DataHelper Data => DataHelper.Defalut;
2525

26-
27-
private Employee GetEmployee(int id)
28-
{
29-
return Data.Employees[id];
30-
}
31-
32-
private Order GetOrder(int id)
33-
{
34-
return Data.Orders[id];
35-
}
36-
37-
private OrderBase GetOrderBase(int id)
38-
{
39-
return Data.OrderBases[id];
40-
}
41-
42-
private Customer GetCustomer(int id)
43-
{
44-
return Data.Customers[id];
45-
}
46-
47-
48-
4926
private void Write(object result)
5027
{
5128
if (result is System.Collections.IEnumerable && !(result is string))

BeetleX.Redis.XUnitTest/HashTableTester.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ public HashTableTester(ITestOutputHelper output)
1212
{
1313
this.Console = output;
1414
DB.Host.AddWriteHost("localhost");
15+
DB.KeyPrefix = "KV";
1516
}
1617

1718
private RedisDB DB = new RedisDB(0);

BeetleX.Redis.XUnitTest/SequenceTest.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public class SequenceTest
1313
public SequenceTest(ITestOutputHelper output)
1414
{
1515
this.Console = output;
16-
DB.Host.AddWriteHost("192.168.2.19");
16+
DB.Host.AddWriteHost("localhost");
1717
}
1818

1919
private RedisDB DB = new RedisDB(0);
@@ -38,7 +38,8 @@ public async void ZAdd()
3838
{
3939
await DB.Del("seq2");
4040
var sequeue = DB.CreateSequence("seq2");
41-
var count = await sequeue.ZAdd((1, Guid.NewGuid().ToString("N")), (2, Guid.NewGuid().ToString("N")));
41+
var count = await sequeue.ZAdd((123.1231, "123"), (123.1231, "234"));
42+
var value = await sequeue.ZRange(0, -1,true);
4243
Assert.Equal<long>(count, 2);
4344
Write(count);
4445
}

BeetleX.Redis.XUnitTest/SetsTester.cs

Lines changed: 2 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -16,35 +16,12 @@ public SetsTester(ITestOutputHelper output)
1616
this.Console = output;
1717
DefaultRedis.Instance.Host.AddWriteHost("localhost");
1818
DefaultRedis.Instance.DataFormater = new JsonFormater();
19-
DB = DefaultRedis.Instance;
19+
DB = DefaultRedis.Instance.Cloneable();
20+
DB.KeyPrefix = "HENRY";
2021
}
2122

2223
private RedisDB DB;
2324

24-
public DataHelper Data => DataHelper.Defalut;
25-
26-
27-
private Employee GetEmployee(int id)
28-
{
29-
return Data.Employees[id];
30-
}
31-
32-
private Order GetOrder(int id)
33-
{
34-
return Data.Orders[id];
35-
}
36-
37-
private OrderBase GetOrderBase(int id)
38-
{
39-
return Data.OrderBases[id];
40-
}
41-
42-
private Customer GetCustomer(int id)
43-
{
44-
return Data.Customers[id];
45-
}
46-
47-
4825
private void Write(object result)
4926
{
5027
if (result is System.Collections.IEnumerable && !(result is string))

BeetleX.Redis.XUnitTest/StreamTester.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ public StreamTester(ITestOutputHelper output)
1717
{
1818
this.Console = output;
1919
DB.DataFormater = new JsonFormater();
20+
DB.KeyPrefix = "henry";
2021
DB.Host.AddWriteHost("127.0.0.1");
2122
}
2223

@@ -61,7 +62,7 @@ public async void XRANGE()
6162
{
6263
RedisStream<Employee> stream = DB.GetStream<Employee>("employees_stream");
6364
var items = await stream.Range();
64-
items = await stream.Read(0);
65+
items = await stream.Read(0, 1, "0");
6566
Write(items);
6667
}
6768
[Fact]
@@ -74,7 +75,7 @@ public async void XREVRANGE()
7475
[Fact]
7576
public async void XREADProperties()
7677
{
77-
RedisStream<Dictionary<string,string>> stream = DB.GetStream<Dictionary<string, string>>("employees_stream");
78+
RedisStream<Dictionary<string, string>> stream = DB.GetStream<Dictionary<string, string>>("employees_stream");
7879
var items = await stream.RangeAll();
7980
Write(items);
8081
items = await stream.RevRangeAll();

BeetleX.Redis.sln

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BeetleX.Redis.Samples", "Be
1111
EndProject
1212
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BeetleX.Redis.XUnitTest", "BeetleX.Redis.XUnitTest\BeetleX.Redis.XUnitTest.csproj", "{B805DA42-087A-4884-9EB1-062771C62026}"
1313
EndProject
14+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "StackExchange.Redis", "C:\Users\henry\Downloads\StackExchange.Redis-main\StackExchange.Redis-main\src\StackExchange.Redis\StackExchange.Redis.csproj", "{9D6EF164-37F3-4674-8B04-3D411A4C9568}"
15+
EndProject
1416
Global
1517
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1618
Debug|Any CPU = Debug|Any CPU
@@ -33,6 +35,10 @@ Global
3335
{B805DA42-087A-4884-9EB1-062771C62026}.Debug|Any CPU.Build.0 = Debug|Any CPU
3436
{B805DA42-087A-4884-9EB1-062771C62026}.Release|Any CPU.ActiveCfg = Release|Any CPU
3537
{B805DA42-087A-4884-9EB1-062771C62026}.Release|Any CPU.Build.0 = Release|Any CPU
38+
{9D6EF164-37F3-4674-8B04-3D411A4C9568}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
39+
{9D6EF164-37F3-4674-8B04-3D411A4C9568}.Debug|Any CPU.Build.0 = Debug|Any CPU
40+
{9D6EF164-37F3-4674-8B04-3D411A4C9568}.Release|Any CPU.ActiveCfg = Release|Any CPU
41+
{9D6EF164-37F3-4674-8B04-3D411A4C9568}.Release|Any CPU.Build.0 = Release|Any CPU
3642
EndGlobalSection
3743
GlobalSection(SolutionProperties) = preSolution
3844
HideSolutionNode = FALSE

PerformanceTest/GET_JSON.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ public async override Task Execute()
4141
var i = OrderHelper.GetOrderID();
4242
var data = await RedisDB.StringGetAsync(i.ToString());
4343
var item = System.Text.Json.JsonSerializer.Deserialize<Northwind.Data.Order>(data);
44+
if (item.OrderID != i)
45+
throw new Exception("aaaa");
4446
}
4547
}
4648

PerformanceTest/PerformanceTest.csproj

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,14 @@
88

99
<ItemGroup>
1010
<PackageReference Include="BeetleX.CodeBenchmark" Version="1.1.1" />
11-
<PackageReference Include="BeetleX.Redis" Version="1.2.1" />
11+
<PackageReference Include="BeetleX.Redis" Version="1.2.4" />
1212
<PackageReference Include="FreeRedis" Version="0.3.5" />
1313
<PackageReference Include="NewLife.Redis" Version="3.9.2021.407" />
1414
<PackageReference Include="Northwind.Data" Version="1.2.3" />
15-
<PackageReference Include="StackExchange.Redis" Version="2.2.4" />
15+
</ItemGroup>
16+
17+
<ItemGroup>
18+
<ProjectReference Include="C:\Users\henry\Downloads\StackExchange.Redis-main\StackExchange.Redis-main\src\StackExchange.Redis\StackExchange.Redis.csproj" />
1619
</ItemGroup>
1720

1821
<ItemGroup>

0 commit comments

Comments
 (0)