1 | /*
|
---|
2 | * Copyright 2003-2004 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.optional.splash;
|
---|
19 |
|
---|
20 | import org.apache.tools.ant.Project;
|
---|
21 |
|
---|
22 | /**
|
---|
23 | * This is an "interactive" test, it passes if the splash screen
|
---|
24 | * disappears after the "finished" but before the "exiting" message.
|
---|
25 | *
|
---|
26 | * This even isn't a JUnit test case.
|
---|
27 | *
|
---|
28 | * @since Ant 1.5.2
|
---|
29 | */
|
---|
30 | public class SplashScreenTest {
|
---|
31 |
|
---|
32 | public static void main(String[] args) {
|
---|
33 | Project p = new Project();
|
---|
34 | SplashTask t = new SplashTask();
|
---|
35 | t.setProject(p);
|
---|
36 | t.execute();
|
---|
37 |
|
---|
38 | // give it some time to display
|
---|
39 | try {
|
---|
40 | Thread.currentThread().sleep(2000);
|
---|
41 | } catch (InterruptedException e) {
|
---|
42 | } // end of try-catch
|
---|
43 |
|
---|
44 | p.fireBuildFinished(null);
|
---|
45 | System.err.println("finished");
|
---|
46 |
|
---|
47 | try {
|
---|
48 | Thread.currentThread().sleep(2000);
|
---|
49 | } catch (InterruptedException e) {
|
---|
50 | } // end of try-catch
|
---|
51 | System.err.println("exiting");
|
---|
52 | System.exit(0);
|
---|
53 | }
|
---|
54 | }
|
---|
55 |
|
---|