You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@turbine.apache.org by jv...@apache.org on 2002/02/23 00:14:20 UTC
cvs commit: jakarta-turbine-maven/src/test-importscrubber/foo Bar.class Bar.java Buz.class Buz.java
jvanzyl 02/02/22 15:14:19
Added: src/test-importscrubber FunctionalTest.class
FunctionalTest.java Hello.class Hello.java
src/test-importscrubber/foo Bar.class Bar.java Buz.class
Buz.java
Log:
- import scrubber tests now pass
Revision Changes Path
1.1 jakarta-turbine-maven/src/test-importscrubber/FunctionalTest.class
Index: FunctionalTest.class
===================================================================
dummy class with a .class extension
1.1 jakarta-turbine-maven/src/test-importscrubber/FunctionalTest.java
Index: FunctionalTest.java
===================================================================
/**
* This is a place where people put copyright headers - these need to be preserved
*/
import foo.Buz;
import java.awt.Component;
import java.io.File;
import java.io.*;
import java.io.IOException;
import java.lang.reflect.Modifier;
import java.net.*;
import java.net.URL;
import java.net.URLConnection;
import java.util.*;
import java.util.Date;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
import java.util.Vector;
import java.util.Map.Entry;
import javax.swing.JLabel;
import javax.swing.JTextField;
/**
* This class encapsulates an piece of code on which to run importscrubber
*/
public class FunctionalTest implements Runnable
{
public static class Bar extends JTextField
{
private static final FilePermission BIF = new FilePermission("/etc/passwd", "foo");
private static final FilePermission BIF2 = new FilePermission("Hello world", "bar");
}
public class Foo extends JLabel {
public String getText() {
return super.getText();
}
}
private static final ArrayList[] STATIC_FOO = new ArrayList[0];
private HashSet set = new HashSet();
public FunctionalTest() throws IOException {
Vector v = new Vector();
for (Enumeration e = v.elements(); e.hasMoreElements();)
{
}
IOException e = new IOException();
// this is to test excluding literals
String buz = "text/plain";
// this is to test array handling
ArrayList[] foo = new ArrayList[0];
ArrayList bar = new ArrayList();
bar.add(HashSet.class);
bar.add(Integer.class);
File[] files = (File[])bar.toArray(new File[0]);
// this is to test imports of inner classes
HashMap biv = new HashMap();
Set set = biv.entrySet();
Iterator iter = set.iterator();
bar.add((Entry)iter.next());
// this is to test inclusion of classes from java.lang.reflect
Modifier m = new Modifier();
// This next one can't be picked up by importscrubber because the compiler inlines it
// System.out.println("A JOptionPane thingy " + JOptionPane.CANCEL_OPTION);
// bummer!
// this is to test importing a class and only calling a static method on it
Buz.doSomething();
// this is to test NOT importing classes which are fully qualified in the class body
java.sql.Date sqlDate = new java.sql.Date(20);
Date javaDate = new Date();
throw new IllegalArgumentException();
}
// this is to test method argument/return value types
public SocketOptions bar(URL aURL, URLConnection aConn) {
return null;
}
public Component getComp() {
return null;
}
public void run() {}
}
1.1 jakarta-turbine-maven/src/test-importscrubber/Hello.class
Index: Hello.class
===================================================================
dummy file with a .class extension
1.1 jakarta-turbine-maven/src/test-importscrubber/Hello.java
Index: Hello.java
===================================================================
import java.util.ArrayList;
public class Hello
{
public Hello()
{
List list = new ArrayList();
}
}
1.1 jakarta-turbine-maven/src/test-importscrubber/foo/Bar.class
Index: Bar.class
===================================================================
dummy file with a .class extension
1.1 jakarta-turbine-maven/src/test-importscrubber/foo/Bar.java
Index: Bar.java
===================================================================
/*
This is one place to put copyright headers
*/
package foo;
/*
This is another place to put copyright headers
*/
import java.util.ArrayList;
public class Bar
{
public Bar()
{
List list = new ArrayList();
}
}
1.1 jakarta-turbine-maven/src/test-importscrubber/foo/Buz.class
Index: Buz.class
===================================================================
dummy file with .class extension
1.1 jakarta-turbine-maven/src/test-importscrubber/foo/Buz.java
Index: Buz.java
===================================================================
package foo;
public class Buz
{
public final static int BUZ = 2;
public static void doSomething() {}
}
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>