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 |
|
---|
18 | package org.apache.tools.ant.taskdefs;
|
---|
19 |
|
---|
20 | import org.apache.tools.ant.BuildFileTest;
|
---|
21 | import org.apache.tools.ant.util.FileUtils;
|
---|
22 |
|
---|
23 | import java.io.IOException;
|
---|
24 |
|
---|
25 | /**
|
---|
26 | */
|
---|
27 | public class BZip2Test extends BuildFileTest {
|
---|
28 |
|
---|
29 | public BZip2Test(String name) {
|
---|
30 | super(name);
|
---|
31 | }
|
---|
32 |
|
---|
33 | public void setUp() {
|
---|
34 | configureProject("src/etc/testcases/taskdefs/bzip2.xml");
|
---|
35 | executeTarget("prepare");
|
---|
36 | }
|
---|
37 |
|
---|
38 | public void tearDown() {
|
---|
39 | executeTarget("cleanup");
|
---|
40 | }
|
---|
41 |
|
---|
42 | public void testRealTest() throws java.io.IOException {
|
---|
43 | FileUtils fileUtils = FileUtils.newFileUtils();
|
---|
44 | executeTarget("realTest");
|
---|
45 | assertTrue("File content mismatch",
|
---|
46 | fileUtils.contentEquals(project.resolveFile("expected/asf-logo-huge.tar.bz2"),
|
---|
47 | project.resolveFile("asf-logo-huge.tar.bz2")));
|
---|
48 | }
|
---|
49 |
|
---|
50 | public void testDateCheck(){
|
---|
51 | executeTarget("testDateCheck");
|
---|
52 | String log = getLog();
|
---|
53 | assertTrue(
|
---|
54 | "Expecting message ending with 'asf-logo.gif.bz2 is up to date.' but got '" + log + "'",
|
---|
55 | log.endsWith("asf-logo.gif.bz2 is up to date."));
|
---|
56 | }
|
---|
57 |
|
---|
58 | }
|
---|