package bytecode; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.util.Vector; import junit.framework.TestCase; import org.junit.Test; import de.dhbwstuttgart.bytecode.ClassFile; import sun.misc.IOUtils; public class GeneralTest extends TestCase{ @Test public void test(){ Vector cfs = null; try { cfs = BytecodeTester.readFileAndTestCodegen("FieldTest.jav"); } catch (IOException e) { e.printStackTrace(); fail(); } assertTrue("Es darf nur eine ClassFile erstellt werden", cfs.size()==1); try { FileOutputStream output = new FileOutputStream(new File(BytecodeTester.rootDirectory+"FieldTest.class")); output.write(cfs.firstElement().getBytecode()); } catch (IOException e) { e.printStackTrace(); fail(); } } }