Fix several tests

This commit is contained in:
Timothy Baldridge 2020-04-06 16:02:01 -06:00
parent 45254b0055
commit 4e0b050260
12 changed files with 36 additions and 3 deletions

View File

@ -5,6 +5,7 @@ using System.Linq;
using System.Text;
using ICSharpCode.SharpZipLib.Zip.Compression;
using Wabbajack.Common;
using Wabbajack.Common.Serialization.Json;
using File = Alphaleonis.Win32.Filesystem.File;
namespace Compression.BSA
@ -108,6 +109,7 @@ namespace Compression.BSA
public ArchiveStateObject State => new BA2StateObject(this);
}
[JsonName("BA2State")]
public class BA2StateObject : ArchiveStateObject
{
public BA2StateObject()
@ -324,6 +326,7 @@ namespace Compression.BSA
}
}
[JsonName("BA2DX10Entry")]
public class BA2DX10EntryState : FileStateObject
{
public BA2DX10EntryState() { }
@ -367,6 +370,7 @@ namespace Compression.BSA
public uint NameHash { get; set; }
}
[JsonName("Chunk")]
public class ChunkState
{
public ChunkState() {}
@ -386,6 +390,7 @@ namespace Compression.BSA
public uint FullSz { get; set; }
}
[JsonName("BA2TextureChunk")]
public class BA2TextureChunk
{
internal ulong _offset;
@ -469,6 +474,7 @@ namespace Compression.BSA
}
}
[JsonName("BA2FileEntryState")]
public class BA2FileEntryState : FileStateObject
{
public BA2FileEntryState() { }

View File

@ -5,6 +5,7 @@ using System.Text;
using ICSharpCode.SharpZipLib.Zip.Compression.Streams;
using K4os.Compression.LZ4.Streams;
using Wabbajack.Common;
using Wabbajack.Common.Serialization.Json;
using File = Alphaleonis.Win32.Filesystem.File;
namespace Compression.BSA
@ -152,6 +153,7 @@ namespace Compression.BSA
}
}
[JsonName("BSAState")]
public class BSAStateObject : ArchiveStateObject
{
public BSAStateObject() { }
@ -342,6 +344,7 @@ namespace Compression.BSA
}
}
[JsonName("BSAFileState")]
public class BSAFileStateObject : FileStateObject
{
public BSAFileStateObject() { }

View File

@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.IO;
using System.Text;
using Wabbajack.Common;
using Wabbajack.Common.Serialization.Json;
namespace Compression.BSA
{
@ -81,6 +82,7 @@ namespace Compression.BSA
}
}
[JsonName("TES3Archive")]
public class TES3ArchiveState : ArchiveStateObject
{
public uint FileCount { get; set; }
@ -127,6 +129,7 @@ namespace Compression.BSA
}
[JsonName("TES3FileState")]
public class TES3FileState : FileStateObject
{
public uint Offset { get; set; }

View File

@ -4,12 +4,14 @@ using System.Linq;
using Wabbajack.BuildServer.Model.Models;
using Wabbajack.BuildServer.Models.JobQueue;
using Wabbajack.Common;
using Wabbajack.Common.Serialization.Json;
using Wabbajack.Lib;
using Wabbajack.Lib.Downloaders;
using Wabbajack.Lib.ModListRegistry;
namespace Wabbajack.BuildServer.Models.Jobs
{
[JsonName("EnqueueAllArchives")]
public class EnqueueAllArchives : AJobPayload, IBackEndJob
{
public override string Description => "Add missing modlist archives to indexer";

View File

@ -6,9 +6,11 @@ using Wabbajack.Lib;
using Wabbajack.Lib.Downloaders;
using System.IO;
using Wabbajack.BuildServer.Model.Models;
using Wabbajack.Common.Serialization.Json;
namespace Wabbajack.BuildServer.Models.Jobs
{
[JsonName("EnqueueAllGameFiles")]
public class EnqueueAllGameFiles : AJobPayload, IBackEndJob
{
public override string Description { get => $"Enqueue all game files for indexing"; }

View File

@ -5,10 +5,12 @@ using Wabbajack.BuildServer.Models.JobQueue;
using Wabbajack.Common;
using Wabbajack.Lib.NexusApi;
using Wabbajack.BuildServer.Model.Models;
using Wabbajack.Common.Serialization.Json;
namespace Wabbajack.BuildServer.Models.Jobs
{
[JsonName("GetNexusUpdatesJob")]
public class GetNexusUpdatesJob : AJobPayload, IFrontEndJob
{
public override string Description => "Poll the Nexus for updated mods, and clean any references to those mods";

View File

@ -6,6 +6,7 @@ using HtmlAgilityPack;
using Wabbajack.BuildServer.Model.Models;
using Wabbajack.BuildServer.Models.JobQueue;
using Wabbajack.Common;
using Wabbajack.Common.Serialization.Json;
using Wabbajack.Lib;
using Wabbajack.Lib.Downloaders;
@ -15,6 +16,7 @@ namespace Wabbajack.BuildServer.Models.Jobs
/// DynDOLOD is really hosted on a STEP Forum post as a series of MEGA links. The Nexus URLs come and go
/// but the real releases are on STEP. So let's keep that data fresh.
/// </summary>
[JsonName("IndexDynDOLOD")]
public class IndexDynDOLOD : AJobPayload
{
public override string Description => "Queue MEGA URLs from the DynDOLOD Post";

View File

@ -6,6 +6,7 @@ using Alphaleonis.Win32.Filesystem;
using Wabbajack.BuildServer.Model.Models;
using Wabbajack.BuildServer.Models.JobQueue;
using Wabbajack.Common;
using Wabbajack.Common.Serialization.Json;
using Wabbajack.Lib;
using Wabbajack.Lib.Downloaders;
using Wabbajack.VirtualFileSystem;
@ -13,6 +14,7 @@ using Wabbajack.VirtualFileSystem;
namespace Wabbajack.BuildServer.Models.Jobs
{
[JsonName("IndexJob")]
public class IndexJob : AJobPayload, IBackEndJob
{
public Archive Archive { get; set; }

View File

@ -7,10 +7,12 @@ using Alphaleonis.Win32.Filesystem;
using Wabbajack.BuildServer.Model.Models;
using Wabbajack.BuildServer.Models.JobQueue;
using Wabbajack.Common;
using Wabbajack.Common.Serialization.Json;
using Wabbajack.VirtualFileSystem;
namespace Wabbajack.BuildServer.Models.Jobs
{
[JsonName("ReindexArchives")]
public class ReindexArchives : AJobPayload
{
public override string Description => "Reindex all files in the mod archive folder";

View File

@ -4,6 +4,7 @@ using System.Threading.Tasks;
using Wabbajack.BuildServer.Model.Models;
using Wabbajack.BuildServer.Models.JobQueue;
using Wabbajack.Common;
using Wabbajack.Common.Serialization.Json;
using Wabbajack.Lib;
using Wabbajack.Lib.Downloaders;
using Wabbajack.Lib.ModListRegistry;
@ -12,6 +13,7 @@ using Wabbajack.Lib.Validation;
namespace Wabbajack.BuildServer.Models.Jobs
{
[JsonName("UpdateModLists")]
public class UpdateModLists : AJobPayload, IFrontEndJob
{
public override string Description => "Validate curated modlists";

View File

@ -6,12 +6,14 @@ using FluentFTP;
using Wabbajack.BuildServer.Model.Models;
using Wabbajack.BuildServer.Models.JobQueue;
using Wabbajack.Common;
using Wabbajack.Common.Serialization.Json;
using Wabbajack.Lib;
using Wabbajack.Lib.Downloaders;
using File = System.IO.File;
namespace Wabbajack.BuildServer.Models.Jobs
{
[JsonName("UploadToCDN")]
public class UploadToCDN : AJobPayload
{
public override string Description => $"Push an uploaded file ({FileId}) to the CDN";

View File

@ -234,15 +234,19 @@ namespace Wabbajack.Common
public class JsonNameSerializationBinder : ISerializationBinder
{
private Dictionary<string, Type> _nameToType;
private Dictionary<Type, string> _typeToName;
private static Dictionary<string, Type> _nameToType = new Dictionary<string, Type>();
private static Dictionary<Type, string> _typeToName = new Dictionary<Type, string>();
private static bool _inited = false;
public JsonNameSerializationBinder()
{
if (_inited)
return;
var customDisplayNameTypes =
AppDomain.CurrentDomain
.GetAssemblies()
.Where(a => a.FullName != null && a.FullName.StartsWith("Wabbajack"))
.Where(a => a.FullName != null && !a.FullName.StartsWith("System") && !a.FullName.StartsWith("Microsoft"))
.SelectMany(a =>
{
try
@ -266,6 +270,7 @@ namespace Wabbajack.Common
_typeToName = _nameToType.ToDictionary(
t => t.Value,
t => t.Key);
_inited = true;
}