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.

CallTargetTest.java 2.1 kB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. /*
  2. * Copyright 2003-2004,2006 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 java.util.Vector;
  19. import org.apache.tools.ant.BuildFileTest;
  20. /**
  21. */
  22. public class CallTargetTest extends BuildFileTest {
  23. public CallTargetTest(String name) {
  24. super(name);
  25. }
  26. public void setUp() {
  27. configureProject("src/etc/testcases/taskdefs/calltarget.xml");
  28. }
  29. // see bugrep 21724 (references not passing through with antcall)
  30. public void testInheritRefFileSet() {
  31. expectLogContaining("testinheritreffileset", "calltarget.xml");
  32. }
  33. // see bugrep 21724 (references not passing through with antcall)
  34. public void testInheritFilterset() {
  35. project.executeTarget("testinheritreffilterset");
  36. }
  37. // see bugrep 11418 (In repeated calls to the same target,
  38. // params will not be passed in)
  39. public void testMultiCall() {
  40. Vector v = new Vector();
  41. v.add("call-multi");
  42. v.add("call-multi");
  43. project.executeTargets(v);
  44. assertLogContaining("multi is SETmulti is SET");
  45. }
  46. public void testBlankTarget() {
  47. expectBuildException("blank-target", "target name must not be empty");
  48. }
  49. public void testMultipleTargets() {
  50. expectLog("multiple-targets", "tadadctbdbtc");
  51. }
  52. public void testMultipleTargets2() {
  53. expectLog("multiple-targets-2", "dadctb");
  54. }
  55. public void tearDown() {
  56. project.executeTarget("cleanup");
  57. }
  58. }