Browse Source

Checkstyle: static final variable names ought to be in all caps

master
Gintas Grigelionis 7 years ago
parent
commit
23b60da332
3 changed files with 25 additions and 24 deletions
  1. +11
    -11
      src/tests/junit/org/apache/tools/ant/util/FileUtilsTest.java
  2. +9
    -9
      src/tests/junit/org/apache/tools/ant/util/LayoutPreservingPropertiesTest.java
  3. +5
    -4
      src/tests/junit/org/apache/tools/ant/util/ReaderInputStreamTest.java

+ 11
- 11
src/tests/junit/org/apache/tools/ant/util/FileUtilsTest.java View File

@@ -50,7 +50,7 @@ public class FileUtilsTest {
public ExpectedException thrown = ExpectedException.none();

private static final FileUtils FILE_UTILS = FileUtils.getFileUtils();
private static final String projectRoot = System.getProperty("root");
private static final String ROOT = System.getProperty("root");
private File removeThis;
private String root;

@@ -405,20 +405,20 @@ public class FileUtilsTest {
@Test
public void testContentEquals() throws IOException {
assertTrue("Non existing files",
FILE_UTILS.contentEquals(new File(projectRoot, "foo"),
new File(projectRoot, "bar")));
FILE_UTILS.contentEquals(new File(ROOT, "foo"),
new File(ROOT, "bar")));
assertFalse("One exists, the other one doesn\'t",
FILE_UTILS.contentEquals(new File(projectRoot, "foo"),
new File(projectRoot, "build.xml")));
FILE_UTILS.contentEquals(new File(ROOT, "foo"),
new File(ROOT, "build.xml")));
assertFalse("Don\'t compare directories",
FILE_UTILS.contentEquals(new File(projectRoot, "src"),
new File(projectRoot, "src")));
FILE_UTILS.contentEquals(new File(ROOT, "src"),
new File(ROOT, "src")));
assertTrue("File equals itself",
FILE_UTILS.contentEquals(new File(projectRoot, "build.xml"),
new File(projectRoot, "build.xml")));
FILE_UTILS.contentEquals(new File(ROOT, "build.xml"),
new File(ROOT, "build.xml")));
assertFalse("Files are different",
FILE_UTILS.contentEquals(new File(projectRoot, "build.xml"),
new File(projectRoot, "docs.xml")));
FILE_UTILS.contentEquals(new File(ROOT, "build.xml"),
new File(ROOT, "docs.xml")));
}

/**


+ 9
- 9
src/tests/junit/org/apache/tools/ant/util/LayoutPreservingPropertiesTest.java View File

@@ -35,7 +35,7 @@ import static org.junit.Assert.assertThat;

public class LayoutPreservingPropertiesTest {

private static final String root = System.getProperty("root");
private static final String ROOT = System.getProperty("root");

private LayoutPreservingProperties lpf;

@@ -50,7 +50,7 @@ public class LayoutPreservingPropertiesTest {
*/
@Test
public void testPreserve() throws Exception {
File simple = new File(root, "src/etc/testcases/util/simple.properties");
File simple = new File(ROOT, "src/etc/testcases/util/simple.properties");
FileInputStream fis = new FileInputStream(simple);
lpf.load(fis);

@@ -115,7 +115,7 @@ public class LayoutPreservingPropertiesTest {
*/
@Test
public void testOverwrite() throws Exception {
File unusual = new File(root, "src/etc/testcases/util/unusual.properties");
File unusual = new File(ROOT, "src/etc/testcases/util/unusual.properties");
FileInputStream fis = new FileInputStream(unusual);
lpf.load(fis);

@@ -140,7 +140,7 @@ public class LayoutPreservingPropertiesTest {

@Test
public void testStoreWithHeader() throws Exception {
File simple = new File(root, "src/etc/testcases/util/simple.properties");
File simple = new File(ROOT, "src/etc/testcases/util/simple.properties");
FileInputStream fis = new FileInputStream(simple);
lpf.load(fis);

@@ -156,7 +156,7 @@ public class LayoutPreservingPropertiesTest {

@Test
public void testClear() throws Exception {
File simple = new File(root, "src/etc/testcases/util/simple.properties");
File simple = new File(ROOT, "src/etc/testcases/util/simple.properties");
FileInputStream fis = new FileInputStream(simple);
lpf.load(fis);

@@ -180,7 +180,7 @@ public class LayoutPreservingPropertiesTest {

@Test
public void testRemove() throws Exception {
File simple = new File(root, "src/etc/testcases/util/simple.properties");
File simple = new File(ROOT, "src/etc/testcases/util/simple.properties");
FileInputStream fis = new FileInputStream(simple);
lpf.load(fis);

@@ -199,7 +199,7 @@ public class LayoutPreservingPropertiesTest {

@Test
public void testRemoveWithComment() throws Exception {
File simple = new File(root, "src/etc/testcases/util/simple.properties");
File simple = new File(ROOT, "src/etc/testcases/util/simple.properties");
FileInputStream fis = new FileInputStream(simple);
lpf.load(fis);

@@ -220,7 +220,7 @@ public class LayoutPreservingPropertiesTest {

@Test
public void testClone() throws Exception {
File simple = new File(root, "src/etc/testcases/util/simple.properties");
File simple = new File(ROOT, "src/etc/testcases/util/simple.properties");
FileInputStream fis = new FileInputStream(simple);
lpf.load(fis);

@@ -253,7 +253,7 @@ public class LayoutPreservingPropertiesTest {

@Test
public void testPreserveEscapeName() throws Exception {
File unusual = new File(root, "src/etc/testcases/util/unusual.properties");
File unusual = new File(ROOT, "src/etc/testcases/util/unusual.properties");
FileInputStream fis = new FileInputStream(unusual);
lpf.load(fis);



+ 5
- 4
src/tests/junit/org/apache/tools/ant/util/ReaderInputStreamTest.java View File

@@ -32,6 +32,8 @@ import static org.junit.Assert.assertEquals;
*/
public class ReaderInputStreamTest {

private static final String ROOT = System.getProperty("root");

@Test
public void testSimple() throws Exception {
compareBytes("abc", "utf-8");
@@ -89,9 +91,8 @@ public class ReaderInputStreamTest {
ReaderInputStream r = null;
FileInputStream utf8 = null;
try {
fin = new InputStreamReader(new FileInputStream(new File(System.getProperty("root"),
"src/tests/antunit/taskdefs/exec/input/iso8859-1")),
"ISO8859_1");
fin = new InputStreamReader(new FileInputStream(new File(ROOT,
"src/tests/antunit/taskdefs/exec/input/iso8859-1")), "ISO8859_1");
r = new ReaderInputStream(fin, "UTF8");

ByteArrayOutputStream actualOS = new ByteArrayOutputStream();
@@ -101,7 +102,7 @@ public class ReaderInputStreamTest {
b = r.read();
}

utf8 = new FileInputStream(new File(System.getProperty("root"),
utf8 = new FileInputStream(new File(ROOT,
"src/tests/antunit/taskdefs/exec/expected/utf-8"));
ByteArrayOutputStream expectedOS = new ByteArrayOutputStream();
b = utf8.read();


Loading…
Cancel
Save