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.

BUnzip2Test.java 1.9 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /*
  2. * Copyright 2001-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. import org.apache.tools.ant.util.FileUtils;
  20. import java.io.IOException;
  21. /**
  22. */
  23. public class BUnzip2Test extends BuildFileTest {
  24. /** Utilities used for file operations */
  25. private static final FileUtils FILE_UTILS = FileUtils.getFileUtils();
  26. public BUnzip2Test(String name) {
  27. super(name);
  28. }
  29. public void setUp() {
  30. configureProject("src/etc/testcases/taskdefs/bunzip2.xml");
  31. executeTarget("prepare");
  32. }
  33. public void tearDown() {
  34. executeTarget("cleanup");
  35. }
  36. public void testRealTest() throws java.io.IOException {
  37. testRealTest("realTest");
  38. }
  39. public void testRealTestWithResource() throws java.io.IOException {
  40. testRealTest("realTestWithResource");
  41. }
  42. private void testRealTest(String target) throws java.io.IOException {
  43. executeTarget(target);
  44. assertTrue("File content mismatch after bunzip2",
  45. FILE_UTILS.contentEquals(project.resolveFile("expected/asf-logo-huge.tar"),
  46. project.resolveFile("asf-logo-huge.tar")));
  47. }
  48. public void testDocumentationClaimsOnCopy() throws java.io.IOException {
  49. testRealTest("testDocumentationClaimsOnCopy");
  50. }
  51. }