Ejemplo n.º 1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void failToLockSameFolderAcrossIndependentLockers() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void FailToLockSameFolderAcrossIndependentLockers()
        {
            StoreLayout storeLayout = TestDirectory.storeLayout();

            using (GlobalStoreLocker storeLocker = new GlobalStoreLocker(FileSystemRule.get(), storeLayout))
            {
                storeLocker.CheckLock();

                try
                {
                    using (GlobalStoreLocker locker = new GlobalStoreLocker(FileSystemRule.get(), storeLayout))
                    {
                        locker.CheckLock();
                        fail("directory should be locked");
                    }
                }
                catch (StoreLockException)
                {
                    // expected
                }

                try
                {
                    using (GlobalStoreLocker locker = new GlobalStoreLocker(FileSystemRule.get(), storeLayout))
                    {
                        locker.CheckLock();
                        fail("directory should be locked");
                    }
                }
                catch (StoreLockException)
                {
                    // expected
                }
            }
        }
Ejemplo n.º 2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void allowToLockSameDirectoryIfItWasUnlocked() throws java.io.IOException
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void AllowToLockSameDirectoryIfItWasUnlocked()
        {
            StoreLayout storeLayout = TestDirectory.storeLayout();

            using (GlobalStoreLocker storeLocker = new GlobalStoreLocker(FileSystemRule.get(), storeLayout))
            {
                storeLocker.CheckLock();
            }
            using (GlobalStoreLocker storeLocker = new GlobalStoreLocker(FileSystemRule.get(), storeLayout))
            {
                storeLocker.CheckLock();
            }
        }
Ejemplo n.º 3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void allowMultipleCallstoActuallyStoreLocker() throws java.io.IOException
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void AllowMultipleCallstoActuallyStoreLocker()
        {
            StoreLayout storeLayout = TestDirectory.storeLayout();

            using (GlobalStoreLocker storeLocker = new GlobalStoreLocker(FileSystemRule.get(), storeLayout))
            {
                storeLocker.CheckLock();
                storeLocker.CheckLock();
                storeLocker.CheckLock();
                storeLocker.CheckLock();
                storeLocker.CheckLock();
            }
        }