You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

EchoTest.java 2.0 kB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /*
  2. * Copyright 2000,2004 The Apache Software Foundation
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. *
  16. */
  17. package org.apache.tools.ant.taskdefs;
  18. import org.apache.tools.ant.BuildFileTest;
  19. /**
  20. */
  21. public class EchoTest extends BuildFileTest {
  22. public EchoTest(String name) {
  23. super(name);
  24. }
  25. public void setUp() {
  26. configureProject("src/etc/testcases/taskdefs/echo.xml");
  27. }
  28. public void tearDown() {
  29. executeTarget("clean");
  30. }
  31. // Output an empty String
  32. public void test1() {
  33. expectLog("test1", "");
  34. }
  35. // Output 'OUTPUT OF ECHO'
  36. public void test2() {
  37. expectLog("test2", "OUTPUT OF ECHO");
  38. }
  39. public void test3() {
  40. expectLog("test3", "\n"+
  41. " This \n"+
  42. " is\n"+
  43. " a \n"+
  44. " multiline\n"+
  45. " message\n"+
  46. " ");
  47. }
  48. public void testFile() throws Exception {
  49. executeTarget("testFile");
  50. }
  51. public void testAppend() throws Exception {
  52. executeTarget("testAppend");
  53. }
  54. public void testEmptyEncoding() throws Exception {
  55. executeTarget("testEmptyEncoding");
  56. }
  57. public void testUTF16Encoding() throws Exception {
  58. executeTarget("testUTF16Encoding");
  59. }
  60. public void testUTF8Encoding() throws Exception {
  61. executeTarget("testUTF8Encoding");
  62. }
  63. }