Skip to content

Commit

Permalink
Fix NoSuchFileException
Browse files Browse the repository at this point in the history
  • Loading branch information
tvand committed Mar 17, 2020
1 parent 1c6b726 commit 366e4f0
Showing 1 changed file with 11 additions and 11 deletions.
@@ -1,5 +1,11 @@
package org.apache.commons.jcs.auxiliary.disk.block;

import java.io.File;
import java.io.IOException;
import java.util.Random;

import org.apache.commons.jcs.utils.serialization.StandardSerializer;

/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
Expand All @@ -20,12 +26,6 @@
*/

import junit.framework.TestCase;
import org.apache.commons.jcs.utils.serialization.StandardSerializer;

import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.util.Random;

/**
* Test for the disk access layer of the Block Disk Cache.
Expand Down Expand Up @@ -55,17 +55,17 @@ protected void setUp() throws Exception
private void setUpBlockDisk(String fileName) throws IOException
{
File file = new File(rafDir, fileName + ".data");
Files.delete(file.toPath());
file.delete();
this.disk = new BlockDisk(file, new StandardSerializer());
}

private void setUpBlockDisk(String fileName, int blockSize) throws IOException
{
File file = new File(rafDir, fileName + ".data");
Files.delete(file.toPath());
file.delete();
this.disk = new BlockDisk(file, blockSize, new StandardSerializer());
}

/**
* @see junit.framework.TestCase#tearDown()
*/
Expand Down Expand Up @@ -357,7 +357,7 @@ public void testWriteAndRead_BigString2()
assertEquals( "Wrong item retured.", string, result );
}

public void testJCS156() throws Exception
public void testJCS156() throws Exception
{
// SETUP
setUpBlockDisk("testJCS156", 4096);
Expand Down

0 comments on commit 366e4f0

Please sign in to comment.