* have to make an acceptible wrapper class. We generate the package name to be "org.apache.axisttest" with the
* testNum appended to it. We also enablt skeleton generation and testcase generation. We also turn on verbosity.
*/
protected void prepareTest(String fileName, int testNum) throws Exception {
JavaWriterFactory writerFactory = new JavaWriterFactory();
Emitter wsdl2java = new Emitter(writerFactory);
writerFactory.setEmitter(wsdl2java);
wsdl2java.setOutputDir(Wsdl2javaTestSuite.WORK_DIR);
wsdl2java.generateSkeleton(true);
wsdl2java.generateTestCase(true);
/* Copy concrete implementation files to the work directory.
*/
File implDir = new File(fileName.substring(0, fileName.lastIndexOf('/')));
if (implDir.isDirectory()) {
File[] files = implDir.listFiles();
for (int i = 0; i < files.length; i++) {
if (files[i].getName().endsWith("Impl.java") || files[i].getName().endsWith("TestCase.java")) {
File subDir = new File(Wsdl2javaTestSuite.WORK_DIR, implDir.toString());
subDir.mkdirs();
File newFile = new File(subDir, files[i].getName());
BufferedInputStream is = new BufferedInputStream(new FileInputStream(files[i]));
BufferedOutputStream os = new BufferedOutputStream(new FileOutputStream(newFile));
byte[] buffer = new byte[1024];
int length = -1;
while ((length = is.read(buffer)) != -1) {
os.write(buffer, 0, length);
}
os.flush();
is.close();
os.close();
}
}
}
wsdl2java.emit(fileName);
Wsdl2javaTestSuite.classNames.add(testNum, wsdl2java.getGeneratedClassNames());
Wsdl2javaTestSuite.fileNames.add(testNum, wsdl2java.getGeneratedFileNames());
this.testSuiteProject.executeTarget(Wsdl2javaTestSuite.COMPILE_TASK);
} //protected void prepareTest()