FileDocCategorySizeDatePackage
ExtraClassesTestCase.javaAPI DocApache Axis 1.43124Sat Apr 22 18:57:28 BST 2006test.wsdl.extra

ExtraClassesTestCase

public class ExtraClassesTestCase extends TestCase
This tests the file generation of only the items that are referenced in WSDL This should extend FileGenTestCase, but we have a dependancy problem as "extra" comes before "filegen". Oh well.

Fields Summary
Constructors Summary
public ExtraClassesTestCase(String name)

        super(name);
    
Methods Summary
protected java.util.SetmayExist()
List of files which may or may not be generated.

        HashSet set = new HashSet();
        return set;
    
protected java.lang.StringrootDir()
The directory containing the files that should exist.

        return "build" + File.separator + "work" + File.separator +
                "test" + File.separator + "wsdl" + File.separator +
                "extra";
    
protected java.util.SetshouldExist()
List of files which should be generated.

        HashSet set = new HashSet();
        set.add("Extra.java");  // this is the important one
        set.add("MyService.java");
        set.add("MyServiceService.java");
        set.add("MyServiceServiceLocator.java");
        set.add("MyServiceSoapBindingStub.java");
        set.add("MyService.wsdl");
        set.add("ExtraClassesTestCase.java");
        return set;
    
public voidtestFileGen()

        String rootDir = rootDir();
        Set shouldExist = shouldExist();
        Set mayExist = mayExist();

        // open up the output directory and check what files exist.
        File outputDir = new File(rootDir);
        
        String[] files = outputDir.list();

        Vector shouldNotExist = new Vector();

        for (int i = 0; i < files.length; ++i) {
            if (shouldExist.contains(files[i])) {
                shouldExist.remove(files[i]);
            } 
            else if (mayExist.contains(files[i])) {
                mayExist.remove(files[i]);
            }
            else {
                shouldNotExist.add(files[i]);
            }
        }

        if (shouldExist.size() > 0) {
            fail("The following files should exist but do not:  " + shouldExist);
        }

        if (shouldNotExist.size() > 0) {
            fail("The following files should NOT exist, but do:  " + shouldNotExist);
        }