Piscal processing work
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Configuration;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using LeafWeb.Core.Remote;
|
||||
using LeafWeb.Core.Utility;
|
||||
@@ -10,17 +11,19 @@ namespace LeafWeb.Core.Tests.Remote
|
||||
[TestFixture]
|
||||
public class PiscalSshClientTests
|
||||
{
|
||||
private const string ContentDirectory = @"Parsers\LeafInputData\";
|
||||
|
||||
private readonly PiscalLeafInput _testInput =
|
||||
new PiscalLeafInput
|
||||
{
|
||||
LeafInputId = 1,
|
||||
DirectoryName = "TestDirectory2",
|
||||
DirectoryName = "TestDirectory3",
|
||||
PhotosyntheticType = "C4_photosynthesis_leafweb",
|
||||
InputFiles = new[]
|
||||
{
|
||||
new PiscalLeafInputFile
|
||||
{
|
||||
Filename = "blah", Contents = "test".GetBytes()
|
||||
Filename = "valid.csv", Contents = File.ReadAllBytes(FileUtility.GetContentFile(ContentDirectory, "LeafInput-valid.csv").FullName)
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -28,17 +31,22 @@ namespace LeafWeb.Core.Tests.Remote
|
||||
private readonly string _piscalConnectionString =
|
||||
ConfigurationManager.ConnectionStrings["PiscalServer"].ConnectionString;
|
||||
|
||||
private PiscalSshClient GetTestClient()
|
||||
{
|
||||
return new PiscalSshClient(_piscalConnectionString);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void SubmitLeafInputFile()
|
||||
{
|
||||
var client = new PiscalSshClient(_piscalConnectionString);
|
||||
var client = GetTestClient();
|
||||
client.RunLeafInput(_testInput);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void GetLeafInputStatus()
|
||||
{
|
||||
var client = new PiscalSshClient(_piscalConnectionString);
|
||||
var client = GetTestClient();
|
||||
var leafInputStatus = client.GetLeafInputStatus(_testInput);
|
||||
Console.WriteLine(leafInputStatus);
|
||||
}
|
||||
@@ -46,10 +54,17 @@ namespace LeafWeb.Core.Tests.Remote
|
||||
[Test]
|
||||
public void RetrieveLeafOutput()
|
||||
{
|
||||
var client = new PiscalSshClient(_piscalConnectionString);
|
||||
var client = GetTestClient();
|
||||
var result = client.RetrieveLeafOutput(_testInput).ToList();
|
||||
Console.WriteLine(string.Join(", ", result.Select(o => o.Filename)));
|
||||
//Console.WriteLine(result[0].Contents.GetString());
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void CleanLeafOutput()
|
||||
{
|
||||
var client = GetTestClient();
|
||||
client.CleanupLeafProcess(_testInput);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user