Author: natasha.vakulenko
Date: 2010-06-15 10:13:39 -0400 (Tue, 15 Jun 2010)
New Revision: 2605
Modified:
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/utils/io/TestSpoolFile.java
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/utils/io/TestSwapFile.java
Log:
EXOJCR-791: Renamed constants in classes TestSpoolFile and TestSwaplFile.
Modified:
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/utils/io/TestSpoolFile.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/utils/io/TestSpoolFile.java 2010-06-15
13:46:56 UTC (rev 2604)
+++
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/utils/io/TestSpoolFile.java 2010-06-15
14:13:39 UTC (rev 2605)
@@ -31,22 +31,22 @@
public class TestSpoolFile extends TestCase
{
- private static final String dirName = "../";
+ private static final String DIR_NAME = "../";
- private static final String fileName = "testSpoolFile";
+ private static final String FILE_NAME = "testSpoolFile";
public void testCreateTempFile() throws IOException
{
// This method creates a file on disk space.
// When calling a method delete() it should be removed.
- SpoolFile sf = SpoolFile.createTempFile("prefix", "suffics",
new File(dirName));
+ SpoolFile sf = SpoolFile.createTempFile("prefix", "suffics",
new File(DIR_NAME));
assertNotNull("File should be created.", sf);
assertTrue("File should be deleted.", sf.delete());
}
public void testAcquireFile() throws FileNotFoundException
{
- SpoolFile sf = new SpoolFile(dirName + fileName);
+ SpoolFile sf = new SpoolFile(DIR_NAME + FILE_NAME);
// Add new holder of file, now file must be in use.
sf.acquire("holder");
@@ -69,7 +69,7 @@
public void testReleaseFile() throws FileNotFoundException
{
- SpoolFile sf = new SpoolFile(dirName + fileName);
+ SpoolFile sf = new SpoolFile(DIR_NAME + FILE_NAME);
// Add new holder of file.
sf.acquire("holder");
@@ -94,7 +94,7 @@
public void testFileInUse() throws FileNotFoundException
{
- SpoolFile sf = new SpoolFile(dirName + fileName);
+ SpoolFile sf = new SpoolFile(DIR_NAME + FILE_NAME);
sf.acquire("holder");
assertTrue("The file has holder. It must be in use.", sf.inUse());
@@ -119,7 +119,7 @@
public void testDeleteFile() throws FileNotFoundException
{
// This method not creates a file on disk space.
- SpoolFile sf = new SpoolFile(dirName + fileName);
+ SpoolFile sf = new SpoolFile(DIR_NAME + FILE_NAME);
// Add and release new holder of file.
sf.acquire("holder");
Modified:
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/utils/io/TestSwapFile.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/utils/io/TestSwapFile.java 2010-06-15
13:46:56 UTC (rev 2604)
+++
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/utils/io/TestSwapFile.java 2010-06-15
14:13:39 UTC (rev 2605)
@@ -30,16 +30,16 @@
public class TestSwapFile extends TestCase
{
- private static final String dirName = "../";
+ private static final String DIR_NAME = "../";
- private static final String fileName = "childSwapFile";
+ private static final String FILE_NAME = "childSwapFile";
public void testCreateTempFile()
{
// Not applicable creation.
try
{
- SwapFile.createTempFile("prefix", "suffix", new
File(dirName));
+ SwapFile.createTempFile("prefix", "suffix", new
File(DIR_NAME));
fail("IOException should have been thrown.");
}
catch (IOException e)
@@ -51,7 +51,7 @@
public void testGetSwapFile() throws IOException
{
// Get swap file is possible only in this way.
- SwapFile sf = SwapFile.get(new File(dirName), fileName);
+ SwapFile sf = SwapFile.get(new File(DIR_NAME), FILE_NAME);
assertNotNull("File should be created.", sf);
sf.spoolDone();
sf.delete();
@@ -59,7 +59,7 @@
public void testIsSpooled() throws IOException
{
- SwapFile sf = SwapFile.get(new File(dirName), fileName);
+ SwapFile sf = SwapFile.get(new File(DIR_NAME), FILE_NAME);
assertFalse("Spool is not over.", sf.isSpooled());
sf.spoolDone();
assertTrue("Spool is over.", sf.isSpooled());
@@ -68,7 +68,7 @@
public void testSpoolDone() throws IOException
{
- SwapFile sf = SwapFile.get(new File(dirName), fileName);
+ SwapFile sf = SwapFile.get(new File(DIR_NAME), FILE_NAME);
sf.spoolDone();
assertTrue("Spool should be done.", sf.isSpooled());
sf.delete();
@@ -76,7 +76,7 @@
public void testDeleteSpoolFile() throws IOException
{
- SwapFile sf = SwapFile.get(new File(dirName), fileName);
+ SwapFile sf = SwapFile.get(new File(DIR_NAME), FILE_NAME);
sf.spoolDone();
// File on disk does not exist. It will not be removed from disk space.