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.

LengthTest.java 1.8 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /*
  2. * Copyright 2005 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. public class LengthTest extends BuildFileTest {
  20. public LengthTest(String name) {
  21. super(name);
  22. }
  23. public void setUp() {
  24. configureProject("src/etc/testcases/taskdefs/length.xml");
  25. }
  26. public void tearDown() {
  27. executeTarget("cleanup");
  28. }
  29. public void testEach() {
  30. // Disable this test as the order of files in a fileset is
  31. // not specified
  32. // executeTarget("testEach");
  33. }
  34. public void testAll() {
  35. executeTarget("testAll");
  36. }
  37. public void testFile() {
  38. executeTarget("testFile");
  39. }
  40. public void testBoth() {
  41. executeTarget("testBoth");
  42. }
  43. public void testDupes() {
  44. executeTarget("testDupes");
  45. }
  46. public void testString() {
  47. executeTarget("testString");
  48. }
  49. public void testStringFile() {
  50. expectBuildExceptionContaining("testStringFile",
  51. "should fail", "incompatible");
  52. }
  53. public void testTrimFile() {
  54. expectBuildExceptionContaining("testTrimFile",
  55. "should fail", "string length function only");
  56. }
  57. }