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.

TaskContainerTest.java 2.2 kB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /*
  2. * Licensed to the Apache Software Foundation (ASF) under one or more
  3. * contributor license agreements. See the NOTICE file distributed with
  4. * this work for additional information regarding copyright ownership.
  5. * The ASF licenses this file to You under the Apache License, Version 2.0
  6. * (the "License"); you may not use this file except in compliance with
  7. * the License. You may obtain a copy of the License at
  8. *
  9. * http://www.apache.org/licenses/LICENSE-2.0
  10. *
  11. * Unless required by applicable law or agreed to in writing, software
  12. * distributed under the License is distributed on an "AS IS" BASIS,
  13. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. * See the License for the specific language governing permissions and
  15. * limitations under the License.
  16. *
  17. */
  18. package org.apache.tools.ant;
  19. public class TaskContainerTest extends BuildFileTest {
  20. public TaskContainerTest(String name) {
  21. super(name);
  22. }
  23. public void setUp() {
  24. configureProject("src/etc/testcases/core/taskcontainer.xml");
  25. }
  26. public void tearDown() {
  27. executeTarget("cleanup");
  28. }
  29. public void testPropertyExpansion() {
  30. executeTarget("testPropertyExpansion");
  31. assertTrue("attribute worked",
  32. getLog().indexOf("As attribute: it worked") > -1);
  33. assertTrue("nested text worked",
  34. getLog().indexOf("As nested text: it worked") > -1);
  35. }
  36. public void testTaskdef() {
  37. executeTarget("testTaskdef");
  38. assertTrue("attribute worked",
  39. getLog().indexOf("As attribute: it worked") > -1);
  40. assertTrue("nested text worked",
  41. getLog().indexOf("As nested text: it worked") > -1);
  42. assertTrue("nested text worked",
  43. getLog().indexOf("As nested task: it worked") > -1);
  44. }
  45. public void testCaseInsensitive() {
  46. executeTarget("testCaseInsensitive");
  47. assertTrue("works outside of container",
  48. getLog().indexOf("hello ") > -1);
  49. assertTrue("works inside of container",
  50. getLog().indexOf("world") > -1);
  51. }
  52. }