Repository: ant Updated Branches: refs/heads/1.9.x ecb6acf01 -> 0ed7f4ab5
http://git-wip-us.apache.org/repos/asf/ant/blob/0ed7f4ab/src/tests/junit/org/apache/tools/zip/ZipLongTest.java ---------------------------------------------------------------------- diff --git a/src/tests/junit/org/apache/tools/zip/ZipLongTest.java b/src/tests/junit/org/apache/tools/zip/ZipLongTest.java index 8ec8019..a7ece04 100644 --- a/src/tests/junit/org/apache/tools/zip/ZipLongTest.java +++ b/src/tests/junit/org/apache/tools/zip/ZipLongTest.java @@ -1,94 +1,94 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -package org.apache.tools.zip; - -import org.junit.Test; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotSame; -import static org.junit.Assert.assertTrue; - -/** - * JUnit testcases for org.apache.tools.zip.ZipLong. - * - */ -public class ZipLongTest { - - /** - * Test conversion to bytes. - */ - @Test - public void testToBytes() { - ZipLong zl = new ZipLong(0x12345678); - byte[] result = zl.getBytes(); - assertEquals("length getBytes", 4, result.length); - assertEquals("first byte getBytes", 0x78, result[0]); - assertEquals("second byte getBytes", 0x56, result[1]); - assertEquals("third byte getBytes", 0x34, result[2]); - assertEquals("fourth byte getBytes", 0x12, result[3]); - } - - /** - * Test conversion from bytes. - */ - @Test - public void testFromBytes() { - byte[] val = new byte[] {0x78, 0x56, 0x34, 0x12}; - ZipLong zl = new ZipLong(val); - assertEquals("value from bytes", 0x12345678, zl.getValue()); - } - - /** - * Test the contract of the equals method. - */ - @Test - public void testEquals() { - ZipLong zl = new ZipLong(0x12345678); - ZipLong zl2 = new ZipLong(0x12345678); - ZipLong zl3 = new ZipLong(0x87654321); - - assertTrue("reflexive", zl.equals(zl)); - - assertTrue("works", zl.equals(zl2)); - assertTrue("works, part two", !zl.equals(zl3)); - - assertTrue("symmetric", zl2.equals(zl)); - - assertTrue("null handling", !zl.equals(null)); - assertTrue("non ZipLong handling", !zl.equals(new Integer(0x1234))); - } - - /** - * Test sign handling. - */ - @Test - public void testSign() { - ZipLong zl = new ZipLong(new byte[] {(byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF}); - assertEquals(0x00000000FFFFFFFFl, zl.getValue()); - } - - @Test - public void testClone() { - ZipLong s1 = new ZipLong(42); - ZipLong s2 = (ZipLong) s1.clone(); - assertNotSame(s1, s2); - assertEquals(s1, s2); - assertEquals(s1.getValue(), s2.getValue()); - } -} +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package org.apache.tools.zip; + +import org.junit.Test; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotSame; +import static org.junit.Assert.assertTrue; + +/** + * JUnit testcases for org.apache.tools.zip.ZipLong. + * + */ +public class ZipLongTest { + + /** + * Test conversion to bytes. + */ + @Test + public void testToBytes() { + ZipLong zl = new ZipLong(0x12345678); + byte[] result = zl.getBytes(); + assertEquals("length getBytes", 4, result.length); + assertEquals("first byte getBytes", 0x78, result[0]); + assertEquals("second byte getBytes", 0x56, result[1]); + assertEquals("third byte getBytes", 0x34, result[2]); + assertEquals("fourth byte getBytes", 0x12, result[3]); + } + + /** + * Test conversion from bytes. + */ + @Test + public void testFromBytes() { + byte[] val = new byte[] {0x78, 0x56, 0x34, 0x12}; + ZipLong zl = new ZipLong(val); + assertEquals("value from bytes", 0x12345678, zl.getValue()); + } + + /** + * Test the contract of the equals method. + */ + @Test + public void testEquals() { + ZipLong zl = new ZipLong(0x12345678); + ZipLong zl2 = new ZipLong(0x12345678); + ZipLong zl3 = new ZipLong(0x87654321); + + assertTrue("reflexive", zl.equals(zl)); + + assertTrue("works", zl.equals(zl2)); + assertTrue("works, part two", !zl.equals(zl3)); + + assertTrue("symmetric", zl2.equals(zl)); + + assertTrue("null handling", !zl.equals(null)); + assertTrue("non ZipLong handling", !zl.equals(new Integer(0x1234))); + } + + /** + * Test sign handling. + */ + @Test + public void testSign() { + ZipLong zl = new ZipLong(new byte[] {(byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF}); + assertEquals(0x00000000FFFFFFFFl, zl.getValue()); + } + + @Test + public void testClone() { + ZipLong s1 = new ZipLong(42); + ZipLong s2 = (ZipLong) s1.clone(); + assertNotSame(s1, s2); + assertEquals(s1, s2); + assertEquals(s1.getValue(), s2.getValue()); + } +} http://git-wip-us.apache.org/repos/asf/ant/blob/0ed7f4ab/src/tests/junit/org/apache/tools/zip/ZipOutputStreamTest.java ---------------------------------------------------------------------- diff --git a/src/tests/junit/org/apache/tools/zip/ZipOutputStreamTest.java b/src/tests/junit/org/apache/tools/zip/ZipOutputStreamTest.java index 7040782..f41b246 100644 --- a/src/tests/junit/org/apache/tools/zip/ZipOutputStreamTest.java +++ b/src/tests/junit/org/apache/tools/zip/ZipOutputStreamTest.java @@ -1,73 +1,73 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -package org.apache.tools.zip; - -import org.junit.Before; -import org.junit.Test; - -import java.util.Calendar; -import java.util.Date; - -import static org.junit.Assert.assertEquals; - -public class ZipOutputStreamTest { - - private Date time; - private ZipLong zl; - - @Before - public void setUp() throws Exception { - time = new Date(); - Calendar cal = Calendar.getInstance(); - cal.setTime(time); - int year = cal.get(Calendar.YEAR); - int month = cal.get(Calendar.MONTH) + 1; - long value = ((year - 1980) << 25) - | (month << 21) - | (cal.get(Calendar.DAY_OF_MONTH) << 16) - | (cal.get(Calendar.HOUR_OF_DAY) << 11) - | (cal.get(Calendar.MINUTE) << 5) - | (cal.get(Calendar.SECOND) >> 1); - - byte[] result = new byte[4]; - result[0] = (byte) ((value & 0xFF)); - result[1] = (byte) ((value & 0xFF00) >> 8); - result[2] = (byte) ((value & 0xFF0000) >> 16); - result[3] = (byte) ((value & 0xFF000000L) >> 24); - zl = new ZipLong(result); - } - - - @Test - public void testZipLong() throws Exception { - ZipLong test = ZipOutputStream.toDosTime(time); - assertEquals(test.getValue(), zl.getValue()); - } - - @Test - public void testAdjustToLong() { - assertEquals((long) Integer.MAX_VALUE, - ZipOutputStream.adjustToLong(Integer.MAX_VALUE)); - assertEquals(((long) Integer.MAX_VALUE) + 1, - ZipOutputStream.adjustToLong(Integer.MAX_VALUE + 1)); - assertEquals(2 * ((long) Integer.MAX_VALUE), - ZipOutputStream.adjustToLong(2 * Integer.MAX_VALUE)); - } - -} +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package org.apache.tools.zip; + +import org.junit.Before; +import org.junit.Test; + +import java.util.Calendar; +import java.util.Date; + +import static org.junit.Assert.assertEquals; + +public class ZipOutputStreamTest { + + private Date time; + private ZipLong zl; + + @Before + public void setUp() throws Exception { + time = new Date(); + Calendar cal = Calendar.getInstance(); + cal.setTime(time); + int year = cal.get(Calendar.YEAR); + int month = cal.get(Calendar.MONTH) + 1; + long value = ((year - 1980) << 25) + | (month << 21) + | (cal.get(Calendar.DAY_OF_MONTH) << 16) + | (cal.get(Calendar.HOUR_OF_DAY) << 11) + | (cal.get(Calendar.MINUTE) << 5) + | (cal.get(Calendar.SECOND) >> 1); + + byte[] result = new byte[4]; + result[0] = (byte) ((value & 0xFF)); + result[1] = (byte) ((value & 0xFF00) >> 8); + result[2] = (byte) ((value & 0xFF0000) >> 16); + result[3] = (byte) ((value & 0xFF000000L) >> 24); + zl = new ZipLong(result); + } + + + @Test + public void testZipLong() throws Exception { + ZipLong test = ZipOutputStream.toDosTime(time); + assertEquals(test.getValue(), zl.getValue()); + } + + @Test + public void testAdjustToLong() { + assertEquals((long) Integer.MAX_VALUE, + ZipOutputStream.adjustToLong(Integer.MAX_VALUE)); + assertEquals(((long) Integer.MAX_VALUE) + 1, + ZipOutputStream.adjustToLong(Integer.MAX_VALUE + 1)); + assertEquals(2 * ((long) Integer.MAX_VALUE), + ZipOutputStream.adjustToLong(2 * Integer.MAX_VALUE)); + } + +} http://git-wip-us.apache.org/repos/asf/ant/blob/0ed7f4ab/src/tests/junit/org/apache/tools/zip/ZipShortTest.java ---------------------------------------------------------------------- diff --git a/src/tests/junit/org/apache/tools/zip/ZipShortTest.java b/src/tests/junit/org/apache/tools/zip/ZipShortTest.java index 4b97471..a6aa3e7 100644 --- a/src/tests/junit/org/apache/tools/zip/ZipShortTest.java +++ b/src/tests/junit/org/apache/tools/zip/ZipShortTest.java @@ -1,92 +1,92 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -package org.apache.tools.zip; - -import org.junit.Test; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotSame; -import static org.junit.Assert.assertTrue; - -/** - * JUnit 3 testcases for org.apache.tools.zip.ZipShort. - * - */ -public class ZipShortTest { - - /** - * Test conversion to bytes. - */ - @Test - public void testToBytes() { - ZipShort zs = new ZipShort(0x1234); - byte[] result = zs.getBytes(); - assertEquals("length getBytes", 2, result.length); - assertEquals("first byte getBytes", 0x34, result[0]); - assertEquals("second byte getBytes", 0x12, result[1]); - } - - /** - * Test conversion from bytes. - */ - @Test - public void testFromBytes() { - byte[] val = new byte[] {0x34, 0x12}; - ZipShort zs = new ZipShort(val); - assertEquals("value from bytes", 0x1234, zs.getValue()); - } - - /** - * Test the contract of the equals method. - */ - @Test - public void testEquals() { - ZipShort zs = new ZipShort(0x1234); - ZipShort zs2 = new ZipShort(0x1234); - ZipShort zs3 = new ZipShort(0x5678); - - assertTrue("reflexive", zs.equals(zs)); - - assertTrue("works", zs.equals(zs2)); - assertTrue("works, part two", !zs.equals(zs3)); - - assertTrue("symmetric", zs2.equals(zs)); - - assertTrue("null handling", !zs.equals(null)); - assertTrue("non ZipShort handling", !zs.equals(new Integer(0x1234))); - } - - /** - * Test sign handling. - */ - @Test - public void testSign() { - ZipShort zs = new ZipShort(new byte[] {(byte)0xFF, (byte)0xFF}); - assertEquals(0x0000FFFF, zs.getValue()); - } - - @Test - public void testClone() { - ZipShort s1 = new ZipShort(42); - ZipShort s2 = (ZipShort) s1.clone(); - assertNotSame(s1, s2); - assertEquals(s1, s2); - assertEquals(s1.getValue(), s2.getValue()); - } -} +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package org.apache.tools.zip; + +import org.junit.Test; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotSame; +import static org.junit.Assert.assertTrue; + +/** + * JUnit 3 testcases for org.apache.tools.zip.ZipShort. + * + */ +public class ZipShortTest { + + /** + * Test conversion to bytes. + */ + @Test + public void testToBytes() { + ZipShort zs = new ZipShort(0x1234); + byte[] result = zs.getBytes(); + assertEquals("length getBytes", 2, result.length); + assertEquals("first byte getBytes", 0x34, result[0]); + assertEquals("second byte getBytes", 0x12, result[1]); + } + + /** + * Test conversion from bytes. + */ + @Test + public void testFromBytes() { + byte[] val = new byte[] {0x34, 0x12}; + ZipShort zs = new ZipShort(val); + assertEquals("value from bytes", 0x1234, zs.getValue()); + } + + /** + * Test the contract of the equals method. + */ + @Test + public void testEquals() { + ZipShort zs = new ZipShort(0x1234); + ZipShort zs2 = new ZipShort(0x1234); + ZipShort zs3 = new ZipShort(0x5678); + + assertTrue("reflexive", zs.equals(zs)); + + assertTrue("works", zs.equals(zs2)); + assertTrue("works, part two", !zs.equals(zs3)); + + assertTrue("symmetric", zs2.equals(zs)); + + assertTrue("null handling", !zs.equals(null)); + assertTrue("non ZipShort handling", !zs.equals(new Integer(0x1234))); + } + + /** + * Test sign handling. + */ + @Test + public void testSign() { + ZipShort zs = new ZipShort(new byte[] {(byte)0xFF, (byte)0xFF}); + assertEquals(0x0000FFFF, zs.getValue()); + } + + @Test + public void testClone() { + ZipShort s1 = new ZipShort(42); + ZipShort s2 = (ZipShort) s1.clone(); + assertNotSame(s1, s2); + assertEquals(s1, s2); + assertEquals(s1.getValue(), s2.getValue()); + } +} http://git-wip-us.apache.org/repos/asf/ant/blob/0ed7f4ab/src/tests/junit/org/example/junit/AbstractJUnit3TestMissed.java ---------------------------------------------------------------------- diff --git a/src/tests/junit/org/example/junit/AbstractJUnit3TestMissed.java b/src/tests/junit/org/example/junit/AbstractJUnit3TestMissed.java index e2bb73a..fd261f5 100644 --- a/src/tests/junit/org/example/junit/AbstractJUnit3TestMissed.java +++ b/src/tests/junit/org/example/junit/AbstractJUnit3TestMissed.java @@ -1,27 +1,27 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.example.junit; - -import junit.framework.TestCase; - -public abstract class AbstractJUnit3TestMissed extends TestCase { - - public void testNothing() { - } - -} +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.example.junit; + +import junit.framework.TestCase; + +public abstract class AbstractJUnit3TestMissed extends TestCase { + + public void testNothing() { + } + +} http://git-wip-us.apache.org/repos/asf/ant/blob/0ed7f4ab/src/tests/junit/org/example/junit/AbstractJUnit3TestNotMissed.java ---------------------------------------------------------------------- diff --git a/src/tests/junit/org/example/junit/AbstractJUnit3TestNotMissed.java b/src/tests/junit/org/example/junit/AbstractJUnit3TestNotMissed.java index 40f2b4a..e1d1c0b 100644 --- a/src/tests/junit/org/example/junit/AbstractJUnit3TestNotMissed.java +++ b/src/tests/junit/org/example/junit/AbstractJUnit3TestNotMissed.java @@ -1,31 +1,31 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.example.junit; - -import junit.framework.TestCase; - -public abstract class AbstractJUnit3TestNotMissed extends TestCase { - - public void testNothing() { - } - - public static class InnerAbstractTestNotMissed extends AbstractJUnit3TestNotMissed { - - } - -} +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.example.junit; + +import junit.framework.TestCase; + +public abstract class AbstractJUnit3TestNotMissed extends TestCase { + + public void testNothing() { + } + + public static class InnerAbstractTestNotMissed extends AbstractJUnit3TestNotMissed { + + } + +} http://git-wip-us.apache.org/repos/asf/ant/blob/0ed7f4ab/src/tests/junit/org/example/junit/AbstractTestMissed.java ---------------------------------------------------------------------- diff --git a/src/tests/junit/org/example/junit/AbstractTestMissed.java b/src/tests/junit/org/example/junit/AbstractTestMissed.java index 8df6adf..6724d5b 100644 --- a/src/tests/junit/org/example/junit/AbstractTestMissed.java +++ b/src/tests/junit/org/example/junit/AbstractTestMissed.java @@ -1,29 +1,29 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.example.junit; - -import org.junit.Test; - - -public abstract class AbstractTestMissed { - - @Test - public void testNothing() { - } - -} +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.example.junit; + +import org.junit.Test; + + +public abstract class AbstractTestMissed { + + @Test + public void testNothing() { + } + +} http://git-wip-us.apache.org/repos/asf/ant/blob/0ed7f4ab/src/tests/junit/org/example/junit/AbstractTestNotMissed.java ---------------------------------------------------------------------- diff --git a/src/tests/junit/org/example/junit/AbstractTestNotMissed.java b/src/tests/junit/org/example/junit/AbstractTestNotMissed.java index 79b925e..9a77d1b 100644 --- a/src/tests/junit/org/example/junit/AbstractTestNotMissed.java +++ b/src/tests/junit/org/example/junit/AbstractTestNotMissed.java @@ -1,32 +1,32 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.example.junit; - -import org.junit.Test; - -public abstract class AbstractTestNotMissed { - - @Test - public void testNothing() { - } - - public static class InnerAbstractTestNotMissed extends AbstractTestNotMissed { - - } - -} +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.example.junit; + +import org.junit.Test; + +public abstract class AbstractTestNotMissed { + + @Test + public void testNothing() { + } + + public static class InnerAbstractTestNotMissed extends AbstractTestNotMissed { + + } + +} http://git-wip-us.apache.org/repos/asf/ant/blob/0ed7f4ab/src/tests/junit/org/example/junit/JUnit3NonTestMissed.java ---------------------------------------------------------------------- diff --git a/src/tests/junit/org/example/junit/JUnit3NonTestMissed.java b/src/tests/junit/org/example/junit/JUnit3NonTestMissed.java index 7a4a00f..76cead6 100644 --- a/src/tests/junit/org/example/junit/JUnit3NonTestMissed.java +++ b/src/tests/junit/org/example/junit/JUnit3NonTestMissed.java @@ -1,27 +1,27 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.example.junit; - -import junit.framework.TestCase; - -public class JUnit3NonTestMissed extends TestCase { - - public void notATest() { - //this isn't a test but shouldn't case an error - } -} +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.example.junit; + +import junit.framework.TestCase; + +public class JUnit3NonTestMissed extends TestCase { + + public void notATest() { + //this isn't a test but shouldn't case an error + } +} http://git-wip-us.apache.org/repos/asf/ant/blob/0ed7f4ab/src/tests/junit/org/example/junit/JUnit3TestNotMissed.java ---------------------------------------------------------------------- diff --git a/src/tests/junit/org/example/junit/JUnit3TestNotMissed.java b/src/tests/junit/org/example/junit/JUnit3TestNotMissed.java index 338012d..1e5ac2d 100644 --- a/src/tests/junit/org/example/junit/JUnit3TestNotMissed.java +++ b/src/tests/junit/org/example/junit/JUnit3TestNotMissed.java @@ -1,28 +1,28 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.example.junit; - -import junit.framework.TestCase; - -public class JUnit3TestNotMissed extends TestCase { - - public void testNothing() { - // don't fail - } - -} +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.example.junit; + +import junit.framework.TestCase; + +public class JUnit3TestNotMissed extends TestCase { + + public void testNothing() { + // don't fail + } + +} http://git-wip-us.apache.org/repos/asf/ant/blob/0ed7f4ab/src/tests/junit/org/example/junit/JUnit4Skippable.java ---------------------------------------------------------------------- diff --git a/src/tests/junit/org/example/junit/JUnit4Skippable.java b/src/tests/junit/org/example/junit/JUnit4Skippable.java index e71345c..aa89ab7 100644 --- a/src/tests/junit/org/example/junit/JUnit4Skippable.java +++ b/src/tests/junit/org/example/junit/JUnit4Skippable.java @@ -1,74 +1,74 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -package org.example.junit; - -import org.junit.Assume; -import org.junit.Ignore; -import org.junit.Test; - -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; - -public class JUnit4Skippable { - - @Test - public void passingTest() { - assertTrue("This test passed", true); - } - - @Ignore("Please don't ignore me!") - @Test - public void explicitIgnoreTest() { - fail("This test should be skipped"); - } - - @Test - public void implicitlyIgnoreTest() { - Assume.assumeFalse("This test will be ignored", true); - fail("I told you, this test should have been ignored!"); - } - - @Test - @Ignore - public void explicitlyIgnoreTestNoMessage() { - fail("This test should be skipped"); - } - - @Test - public void implicitlyIgnoreTestNoMessage() { - Assume.assumeFalse(true); - fail("I told you, this test should have been ignored!"); - } - - @Test - public void failingTest() { - fail("I told you this test was going to fail"); - } - - @Test - public void failingTestNoMessage() { - fail(); - } - - @Test - public void errorTest() { - throw new RuntimeException("Whoops, this test went wrong"); - } - -} +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package org.example.junit; + +import org.junit.Assume; +import org.junit.Ignore; +import org.junit.Test; + +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + +public class JUnit4Skippable { + + @Test + public void passingTest() { + assertTrue("This test passed", true); + } + + @Ignore("Please don't ignore me!") + @Test + public void explicitIgnoreTest() { + fail("This test should be skipped"); + } + + @Test + public void implicitlyIgnoreTest() { + Assume.assumeFalse("This test will be ignored", true); + fail("I told you, this test should have been ignored!"); + } + + @Test + @Ignore + public void explicitlyIgnoreTestNoMessage() { + fail("This test should be skipped"); + } + + @Test + public void implicitlyIgnoreTestNoMessage() { + Assume.assumeFalse(true); + fail("I told you, this test should have been ignored!"); + } + + @Test + public void failingTest() { + fail("I told you this test was going to fail"); + } + + @Test + public void failingTestNoMessage() { + fail(); + } + + @Test + public void errorTest() { + throw new RuntimeException("Whoops, this test went wrong"); + } + +} http://git-wip-us.apache.org/repos/asf/ant/blob/0ed7f4ab/src/tests/junit/org/example/junit/MultilineAsserts.java ---------------------------------------------------------------------- diff --git a/src/tests/junit/org/example/junit/MultilineAsserts.java b/src/tests/junit/org/example/junit/MultilineAsserts.java index 1b0cc59..06e1039 100644 --- a/src/tests/junit/org/example/junit/MultilineAsserts.java +++ b/src/tests/junit/org/example/junit/MultilineAsserts.java @@ -1,27 +1,27 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.example.junit; - -import junit.framework.TestCase; - -public class MultilineAsserts extends TestCase { - public void testFoo() { assertTrue("testFoo \nmessed up", false); } - public void testBar() { assertTrue("testBar \ndidn't work", true); } - public void testFee() { assertTrue("testFee \ncrashed", false); } - public void testFie() { assertTrue("testFie \nbroke", true); } -} +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.example.junit; + +import junit.framework.TestCase; + +public class MultilineAsserts extends TestCase { + public void testFoo() { assertTrue("testFoo \nmessed up", false); } + public void testBar() { assertTrue("testBar \ndidn't work", true); } + public void testFee() { assertTrue("testFee \ncrashed", false); } + public void testFie() { assertTrue("testFie \nbroke", true); } +} http://git-wip-us.apache.org/repos/asf/ant/blob/0ed7f4ab/src/tests/junit/org/example/junit/NonTestMissed.java ---------------------------------------------------------------------- diff --git a/src/tests/junit/org/example/junit/NonTestMissed.java b/src/tests/junit/org/example/junit/NonTestMissed.java index 5a76d17..0a020ec 100644 --- a/src/tests/junit/org/example/junit/NonTestMissed.java +++ b/src/tests/junit/org/example/junit/NonTestMissed.java @@ -1,25 +1,25 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.example.junit; - -public class NonTestMissed { - - public void notATest() { - //this isn't a test but shouldn't case an error - } -} +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.example.junit; + +public class NonTestMissed { + + public void notATest() { + //this isn't a test but shouldn't case an error + } +} http://git-wip-us.apache.org/repos/asf/ant/blob/0ed7f4ab/src/tests/junit/org/example/junit/Output.java ---------------------------------------------------------------------- diff --git a/src/tests/junit/org/example/junit/Output.java b/src/tests/junit/org/example/junit/Output.java index a536a47..a7135f7 100644 --- a/src/tests/junit/org/example/junit/Output.java +++ b/src/tests/junit/org/example/junit/Output.java @@ -1,37 +1,37 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.example.junit; - -import junit.framework.TestCase; - -/** - * Not really a test of Ant but a test that is run by the test of the - * junit task. Confused? - * - * @since Ant 1.5 - */ -public class Output extends TestCase { - - public Output(String s) { - super(s); - } - - public void testOutput() { - System.out.println("foo"); - } -} +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.example.junit; + +import junit.framework.TestCase; + +/** + * Not really a test of Ant but a test that is run by the test of the + * junit task. Confused? + * + * @since Ant 1.5 + */ +public class Output extends TestCase { + + public Output(String s) { + super(s); + } + + public void testOutput() { + System.out.println("foo"); + } +} http://git-wip-us.apache.org/repos/asf/ant/blob/0ed7f4ab/src/tests/junit/org/example/junit/TestNotMissed.java ---------------------------------------------------------------------- diff --git a/src/tests/junit/org/example/junit/TestNotMissed.java b/src/tests/junit/org/example/junit/TestNotMissed.java index 1c967e0..6d3babe 100644 --- a/src/tests/junit/org/example/junit/TestNotMissed.java +++ b/src/tests/junit/org/example/junit/TestNotMissed.java @@ -1,29 +1,29 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.example.junit; - - -import org.junit.Test; - -public class TestNotMissed { - - @Test - public void testNothing() { - // don't fail - } -} +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.example.junit; + + +import org.junit.Test; + +public class TestNotMissed { + + @Test + public void testNothing() { + // don't fail + } +} http://git-wip-us.apache.org/repos/asf/ant/blob/0ed7f4ab/src/tests/junit/org/example/junit/TestWithSuiteNotMissed.java ---------------------------------------------------------------------- diff --git a/src/tests/junit/org/example/junit/TestWithSuiteNotMissed.java b/src/tests/junit/org/example/junit/TestWithSuiteNotMissed.java index e5cdf93..80b722c 100644 --- a/src/tests/junit/org/example/junit/TestWithSuiteNotMissed.java +++ b/src/tests/junit/org/example/junit/TestWithSuiteNotMissed.java @@ -1,32 +1,32 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.example.junit; - -import junit.framework.Test; -import junit.framework.TestSuite; - -public class TestWithSuiteNotMissed { - - public static Test suite() { - TestSuite test = new TestSuite("meh"); - JUnit3TestNotMissed testCase = new JUnit3TestNotMissed(); - testCase.setName("testNothing"); - test.addTest(testCase); - return test; - } -} +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.example.junit; + +import junit.framework.Test; +import junit.framework.TestSuite; + +public class TestWithSuiteNotMissed { + + public static Test suite() { + TestSuite test = new TestSuite("meh"); + JUnit3TestNotMissed testCase = new JUnit3TestNotMissed(); + testCase.setName("testNothing"); + test.addTest(testCase); + return test; + } +} http://git-wip-us.apache.org/repos/asf/ant/blob/0ed7f4ab/src/tests/junit/org/example/junit/ThreadedOutput.java ---------------------------------------------------------------------- diff --git a/src/tests/junit/org/example/junit/ThreadedOutput.java b/src/tests/junit/org/example/junit/ThreadedOutput.java index f5ee38d..91f462a 100644 --- a/src/tests/junit/org/example/junit/ThreadedOutput.java +++ b/src/tests/junit/org/example/junit/ThreadedOutput.java @@ -1,43 +1,43 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.example.junit; - -import junit.framework.TestCase; - -/** - * Not really a test of Ant but a test that is run by the test of the - * junit task. Confused? - * - * @since Ant 1.5 - */ -public class ThreadedOutput extends TestCase { - - public ThreadedOutput(String s) { - super(s); - } - - public void testOutput() throws InterruptedException { - Thread t = new Thread(new Runnable() { - public void run() { - System.out.println("foo"); - } - }); - t.start(); - t.join(); - } -} +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.example.junit; + +import junit.framework.TestCase; + +/** + * Not really a test of Ant but a test that is run by the test of the + * junit task. Confused? + * + * @since Ant 1.5 + */ +public class ThreadedOutput extends TestCase { + + public ThreadedOutput(String s) { + super(s); + } + + public void testOutput() throws InterruptedException { + Thread t = new Thread(new Runnable() { + public void run() { + System.out.println("foo"); + } + }); + t.start(); + t.join(); + } +} http://git-wip-us.apache.org/repos/asf/ant/blob/0ed7f4ab/src/tests/junit/org/example/junit/Timeout.java ---------------------------------------------------------------------- diff --git a/src/tests/junit/org/example/junit/Timeout.java b/src/tests/junit/org/example/junit/Timeout.java index 54cb4e7..6a42ee7 100644 --- a/src/tests/junit/org/example/junit/Timeout.java +++ b/src/tests/junit/org/example/junit/Timeout.java @@ -1,32 +1,32 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.example.junit; - -import org.junit.After; -import org.junit.Test; - -public class Timeout { - @Test - public void testTimeout() throws InterruptedException { - Thread.sleep(5000); - } - @After - public void tearDown() { - System.out.println("tearDown called on Timeout"); - } -} +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.example.junit; + +import org.junit.After; +import org.junit.Test; + +public class Timeout { + @Test + public void testTimeout() throws InterruptedException { + Thread.sleep(5000); + } + @After + public void tearDown() { + System.out.println("tearDown called on Timeout"); + } +} http://git-wip-us.apache.org/repos/asf/ant/blob/0ed7f4ab/src/tests/junit/org/example/junit/XmlParserTest.java ---------------------------------------------------------------------- diff --git a/src/tests/junit/org/example/junit/XmlParserTest.java b/src/tests/junit/org/example/junit/XmlParserTest.java index 57d74f0..e5fae55 100644 --- a/src/tests/junit/org/example/junit/XmlParserTest.java +++ b/src/tests/junit/org/example/junit/XmlParserTest.java @@ -1,58 +1,58 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.example.junit; - -import org.junit.Test; -import org.xml.sax.SAXException; -import org.xml.sax.XMLReader; -import org.xml.sax.helpers.XMLReaderFactory; - -import static org.junit.Assert.assertNotNull; - -/** - * created Aug 12, 2004 1:39:59 PM - */ - -public class XmlParserTest { - - - @Test - public void testXercesIsPresent() throws SAXException { - XMLReader xerces; - xerces = XMLReaderFactory.createXMLReader( - "org.apache.xerces.parsers.SAXParser"); - assertNotNull(xerces); - } - - @Test - public void testXercesHandlesSchema() throws SAXException { - XMLReader xerces; - xerces = XMLReaderFactory.createXMLReader("org.apache.xerces.parsers.SAXParser"); - xerces.setFeature("http://apache.org/xml/features/validation/schema", - true); - } - - @Test - public void testParserHandlesSchema() throws SAXException { - XMLReader xerces; - xerces = XMLReaderFactory.createXMLReader(); - xerces.setFeature("http://apache.org/xml/features/validation/schema", - true); - } - -} +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.example.junit; + +import org.junit.Test; +import org.xml.sax.SAXException; +import org.xml.sax.XMLReader; +import org.xml.sax.helpers.XMLReaderFactory; + +import static org.junit.Assert.assertNotNull; + +/** + * created Aug 12, 2004 1:39:59 PM + */ + +public class XmlParserTest { + + + @Test + public void testXercesIsPresent() throws SAXException { + XMLReader xerces; + xerces = XMLReaderFactory.createXMLReader( + "org.apache.xerces.parsers.SAXParser"); + assertNotNull(xerces); + } + + @Test + public void testXercesHandlesSchema() throws SAXException { + XMLReader xerces; + xerces = XMLReaderFactory.createXMLReader("org.apache.xerces.parsers.SAXParser"); + xerces.setFeature("http://apache.org/xml/features/validation/schema", + true); + } + + @Test + public void testParserHandlesSchema() throws SAXException { + XMLReader xerces; + xerces = XMLReaderFactory.createXMLReader(); + xerces.setFeature("http://apache.org/xml/features/validation/schema", + true); + } + +} http://git-wip-us.apache.org/repos/asf/ant/blob/0ed7f4ab/src/tests/junit/org/example/tasks/TaskdefTestContainerTask.java ---------------------------------------------------------------------- diff --git a/src/tests/junit/org/example/tasks/TaskdefTestContainerTask.java b/src/tests/junit/org/example/tasks/TaskdefTestContainerTask.java index 0e0a599..a566d5c 100644 --- a/src/tests/junit/org/example/tasks/TaskdefTestContainerTask.java +++ b/src/tests/junit/org/example/tasks/TaskdefTestContainerTask.java @@ -1,25 +1,25 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -package org.example.tasks; - -import org.apache.tools.ant.taskdefs.Sequential; - -public class TaskdefTestContainerTask extends Sequential { - public TaskdefTestContainerTask() {} -} +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package org.example.tasks; + +import org.apache.tools.ant.taskdefs.Sequential; + +public class TaskdefTestContainerTask extends Sequential { + public TaskdefTestContainerTask() {} +} http://git-wip-us.apache.org/repos/asf/ant/blob/0ed7f4ab/src/tests/junit/org/example/tasks/TaskdefTestSimpleTask.java ---------------------------------------------------------------------- diff --git a/src/tests/junit/org/example/tasks/TaskdefTestSimpleTask.java b/src/tests/junit/org/example/tasks/TaskdefTestSimpleTask.java index 4c0bc69..fdb48b0 100644 --- a/src/tests/junit/org/example/tasks/TaskdefTestSimpleTask.java +++ b/src/tests/junit/org/example/tasks/TaskdefTestSimpleTask.java @@ -1,45 +1,44 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -package org.example.tasks; - -import org.apache.tools.ant.Project; -import org.apache.tools.ant.Task; - -public class TaskdefTestSimpleTask extends Task { - - public class Echo { - Echo() {} - private String message = null; - public void setMessage(String s) {message = s;} - } - - public TaskdefTestSimpleTask() {} - - private Echo echo; - public Echo createEcho() { - echo = new Echo(); - return echo; - } - - public void execute() { - log("simpletask: "+echo.message, Project.MSG_INFO); - } - -} - +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package org.example.tasks; + +import org.apache.tools.ant.Project; +import org.apache.tools.ant.Task; + +public class TaskdefTestSimpleTask extends Task { + + public class Echo { + Echo() {} + private String message = null; + public void setMessage(String s) {message = s;} + } + + public TaskdefTestSimpleTask() {} + + private Echo echo; + public Echo createEcho() { + echo = new Echo(); + return echo; + } + + public void execute() { + log("simpletask: "+echo.message, Project.MSG_INFO); + } + +} http://git-wip-us.apache.org/repos/asf/ant/blob/0ed7f4ab/src/tests/junit/org/example/types/TypedefTestType.java ---------------------------------------------------------------------- diff --git a/src/tests/junit/org/example/types/TypedefTestType.java b/src/tests/junit/org/example/types/TypedefTestType.java index 80eef22..c031422 100644 --- a/src/tests/junit/org/example/types/TypedefTestType.java +++ b/src/tests/junit/org/example/types/TypedefTestType.java @@ -1,25 +1,24 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -package org.example.types; - -import org.apache.tools.ant.ProjectComponent; - -public class TypedefTestType extends ProjectComponent { -} - +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package org.example.types; + +import org.apache.tools.ant.ProjectComponent; + +public class TypedefTestType extends ProjectComponent { +}
