Skip to content

Commit

Permalink
添加http,sql,tcp测试用例,对控制中心的测试用例加入加载状态跟踪,加入测试错误节点显示查看。
Browse files Browse the repository at this point in the history
  • Loading branch information
beetlex-io committed Sep 11, 2017
1 parent 05d7c93 commit 269e14c
Show file tree
Hide file tree
Showing 59 changed files with 184 additions and 21,588 deletions.
1 change: 1 addition & 0 deletions Beetle.DTCore/Beetle.DTCore.csproj
Expand Up @@ -53,6 +53,7 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Center\FolderInfo.cs" />
<Compile Include="Center\NodeInfo.cs" />
<Compile Include="Center\NodeManager.cs" />
<Compile Include="Center\SyncMonitor.cs" />
Expand Down
24 changes: 24 additions & 0 deletions Beetle.DTCore/Center/FolderInfo.cs
@@ -0,0 +1,24 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Beetle.DTCore.Center
{
public class FolderInfo
{
public string Name { get; set; }

public Domains.DomainStatus Status { get; set; }

public override bool Equals(object obj)
{
if (obj is FolderInfo)
return this.Name == ((FolderInfo)obj).Name;
return base.Equals(obj);
}

public string[] Cases { get; set; }
}
}
2 changes: 1 addition & 1 deletion Beetle.DTCore/Center/ServerCenter.cs
Expand Up @@ -15,7 +15,7 @@ public class ServerCenter : IServerHandler
{
public ServerCenter()
{
mUnitTestPath = AppDomain.CurrentDomain.BaseDirectory + System.IO.Path.DirectorySeparatorChar + @"UnitTest" + System.IO.Path.DirectorySeparatorChar;
mUnitTestPath = AppDomain.CurrentDomain.BaseDirectory + @"UnitTest" + System.IO.Path.DirectorySeparatorChar;
Loger = new LogHandlerAdapter();
TimeWatch = new System.Diagnostics.Stopwatch();
TimeWatch.Restart();
Expand Down
7 changes: 4 additions & 3 deletions Beetle.DTCore/Center/TestFolderManager.cs
Expand Up @@ -58,14 +58,14 @@ public TestInfo GetInfo(string name)
return result;
}

public List<string> ListFolders()
public List<FolderInfo> ListFolders()
{
lock (this)
{
List<string> result = new List<string>();
List<FolderInfo> result = new List<FolderInfo>();
foreach (TestInfo item in mFolders.Values)
{
result.Add(item.Name);
result.Add(new DTCore.Center.FolderInfo { Name = item.Name, Status = item.GetDomainAdapter().Status, Cases = item.GetDomainAdapter().GetUnitTests() });
}
return result;
}
Expand Down Expand Up @@ -122,6 +122,7 @@ public void UpdateFile(string test, string filename, byte[] data)
if (mFolders.TryGetValue(test, out info))
{
info.Folder.UpdateFile(filename, data);
info.GetDomainAdapter().Status = Domains.DomainStatus.Uploading;
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion Beetle.DTCore/Domains/AssemblyLoader.cs
Expand Up @@ -113,7 +113,7 @@ public void LoadAssembly(string path)
catch (Exception e_)
{
if (Log != null)
Log.Error("<{0}> domain load {1} assembly error:{3}.", AppName, item.Name, e_.Message);
Log.Error("<{0}> domain load {1} assembly error:{2}", AppName, item.Name, e_.Message);
}
}
if (CompilerFiles)
Expand Down
10 changes: 8 additions & 2 deletions Beetle.DTCore/Domains/DomainAdapter.cs
Expand Up @@ -11,7 +11,7 @@ public class DomainAdapter

public DomainAdapter(string appPath, string appName, DomainArgs args)
{
Status = DomainStatus.Stop;
Status = DomainStatus.None;
mArgs = args;
if (appPath.LastIndexOf(System.IO.Path.DirectorySeparatorChar) != appPath.Length - 1)
{
Expand Down Expand Up @@ -54,6 +54,7 @@ protected void OnChange(FileWatcher e)
{
try
{
Status = DomainStatus.Uploading;
if (Log != null)
{
Log.Info("<{0}> on updating!", AppName);
Expand All @@ -68,6 +69,7 @@ protected void OnChange(FileWatcher e)
}
catch (Exception e_)
{
Status = DomainStatus.Error;
if (Log != null)
{
Log.Error("<{0}> domain update error {1}!", AppName, e_.Message);
Expand Down Expand Up @@ -116,6 +118,7 @@ public void Load()
{
try
{
Status = DomainStatus.None;
Log.Info("<{0}> domain creating ...", AppName);
Type loadertype = typeof(AssemblyLoader);
AppDomainSetup setup = new AppDomainSetup();
Expand All @@ -137,10 +140,11 @@ public void Load()
mLoader.LoadAssembly(AppPath);
mLoader.Load();
Log.Info("<{0}> domain created!", AppName);
Status = DomainStatus.Start;
Status = DomainStatus.Completed;
}
catch (Exception e_)
{
Status = DomainStatus.Error;
if (Log != null)
{
Log.Error("<{0}> domain Creating error {1}!", AppName, e_.Message);
Expand All @@ -153,6 +157,7 @@ public void UnLoad()

if (mLoader != null)
{
Status = DomainStatus.Stop;
try
{
Log.Info("<{0}> domain unloading ...", AppName);
Expand All @@ -164,6 +169,7 @@ public void UnLoad()
}
catch (Exception e_)
{
Status = DomainStatus.Error;
if (Log != null)
{
Log.Error("<{0}> domain unload error {1}!", AppName, e_.Message);
Expand Down
13 changes: 8 additions & 5 deletions Beetle.DTCore/Domains/DomainStatus.cs
Expand Up @@ -5,9 +5,12 @@

namespace Beetle.DTCore.Domains
{
public enum DomainStatus
{
Start,
Stop
}
public enum DomainStatus
{
None,
Completed,
Error,
Uploading,
Stop
}
}
12 changes: 1 addition & 11 deletions Beetle.DTCore/ITestProcessHandler.cs
Expand Up @@ -15,18 +15,8 @@ public class TestProcessHandler : ITestProcessHandler
{
public void Execute(ITestCase test)
{
Task.Run(() =>
{
try
{
test.Execute();
}
catch
{
}

});
Task.Run(new Action(test.Execute));
}
}

Expand Down
7 changes: 4 additions & 3 deletions Beetle.DTCore/Network/ListFolder.cs
@@ -1,4 +1,5 @@
using System;
using Beetle.DTCore.Center;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
Expand All @@ -16,9 +17,9 @@ public class ListFolderResponse : MessageBase

public ListFolderResponse()
{
Items = new List<string>();
Items = new List<FolderInfo>();
}
public List<string> Items { get; set; }
public List<FolderInfo> Items { get; set; }
}

}
4 changes: 2 additions & 2 deletions Beetle.DTCore/Properties/AssemblyInfo.cs
Expand Up @@ -32,5 +32,5 @@
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
// 方法是按如下所示使用“*”: :
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.9.5.0")]
[assembly: AssemblyFileVersion("0.9.5.0")]
[assembly: AssemblyVersion("0.9.6.0")]
[assembly: AssemblyFileVersion("0.9.6.0")]

This file was deleted.

Binary file removed Beetle.DTCore/obj/Debug/Beetle.DTCore.dll
Binary file not shown.
Binary file removed Beetle.DTCore/obj/Debug/Beetle.DTCore.pdb
Binary file not shown.
Binary file not shown.
Empty file.
Empty file.
Empty file.
17 changes: 15 additions & 2 deletions Beetle.DTManager/FrmErrors.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions Beetle.DTManager/FrmErrors.cs
Expand Up @@ -34,7 +34,12 @@ private void FrmErrors_Load(object sender, EventArgs e)

private void lstErrors_SelectedIndexChanged(object sender, EventArgs e)
{
if (lstErrors.SelectedItem != null)
{
Beetle.DTCore.Network.ErrorInfo info = (Beetle.DTCore.Network.ErrorInfo)lstErrors.SelectedItem;
richTextBox1.Text = info.StackTrace;

}
}
}
}
1 change: 1 addition & 0 deletions Beetle.DTManager/FrmMain.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 269e14c

Please sign in to comment.