Debian Codegraph @

animal-sniffer-maven-plugin/src/it/manimalsniffer-29/verify.bsh

raw
1
2 /*
3 * The MIT License
4 *
5 * Copyright (c) 2012, codehaus.org
6 *
7 * Permission is hereby granted, free of charge, to any person obtaining a copy
8 * of this software and associated documentation files (the "Software"), to deal
9 * in the Software without restriction, including without limitation the rights
10 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 * copies of the Software, and to permit persons to whom the Software is
12 * furnished to do so, subject to the following conditions:
13 *
14 * The above copyright notice and this permission notice shall be included in
15 * all copies or substantial portions of the Software.
16 *
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23 * THE SOFTWARE.
24 *
25 */
26
27 import java.io.*;
28 import org.codehaus.plexus.util.FileUtils;
29
30 try
31 {
32 File file = new File( basedir, "build.log" );
33 String buf = FileUtils.fileRead( file, "UTF-8" );
34
35 String[] expected = {
36 "Bad.java:9: Undefined reference: void java.util.concurrent.DelayQueue.<init>()",
37 "Bad.java:9: Undefined reference: java.util.concurrent.ScheduledFuture",
38 "Bad.java:11: Undefined reference: boolean java.util.concurrent.ScheduledFuture.isCancelled()",
39 "Bad.java:15: Undefined reference: java.util.concurrent.Callable java.util.concurrent.Executors.callable(Runnable)",
40 "Bad.java:15: Undefined reference: Object java.util.concurrent.Callable.call()",
41 // XXX seems like there should be more of them...
42 };
43 for (String s : expected) {
44 if (!buf.contains(s)) {
45 System.err.println("Failed to find: " + s);
46 return false;
47 }
48 }
49 if (buf.contains("Good1.java")) {
50 System.err.println("Should not have warned about Good1.java");
51 return false;
52 }
53 if (buf.contains("Good2.java")) {
54 System.err.println("Should not have warned about Good2.java");
55 return false;
56 }
57 }
58 catch( Throwable t )
59 {
60 t.printStackTrace();
61 return false;
62 }
63
64 return true;