FileDisposeHelper.cs

Clone Tools
  • last updated a few seconds ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
Updating copyright year. WTI-2951

  1. … 5657 more files in changeset.
Updating copyright year. WTI-2914

  1. … 5658 more files in changeset.
Updated copyright year. WTI-2882

  1. … 5659 more files in changeset.
Updated license headers. WTI-2820

  1. … 136 more files in changeset.
Updated year in license header to 2022. WTI-2715

  1. … 5729 more files in changeset.
Adapted copyright year. WTI-2195

  1. … 431 more files in changeset.
Updated license headers in source files of test\Core.Common. WTI-1931

  1. … 241 more files in changeset.
Changed copyright year. Paired with lubbers. WTI-1828

  1. … 6095 more files in changeset.
Ran Deltares Cleanup:

- Performed for Common.TestUtil and Common.Util.Test namespaces

WTI-1767

  1. … 16 more files in changeset.
Rename Core.Common.Utils.* to Core.Common.Util.* Related to Issue [WTI-1505]

git-svn-id: https://repos.deltares.nl/repos/WettelijkToetsInstrumentarium/trunk@13231 5a3db67b-de53-47b5-99c8-a1c30a6650e2

Former-commit-id: cbdb6083b66a0f5e31e8d646a50ec7b6d506babb

Former-commit-id: 1e007d66918a5408581dc8e47b78130d5cd299c5

  1. … 841 more files in changeset.
Implement review comments, improve tests and names, update xmldoc, inline some checks Related to Issue [WTI-1391]

git-svn-id: https://repos.deltares.nl/repos/WettelijkToetsInstrumentarium/trunk@12087 5a3db67b-de53-47b5-99c8-a1c30a6650e2

Former-commit-id: 5fb39e58032f2ab2ed02d126a9003c75c1580181

Former-commit-id: f4adacc4c9cca722a4e16e85656e7e3792c9a67a

  1. … 20 more files in changeset.
Updated license headers in core. Related to Issue [WTI-1242]

git-svn-id: https://repos.deltares.nl/repos/WettelijkToetsInstrumentarium/trunk@9490 5a3db67b-de53-47b5-99c8-a1c30a6650e2

Former-commit-id: e7f214adee97782d28ee82f096d8cc27547439e6

Former-commit-id: b339ec31825c8ea8fed91e675069b65afba8433b

  1. … 817 more files in changeset.
Review related changes Related to Issue [WTI-1229]

git-svn-id: https://repos.deltares.nl/repos/WettelijkToetsInstrumentarium/trunk@9155 5a3db67b-de53-47b5-99c8-a1c30a6650e2

Former-commit-id: 285128d4cefa432f3689d4ab0f908f69c24214b6

Former-commit-id: 7840d089bbdaa8ed2a7ecdf87690902ed1fe1dd7

  1. … 1 more file in changeset.
* Fix attempt for bug in buildserver.

Should fix the following exception occurring on teamcity:

Expected: No Exception to be thrown

But was: <System.InvalidOperationException: Collection was modified; enumeration operation may not execute.

at System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource)

at System.Collections.Generic.Dictionary`2.KeyCollection.Enumerator.MoveNext()

at Core.Common.TestUtil.FileDisposeHelper.Create()

at Core.Common.TestUtil.FileDisposeHelper..ctor(IEnumerable`1 filePaths)

at Core.Common.TestUtil.Test.FileDisposeHelperTest.<>c__DisplayClass5_0.<Constructor_InvalidPath_DoesNotThrowException>b__0()

at NUnit.Framework.Constraints.ThrowsConstraint.VoidInvocationDescriptor.Invoke()

at NUnit.Framework.Constraints.ThrowsConstraint.ExceptionInterceptor.Intercept(Object invocation)>

at Core.Common.TestUtil.Test.FileDisposeHelperTest.Constructor_InvalidPath_DoesNotThrowException()

Analysis:

The dictionary is not changed while it is being enumerated. The relevant code is called from within the constructor, so there cannot be another thread attempting to do work on that FileDisposeHelper instance as no reference to that instance has been produced yet. The 'foreach' inside the constructor of FileDisposeHelper over all filepaths will enumerate that particular collection and add member to the dictionary before the Create method is called. From this analysis, I dare to conclude that it is impossible that there are any changes to the dictionary from within the Create method when it is called from the constructor of FileDisposeHelper.

However, failing tests on the buildserver with stacktrace prove otherwise. This at least ought to solve the problem, but it's likely treating symptoms than the actual root cause of the problem.

Related to Issue [WTI-1229]

git-svn-id: https://repos.deltares.nl/repos/WettelijkToetsInstrumentarium/trunk@9057 5a3db67b-de53-47b5-99c8-a1c30a6650e2

Former-commit-id: 9115d5114f3133b79811fb9f0ec1b417431be9f2

Former-commit-id: 1a64da7f60a42c228acb0a0c6776169a436d7185

* Fix attempt for FileDisposeHelper and DirectoryDisposeHelper to perform multiple attempts for deleting file/folder and waiting for finalizers when failing. Related to Issue [WTI-1229]

git-svn-id: https://repos.deltares.nl/repos/WettelijkToetsInstrumentarium/trunk@9050 5a3db67b-de53-47b5-99c8-a1c30a6650e2

Former-commit-id: 0fc2bacae5cffb8e2611e67caa3642ea8f0f5abf

Former-commit-id: 208b6580935083833eaa986ff6131ecfe98b3d37

  1. … 2 more files in changeset.
Review suggestion - Extracted 'can write in directory' to TestHelper Related to Issue [WTI-1091]

git-svn-id: https://repos.deltares.nl/repos/WettelijkToetsInstrumentarium/trunk@8444 5a3db67b-de53-47b5-99c8-a1c30a6650e2

Former-commit-id: 765597811edfbd109236b4e396a7773d858cdc7f

Former-commit-id: 8df66894178c30a8573677d772beb1e308a58755

  1. … 4 more files in changeset.
- Used nameof methods instead of random path to create test file names. - Bubbled IOException when trying to delete a test file and it fails so we know that the file is not deleted. Paired with @janssen

git-svn-id: https://repos.deltares.nl/repos/WettelijkToetsInstrumentarium/trunk@8412 5a3db67b-de53-47b5-99c8-a1c30a6650e2

Former-commit-id: e808c5751086faf8a2b72d918e1074adb5044314

Former-commit-id: 4ba1926135f291f4b4a4ecb3debc1e7712f492c3

  1. … 25 more files in changeset.
Fixed Dispose implementation, see: * https://msdn.microsoft.com/en-us/library/fs2xkftw(v=vs.110).aspx * https://msdn.microsoft.com/en-us/library/ms182329.aspx Modified test names according to review suggestions paired with berg_jl Related to Issue [WTI-1060]

git-svn-id: https://repos.deltares.nl/repos/WettelijkToetsInstrumentarium/trunk@8173 5a3db67b-de53-47b5-99c8-a1c30a6650e2

Former-commit-id: 0309ea4270612fcb1bcc18fc4a5e736b9d1722d2

Former-commit-id: 8e47735d6edd9e2f33431dd21d6f9c686651c976

  1. … 5 more files in changeset.
Created method to lock the files in FileDisposeHelper

Related to Issue [WTI-1060]

git-svn-id: https://repos.deltares.nl/repos/WettelijkToetsInstrumentarium/trunk@8148 5a3db67b-de53-47b5-99c8-a1c30a6650e2

Former-commit-id: cf200112fe4cc6f7b116b10789756cdd455cfeee

Former-commit-id: e7781162166cbb6dd42603c6adb9d5e6377ace5d

  1. … 2 more files in changeset.
* Renamed FileUtils to IOUtils and extended it with folder related validation methods. ** Defined DirectoryWriterErrorMessageBuilder to be used in validation message generation. * Extended MapControl with BackgroundMapData property. ** MapControl observes BackgroundMapData for changes. ** BackgroundMapData defines the coordinate system used, and will reprojet all other layers when needed. * Defined testing mocks for getting fake tile data, instead of requiring an internet connection for tests. * PipingFailureMechanismView makes use of the BackgroundMapData feature. Related to Issue [WTI-1088]

git-svn-id: https://repos.deltares.nl/repos/WettelijkToetsInstrumentarium/trunk@7881 5a3db67b-de53-47b5-99c8-a1c30a6650e2

Former-commit-id: ebd8aca90052bb12a8d8167237267eb60e050684

Former-commit-id: 8a9624c64bec0ab4467267d9cbdbe12698bdff96

  1. … 65 more files in changeset.
Incorporated comments review 1176

Paired with janssen

Related to Issue [WTI-931]

git-svn-id: https://repos.deltares.nl/repos/WettelijkToetsInstrumentarium/trunk@6532 5a3db67b-de53-47b5-99c8-a1c30a6650e2

Former-commit-id: caf6ee7611042698e1c3825f88054cdc6d2c419e

Former-commit-id: aa9603d60888fe2b9df0424071acb03e28bd446e

  1. … 11 more files in changeset.
- Some XMLdoc related changes - Added tests for FileDisposeHelperTest Related to Issue [WTI-931]

git-svn-id: https://repos.deltares.nl/repos/WettelijkToetsInstrumentarium/trunk@6427 5a3db67b-de53-47b5-99c8-a1c30a6650e2

Former-commit-id: 77c87ba591192bdd285d37f194ef4c3587be5787

Former-commit-id: fb1887410da13bb09ff78cf6d529d20c51f16d37

  1. … 1 more file in changeset.
Merged revision(s) 5006-5019 from branches/Release/16_1_1: Resharper cleanup Related to Issue WTI 739

........

Resharper cleanup

Related to Issue WTI 739

........

Resharper cleanup

Related to Issue WTI 739

........

constants now are at the beginning of test files.

Resharper cleanup

Related to Issue WTI 739

........

Resharper cleanup

Related to Issue WTI 739

........

Resharper cleanup

Related to Issue WTI 739

........

Cleanup project references.

Related to Issue WTI 737

........

git-svn-id: https://repos.deltares.nl/repos/WettelijkToetsInstrumentarium/trunk@5024 5a3db67b-de53-47b5-99c8-a1c30a6650e2

Former-commit-id: 21f2b2d3f74765437bc2f5ac6001d62a6c3afd98

Former-commit-id: 79979c7e6cb96a998c3b1a0d4fc4d9bd4bf10566

  1. … 219 more files in changeset.
Documented exceptions thrown by FileDisposeHelper. Restructured test data so that TestDataCopyHelper became obsolete. Restructured tests so that DirectoryDisposeHelper became obsolete. Extended FileUtils with IsValidFilePath.

Related to Issue [WTI-666]

git-svn-id: https://repos.deltares.nl/repos/WettelijkToetsInstrumentarium/trunk@4000 5a3db67b-de53-47b5-99c8-a1c30a6650e2

Former-commit-id: 7bed29310919ea82c6700affd257a7e68b942633

Former-commit-id: 418f990752da2b746fa44a116f2266b30835f853

  1. … 72 more files in changeset.
Added doc where missing. Improved routine for matching the most relevant overtopping result. Made many variable explicit. Translated overtopping/overflow. Added license headers where missing. Added category for indicative wave height results.

Related to Issue [WTI-666]

git-svn-id: https://repos.deltares.nl/repos/WettelijkToetsInstrumentarium/trunk@3986 5a3db67b-de53-47b5-99c8-a1c30a6650e2

Former-commit-id: e4122fec3057e43ed0aa322beda948de72cc74e3

Former-commit-id: ba893975098e4d3904aa49634351eb394d5de26c

  1. … 18 more files in changeset.
Added DirectoryDisposeHelper to create directories and have them removed when Disposing the instance. Modified FileDisposeHelper so that the Create method doesn't need to be called every time. HydraRingInitializationService and HydraRingConfigurationService are now responsible for writing their files themselves. Introduced HydraRingFileName with file name constants for in-/output files. Made TargetProbabilityCalculationParser and ExceedanceProbabilityCalculationParser non-static, so that output can be set on the parsers and read after parsing. Added license headers to Core.Common.TestUtil and Core.Common.TestUtil.Test files. Added Ringtoets.HydraRing.Calculation.TestUtil which contains a TestTargetProbabilityCalculationInput which can be used for testing. Added Ringtoets.HydraRing.Calculation.TestUtil.Test for tests. Related to Issue [WTI-666]

git-svn-id: https://repos.deltares.nl/repos/WettelijkToetsInstrumentarium/trunk@3933 5a3db67b-de53-47b5-99c8-a1c30a6650e2

Former-commit-id: 65a4114dbe4f5ac9b516fd2753693db31aa4304e

Former-commit-id: 55601eb9116b1dff7de78dae0cd1a3d4385ea0a5

  1. … 47 more files in changeset.
- Moved GC of FileDisposeHelper to the tests that depend on it -- Found out that calling *SQLiteConnection.ClearAllPools();* should close the connection pools. Unfortunately, in combination with the Entity Framework it does not seem to to have affect anything.

Related to Issue [WTI-476]

git-svn-id: https://repos.deltares.nl/repos/WettelijkToetsInstrumentarium/trunk@2839 5a3db67b-de53-47b5-99c8-a1c30a6650e2

Former-commit-id: 714bcdc0449060510357432a4911f7c707119174

Former-commit-id: 0dbd339ef76ea75631b12f83cae703df639c6a68

  1. … 5 more files in changeset.
- Extended FileDisposeHelper to support multiple files that are guaranteed to be deleted upon disposal. - Implemented *PerformCalculation* for *ExceedanceProbabilityCalculationOutput* Related to Issue [WTI-476]

git-svn-id: https://repos.deltares.nl/repos/WettelijkToetsInstrumentarium/trunk@2798 5a3db67b-de53-47b5-99c8-a1c30a6650e2

Former-commit-id: 7a76766169ac55a3e4b54b1c8ee9b5f8751344d7

Former-commit-id: 175f2ab6ab6fd6fd6971d29d79d08f8dd49f129f

  1. … 4 more files in changeset.
- Review comments processed Related to Issue [WTI-434]

git-svn-id: https://repos.deltares.nl/repos/WettelijkToetsInstrumentarium/trunk@2606 5a3db67b-de53-47b5-99c8-a1c30a6650e2

Former-commit-id: f05f341be86ca1b4eb879333768a3925aa0cf58f

Former-commit-id: 447cb6e97ffc42fd36f3f0ce3d1649cd844161b9

    • -0
    • +52
    ./FileDisposeHelper.cs
  1. … 20 more files in changeset.