Skip to content

Commit

Permalink
Remove RunSerialyAndSweepTmpFilesAttribute
Browse files Browse the repository at this point in the history
  • Loading branch information
Bykiev committed Sep 14, 2023
1 parent 928fa26 commit e7faafb
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 74 deletions.
6 changes: 5 additions & 1 deletion solution/NPOI.Core.Test.sln
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "_build", "..\build\_build.c
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NPOI.Benchmarks", "..\benchmarks\NPOI.Benchmarks\NPOI.Benchmarks.csproj", "{3DA1149D-46F8-4181-9976-E002BF2BFB76}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NPOI.Pack", "NPOI.Pack.csproj", "{6D7A6E15-C914-4FCA-B8E4-FF5C7437C2E0}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NPOI.Pack", "NPOI.Pack.csproj", "{6D7A6E15-C914-4FCA-B8E4-FF5C7437C2E0}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down Expand Up @@ -62,6 +62,10 @@ Global
{DA2CA3BD-1CAC-470C-9FA2-611A5768A76A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DA2CA3BD-1CAC-470C-9FA2-611A5768A76A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DA2CA3BD-1CAC-470C-9FA2-611A5768A76A}.Release|Any CPU.Build.0 = Release|Any CPU
{94B18BCF-84E8-401F-BAAB-0496AA136628}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{94B18BCF-84E8-401F-BAAB-0496AA136628}.Debug|Any CPU.Build.0 = Debug|Any CPU
{94B18BCF-84E8-401F-BAAB-0496AA136628}.Release|Any CPU.ActiveCfg = Release|Any CPU
{94B18BCF-84E8-401F-BAAB-0496AA136628}.Release|Any CPU.Build.0 = Release|Any CPU
{3DA1149D-46F8-4181-9976-E002BF2BFB76}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3DA1149D-46F8-4181-9976-E002BF2BFB76}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3DA1149D-46F8-4181-9976-E002BF2BFB76}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand Down
53 changes: 0 additions & 53 deletions testcases/main/RunSerialyAndSweepTmpFilesAttribute.cs

This file was deleted.

1 change: 0 additions & 1 deletion testcases/main/Util/TestTempFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ namespace TestCases.Util
/// Tests of creating temp files
/// </summary>
[TestFixture]
[NonParallelizable]
internal class TestTempFile
{
[Test]
Expand Down
1 change: 0 additions & 1 deletion testcases/ooxml/XSSF/Streaming/GZIPSheetDataWriterTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ limitations under the License.
namespace TestCases.XSSF.Streaming
{
[TestFixture]
[NonParallelizable]
public class GZIPSheetDataWriterTests
{
private GZIPSheetDataWriter _objectToTest;
Expand Down
1 change: 0 additions & 1 deletion testcases/ooxml/XSSF/Streaming/SheetDataWriterTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ limitations under the License.
namespace TestCases.XSSF.Streaming
{
[TestFixture]
[NonParallelizable]
public class SheetDataWriterTests
{
private SheetDataWriter _objectToTest;
Expand Down
1 change: 0 additions & 1 deletion testcases/ooxml/XSSF/Streaming/TestSXSSFWorkbook.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ namespace TestCases.XSSF.Streaming
using TestCases.Util;

[TestFixture]
[NonParallelizable]
public class TestSXSSFWorkbook : BaseTestXWorkbook
{

Expand Down
2 changes: 1 addition & 1 deletion testcases/ooxml/XSSF/UserModel/TestXSSFBugs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2707,7 +2707,7 @@ public void Bug57642()
* 32,767 must not be -32,768, then -32,767, -32,766
* long time test, run over 1 minute.
*/
[Test, RunSerialyAndSweepTmpFiles]
[Test]
[Ignore("this test doesn't make sense")]
public void Bug57880()
{
Expand Down
5 changes: 2 additions & 3 deletions testcases/ooxml/XSSF/UserModel/TestXSSFWorkbook.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public TestXSSFWorkbook()
/**
* Tests that we can save, and then re-load a new document
*/
[Test, RunSerialyAndSweepTmpFiles]
[Test]
public void SaveLoadNew()
{
XSSFWorkbook wb1 = new XSSFWorkbook();
Expand Down Expand Up @@ -121,9 +121,8 @@ public void SaveLoadNew()
Assert.AreEqual("hello world", sheet1.GetRow(1).GetCell(0).RichStringCellValue.String);

pkg.Close();

Assert.AreEqual(0, Directory.GetFiles(AppDomain.CurrentDomain.BaseDirectory, "*.tmp").Length, "At Last: There are no temporary files.");
}

[Test]
public void Existing()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ public void TestNoCoreProperties_saveNew()
* Document with no core properties - testing at the OPC level,
* from a temp-file, saving in-place
*/
[Test, RunSerialyAndSweepTmpFiles]
[Test]
public void TestNoCoreProperties_saveInPlace()
{
String sampleFileName = "OPCCompliance_NoCoreProperties.xlsx";
Expand Down Expand Up @@ -328,8 +328,7 @@ public void TestNoCoreProperties_saveInPlace()
pkg.Revert();
tmp.Delete();

Assert.AreEqual(0, Directory.GetFiles(AppDomain.CurrentDomain.BaseDirectory, "*.tmp").Length, "At Last: There are no temporary files.");
Assert.IsFalse(File.Exists(tmp.FullName), $"{tmp.FullName} file exists!");
}

}
}
17 changes: 8 additions & 9 deletions testcases/openxml4net/TestPackage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ public void TestCreatePackageAddPart()
* document and another part, save and re-load and
* have everything Setup as expected
*/
[Test, RunSerialyAndSweepTmpFiles]
[Test]
//[Ignore("add relation Uri #Sheet1!A1")]
public void TestCreatePackageWithCoreDocument()
{
Expand Down Expand Up @@ -256,8 +256,6 @@ public void TestCreatePackageWithCoreDocument()
{
pkg.Close();
}

Assert.AreEqual(0, Directory.GetFiles(AppDomain.CurrentDomain.BaseDirectory, "*.tmp").Length, "At Last: There are no temporary files.");
}

private void assertMSCompatibility(OPCPackage pkg)
Expand All @@ -282,7 +280,7 @@ private void assertMSCompatibility(OPCPackage pkg)
/**
* Test namespace opening.
*/
[Test, RunSerialyAndSweepTmpFiles]
[Test]
public void TestOpenPackage()
{
FileInfo targetFile = OpenXml4NetTestDataSamples.GetOutputFile("TestOpenPackageTMP.docx");
Expand Down Expand Up @@ -344,7 +342,7 @@ public void TestOpenPackage()
ZipFileAssert.AssertEqual(expectedFile, targetFile);
File.Delete(targetFile.FullName);

Assert.AreEqual(0, Directory.GetFiles(AppDomain.CurrentDomain.BaseDirectory, "*.tmp").Length, "At Last: There are no temporary files.");
Assert.IsFalse(File.Exists(targetFile.FullName), $"{targetFile.FullName} file exists!");
}

/**
Expand Down Expand Up @@ -531,7 +529,7 @@ public void TestDeletePartRecursive()
* Test that we can open a file by path, and then
* write Changes to it.
*/
[Test, RunSerialyAndSweepTmpFiles, Platform("Win")]
[Test, Platform("Win")]
public void TestOpenFileThenOverWrite()
{
string tempFile = TempFile.GetTempFilePath("poiTesting", "tmp");
Expand Down Expand Up @@ -568,13 +566,13 @@ public void TestOpenFileThenOverWrite()
p.Close();
File.Delete(tempFile);

Assert.AreEqual(0, Directory.GetFiles(AppDomain.CurrentDomain.BaseDirectory, "*.tmp").Length, "At Last: There are no temporary files.");
Assert.IsFalse(File.Exists(tempFile), $"{tempFile} file exists!");
}
/**
* Test that we can open a file by path, save it
* to another file, then delete both
*/
[Test, RunSerialyAndSweepTmpFiles]
[Test]
public void TestOpenFileThenSaveDelete()
{
string tempFile = TempFile.GetTempFilePath("poiTesting", "tmp");
Expand All @@ -593,7 +591,8 @@ public void TestOpenFileThenSaveDelete()
File.Delete(tempFile);
File.Delete(tempFile2);

Assert.AreEqual(0, Directory.GetFiles(AppDomain.CurrentDomain.BaseDirectory, "*.tmp").Length, "At Last: There are no temporary files.");
Assert.IsFalse(File.Exists(tempFile), $"{tempFile} file exists!");
Assert.IsFalse(File.Exists(tempFile2), $"{tempFile2} file exists!");
}

private static ContentTypeManager GetContentTypeManager(OPCPackage pkg)
Expand Down

0 comments on commit e7faafb

Please sign in to comment.