Browse Source

Tidy up the code

master
Gintas Grigelionis 7 years ago
parent
commit
233421885c
4 changed files with 15 additions and 15 deletions
  1. +1
    -1
      src/tests/antunit/core/extension-point-test.xml
  2. +8
    -8
      src/tests/junit/org/apache/tools/ant/types/selectors/FilenameSelectorTest.java
  3. +2
    -2
      src/tests/junit/org/apache/tools/ant/util/FileUtilsTest.java
  4. +4
    -4
      src/tests/junit/org/apache/tools/zip/ZipOutputStreamTest.java

+ 1
- 1
src/tests/antunit/core/extension-point-test.xml View File

@@ -105,7 +105,7 @@
<project name="master">
<include file="compile-java.xml" as="compile"/>
</project>]]></echo>
<!-- here prefix should be concatened from each include first
<!-- here prefix should be concatenated from each include first
"compile" then "abstract-compile"-->
<ant dir="${output}" target="compile.abstract-compile.compile"/>
<au:assertLogContains text="in compile java"/>


+ 8
- 8
src/tests/junit/org/apache/tools/ant/types/selectors/FilenameSelectorTest.java View File

@@ -23,6 +23,7 @@ import static org.junit.Assert.assertEquals;
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.types.Parameter;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
@@ -82,14 +83,13 @@ public class FilenameSelectorTest {
assertEquals("FFFFFFFFFFFF", selectorRule.selectionString(s));
}

// This is turned off temporarily. There appears to be a bug
// in SelectorUtils.matchPattern() where it is recursive on
// Windows even if no ** is in pattern.
// s.setName("*.gz");
// String results = selectorRule.selectionString(s);
// assertEquals("FFFTFFFFFFFF", results); // Unix
// vs
// assertEquals("FFFTFFFFTFFF", results); // Windows
@Ignore("Turned off due to a bug: SelectorUtils.matchPattern() is recursive without '**' on Windows")
@Test
public void testSelectionBehaviourWildcard() {
s.setName("*.gz");
assertEquals("FFFTFFFFFFFF", selectorRule.selectionString(s)); // Unix
assertEquals("FFFTFFFFTFFF", selectorRule.selectionString(s)); // Windows
}

@Test
public void testSelectionBehaviourNegate() {


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

@@ -617,8 +617,8 @@ public class FileUtilsTest {
* calling this method allows tests where normalize is called to pass under cygwin
*/
private void assertEqualsIgnoreDriveCase(String s1, String s2) {
if ((Os.isFamily("dos") || Os.isFamily("netware"))
&& !s1.isEmpty() && !s2.isEmpty()) {
assumeTrue("Not DOS or Netware", Os.isFamily("dos") || Os.isFamily("netware"));
if (!s1.isEmpty() && !s2.isEmpty()) {
StringBuilder sb1 = new StringBuilder(s1);
StringBuilder sb2 = new StringBuilder(s2);
sb1.setCharAt(0, Character.toUpperCase(s1.charAt(0)));


+ 4
- 4
src/tests/junit/org/apache/tools/zip/ZipOutputStreamTest.java View File

@@ -56,18 +56,18 @@ public class ZipOutputStreamTest {

@Test
public void testZipLong() {
ZipLong test = ZipOutputStream.toDosTime(time);
ZipLong test = ZipUtil.toDosTime(time);
assertEquals(test.getValue(), zl.getValue());
}

@Test
public void testAdjustToLong() {
assertEquals((long) Integer.MAX_VALUE,
ZipOutputStream.adjustToLong(Integer.MAX_VALUE));
ZipUtil.adjustToLong(Integer.MAX_VALUE));
assertEquals(((long) Integer.MAX_VALUE) + 1,
ZipOutputStream.adjustToLong(Integer.MAX_VALUE + 1));
ZipUtil.adjustToLong(Integer.MAX_VALUE + 1));
assertEquals(2 * ((long) Integer.MAX_VALUE),
ZipOutputStream.adjustToLong(2 * Integer.MAX_VALUE));
ZipUtil.adjustToLong(2 * Integer.MAX_VALUE));
}

}

Loading…
Cancel
Save