diff --git a/pom.xml b/pom.xml index 67e4f37d..70b7ce6d 100644 --- a/pom.xml +++ b/pom.xml @@ -7,16 +7,23 @@ JavaTXcompiler jar + + 1.8 + 1.8 + 0.23.0 + + + + maven-repository + MyCo Internal Repository + file:///${project.basedir}/maven-repository/ + + + 0.1 JavaTXcompiler http://maven.apache.org - - junit - junit - 4.0 - test - org.antlr antlr4 @@ -42,6 +49,12 @@ asm-all [4.0.0,) + + junit + junit + 4.12 + test + @@ -49,8 +62,6 @@ target/classes ${project.artifactId}-${project.version} target/test-classes - src/ - test/ org.antlr @@ -63,8 +74,8 @@ antlr4 - src/de/dhbwstuttgart/parser/antlr/ - src/de/dhbwstuttgart/parser/antlr/ + src/main/java/de/dhbwstuttgart/parser/antlr/ + src/main/java/de/dhbwstuttgart/parser/antlr/ -package de.dhbwstuttgart.parser.antlr @@ -77,8 +88,8 @@ antlr4 - src/de/dhbwstuttgart/sat/asp/parser/antlr/ - src/de/dhbwstuttgart/sat/asp/parser/antlr/ + src/main/java/de/dhbwstuttgart/sat/asp/parser/antlr/ + src/main/java/de/dhbwstuttgart/sat/asp/parser/antlr/ -package de.dhbwstuttgart.sat.asp.parser.antlr @@ -170,16 +181,4 @@ file:///${project.basedir}/target - - 1.8 - 1.8 - 0.23.0 - - - - maven-repository - MyCo Internal Repository - file:///${project.basedir}/maven-repository/ - - diff --git a/src/de/dhbwstuttgart/.DS_Store b/src/main/java/de/dhbwstuttgart/.DS_Store similarity index 100% rename from src/de/dhbwstuttgart/.DS_Store rename to src/main/java/de/dhbwstuttgart/.DS_Store diff --git a/src/de/dhbwstuttgart/bytecode/AStatement.java b/src/main/java/de/dhbwstuttgart/bytecode/AStatement.java similarity index 100% rename from src/de/dhbwstuttgart/bytecode/AStatement.java rename to src/main/java/de/dhbwstuttgart/bytecode/AStatement.java diff --git a/src/de/dhbwstuttgart/bytecode/ArgumentExpr.java b/src/main/java/de/dhbwstuttgart/bytecode/ArgumentExpr.java similarity index 100% rename from src/de/dhbwstuttgart/bytecode/ArgumentExpr.java rename to src/main/java/de/dhbwstuttgart/bytecode/ArgumentExpr.java diff --git a/src/de/dhbwstuttgart/bytecode/ArgumentVisitor.java b/src/main/java/de/dhbwstuttgart/bytecode/ArgumentVisitor.java similarity index 100% rename from src/de/dhbwstuttgart/bytecode/ArgumentVisitor.java rename to src/main/java/de/dhbwstuttgart/bytecode/ArgumentVisitor.java diff --git a/src/de/dhbwstuttgart/bytecode/AssignStmt.java b/src/main/java/de/dhbwstuttgart/bytecode/AssignStmt.java similarity index 100% rename from src/de/dhbwstuttgart/bytecode/AssignStmt.java rename to src/main/java/de/dhbwstuttgart/bytecode/AssignStmt.java diff --git a/src/de/dhbwstuttgart/bytecode/BytecodeGen.java b/src/main/java/de/dhbwstuttgart/bytecode/BytecodeGen.java similarity index 100% rename from src/de/dhbwstuttgart/bytecode/BytecodeGen.java rename to src/main/java/de/dhbwstuttgart/bytecode/BytecodeGen.java diff --git a/src/de/dhbwstuttgart/bytecode/BytecodeGenMethod.java b/src/main/java/de/dhbwstuttgart/bytecode/BytecodeGenMethod.java similarity index 100% rename from src/de/dhbwstuttgart/bytecode/BytecodeGenMethod.java rename to src/main/java/de/dhbwstuttgart/bytecode/BytecodeGenMethod.java diff --git a/src/de/dhbwstuttgart/bytecode/IStatement.java b/src/main/java/de/dhbwstuttgart/bytecode/IStatement.java similarity index 100% rename from src/de/dhbwstuttgart/bytecode/IStatement.java rename to src/main/java/de/dhbwstuttgart/bytecode/IStatement.java diff --git a/src/de/dhbwstuttgart/bytecode/IfStatement.java b/src/main/java/de/dhbwstuttgart/bytecode/IfStatement.java similarity index 100% rename from src/de/dhbwstuttgart/bytecode/IfStatement.java rename to src/main/java/de/dhbwstuttgart/bytecode/IfStatement.java diff --git a/src/de/dhbwstuttgart/bytecode/LoopStmt.java b/src/main/java/de/dhbwstuttgart/bytecode/LoopStmt.java similarity index 100% rename from src/de/dhbwstuttgart/bytecode/LoopStmt.java rename to src/main/java/de/dhbwstuttgart/bytecode/LoopStmt.java diff --git a/src/de/dhbwstuttgart/bytecode/ReturnStmt.java b/src/main/java/de/dhbwstuttgart/bytecode/ReturnStmt.java similarity index 100% rename from src/de/dhbwstuttgart/bytecode/ReturnStmt.java rename to src/main/java/de/dhbwstuttgart/bytecode/ReturnStmt.java diff --git a/src/de/dhbwstuttgart/bytecode/constraint/EqualConstraint.java b/src/main/java/de/dhbwstuttgart/bytecode/constraint/EqualConstraint.java similarity index 100% rename from src/de/dhbwstuttgart/bytecode/constraint/EqualConstraint.java rename to src/main/java/de/dhbwstuttgart/bytecode/constraint/EqualConstraint.java diff --git a/src/de/dhbwstuttgart/bytecode/constraint/ExtendsConstraint.java b/src/main/java/de/dhbwstuttgart/bytecode/constraint/ExtendsConstraint.java similarity index 100% rename from src/de/dhbwstuttgart/bytecode/constraint/ExtendsConstraint.java rename to src/main/java/de/dhbwstuttgart/bytecode/constraint/ExtendsConstraint.java diff --git a/src/de/dhbwstuttgart/bytecode/constraint/TPHConstraint.java b/src/main/java/de/dhbwstuttgart/bytecode/constraint/TPHConstraint.java similarity index 100% rename from src/de/dhbwstuttgart/bytecode/constraint/TPHConstraint.java rename to src/main/java/de/dhbwstuttgart/bytecode/constraint/TPHConstraint.java diff --git a/src/de/dhbwstuttgart/bytecode/descriptor/DescriptorToString.java b/src/main/java/de/dhbwstuttgart/bytecode/descriptor/DescriptorToString.java similarity index 100% rename from src/de/dhbwstuttgart/bytecode/descriptor/DescriptorToString.java rename to src/main/java/de/dhbwstuttgart/bytecode/descriptor/DescriptorToString.java diff --git a/src/de/dhbwstuttgart/bytecode/descriptor/DescriptorVisitor.java b/src/main/java/de/dhbwstuttgart/bytecode/descriptor/DescriptorVisitor.java similarity index 100% rename from src/de/dhbwstuttgart/bytecode/descriptor/DescriptorVisitor.java rename to src/main/java/de/dhbwstuttgart/bytecode/descriptor/DescriptorVisitor.java diff --git a/src/de/dhbwstuttgart/bytecode/descriptor/TypeToDescriptor.java b/src/main/java/de/dhbwstuttgart/bytecode/descriptor/TypeToDescriptor.java similarity index 100% rename from src/de/dhbwstuttgart/bytecode/descriptor/TypeToDescriptor.java rename to src/main/java/de/dhbwstuttgart/bytecode/descriptor/TypeToDescriptor.java diff --git a/src/de/dhbwstuttgart/bytecode/signature/Signature.java b/src/main/java/de/dhbwstuttgart/bytecode/signature/Signature.java similarity index 100% rename from src/de/dhbwstuttgart/bytecode/signature/Signature.java rename to src/main/java/de/dhbwstuttgart/bytecode/signature/Signature.java diff --git a/src/de/dhbwstuttgart/bytecode/signature/TypeToSignature.java b/src/main/java/de/dhbwstuttgart/bytecode/signature/TypeToSignature.java similarity index 100% rename from src/de/dhbwstuttgart/bytecode/signature/TypeToSignature.java rename to src/main/java/de/dhbwstuttgart/bytecode/signature/TypeToSignature.java diff --git a/src/de/dhbwstuttgart/bytecode/signature/TypeToString.java b/src/main/java/de/dhbwstuttgart/bytecode/signature/TypeToString.java similarity index 100% rename from src/de/dhbwstuttgart/bytecode/signature/TypeToString.java rename to src/main/java/de/dhbwstuttgart/bytecode/signature/TypeToString.java diff --git a/src/de/dhbwstuttgart/bytecode/utilities/KindOfLambda.java b/src/main/java/de/dhbwstuttgart/bytecode/utilities/KindOfLambda.java similarity index 100% rename from src/de/dhbwstuttgart/bytecode/utilities/KindOfLambda.java rename to src/main/java/de/dhbwstuttgart/bytecode/utilities/KindOfLambda.java diff --git a/src/de/dhbwstuttgart/bytecode/utilities/Lambda.java b/src/main/java/de/dhbwstuttgart/bytecode/utilities/Lambda.java similarity index 100% rename from src/de/dhbwstuttgart/bytecode/utilities/Lambda.java rename to src/main/java/de/dhbwstuttgart/bytecode/utilities/Lambda.java diff --git a/src/de/dhbwstuttgart/bytecode/utilities/MethodAndTPH.java b/src/main/java/de/dhbwstuttgart/bytecode/utilities/MethodAndTPH.java similarity index 100% rename from src/de/dhbwstuttgart/bytecode/utilities/MethodAndTPH.java rename to src/main/java/de/dhbwstuttgart/bytecode/utilities/MethodAndTPH.java diff --git a/src/de/dhbwstuttgart/bytecode/utilities/MethodFromMethodCall.java b/src/main/java/de/dhbwstuttgart/bytecode/utilities/MethodFromMethodCall.java similarity index 100% rename from src/de/dhbwstuttgart/bytecode/utilities/MethodFromMethodCall.java rename to src/main/java/de/dhbwstuttgart/bytecode/utilities/MethodFromMethodCall.java diff --git a/src/de/dhbwstuttgart/bytecode/utilities/NormalConstructor.java b/src/main/java/de/dhbwstuttgart/bytecode/utilities/NormalConstructor.java similarity index 100% rename from src/de/dhbwstuttgart/bytecode/utilities/NormalConstructor.java rename to src/main/java/de/dhbwstuttgart/bytecode/utilities/NormalConstructor.java diff --git a/src/de/dhbwstuttgart/bytecode/utilities/NormalMethod.java b/src/main/java/de/dhbwstuttgart/bytecode/utilities/NormalMethod.java similarity index 100% rename from src/de/dhbwstuttgart/bytecode/utilities/NormalMethod.java rename to src/main/java/de/dhbwstuttgart/bytecode/utilities/NormalMethod.java diff --git a/src/de/dhbwstuttgart/bytecode/utilities/SamMethod.java b/src/main/java/de/dhbwstuttgart/bytecode/utilities/SamMethod.java similarity index 100% rename from src/de/dhbwstuttgart/bytecode/utilities/SamMethod.java rename to src/main/java/de/dhbwstuttgart/bytecode/utilities/SamMethod.java diff --git a/src/de/dhbwstuttgart/bytecode/utilities/Simplify.java b/src/main/java/de/dhbwstuttgart/bytecode/utilities/Simplify.java similarity index 100% rename from src/de/dhbwstuttgart/bytecode/utilities/Simplify.java rename to src/main/java/de/dhbwstuttgart/bytecode/utilities/Simplify.java diff --git a/src/de/dhbwstuttgart/core/ConsoleInterface.java b/src/main/java/de/dhbwstuttgart/core/ConsoleInterface.java similarity index 100% rename from src/de/dhbwstuttgart/core/ConsoleInterface.java rename to src/main/java/de/dhbwstuttgart/core/ConsoleInterface.java diff --git a/src/de/dhbwstuttgart/core/IItemWithOffset.java b/src/main/java/de/dhbwstuttgart/core/IItemWithOffset.java similarity index 100% rename from src/de/dhbwstuttgart/core/IItemWithOffset.java rename to src/main/java/de/dhbwstuttgart/core/IItemWithOffset.java diff --git a/src/de/dhbwstuttgart/core/JavaTXCompiler.java b/src/main/java/de/dhbwstuttgart/core/JavaTXCompiler.java similarity index 100% rename from src/de/dhbwstuttgart/core/JavaTXCompiler.java rename to src/main/java/de/dhbwstuttgart/core/JavaTXCompiler.java diff --git a/src/de/dhbwstuttgart/environment/CompilationEnvironment.java b/src/main/java/de/dhbwstuttgart/environment/CompilationEnvironment.java similarity index 100% rename from src/de/dhbwstuttgart/environment/CompilationEnvironment.java rename to src/main/java/de/dhbwstuttgart/environment/CompilationEnvironment.java diff --git a/src/de/dhbwstuttgart/environment/PackageCrawler.java b/src/main/java/de/dhbwstuttgart/environment/PackageCrawler.java similarity index 100% rename from src/de/dhbwstuttgart/environment/PackageCrawler.java rename to src/main/java/de/dhbwstuttgart/environment/PackageCrawler.java diff --git a/src/de/dhbwstuttgart/exceptions/DebugException.java b/src/main/java/de/dhbwstuttgart/exceptions/DebugException.java similarity index 100% rename from src/de/dhbwstuttgart/exceptions/DebugException.java rename to src/main/java/de/dhbwstuttgart/exceptions/DebugException.java diff --git a/src/de/dhbwstuttgart/exceptions/NotImplementedException.java b/src/main/java/de/dhbwstuttgart/exceptions/NotImplementedException.java similarity index 100% rename from src/de/dhbwstuttgart/exceptions/NotImplementedException.java rename to src/main/java/de/dhbwstuttgart/exceptions/NotImplementedException.java diff --git a/src/de/dhbwstuttgart/exceptions/ParserError.java b/src/main/java/de/dhbwstuttgart/exceptions/ParserError.java similarity index 100% rename from src/de/dhbwstuttgart/exceptions/ParserError.java rename to src/main/java/de/dhbwstuttgart/exceptions/ParserError.java diff --git a/src/de/dhbwstuttgart/exceptions/TypeinferenceException.java b/src/main/java/de/dhbwstuttgart/exceptions/TypeinferenceException.java similarity index 100% rename from src/de/dhbwstuttgart/exceptions/TypeinferenceException.java rename to src/main/java/de/dhbwstuttgart/exceptions/TypeinferenceException.java diff --git a/src/de/dhbwstuttgart/parser/JavaTXParser.java b/src/main/java/de/dhbwstuttgart/parser/JavaTXParser.java similarity index 100% rename from src/de/dhbwstuttgart/parser/JavaTXParser.java rename to src/main/java/de/dhbwstuttgart/parser/JavaTXParser.java diff --git a/src/de/dhbwstuttgart/parser/NullToken.java b/src/main/java/de/dhbwstuttgart/parser/NullToken.java similarity index 100% rename from src/de/dhbwstuttgart/parser/NullToken.java rename to src/main/java/de/dhbwstuttgart/parser/NullToken.java diff --git a/src/de/dhbwstuttgart/parser/SyntaxTreeGenerator/AssignToLocal.java b/src/main/java/de/dhbwstuttgart/parser/SyntaxTreeGenerator/AssignToLocal.java similarity index 100% rename from src/de/dhbwstuttgart/parser/SyntaxTreeGenerator/AssignToLocal.java rename to src/main/java/de/dhbwstuttgart/parser/SyntaxTreeGenerator/AssignToLocal.java diff --git a/src/de/dhbwstuttgart/parser/SyntaxTreeGenerator/FCGenerator.java b/src/main/java/de/dhbwstuttgart/parser/SyntaxTreeGenerator/FCGenerator.java similarity index 100% rename from src/de/dhbwstuttgart/parser/SyntaxTreeGenerator/FCGenerator.java rename to src/main/java/de/dhbwstuttgart/parser/SyntaxTreeGenerator/FCGenerator.java diff --git a/src/de/dhbwstuttgart/parser/SyntaxTreeGenerator/GenericContext.java b/src/main/java/de/dhbwstuttgart/parser/SyntaxTreeGenerator/GenericContext.java similarity index 100% rename from src/de/dhbwstuttgart/parser/SyntaxTreeGenerator/GenericContext.java rename to src/main/java/de/dhbwstuttgart/parser/SyntaxTreeGenerator/GenericContext.java diff --git a/src/de/dhbwstuttgart/parser/SyntaxTreeGenerator/StatementGenerator.java b/src/main/java/de/dhbwstuttgart/parser/SyntaxTreeGenerator/StatementGenerator.java similarity index 100% rename from src/de/dhbwstuttgart/parser/SyntaxTreeGenerator/StatementGenerator.java rename to src/main/java/de/dhbwstuttgart/parser/SyntaxTreeGenerator/StatementGenerator.java diff --git a/src/de/dhbwstuttgart/parser/SyntaxTreeGenerator/SyntacticSugar.java b/src/main/java/de/dhbwstuttgart/parser/SyntaxTreeGenerator/SyntacticSugar.java similarity index 100% rename from src/de/dhbwstuttgart/parser/SyntaxTreeGenerator/SyntacticSugar.java rename to src/main/java/de/dhbwstuttgart/parser/SyntaxTreeGenerator/SyntacticSugar.java diff --git a/src/de/dhbwstuttgart/parser/SyntaxTreeGenerator/SyntaxTreeGenerator.java b/src/main/java/de/dhbwstuttgart/parser/SyntaxTreeGenerator/SyntaxTreeGenerator.java similarity index 100% rename from src/de/dhbwstuttgart/parser/SyntaxTreeGenerator/SyntaxTreeGenerator.java rename to src/main/java/de/dhbwstuttgart/parser/SyntaxTreeGenerator/SyntaxTreeGenerator.java diff --git a/src/de/dhbwstuttgart/parser/SyntaxTreeGenerator/TypeGenerator.java b/src/main/java/de/dhbwstuttgart/parser/SyntaxTreeGenerator/TypeGenerator.java similarity index 100% rename from src/de/dhbwstuttgart/parser/SyntaxTreeGenerator/TypeGenerator.java rename to src/main/java/de/dhbwstuttgart/parser/SyntaxTreeGenerator/TypeGenerator.java diff --git a/src/de/dhbwstuttgart/parser/TODO b/src/main/java/de/dhbwstuttgart/parser/TODO similarity index 100% rename from src/de/dhbwstuttgart/parser/TODO rename to src/main/java/de/dhbwstuttgart/parser/TODO diff --git a/src/de/dhbwstuttgart/parser/antlr/Java8.g4 b/src/main/java/de/dhbwstuttgart/parser/antlr/Java8.g4 similarity index 100% rename from src/de/dhbwstuttgart/parser/antlr/Java8.g4 rename to src/main/java/de/dhbwstuttgart/parser/antlr/Java8.g4 diff --git a/src/de/dhbwstuttgart/parser/antlr/Java8.tokens b/src/main/java/de/dhbwstuttgart/parser/antlr/Java8.tokens similarity index 100% rename from src/de/dhbwstuttgart/parser/antlr/Java8.tokens rename to src/main/java/de/dhbwstuttgart/parser/antlr/Java8.tokens diff --git a/src/de/dhbwstuttgart/parser/antlr/Java8BaseListener.java b/src/main/java/de/dhbwstuttgart/parser/antlr/Java8BaseListener.java similarity index 100% rename from src/de/dhbwstuttgart/parser/antlr/Java8BaseListener.java rename to src/main/java/de/dhbwstuttgart/parser/antlr/Java8BaseListener.java diff --git a/src/de/dhbwstuttgart/parser/antlr/Java8Lexer.java b/src/main/java/de/dhbwstuttgart/parser/antlr/Java8Lexer.java similarity index 100% rename from src/de/dhbwstuttgart/parser/antlr/Java8Lexer.java rename to src/main/java/de/dhbwstuttgart/parser/antlr/Java8Lexer.java diff --git a/src/de/dhbwstuttgart/parser/antlr/Java8Lexer.tokens b/src/main/java/de/dhbwstuttgart/parser/antlr/Java8Lexer.tokens similarity index 100% rename from src/de/dhbwstuttgart/parser/antlr/Java8Lexer.tokens rename to src/main/java/de/dhbwstuttgart/parser/antlr/Java8Lexer.tokens diff --git a/src/de/dhbwstuttgart/parser/antlr/Java8Listener.java b/src/main/java/de/dhbwstuttgart/parser/antlr/Java8Listener.java similarity index 100% rename from src/de/dhbwstuttgart/parser/antlr/Java8Listener.java rename to src/main/java/de/dhbwstuttgart/parser/antlr/Java8Listener.java diff --git a/src/de/dhbwstuttgart/parser/antlr/Java8Parser.java b/src/main/java/de/dhbwstuttgart/parser/antlr/Java8Parser.java similarity index 100% rename from src/de/dhbwstuttgart/parser/antlr/Java8Parser.java rename to src/main/java/de/dhbwstuttgart/parser/antlr/Java8Parser.java diff --git a/src/de/dhbwstuttgart/parser/notes/GetNames b/src/main/java/de/dhbwstuttgart/parser/notes/GetNames similarity index 100% rename from src/de/dhbwstuttgart/parser/notes/GetNames rename to src/main/java/de/dhbwstuttgart/parser/notes/GetNames diff --git a/src/de/dhbwstuttgart/parser/notes/TODO b/src/main/java/de/dhbwstuttgart/parser/notes/TODO similarity index 100% rename from src/de/dhbwstuttgart/parser/notes/TODO rename to src/main/java/de/dhbwstuttgart/parser/notes/TODO diff --git a/src/de/dhbwstuttgart/parser/notes/questions b/src/main/java/de/dhbwstuttgart/parser/notes/questions similarity index 100% rename from src/de/dhbwstuttgart/parser/notes/questions rename to src/main/java/de/dhbwstuttgart/parser/notes/questions diff --git a/src/de/dhbwstuttgart/parser/parse_tree b/src/main/java/de/dhbwstuttgart/parser/parse_tree similarity index 100% rename from src/de/dhbwstuttgart/parser/parse_tree rename to src/main/java/de/dhbwstuttgart/parser/parse_tree diff --git a/src/de/dhbwstuttgart/parser/scope/GatherNames.java b/src/main/java/de/dhbwstuttgart/parser/scope/GatherNames.java similarity index 100% rename from src/de/dhbwstuttgart/parser/scope/GatherNames.java rename to src/main/java/de/dhbwstuttgart/parser/scope/GatherNames.java diff --git a/src/de/dhbwstuttgart/parser/scope/GenericsRegistry.java b/src/main/java/de/dhbwstuttgart/parser/scope/GenericsRegistry.java similarity index 100% rename from src/de/dhbwstuttgart/parser/scope/GenericsRegistry.java rename to src/main/java/de/dhbwstuttgart/parser/scope/GenericsRegistry.java diff --git a/src/de/dhbwstuttgart/parser/scope/JavaClassName.java b/src/main/java/de/dhbwstuttgart/parser/scope/JavaClassName.java similarity index 100% rename from src/de/dhbwstuttgart/parser/scope/JavaClassName.java rename to src/main/java/de/dhbwstuttgart/parser/scope/JavaClassName.java diff --git a/src/de/dhbwstuttgart/parser/scope/JavaClassRegistry.java b/src/main/java/de/dhbwstuttgart/parser/scope/JavaClassRegistry.java similarity index 100% rename from src/de/dhbwstuttgart/parser/scope/JavaClassRegistry.java rename to src/main/java/de/dhbwstuttgart/parser/scope/JavaClassRegistry.java diff --git a/src/de/dhbwstuttgart/sat/CNF/CNF.java b/src/main/java/de/dhbwstuttgart/sat/CNF/CNF.java similarity index 100% rename from src/de/dhbwstuttgart/sat/CNF/CNF.java rename to src/main/java/de/dhbwstuttgart/sat/CNF/CNF.java diff --git a/src/de/dhbwstuttgart/sat/CNF/Writer.java b/src/main/java/de/dhbwstuttgart/sat/CNF/Writer.java similarity index 100% rename from src/de/dhbwstuttgart/sat/CNF/Writer.java rename to src/main/java/de/dhbwstuttgart/sat/CNF/Writer.java diff --git a/src/de/dhbwstuttgart/sat/asp/ASPStringConverter.java b/src/main/java/de/dhbwstuttgart/sat/asp/ASPStringConverter.java similarity index 100% rename from src/de/dhbwstuttgart/sat/asp/ASPStringConverter.java rename to src/main/java/de/dhbwstuttgart/sat/asp/ASPStringConverter.java diff --git a/src/de/dhbwstuttgart/sat/asp/Clingo.java b/src/main/java/de/dhbwstuttgart/sat/asp/Clingo.java similarity index 100% rename from src/de/dhbwstuttgart/sat/asp/Clingo.java rename to src/main/java/de/dhbwstuttgart/sat/asp/Clingo.java diff --git a/src/de/dhbwstuttgart/sat/asp/model/ASPGencayRule.java b/src/main/java/de/dhbwstuttgart/sat/asp/model/ASPGencayRule.java similarity index 100% rename from src/de/dhbwstuttgart/sat/asp/model/ASPGencayRule.java rename to src/main/java/de/dhbwstuttgart/sat/asp/model/ASPGencayRule.java diff --git a/src/de/dhbwstuttgart/sat/asp/model/ASPRule.java b/src/main/java/de/dhbwstuttgart/sat/asp/model/ASPRule.java similarity index 100% rename from src/de/dhbwstuttgart/sat/asp/model/ASPRule.java rename to src/main/java/de/dhbwstuttgart/sat/asp/model/ASPRule.java diff --git a/src/de/dhbwstuttgart/sat/asp/parser/ASPParser.java b/src/main/java/de/dhbwstuttgart/sat/asp/parser/ASPParser.java similarity index 100% rename from src/de/dhbwstuttgart/sat/asp/parser/ASPParser.java rename to src/main/java/de/dhbwstuttgart/sat/asp/parser/ASPParser.java diff --git a/src/de/dhbwstuttgart/sat/asp/parser/antlr/UnifyResult.g4 b/src/main/java/de/dhbwstuttgart/sat/asp/parser/antlr/UnifyResult.g4 similarity index 100% rename from src/de/dhbwstuttgart/sat/asp/parser/antlr/UnifyResult.g4 rename to src/main/java/de/dhbwstuttgart/sat/asp/parser/antlr/UnifyResult.g4 diff --git a/src/de/dhbwstuttgart/sat/asp/parser/antlr/UnifyResult.tokens b/src/main/java/de/dhbwstuttgart/sat/asp/parser/antlr/UnifyResult.tokens similarity index 100% rename from src/de/dhbwstuttgart/sat/asp/parser/antlr/UnifyResult.tokens rename to src/main/java/de/dhbwstuttgart/sat/asp/parser/antlr/UnifyResult.tokens diff --git a/src/de/dhbwstuttgart/sat/asp/parser/antlr/UnifyResultBaseListener.java b/src/main/java/de/dhbwstuttgart/sat/asp/parser/antlr/UnifyResultBaseListener.java similarity index 100% rename from src/de/dhbwstuttgart/sat/asp/parser/antlr/UnifyResultBaseListener.java rename to src/main/java/de/dhbwstuttgart/sat/asp/parser/antlr/UnifyResultBaseListener.java diff --git a/src/de/dhbwstuttgart/sat/asp/parser/antlr/UnifyResultLexer.java b/src/main/java/de/dhbwstuttgart/sat/asp/parser/antlr/UnifyResultLexer.java similarity index 100% rename from src/de/dhbwstuttgart/sat/asp/parser/antlr/UnifyResultLexer.java rename to src/main/java/de/dhbwstuttgart/sat/asp/parser/antlr/UnifyResultLexer.java diff --git a/src/de/dhbwstuttgart/sat/asp/parser/antlr/UnifyResultLexer.tokens b/src/main/java/de/dhbwstuttgart/sat/asp/parser/antlr/UnifyResultLexer.tokens similarity index 100% rename from src/de/dhbwstuttgart/sat/asp/parser/antlr/UnifyResultLexer.tokens rename to src/main/java/de/dhbwstuttgart/sat/asp/parser/antlr/UnifyResultLexer.tokens diff --git a/src/de/dhbwstuttgart/sat/asp/parser/antlr/UnifyResultListener.java b/src/main/java/de/dhbwstuttgart/sat/asp/parser/antlr/UnifyResultListener.java similarity index 100% rename from src/de/dhbwstuttgart/sat/asp/parser/antlr/UnifyResultListener.java rename to src/main/java/de/dhbwstuttgart/sat/asp/parser/antlr/UnifyResultListener.java diff --git a/src/de/dhbwstuttgart/sat/asp/parser/antlr/UnifyResultParser.java b/src/main/java/de/dhbwstuttgart/sat/asp/parser/antlr/UnifyResultParser.java similarity index 100% rename from src/de/dhbwstuttgart/sat/asp/parser/antlr/UnifyResultParser.java rename to src/main/java/de/dhbwstuttgart/sat/asp/parser/antlr/UnifyResultParser.java diff --git a/src/de/dhbwstuttgart/sat/asp/parser/model/ParsedType.java b/src/main/java/de/dhbwstuttgart/sat/asp/parser/model/ParsedType.java similarity index 100% rename from src/de/dhbwstuttgart/sat/asp/parser/model/ParsedType.java rename to src/main/java/de/dhbwstuttgart/sat/asp/parser/model/ParsedType.java diff --git a/src/de/dhbwstuttgart/sat/asp/writer/ASPFactory.java b/src/main/java/de/dhbwstuttgart/sat/asp/writer/ASPFactory.java similarity index 100% rename from src/de/dhbwstuttgart/sat/asp/writer/ASPFactory.java rename to src/main/java/de/dhbwstuttgart/sat/asp/writer/ASPFactory.java diff --git a/src/de/dhbwstuttgart/sat/asp/writer/ASPGencayFactory.java b/src/main/java/de/dhbwstuttgart/sat/asp/writer/ASPGencayFactory.java similarity index 100% rename from src/de/dhbwstuttgart/sat/asp/writer/ASPGencayFactory.java rename to src/main/java/de/dhbwstuttgart/sat/asp/writer/ASPGencayFactory.java diff --git a/src/de/dhbwstuttgart/sat/asp/writer/ASPStatement.java b/src/main/java/de/dhbwstuttgart/sat/asp/writer/ASPStatement.java similarity index 100% rename from src/de/dhbwstuttgart/sat/asp/writer/ASPStatement.java rename to src/main/java/de/dhbwstuttgart/sat/asp/writer/ASPStatement.java diff --git a/src/de/dhbwstuttgart/sat/asp/writer/ASPWriter.java b/src/main/java/de/dhbwstuttgart/sat/asp/writer/ASPWriter.java similarity index 100% rename from src/de/dhbwstuttgart/sat/asp/writer/ASPWriter.java rename to src/main/java/de/dhbwstuttgart/sat/asp/writer/ASPWriter.java diff --git a/src/de/dhbwstuttgart/syntaxtree/ASTVisitor.java b/src/main/java/de/dhbwstuttgart/syntaxtree/ASTVisitor.java similarity index 100% rename from src/de/dhbwstuttgart/syntaxtree/ASTVisitor.java rename to src/main/java/de/dhbwstuttgart/syntaxtree/ASTVisitor.java diff --git a/src/de/dhbwstuttgart/syntaxtree/AbstractASTWalker.java b/src/main/java/de/dhbwstuttgart/syntaxtree/AbstractASTWalker.java similarity index 100% rename from src/de/dhbwstuttgart/syntaxtree/AbstractASTWalker.java rename to src/main/java/de/dhbwstuttgart/syntaxtree/AbstractASTWalker.java diff --git a/src/de/dhbwstuttgart/syntaxtree/ClassOrInterface.java b/src/main/java/de/dhbwstuttgart/syntaxtree/ClassOrInterface.java similarity index 100% rename from src/de/dhbwstuttgart/syntaxtree/ClassOrInterface.java rename to src/main/java/de/dhbwstuttgart/syntaxtree/ClassOrInterface.java diff --git a/src/de/dhbwstuttgart/syntaxtree/Constructor.java b/src/main/java/de/dhbwstuttgart/syntaxtree/Constructor.java similarity index 100% rename from src/de/dhbwstuttgart/syntaxtree/Constructor.java rename to src/main/java/de/dhbwstuttgart/syntaxtree/Constructor.java diff --git a/src/de/dhbwstuttgart/syntaxtree/ExceptionList.java b/src/main/java/de/dhbwstuttgart/syntaxtree/ExceptionList.java similarity index 100% rename from src/de/dhbwstuttgart/syntaxtree/ExceptionList.java rename to src/main/java/de/dhbwstuttgart/syntaxtree/ExceptionList.java diff --git a/src/de/dhbwstuttgart/syntaxtree/Field.java b/src/main/java/de/dhbwstuttgart/syntaxtree/Field.java similarity index 100% rename from src/de/dhbwstuttgart/syntaxtree/Field.java rename to src/main/java/de/dhbwstuttgart/syntaxtree/Field.java diff --git a/src/de/dhbwstuttgart/syntaxtree/FieldDeclaration.java b/src/main/java/de/dhbwstuttgart/syntaxtree/FieldDeclaration.java similarity index 100% rename from src/de/dhbwstuttgart/syntaxtree/FieldDeclaration.java rename to src/main/java/de/dhbwstuttgart/syntaxtree/FieldDeclaration.java diff --git a/src/de/dhbwstuttgart/syntaxtree/FormalParameter.java b/src/main/java/de/dhbwstuttgart/syntaxtree/FormalParameter.java similarity index 100% rename from src/de/dhbwstuttgart/syntaxtree/FormalParameter.java rename to src/main/java/de/dhbwstuttgart/syntaxtree/FormalParameter.java diff --git a/src/de/dhbwstuttgart/syntaxtree/GenericDeclarationList.java b/src/main/java/de/dhbwstuttgart/syntaxtree/GenericDeclarationList.java similarity index 100% rename from src/de/dhbwstuttgart/syntaxtree/GenericDeclarationList.java rename to src/main/java/de/dhbwstuttgart/syntaxtree/GenericDeclarationList.java diff --git a/src/de/dhbwstuttgart/syntaxtree/GenericTypeVar.java b/src/main/java/de/dhbwstuttgart/syntaxtree/GenericTypeVar.java similarity index 100% rename from src/de/dhbwstuttgart/syntaxtree/GenericTypeVar.java rename to src/main/java/de/dhbwstuttgart/syntaxtree/GenericTypeVar.java diff --git a/src/de/dhbwstuttgart/syntaxtree/Method.java b/src/main/java/de/dhbwstuttgart/syntaxtree/Method.java similarity index 100% rename from src/de/dhbwstuttgart/syntaxtree/Method.java rename to src/main/java/de/dhbwstuttgart/syntaxtree/Method.java diff --git a/src/de/dhbwstuttgart/syntaxtree/ParameterList.java b/src/main/java/de/dhbwstuttgart/syntaxtree/ParameterList.java similarity index 100% rename from src/de/dhbwstuttgart/syntaxtree/ParameterList.java rename to src/main/java/de/dhbwstuttgart/syntaxtree/ParameterList.java diff --git a/src/de/dhbwstuttgart/syntaxtree/SourceFile.java b/src/main/java/de/dhbwstuttgart/syntaxtree/SourceFile.java similarity index 100% rename from src/de/dhbwstuttgart/syntaxtree/SourceFile.java rename to src/main/java/de/dhbwstuttgart/syntaxtree/SourceFile.java diff --git a/src/de/dhbwstuttgart/syntaxtree/StatementVisitor.java b/src/main/java/de/dhbwstuttgart/syntaxtree/StatementVisitor.java similarity index 100% rename from src/de/dhbwstuttgart/syntaxtree/StatementVisitor.java rename to src/main/java/de/dhbwstuttgart/syntaxtree/StatementVisitor.java diff --git a/src/de/dhbwstuttgart/syntaxtree/SyntaxTreeNode.java b/src/main/java/de/dhbwstuttgart/syntaxtree/SyntaxTreeNode.java similarity index 100% rename from src/de/dhbwstuttgart/syntaxtree/SyntaxTreeNode.java rename to src/main/java/de/dhbwstuttgart/syntaxtree/SyntaxTreeNode.java diff --git a/src/de/dhbwstuttgart/syntaxtree/TypeScope.java b/src/main/java/de/dhbwstuttgart/syntaxtree/TypeScope.java similarity index 100% rename from src/de/dhbwstuttgart/syntaxtree/TypeScope.java rename to src/main/java/de/dhbwstuttgart/syntaxtree/TypeScope.java diff --git a/src/de/dhbwstuttgart/syntaxtree/factory/ASTFactory.java b/src/main/java/de/dhbwstuttgart/syntaxtree/factory/ASTFactory.java similarity index 100% rename from src/de/dhbwstuttgart/syntaxtree/factory/ASTFactory.java rename to src/main/java/de/dhbwstuttgart/syntaxtree/factory/ASTFactory.java diff --git a/src/de/dhbwstuttgart/syntaxtree/factory/NameGenerator.java b/src/main/java/de/dhbwstuttgart/syntaxtree/factory/NameGenerator.java similarity index 100% rename from src/de/dhbwstuttgart/syntaxtree/factory/NameGenerator.java rename to src/main/java/de/dhbwstuttgart/syntaxtree/factory/NameGenerator.java diff --git a/src/de/dhbwstuttgart/syntaxtree/factory/PrimitiveMethodsGenerator.java b/src/main/java/de/dhbwstuttgart/syntaxtree/factory/PrimitiveMethodsGenerator.java similarity index 100% rename from src/de/dhbwstuttgart/syntaxtree/factory/PrimitiveMethodsGenerator.java rename to src/main/java/de/dhbwstuttgart/syntaxtree/factory/PrimitiveMethodsGenerator.java diff --git a/src/de/dhbwstuttgart/syntaxtree/factory/UnifyTypeFactory.java b/src/main/java/de/dhbwstuttgart/syntaxtree/factory/UnifyTypeFactory.java similarity index 100% rename from src/de/dhbwstuttgart/syntaxtree/factory/UnifyTypeFactory.java rename to src/main/java/de/dhbwstuttgart/syntaxtree/factory/UnifyTypeFactory.java diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/ArgumentList.java b/src/main/java/de/dhbwstuttgart/syntaxtree/statement/ArgumentList.java similarity index 100% rename from src/de/dhbwstuttgart/syntaxtree/statement/ArgumentList.java rename to src/main/java/de/dhbwstuttgart/syntaxtree/statement/ArgumentList.java diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/Assign.java b/src/main/java/de/dhbwstuttgart/syntaxtree/statement/Assign.java similarity index 100% rename from src/de/dhbwstuttgart/syntaxtree/statement/Assign.java rename to src/main/java/de/dhbwstuttgart/syntaxtree/statement/Assign.java diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/AssignLeftSide.java b/src/main/java/de/dhbwstuttgart/syntaxtree/statement/AssignLeftSide.java similarity index 100% rename from src/de/dhbwstuttgart/syntaxtree/statement/AssignLeftSide.java rename to src/main/java/de/dhbwstuttgart/syntaxtree/statement/AssignLeftSide.java diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/AssignToField.java b/src/main/java/de/dhbwstuttgart/syntaxtree/statement/AssignToField.java similarity index 100% rename from src/de/dhbwstuttgart/syntaxtree/statement/AssignToField.java rename to src/main/java/de/dhbwstuttgart/syntaxtree/statement/AssignToField.java diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/BinaryExpr.java b/src/main/java/de/dhbwstuttgart/syntaxtree/statement/BinaryExpr.java similarity index 100% rename from src/de/dhbwstuttgart/syntaxtree/statement/BinaryExpr.java rename to src/main/java/de/dhbwstuttgart/syntaxtree/statement/BinaryExpr.java diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/Block.java b/src/main/java/de/dhbwstuttgart/syntaxtree/statement/Block.java similarity index 100% rename from src/de/dhbwstuttgart/syntaxtree/statement/Block.java rename to src/main/java/de/dhbwstuttgart/syntaxtree/statement/Block.java diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/CastExpr.java b/src/main/java/de/dhbwstuttgart/syntaxtree/statement/CastExpr.java similarity index 100% rename from src/de/dhbwstuttgart/syntaxtree/statement/CastExpr.java rename to src/main/java/de/dhbwstuttgart/syntaxtree/statement/CastExpr.java diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/DoStmt.java b/src/main/java/de/dhbwstuttgart/syntaxtree/statement/DoStmt.java similarity index 100% rename from src/de/dhbwstuttgart/syntaxtree/statement/DoStmt.java rename to src/main/java/de/dhbwstuttgart/syntaxtree/statement/DoStmt.java diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/EmptyStmt.java b/src/main/java/de/dhbwstuttgart/syntaxtree/statement/EmptyStmt.java similarity index 100% rename from src/de/dhbwstuttgart/syntaxtree/statement/EmptyStmt.java rename to src/main/java/de/dhbwstuttgart/syntaxtree/statement/EmptyStmt.java diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/Expression.java b/src/main/java/de/dhbwstuttgart/syntaxtree/statement/Expression.java similarity index 100% rename from src/de/dhbwstuttgart/syntaxtree/statement/Expression.java rename to src/main/java/de/dhbwstuttgart/syntaxtree/statement/Expression.java diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/ExpressionReceiver.java b/src/main/java/de/dhbwstuttgart/syntaxtree/statement/ExpressionReceiver.java similarity index 100% rename from src/de/dhbwstuttgart/syntaxtree/statement/ExpressionReceiver.java rename to src/main/java/de/dhbwstuttgart/syntaxtree/statement/ExpressionReceiver.java diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/FieldVar.java b/src/main/java/de/dhbwstuttgart/syntaxtree/statement/FieldVar.java similarity index 100% rename from src/de/dhbwstuttgart/syntaxtree/statement/FieldVar.java rename to src/main/java/de/dhbwstuttgart/syntaxtree/statement/FieldVar.java diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/ForStmt.java b/src/main/java/de/dhbwstuttgart/syntaxtree/statement/ForStmt.java similarity index 100% rename from src/de/dhbwstuttgart/syntaxtree/statement/ForStmt.java rename to src/main/java/de/dhbwstuttgart/syntaxtree/statement/ForStmt.java diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/IfStmt.java b/src/main/java/de/dhbwstuttgart/syntaxtree/statement/IfStmt.java similarity index 100% rename from src/de/dhbwstuttgart/syntaxtree/statement/IfStmt.java rename to src/main/java/de/dhbwstuttgart/syntaxtree/statement/IfStmt.java diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/InstanceOf.java b/src/main/java/de/dhbwstuttgart/syntaxtree/statement/InstanceOf.java similarity index 100% rename from src/de/dhbwstuttgart/syntaxtree/statement/InstanceOf.java rename to src/main/java/de/dhbwstuttgart/syntaxtree/statement/InstanceOf.java diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/JavaInternalExpression.java b/src/main/java/de/dhbwstuttgart/syntaxtree/statement/JavaInternalExpression.java similarity index 100% rename from src/de/dhbwstuttgart/syntaxtree/statement/JavaInternalExpression.java rename to src/main/java/de/dhbwstuttgart/syntaxtree/statement/JavaInternalExpression.java diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/LambdaExpression.java b/src/main/java/de/dhbwstuttgart/syntaxtree/statement/LambdaExpression.java similarity index 100% rename from src/de/dhbwstuttgart/syntaxtree/statement/LambdaExpression.java rename to src/main/java/de/dhbwstuttgart/syntaxtree/statement/LambdaExpression.java diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/Literal.java b/src/main/java/de/dhbwstuttgart/syntaxtree/statement/Literal.java similarity index 100% rename from src/de/dhbwstuttgart/syntaxtree/statement/Literal.java rename to src/main/java/de/dhbwstuttgart/syntaxtree/statement/Literal.java diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/LocalVar.java b/src/main/java/de/dhbwstuttgart/syntaxtree/statement/LocalVar.java similarity index 100% rename from src/de/dhbwstuttgart/syntaxtree/statement/LocalVar.java rename to src/main/java/de/dhbwstuttgart/syntaxtree/statement/LocalVar.java diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/LocalVarDecl.java b/src/main/java/de/dhbwstuttgart/syntaxtree/statement/LocalVarDecl.java similarity index 100% rename from src/de/dhbwstuttgart/syntaxtree/statement/LocalVarDecl.java rename to src/main/java/de/dhbwstuttgart/syntaxtree/statement/LocalVarDecl.java diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/MethodCall.java b/src/main/java/de/dhbwstuttgart/syntaxtree/statement/MethodCall.java similarity index 100% rename from src/de/dhbwstuttgart/syntaxtree/statement/MethodCall.java rename to src/main/java/de/dhbwstuttgart/syntaxtree/statement/MethodCall.java diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/NewArray.java b/src/main/java/de/dhbwstuttgart/syntaxtree/statement/NewArray.java similarity index 100% rename from src/de/dhbwstuttgart/syntaxtree/statement/NewArray.java rename to src/main/java/de/dhbwstuttgart/syntaxtree/statement/NewArray.java diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/NewClass.java b/src/main/java/de/dhbwstuttgart/syntaxtree/statement/NewClass.java similarity index 100% rename from src/de/dhbwstuttgart/syntaxtree/statement/NewClass.java rename to src/main/java/de/dhbwstuttgart/syntaxtree/statement/NewClass.java diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/Receiver.java b/src/main/java/de/dhbwstuttgart/syntaxtree/statement/Receiver.java similarity index 100% rename from src/de/dhbwstuttgart/syntaxtree/statement/Receiver.java rename to src/main/java/de/dhbwstuttgart/syntaxtree/statement/Receiver.java diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/Return.java b/src/main/java/de/dhbwstuttgart/syntaxtree/statement/Return.java similarity index 100% rename from src/de/dhbwstuttgart/syntaxtree/statement/Return.java rename to src/main/java/de/dhbwstuttgart/syntaxtree/statement/Return.java diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/ReturnVoid.java b/src/main/java/de/dhbwstuttgart/syntaxtree/statement/ReturnVoid.java similarity index 100% rename from src/de/dhbwstuttgart/syntaxtree/statement/ReturnVoid.java rename to src/main/java/de/dhbwstuttgart/syntaxtree/statement/ReturnVoid.java diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/Statement.java b/src/main/java/de/dhbwstuttgart/syntaxtree/statement/Statement.java similarity index 100% rename from src/de/dhbwstuttgart/syntaxtree/statement/Statement.java rename to src/main/java/de/dhbwstuttgart/syntaxtree/statement/Statement.java diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/StaticClassName.java b/src/main/java/de/dhbwstuttgart/syntaxtree/statement/StaticClassName.java similarity index 100% rename from src/de/dhbwstuttgart/syntaxtree/statement/StaticClassName.java rename to src/main/java/de/dhbwstuttgart/syntaxtree/statement/StaticClassName.java diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/Super.java b/src/main/java/de/dhbwstuttgart/syntaxtree/statement/Super.java similarity index 100% rename from src/de/dhbwstuttgart/syntaxtree/statement/Super.java rename to src/main/java/de/dhbwstuttgart/syntaxtree/statement/Super.java diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/SuperCall.java b/src/main/java/de/dhbwstuttgart/syntaxtree/statement/SuperCall.java similarity index 100% rename from src/de/dhbwstuttgart/syntaxtree/statement/SuperCall.java rename to src/main/java/de/dhbwstuttgart/syntaxtree/statement/SuperCall.java diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/This.java b/src/main/java/de/dhbwstuttgart/syntaxtree/statement/This.java similarity index 100% rename from src/de/dhbwstuttgart/syntaxtree/statement/This.java rename to src/main/java/de/dhbwstuttgart/syntaxtree/statement/This.java diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/ThisCall.java b/src/main/java/de/dhbwstuttgart/syntaxtree/statement/ThisCall.java similarity index 100% rename from src/de/dhbwstuttgart/syntaxtree/statement/ThisCall.java rename to src/main/java/de/dhbwstuttgart/syntaxtree/statement/ThisCall.java diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/TypableStatement.java b/src/main/java/de/dhbwstuttgart/syntaxtree/statement/TypableStatement.java similarity index 100% rename from src/de/dhbwstuttgart/syntaxtree/statement/TypableStatement.java rename to src/main/java/de/dhbwstuttgart/syntaxtree/statement/TypableStatement.java diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/UnaryExpr.java b/src/main/java/de/dhbwstuttgart/syntaxtree/statement/UnaryExpr.java similarity index 100% rename from src/de/dhbwstuttgart/syntaxtree/statement/UnaryExpr.java rename to src/main/java/de/dhbwstuttgart/syntaxtree/statement/UnaryExpr.java diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/WhileStmt.java b/src/main/java/de/dhbwstuttgart/syntaxtree/statement/WhileStmt.java similarity index 100% rename from src/de/dhbwstuttgart/syntaxtree/statement/WhileStmt.java rename to src/main/java/de/dhbwstuttgart/syntaxtree/statement/WhileStmt.java diff --git a/src/de/dhbwstuttgart/syntaxtree/type/ExtendsWildcardType.java b/src/main/java/de/dhbwstuttgart/syntaxtree/type/ExtendsWildcardType.java similarity index 100% rename from src/de/dhbwstuttgart/syntaxtree/type/ExtendsWildcardType.java rename to src/main/java/de/dhbwstuttgart/syntaxtree/type/ExtendsWildcardType.java diff --git a/src/de/dhbwstuttgart/syntaxtree/type/FunN.java b/src/main/java/de/dhbwstuttgart/syntaxtree/type/FunN.java similarity index 100% rename from src/de/dhbwstuttgart/syntaxtree/type/FunN.java rename to src/main/java/de/dhbwstuttgart/syntaxtree/type/FunN.java diff --git a/src/de/dhbwstuttgart/syntaxtree/type/GenericRefType.java b/src/main/java/de/dhbwstuttgart/syntaxtree/type/GenericRefType.java similarity index 100% rename from src/de/dhbwstuttgart/syntaxtree/type/GenericRefType.java rename to src/main/java/de/dhbwstuttgart/syntaxtree/type/GenericRefType.java diff --git a/src/de/dhbwstuttgart/syntaxtree/type/RefType.java b/src/main/java/de/dhbwstuttgart/syntaxtree/type/RefType.java similarity index 100% rename from src/de/dhbwstuttgart/syntaxtree/type/RefType.java rename to src/main/java/de/dhbwstuttgart/syntaxtree/type/RefType.java diff --git a/src/de/dhbwstuttgart/syntaxtree/type/RefTypeOrTPHOrWildcardOrGeneric.java b/src/main/java/de/dhbwstuttgart/syntaxtree/type/RefTypeOrTPHOrWildcardOrGeneric.java similarity index 100% rename from src/de/dhbwstuttgart/syntaxtree/type/RefTypeOrTPHOrWildcardOrGeneric.java rename to src/main/java/de/dhbwstuttgart/syntaxtree/type/RefTypeOrTPHOrWildcardOrGeneric.java diff --git a/src/de/dhbwstuttgart/syntaxtree/type/SuperWildcardType.java b/src/main/java/de/dhbwstuttgart/syntaxtree/type/SuperWildcardType.java similarity index 100% rename from src/de/dhbwstuttgart/syntaxtree/type/SuperWildcardType.java rename to src/main/java/de/dhbwstuttgart/syntaxtree/type/SuperWildcardType.java diff --git a/src/de/dhbwstuttgart/syntaxtree/type/TypePlaceholder.java b/src/main/java/de/dhbwstuttgart/syntaxtree/type/TypePlaceholder.java similarity index 100% rename from src/de/dhbwstuttgart/syntaxtree/type/TypePlaceholder.java rename to src/main/java/de/dhbwstuttgart/syntaxtree/type/TypePlaceholder.java diff --git a/src/de/dhbwstuttgart/syntaxtree/type/TypeVisitor.java b/src/main/java/de/dhbwstuttgart/syntaxtree/type/TypeVisitor.java similarity index 100% rename from src/de/dhbwstuttgart/syntaxtree/type/TypeVisitor.java rename to src/main/java/de/dhbwstuttgart/syntaxtree/type/TypeVisitor.java diff --git a/src/de/dhbwstuttgart/syntaxtree/type/Void.java b/src/main/java/de/dhbwstuttgart/syntaxtree/type/Void.java similarity index 100% rename from src/de/dhbwstuttgart/syntaxtree/type/Void.java rename to src/main/java/de/dhbwstuttgart/syntaxtree/type/Void.java diff --git a/src/de/dhbwstuttgart/syntaxtree/type/WildcardType.java b/src/main/java/de/dhbwstuttgart/syntaxtree/type/WildcardType.java similarity index 100% rename from src/de/dhbwstuttgart/syntaxtree/type/WildcardType.java rename to src/main/java/de/dhbwstuttgart/syntaxtree/type/WildcardType.java diff --git a/src/de/dhbwstuttgart/syntaxtree/visual/ASTPrinter.java b/src/main/java/de/dhbwstuttgart/syntaxtree/visual/ASTPrinter.java similarity index 100% rename from src/de/dhbwstuttgart/syntaxtree/visual/ASTPrinter.java rename to src/main/java/de/dhbwstuttgart/syntaxtree/visual/ASTPrinter.java diff --git a/src/de/dhbwstuttgart/syntaxtree/visual/ASTTypePrinter.java b/src/main/java/de/dhbwstuttgart/syntaxtree/visual/ASTTypePrinter.java similarity index 100% rename from src/de/dhbwstuttgart/syntaxtree/visual/ASTTypePrinter.java rename to src/main/java/de/dhbwstuttgart/syntaxtree/visual/ASTTypePrinter.java diff --git a/src/de/dhbwstuttgart/syntaxtree/visual/OutputGenerator.java b/src/main/java/de/dhbwstuttgart/syntaxtree/visual/OutputGenerator.java similarity index 100% rename from src/de/dhbwstuttgart/syntaxtree/visual/OutputGenerator.java rename to src/main/java/de/dhbwstuttgart/syntaxtree/visual/OutputGenerator.java diff --git a/src/de/dhbwstuttgart/syntaxtree/visual/ResultSetOutputGenerator.java b/src/main/java/de/dhbwstuttgart/syntaxtree/visual/ResultSetOutputGenerator.java similarity index 100% rename from src/de/dhbwstuttgart/syntaxtree/visual/ResultSetOutputGenerator.java rename to src/main/java/de/dhbwstuttgart/syntaxtree/visual/ResultSetOutputGenerator.java diff --git a/src/de/dhbwstuttgart/syntaxtree/visual/ResultSetPrinter.java b/src/main/java/de/dhbwstuttgart/syntaxtree/visual/ResultSetPrinter.java similarity index 100% rename from src/de/dhbwstuttgart/syntaxtree/visual/ResultSetPrinter.java rename to src/main/java/de/dhbwstuttgart/syntaxtree/visual/ResultSetPrinter.java diff --git a/src/de/dhbwstuttgart/syntaxtree/visual/TypeOutputGenerator.java b/src/main/java/de/dhbwstuttgart/syntaxtree/visual/TypeOutputGenerator.java similarity index 100% rename from src/de/dhbwstuttgart/syntaxtree/visual/TypeOutputGenerator.java rename to src/main/java/de/dhbwstuttgart/syntaxtree/visual/TypeOutputGenerator.java diff --git a/src/de/dhbwstuttgart/typedeployment/TypeInsert.java b/src/main/java/de/dhbwstuttgart/typedeployment/TypeInsert.java similarity index 100% rename from src/de/dhbwstuttgart/typedeployment/TypeInsert.java rename to src/main/java/de/dhbwstuttgart/typedeployment/TypeInsert.java diff --git a/src/de/dhbwstuttgart/typedeployment/TypeInsertFactory.java b/src/main/java/de/dhbwstuttgart/typedeployment/TypeInsertFactory.java similarity index 100% rename from src/de/dhbwstuttgart/typedeployment/TypeInsertFactory.java rename to src/main/java/de/dhbwstuttgart/typedeployment/TypeInsertFactory.java diff --git a/src/de/dhbwstuttgart/typedeployment/TypeInsertPlacer.java b/src/main/java/de/dhbwstuttgart/typedeployment/TypeInsertPlacer.java similarity index 100% rename from src/de/dhbwstuttgart/typedeployment/TypeInsertPlacer.java rename to src/main/java/de/dhbwstuttgart/typedeployment/TypeInsertPlacer.java diff --git a/src/de/dhbwstuttgart/typedeployment/TypeInsertPoint.java b/src/main/java/de/dhbwstuttgart/typedeployment/TypeInsertPoint.java similarity index 100% rename from src/de/dhbwstuttgart/typedeployment/TypeInsertPoint.java rename to src/main/java/de/dhbwstuttgart/typedeployment/TypeInsertPoint.java diff --git a/src/de/dhbwstuttgart/typeinference/assumptions/Assumption.java b/src/main/java/de/dhbwstuttgart/typeinference/assumptions/Assumption.java similarity index 100% rename from src/de/dhbwstuttgart/typeinference/assumptions/Assumption.java rename to src/main/java/de/dhbwstuttgart/typeinference/assumptions/Assumption.java diff --git a/src/de/dhbwstuttgart/typeinference/assumptions/FieldAssumption.java b/src/main/java/de/dhbwstuttgart/typeinference/assumptions/FieldAssumption.java similarity index 100% rename from src/de/dhbwstuttgart/typeinference/assumptions/FieldAssumption.java rename to src/main/java/de/dhbwstuttgart/typeinference/assumptions/FieldAssumption.java diff --git a/src/de/dhbwstuttgart/typeinference/assumptions/FunNClass.java b/src/main/java/de/dhbwstuttgart/typeinference/assumptions/FunNClass.java similarity index 100% rename from src/de/dhbwstuttgart/typeinference/assumptions/FunNClass.java rename to src/main/java/de/dhbwstuttgart/typeinference/assumptions/FunNClass.java diff --git a/src/de/dhbwstuttgart/typeinference/assumptions/MethodAssumption.java b/src/main/java/de/dhbwstuttgart/typeinference/assumptions/MethodAssumption.java similarity index 100% rename from src/de/dhbwstuttgart/typeinference/assumptions/MethodAssumption.java rename to src/main/java/de/dhbwstuttgart/typeinference/assumptions/MethodAssumption.java diff --git a/src/de/dhbwstuttgart/typeinference/assumptions/TypeInferenceBlockInformation.java b/src/main/java/de/dhbwstuttgart/typeinference/assumptions/TypeInferenceBlockInformation.java similarity index 100% rename from src/de/dhbwstuttgart/typeinference/assumptions/TypeInferenceBlockInformation.java rename to src/main/java/de/dhbwstuttgart/typeinference/assumptions/TypeInferenceBlockInformation.java diff --git a/src/de/dhbwstuttgart/typeinference/assumptions/TypeInferenceInformation.java b/src/main/java/de/dhbwstuttgart/typeinference/assumptions/TypeInferenceInformation.java similarity index 100% rename from src/de/dhbwstuttgart/typeinference/assumptions/TypeInferenceInformation.java rename to src/main/java/de/dhbwstuttgart/typeinference/assumptions/TypeInferenceInformation.java diff --git a/src/de/dhbwstuttgart/typeinference/assumptions/TypeScopeContainer.java b/src/main/java/de/dhbwstuttgart/typeinference/assumptions/TypeScopeContainer.java similarity index 100% rename from src/de/dhbwstuttgart/typeinference/assumptions/TypeScopeContainer.java rename to src/main/java/de/dhbwstuttgart/typeinference/assumptions/TypeScopeContainer.java diff --git a/src/de/dhbwstuttgart/typeinference/constraints/Constraint.java b/src/main/java/de/dhbwstuttgart/typeinference/constraints/Constraint.java similarity index 100% rename from src/de/dhbwstuttgart/typeinference/constraints/Constraint.java rename to src/main/java/de/dhbwstuttgart/typeinference/constraints/Constraint.java diff --git a/src/de/dhbwstuttgart/typeinference/constraints/ConstraintSet.java b/src/main/java/de/dhbwstuttgart/typeinference/constraints/ConstraintSet.java similarity index 100% rename from src/de/dhbwstuttgart/typeinference/constraints/ConstraintSet.java rename to src/main/java/de/dhbwstuttgart/typeinference/constraints/ConstraintSet.java diff --git a/src/de/dhbwstuttgart/typeinference/constraints/GenericsResolver.java b/src/main/java/de/dhbwstuttgart/typeinference/constraints/GenericsResolver.java similarity index 100% rename from src/de/dhbwstuttgart/typeinference/constraints/GenericsResolver.java rename to src/main/java/de/dhbwstuttgart/typeinference/constraints/GenericsResolver.java diff --git a/src/de/dhbwstuttgart/typeinference/constraints/Pair.java b/src/main/java/de/dhbwstuttgart/typeinference/constraints/Pair.java similarity index 100% rename from src/de/dhbwstuttgart/typeinference/constraints/Pair.java rename to src/main/java/de/dhbwstuttgart/typeinference/constraints/Pair.java diff --git a/src/de/dhbwstuttgart/typeinference/result/GenericInsertPair.java b/src/main/java/de/dhbwstuttgart/typeinference/result/GenericInsertPair.java similarity index 100% rename from src/de/dhbwstuttgart/typeinference/result/GenericInsertPair.java rename to src/main/java/de/dhbwstuttgart/typeinference/result/GenericInsertPair.java diff --git a/src/de/dhbwstuttgart/typeinference/result/PairTPHEqualTPH.java b/src/main/java/de/dhbwstuttgart/typeinference/result/PairTPHEqualTPH.java similarity index 100% rename from src/de/dhbwstuttgart/typeinference/result/PairTPHEqualTPH.java rename to src/main/java/de/dhbwstuttgart/typeinference/result/PairTPHEqualTPH.java diff --git a/src/de/dhbwstuttgart/typeinference/result/PairTPHequalRefTypeOrWildcardType.java b/src/main/java/de/dhbwstuttgart/typeinference/result/PairTPHequalRefTypeOrWildcardType.java similarity index 100% rename from src/de/dhbwstuttgart/typeinference/result/PairTPHequalRefTypeOrWildcardType.java rename to src/main/java/de/dhbwstuttgart/typeinference/result/PairTPHequalRefTypeOrWildcardType.java diff --git a/src/de/dhbwstuttgart/typeinference/result/PairTPHsmallerTPH.java b/src/main/java/de/dhbwstuttgart/typeinference/result/PairTPHsmallerTPH.java similarity index 100% rename from src/de/dhbwstuttgart/typeinference/result/PairTPHsmallerTPH.java rename to src/main/java/de/dhbwstuttgart/typeinference/result/PairTPHsmallerTPH.java diff --git a/src/de/dhbwstuttgart/typeinference/result/ResolvedType.java b/src/main/java/de/dhbwstuttgart/typeinference/result/ResolvedType.java similarity index 100% rename from src/de/dhbwstuttgart/typeinference/result/ResolvedType.java rename to src/main/java/de/dhbwstuttgart/typeinference/result/ResolvedType.java diff --git a/src/de/dhbwstuttgart/typeinference/result/ResultPair.java b/src/main/java/de/dhbwstuttgart/typeinference/result/ResultPair.java similarity index 100% rename from src/de/dhbwstuttgart/typeinference/result/ResultPair.java rename to src/main/java/de/dhbwstuttgart/typeinference/result/ResultPair.java diff --git a/src/de/dhbwstuttgart/typeinference/result/ResultPairVisitor.java b/src/main/java/de/dhbwstuttgart/typeinference/result/ResultPairVisitor.java similarity index 100% rename from src/de/dhbwstuttgart/typeinference/result/ResultPairVisitor.java rename to src/main/java/de/dhbwstuttgart/typeinference/result/ResultPairVisitor.java diff --git a/src/de/dhbwstuttgart/typeinference/result/ResultSet.java b/src/main/java/de/dhbwstuttgart/typeinference/result/ResultSet.java similarity index 100% rename from src/de/dhbwstuttgart/typeinference/result/ResultSet.java rename to src/main/java/de/dhbwstuttgart/typeinference/result/ResultSet.java diff --git a/src/de/dhbwstuttgart/typeinference/result/ResultSetVisitor.java b/src/main/java/de/dhbwstuttgart/typeinference/result/ResultSetVisitor.java similarity index 100% rename from src/de/dhbwstuttgart/typeinference/result/ResultSetVisitor.java rename to src/main/java/de/dhbwstuttgart/typeinference/result/ResultSetVisitor.java diff --git a/src/de/dhbwstuttgart/typeinference/typeAlgo/GenericsResolverSameName.java b/src/main/java/de/dhbwstuttgart/typeinference/typeAlgo/GenericsResolverSameName.java similarity index 100% rename from src/de/dhbwstuttgart/typeinference/typeAlgo/GenericsResolverSameName.java rename to src/main/java/de/dhbwstuttgart/typeinference/typeAlgo/GenericsResolverSameName.java diff --git a/src/de/dhbwstuttgart/typeinference/typeAlgo/TYPE.java b/src/main/java/de/dhbwstuttgart/typeinference/typeAlgo/TYPE.java similarity index 100% rename from src/de/dhbwstuttgart/typeinference/typeAlgo/TYPE.java rename to src/main/java/de/dhbwstuttgart/typeinference/typeAlgo/TYPE.java diff --git a/src/de/dhbwstuttgart/typeinference/typeAlgo/TYPEStmt.java b/src/main/java/de/dhbwstuttgart/typeinference/typeAlgo/TYPEStmt.java similarity index 100% rename from src/de/dhbwstuttgart/typeinference/typeAlgo/TYPEStmt.java rename to src/main/java/de/dhbwstuttgart/typeinference/typeAlgo/TYPEStmt.java diff --git a/src/de/dhbwstuttgart/typeinference/unify/GuavaSetOperations.java b/src/main/java/de/dhbwstuttgart/typeinference/unify/GuavaSetOperations.java similarity index 100% rename from src/de/dhbwstuttgart/typeinference/unify/GuavaSetOperations.java rename to src/main/java/de/dhbwstuttgart/typeinference/unify/GuavaSetOperations.java diff --git a/src/de/dhbwstuttgart/typeinference/unify/MartelliMontanariUnify.java b/src/main/java/de/dhbwstuttgart/typeinference/unify/MartelliMontanariUnify.java similarity index 100% rename from src/de/dhbwstuttgart/typeinference/unify/MartelliMontanariUnify.java rename to src/main/java/de/dhbwstuttgart/typeinference/unify/MartelliMontanariUnify.java diff --git a/src/de/dhbwstuttgart/typeinference/unify/Match.java b/src/main/java/de/dhbwstuttgart/typeinference/unify/Match.java similarity index 100% rename from src/de/dhbwstuttgart/typeinference/unify/Match.java rename to src/main/java/de/dhbwstuttgart/typeinference/unify/Match.java diff --git a/src/de/dhbwstuttgart/typeinference/unify/RuleSet.java b/src/main/java/de/dhbwstuttgart/typeinference/unify/RuleSet.java similarity index 100% rename from src/de/dhbwstuttgart/typeinference/unify/RuleSet.java rename to src/main/java/de/dhbwstuttgart/typeinference/unify/RuleSet.java diff --git a/src/de/dhbwstuttgart/typeinference/unify/TypeUnify.java b/src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnify.java similarity index 100% rename from src/de/dhbwstuttgart/typeinference/unify/TypeUnify.java rename to src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnify.java diff --git a/src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java b/src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java similarity index 100% rename from src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java rename to src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java diff --git a/src/de/dhbwstuttgart/typeinference/unify/Unifikationsalgorithmus.java b/src/main/java/de/dhbwstuttgart/typeinference/unify/Unifikationsalgorithmus.java similarity index 100% rename from src/de/dhbwstuttgart/typeinference/unify/Unifikationsalgorithmus.java rename to src/main/java/de/dhbwstuttgart/typeinference/unify/Unifikationsalgorithmus.java diff --git a/src/de/dhbwstuttgart/typeinference/unify/distributeVariance.java b/src/main/java/de/dhbwstuttgart/typeinference/unify/distributeVariance.java similarity index 100% rename from src/de/dhbwstuttgart/typeinference/unify/distributeVariance.java rename to src/main/java/de/dhbwstuttgart/typeinference/unify/distributeVariance.java diff --git a/src/de/dhbwstuttgart/typeinference/unify/freshPlaceholder.java b/src/main/java/de/dhbwstuttgart/typeinference/unify/freshPlaceholder.java similarity index 100% rename from src/de/dhbwstuttgart/typeinference/unify/freshPlaceholder.java rename to src/main/java/de/dhbwstuttgart/typeinference/unify/freshPlaceholder.java diff --git a/src/de/dhbwstuttgart/typeinference/unify/interfaces/IFiniteClosure.java b/src/main/java/de/dhbwstuttgart/typeinference/unify/interfaces/IFiniteClosure.java similarity index 100% rename from src/de/dhbwstuttgart/typeinference/unify/interfaces/IFiniteClosure.java rename to src/main/java/de/dhbwstuttgart/typeinference/unify/interfaces/IFiniteClosure.java diff --git a/src/de/dhbwstuttgart/typeinference/unify/interfaces/IMatch.java b/src/main/java/de/dhbwstuttgart/typeinference/unify/interfaces/IMatch.java similarity index 100% rename from src/de/dhbwstuttgart/typeinference/unify/interfaces/IMatch.java rename to src/main/java/de/dhbwstuttgart/typeinference/unify/interfaces/IMatch.java diff --git a/src/de/dhbwstuttgart/typeinference/unify/interfaces/IRuleSet.java b/src/main/java/de/dhbwstuttgart/typeinference/unify/interfaces/IRuleSet.java similarity index 100% rename from src/de/dhbwstuttgart/typeinference/unify/interfaces/IRuleSet.java rename to src/main/java/de/dhbwstuttgart/typeinference/unify/interfaces/IRuleSet.java diff --git a/src/de/dhbwstuttgart/typeinference/unify/interfaces/ISetOperations.java b/src/main/java/de/dhbwstuttgart/typeinference/unify/interfaces/ISetOperations.java similarity index 100% rename from src/de/dhbwstuttgart/typeinference/unify/interfaces/ISetOperations.java rename to src/main/java/de/dhbwstuttgart/typeinference/unify/interfaces/ISetOperations.java diff --git a/src/de/dhbwstuttgart/typeinference/unify/interfaces/IUnify.java b/src/main/java/de/dhbwstuttgart/typeinference/unify/interfaces/IUnify.java similarity index 100% rename from src/de/dhbwstuttgart/typeinference/unify/interfaces/IUnify.java rename to src/main/java/de/dhbwstuttgart/typeinference/unify/interfaces/IUnify.java diff --git a/src/de/dhbwstuttgart/typeinference/unify/interfaces/UnifyTypeVisitor.java b/src/main/java/de/dhbwstuttgart/typeinference/unify/interfaces/UnifyTypeVisitor.java similarity index 100% rename from src/de/dhbwstuttgart/typeinference/unify/interfaces/UnifyTypeVisitor.java rename to src/main/java/de/dhbwstuttgart/typeinference/unify/interfaces/UnifyTypeVisitor.java diff --git a/src/de/dhbwstuttgart/typeinference/unify/model/ExtendsType.java b/src/main/java/de/dhbwstuttgart/typeinference/unify/model/ExtendsType.java similarity index 100% rename from src/de/dhbwstuttgart/typeinference/unify/model/ExtendsType.java rename to src/main/java/de/dhbwstuttgart/typeinference/unify/model/ExtendsType.java diff --git a/src/de/dhbwstuttgart/typeinference/unify/model/FiniteClosure.java b/src/main/java/de/dhbwstuttgart/typeinference/unify/model/FiniteClosure.java similarity index 100% rename from src/de/dhbwstuttgart/typeinference/unify/model/FiniteClosure.java rename to src/main/java/de/dhbwstuttgart/typeinference/unify/model/FiniteClosure.java diff --git a/src/de/dhbwstuttgart/typeinference/unify/model/FunNType.java b/src/main/java/de/dhbwstuttgart/typeinference/unify/model/FunNType.java similarity index 100% rename from src/de/dhbwstuttgart/typeinference/unify/model/FunNType.java rename to src/main/java/de/dhbwstuttgart/typeinference/unify/model/FunNType.java diff --git a/src/de/dhbwstuttgart/typeinference/unify/model/Node.java b/src/main/java/de/dhbwstuttgart/typeinference/unify/model/Node.java similarity index 100% rename from src/de/dhbwstuttgart/typeinference/unify/model/Node.java rename to src/main/java/de/dhbwstuttgart/typeinference/unify/model/Node.java diff --git a/src/de/dhbwstuttgart/typeinference/unify/model/OrderingUnifyPair.java b/src/main/java/de/dhbwstuttgart/typeinference/unify/model/OrderingUnifyPair.java similarity index 100% rename from src/de/dhbwstuttgart/typeinference/unify/model/OrderingUnifyPair.java rename to src/main/java/de/dhbwstuttgart/typeinference/unify/model/OrderingUnifyPair.java diff --git a/src/de/dhbwstuttgart/typeinference/unify/model/Pair.java b/src/main/java/de/dhbwstuttgart/typeinference/unify/model/Pair.java similarity index 100% rename from src/de/dhbwstuttgart/typeinference/unify/model/Pair.java rename to src/main/java/de/dhbwstuttgart/typeinference/unify/model/Pair.java diff --git a/src/de/dhbwstuttgart/typeinference/unify/model/PairOperator.java b/src/main/java/de/dhbwstuttgart/typeinference/unify/model/PairOperator.java similarity index 100% rename from src/de/dhbwstuttgart/typeinference/unify/model/PairOperator.java rename to src/main/java/de/dhbwstuttgart/typeinference/unify/model/PairOperator.java diff --git a/src/de/dhbwstuttgart/typeinference/unify/model/PlaceholderType.java b/src/main/java/de/dhbwstuttgart/typeinference/unify/model/PlaceholderType.java similarity index 100% rename from src/de/dhbwstuttgart/typeinference/unify/model/PlaceholderType.java rename to src/main/java/de/dhbwstuttgart/typeinference/unify/model/PlaceholderType.java diff --git a/src/de/dhbwstuttgart/typeinference/unify/model/ReferenceType.java b/src/main/java/de/dhbwstuttgart/typeinference/unify/model/ReferenceType.java similarity index 100% rename from src/de/dhbwstuttgart/typeinference/unify/model/ReferenceType.java rename to src/main/java/de/dhbwstuttgart/typeinference/unify/model/ReferenceType.java diff --git a/src/de/dhbwstuttgart/typeinference/unify/model/SuperType.java b/src/main/java/de/dhbwstuttgart/typeinference/unify/model/SuperType.java similarity index 100% rename from src/de/dhbwstuttgart/typeinference/unify/model/SuperType.java rename to src/main/java/de/dhbwstuttgart/typeinference/unify/model/SuperType.java diff --git a/src/de/dhbwstuttgart/typeinference/unify/model/TypeParams.java b/src/main/java/de/dhbwstuttgart/typeinference/unify/model/TypeParams.java similarity index 100% rename from src/de/dhbwstuttgart/typeinference/unify/model/TypeParams.java rename to src/main/java/de/dhbwstuttgart/typeinference/unify/model/TypeParams.java diff --git a/src/de/dhbwstuttgart/typeinference/unify/model/Unifier.java b/src/main/java/de/dhbwstuttgart/typeinference/unify/model/Unifier.java similarity index 100% rename from src/de/dhbwstuttgart/typeinference/unify/model/Unifier.java rename to src/main/java/de/dhbwstuttgart/typeinference/unify/model/Unifier.java diff --git a/src/de/dhbwstuttgart/typeinference/unify/model/UnifyPair.java b/src/main/java/de/dhbwstuttgart/typeinference/unify/model/UnifyPair.java similarity index 100% rename from src/de/dhbwstuttgart/typeinference/unify/model/UnifyPair.java rename to src/main/java/de/dhbwstuttgart/typeinference/unify/model/UnifyPair.java diff --git a/src/de/dhbwstuttgart/typeinference/unify/model/UnifyType.java b/src/main/java/de/dhbwstuttgart/typeinference/unify/model/UnifyType.java similarity index 100% rename from src/de/dhbwstuttgart/typeinference/unify/model/UnifyType.java rename to src/main/java/de/dhbwstuttgart/typeinference/unify/model/UnifyType.java diff --git a/src/de/dhbwstuttgart/typeinference/unify/model/WildcardType.java b/src/main/java/de/dhbwstuttgart/typeinference/unify/model/WildcardType.java similarity index 100% rename from src/de/dhbwstuttgart/typeinference/unify/model/WildcardType.java rename to src/main/java/de/dhbwstuttgart/typeinference/unify/model/WildcardType.java diff --git a/src/de/dhbwstuttgart/typeinference/unify/visitUnifyTypeVisitor.java b/src/main/java/de/dhbwstuttgart/typeinference/unify/visitUnifyTypeVisitor.java similarity index 100% rename from src/de/dhbwstuttgart/typeinference/unify/visitUnifyTypeVisitor.java rename to src/main/java/de/dhbwstuttgart/typeinference/unify/visitUnifyTypeVisitor.java diff --git a/test/asp/ClingoTest.java b/src/test/java/asp/ClingoTest.java similarity index 96% rename from test/asp/ClingoTest.java rename to src/test/java/asp/ClingoTest.java index 90635bde..b0672987 100644 --- a/test/asp/ClingoTest.java +++ b/src/test/java/asp/ClingoTest.java @@ -12,6 +12,9 @@ import de.dhbwstuttgart.typeinference.constraints.ConstraintSet; import de.dhbwstuttgart.typeinference.constraints.Pair; import de.dhbwstuttgart.typeinference.result.ResultSet; import de.dhbwstuttgart.typeinference.unify.model.PairOperator; +import jdk.jfr.StackTrace; + +import org.junit.Ignore; import org.junit.Test; import javax.json.Json; @@ -22,11 +25,13 @@ import java.util.*; public class ClingoTest { public static final String tempDirectory = "/tmp/"; private final TypePlaceholder testType = TypePlaceholder.fresh(new NullToken()); + @Test + @Ignore public void test() throws IOException, InterruptedException, ClassNotFoundException { String content = ""; content = ASPFactory.generateASP(this.getPairs(), this.getFC()); - + PrintWriter writer = new PrintWriter(tempDirectory + "test.lp", "UTF-8"); writer.println(content); writer.close(); diff --git a/test/asp/UnifyWithoutWildcards.java b/src/test/java/asp/UnifyWithoutWildcards.java similarity index 100% rename from test/asp/UnifyWithoutWildcards.java rename to src/test/java/asp/UnifyWithoutWildcards.java diff --git a/test/asp/gencay/GeneratorTest.java b/src/test/java/asp/gencay/GeneratorTest.java similarity index 97% rename from test/asp/gencay/GeneratorTest.java rename to src/test/java/asp/gencay/GeneratorTest.java index 2c9fc46f..54da7c0f 100644 --- a/test/asp/gencay/GeneratorTest.java +++ b/src/test/java/asp/gencay/GeneratorTest.java @@ -17,6 +17,8 @@ import de.dhbwstuttgart.typeinference.constraints.ConstraintSet; import de.dhbwstuttgart.typeinference.constraints.Pair; import de.dhbwstuttgart.typeinference.result.ResultSet; import de.dhbwstuttgart.typeinference.unify.model.PairOperator; + +import org.junit.Ignore; import org.junit.Test; import java.io.File; @@ -25,6 +27,7 @@ import java.io.PrintWriter; import java.util.*; import java.util.concurrent.ArrayBlockingQueue; +@Ignore public class GeneratorTest extends UnifyWithoutWildcards{ @Test public void simple() throws ClassNotFoundException { diff --git a/test/asp/typeinference/ASPTest.java b/src/test/java/asp/typeinference/ASPTest.java similarity index 98% rename from test/asp/typeinference/ASPTest.java rename to src/test/java/asp/typeinference/ASPTest.java index 632d288e..5a43b6a9 100644 --- a/test/asp/typeinference/ASPTest.java +++ b/src/test/java/asp/typeinference/ASPTest.java @@ -20,7 +20,7 @@ import java.util.Set; public class ASPTest { - public static final String rootDirectory = System.getProperty("user.dir")+"/test/javFiles/"; + public static final String rootDirectory = System.getProperty("user.dir")+"/src/test/resources/javFiles/"; private static final List filesToTest = new ArrayList<>(); protected File fileToTest = null; diff --git a/test/asp/typeinference/GenericsTest.java b/src/test/java/asp/typeinference/GenericsTest.java similarity index 100% rename from test/asp/typeinference/GenericsTest.java rename to src/test/java/asp/typeinference/GenericsTest.java diff --git a/test/asp/typeinference/VectorTest.java b/src/test/java/asp/typeinference/VectorTest.java similarity index 100% rename from test/asp/typeinference/VectorTest.java rename to src/test/java/asp/typeinference/VectorTest.java diff --git a/test/asp/unifywithoutwildcards/ASPTests.java b/src/test/java/asp/unifywithoutwildcards/ASPTests.java similarity index 100% rename from test/asp/unifywithoutwildcards/ASPTests.java rename to src/test/java/asp/unifywithoutwildcards/ASPTests.java diff --git a/test/astfactory/ASTFactoryTest.java b/src/test/java/astfactory/ASTFactoryTest.java similarity index 100% rename from test/astfactory/ASTFactoryTest.java rename to src/test/java/astfactory/ASTFactoryTest.java diff --git a/src/test/java/bytecode/BinaryTest.java b/src/test/java/bytecode/BinaryTest.java new file mode 100644 index 00000000..dafa7a18 --- /dev/null +++ b/src/test/java/bytecode/BinaryTest.java @@ -0,0 +1,49 @@ +package bytecode; + +import static org.junit.Assert.*; + +import java.io.File; +import java.lang.reflect.Method; +import java.net.URL; +import java.net.URLClassLoader; + +import org.junit.BeforeClass; +import org.junit.Test; + +import de.dhbwstuttgart.core.JavaTXCompiler; + +public class BinaryTest { + private static String path; + private static File fileToTest; + private static JavaTXCompiler compiler; + private static ClassLoader loader; + private static Class classToTest; + private static String pathToClassFile; + private static Object instanceOfClass; + + @BeforeClass + public static void setUpBeforeClass() throws Exception { + path = System.getProperty("user.dir")+"/src/test/resources/javFiles/bytecode/BinaryInMeth.jav"; + fileToTest = new File(path); + compiler = new JavaTXCompiler(fileToTest); + pathToClassFile = System.getProperty("user.dir")+"/src/test/resources/testBytecode/generatedBC/"; + compiler.generateBytecode(pathToClassFile); + loader = new URLClassLoader(new URL[] {new URL("file://"+pathToClassFile)}); + classToTest = loader.loadClass("BinaryInMeth"); + instanceOfClass = classToTest.getDeclaredConstructor().newInstance(); + } + + @Test + public void test() throws Exception { + Method m2 = classToTest.getDeclaredMethod("m2", Integer.class,Integer.class); + Integer res = (Integer) m2.invoke(instanceOfClass, 2,3); + } + + @Test + public void testM3() throws Exception { + Method m3 = classToTest.getDeclaredMethod("m3", Integer.class); + Integer res = (Integer) m3.invoke(instanceOfClass, 2); + assertEquals(Integer.valueOf(4), res); + } + +} diff --git a/src/test/java/bytecode/FacTest.java b/src/test/java/bytecode/FacTest.java new file mode 100644 index 00000000..9f9f90cd --- /dev/null +++ b/src/test/java/bytecode/FacTest.java @@ -0,0 +1,44 @@ +package bytecode; + +import static org.junit.Assert.*; + +import java.io.File; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.net.URL; +import java.net.URLClassLoader; + +import org.junit.BeforeClass; +import org.junit.Test; + +import de.dhbwstuttgart.core.JavaTXCompiler; + +public class FacTest { + private static String path; + private static File fileToTest; + private static JavaTXCompiler compiler; + private static ClassLoader loader; + private static Class classToTest; + private static String pathToClassFile; + private static Object instanceOfClass; + + @BeforeClass + public static void setUpBeforeClass() throws Exception { + path = System.getProperty("user.dir")+"/src/test/resources/javFiles/bytecode/Fac.jav"; + fileToTest = new File(path); + compiler = new JavaTXCompiler(fileToTest); + pathToClassFile = System.getProperty("user.dir")+"/src/test/resources/testBytecode/generatedBC/"; + compiler.generateBytecode(pathToClassFile); + loader = new URLClassLoader(new URL[] {new URL("file://"+pathToClassFile)}); + classToTest = loader.loadClass("Fac"); + instanceOfClass = classToTest.getDeclaredConstructor().newInstance(); + } + + @Test + public void testInteger() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { + Method getFac = classToTest.getDeclaredMethod("getFac", Integer.class); + Integer result = (Integer) getFac.invoke(instanceOfClass,3); + assertEquals(result, Integer.valueOf(6)); + } + +} diff --git a/src/test/java/bytecode/FacultyTest.java b/src/test/java/bytecode/FacultyTest.java new file mode 100644 index 00000000..7ba08e58 --- /dev/null +++ b/src/test/java/bytecode/FacultyTest.java @@ -0,0 +1,54 @@ +package bytecode; + +import static org.junit.Assert.assertEquals; + +import java.io.File; +import java.lang.reflect.Field; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.net.URL; +import java.net.URLClassLoader; + +import org.junit.Test; + +import de.dhbwstuttgart.core.JavaTXCompiler; + +public class FacultyTest { + private static String path; + private static File fileToTest; + private static JavaTXCompiler compiler; + private static ClassLoader loader; + private static Class classToTest; + private static String pathToClassFile; + private static Object instanceOfClass; + + @Test + public void generateBC() throws Exception { + path = System.getProperty("user.dir")+"/src/test/resources/javFiles/Faculty.jav"; + fileToTest = new File(path); + compiler = new JavaTXCompiler(fileToTest); + compiler.generateBytecode(System.getProperty("user.dir")+"/src/test/resources/testBytecode/generatedBC/"); + pathToClassFile = System.getProperty("user.dir")+"/src/test/resources/testBytecode/generatedBC/"; + loader = new URLClassLoader(new URL[] {new URL("file://"+pathToClassFile)}); + classToTest = loader.loadClass("Faculty"); + instanceOfClass = classToTest.getDeclaredConstructor().newInstance(); + +// Method m = classToTest.getDeclaredMethod("m", Integer.class); + Field fact = classToTest.getDeclaredField("fact"); +// Class lambda = m.invoke(instanceOfClass).getClass(); + Class lambda = fact.getType(); + Method apply = lambda.getMethod("apply", Object.class); +// +// // Damit man auf die Methode zugreifen kann + apply.setAccessible(true); + + Integer i = 3; + + Integer result = (Integer) apply.invoke(instanceOfClass, i); +// Integer result = (Integer) m.invoke(instanceOfClass,i); + + assertEquals(Integer.valueOf(6), result); + } + + +} diff --git a/src/test/java/bytecode/FieldTest.java b/src/test/java/bytecode/FieldTest.java new file mode 100644 index 00000000..e7ec2582 --- /dev/null +++ b/src/test/java/bytecode/FieldTest.java @@ -0,0 +1,43 @@ +package bytecode; + +import static org.junit.Assert.*; + +import java.io.File; +import java.lang.reflect.Field; + +import org.junit.BeforeClass; +import org.junit.Test; +import java.net.URL; +import java.net.URLClassLoader; + +import de.dhbwstuttgart.core.JavaTXCompiler; + +public class FieldTest { + + private static String path; + private static File fileToTest; + private static JavaTXCompiler compiler; + private static ClassLoader loader; + private static Class classToTest; + private static String pathToClassFile; + private static Object instanceOfClass; + + @BeforeClass + public static void setUpBeforeClass() throws Exception { + path = System.getProperty("user.dir")+"/src/test/resources/javFiles/bytecode/Field.jav"; + fileToTest = new File(path); + compiler = new JavaTXCompiler(fileToTest); + compiler.generateBytecode(System.getProperty("user.dir")+"/src/test/resources/testBytecode/generatedBC/"); + pathToClassFile = System.getProperty("user.dir")+"/src/test/resources/testBytecode/generatedBC/"; + loader = new URLClassLoader(new URL[] {new URL("file://"+pathToClassFile)}); + classToTest = loader.loadClass("Field"); + instanceOfClass = classToTest.getDeclaredConstructor().newInstance(); + } + + @Test + public void test() { + Field[] fields = classToTest.getFields(); + assertEquals(1, fields.length); + } + +} diff --git a/src/test/java/bytecode/FunOLTest.java b/src/test/java/bytecode/FunOLTest.java new file mode 100644 index 00000000..c7686e8a --- /dev/null +++ b/src/test/java/bytecode/FunOLTest.java @@ -0,0 +1,52 @@ +package bytecode; + +import static org.junit.Assert.assertEquals; + +import java.io.File; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.net.URL; +import java.net.URLClassLoader; + +import org.junit.Test; + +import de.dhbwstuttgart.core.JavaTXCompiler; + +public class FunOLTest { + private static String path; + private static File fileToTest; + private static JavaTXCompiler compiler; + private static ClassLoader loader; + private static Class classToTest; + private static String pathToClassFile; + private static Object instanceOfClass; + + @Test + public void generateBC() throws Exception { + path = System.getProperty("user.dir")+"/src/test/resources/javFiles/bytecode/FunOL.jav"; + fileToTest = new File(path); + compiler = new JavaTXCompiler(fileToTest); + compiler.generateBytecode(System.getProperty("user.dir")+"/src/test/resources/testBytecode/generatedBC/"); + pathToClassFile = System.getProperty("user.dir")+"/src/test/resources/testBytecode/generatedBC/"; + loader = new URLClassLoader(new URL[] {new URL("file://"+pathToClassFile)}); + classToTest = loader.loadClass("FunOL"); + /* + instanceOfClass = classToTest.getDeclaredConstructor().newInstance(); + + Method m = classToTest.getDeclaredMethod("m"); + Class lambda = m.invoke(instanceOfClass).getClass(); + Method apply = lambda.getMethod("apply", Object.class); + + // Damit man auf die Methode zugreifen kann + apply.setAccessible(true); + + Integer i = 77; + + Integer result = (Integer) apply.invoke(m.invoke(instanceOfClass), i); + + assertEquals(77, result); + */ + } + + +} diff --git a/src/test/java/bytecode/GenTest.java b/src/test/java/bytecode/GenTest.java new file mode 100644 index 00000000..97d02372 --- /dev/null +++ b/src/test/java/bytecode/GenTest.java @@ -0,0 +1,30 @@ +package bytecode; + +import static org.junit.Assert.*; + +import java.io.File; +import java.net.URL; +import java.net.URLClassLoader; + +import org.junit.BeforeClass; +import org.junit.Test; + +import de.dhbwstuttgart.core.JavaTXCompiler; + +public class GenTest { + + private static String path; + private static File fileToTest; + private static JavaTXCompiler compiler; + private static String pathToClassFile; + + @Test + public void generateBC() throws Exception { + path = System.getProperty("user.dir")+"/src/test/resources/javFiles/bytecode/Gen.jav"; + fileToTest = new File(path); + compiler = new JavaTXCompiler(fileToTest); + pathToClassFile = System.getProperty("user.dir")+"/src/test/resources/testBytecode/generatedBC/"; + compiler.generateBytecode(pathToClassFile); + } + +} diff --git a/src/test/java/bytecode/GreaterEqualTest.java b/src/test/java/bytecode/GreaterEqualTest.java new file mode 100644 index 00000000..920f6e3b --- /dev/null +++ b/src/test/java/bytecode/GreaterEqualTest.java @@ -0,0 +1,140 @@ +package bytecode; + +import static org.junit.Assert.*; + +import java.io.File; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.net.URL; +import java.net.URLClassLoader; + +import org.junit.BeforeClass; +import org.junit.Test; + +import de.dhbwstuttgart.core.JavaTXCompiler; + +public class GreaterEqualTest { + + private static String path; + private static File fileToTest; + private static JavaTXCompiler compiler; + private static ClassLoader loader; + private static Class classToTest; + private static String pathToClassFile; + private static Object instanceOfClass; + + @BeforeClass + public static void setUpBeforeClass() throws Exception { + path = System.getProperty("user.dir")+"/src/test/resources/javFiles/bytecode/GreaterEqual.jav"; + fileToTest = new File(path); + compiler = new JavaTXCompiler(fileToTest); + pathToClassFile = System.getProperty("user.dir")+"/src/test/resources/testBytecode/generatedBC/"; + compiler.generateBytecode(pathToClassFile); + loader = new URLClassLoader(new URL[] {new URL("File://"+pathToClassFile)}); + classToTest = loader.loadClass("GreaterEqual"); + instanceOfClass = classToTest.getDeclaredConstructor().newInstance(); + } + + @Test + public void testName() { + assertEquals("GreaterEqual", classToTest.getName()); + } + @Test + public void testIntegers() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { + Method gE = classToTest.getDeclaredMethod("gE", Integer.class, Integer.class); + Boolean result = (Boolean) gE.invoke(instanceOfClass, 7, 5); + assertTrue(result); + } + + @Test + public void testIntegers2() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { + Method gE = classToTest.getDeclaredMethod("gE", Integer.class, Integer.class); + Boolean result = (Boolean) gE.invoke(instanceOfClass, 5, 7); + assertFalse(result); + } + + @Test + public void testEqIntegers() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { + Method gE = classToTest.getDeclaredMethod("gE", Integer.class, Integer.class); + Boolean result = (Boolean) gE.invoke(instanceOfClass, 5, 5); + assertTrue(result); + } + + @Test + public void testLongs() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { + Method gE = classToTest.getDeclaredMethod("gE", Long.class, Long.class); + Boolean result = (Boolean) gE.invoke(instanceOfClass, 10L,7L); + assertTrue(result); + } + + @Test + public void testFloats() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { + Method gE = classToTest.getDeclaredMethod("gE", Float.class, Float.class); + Boolean result = (Boolean) gE.invoke(instanceOfClass, 5F,7F); + assertFalse(result); + } + + @Test + public void testDoubles() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { + Method gE = classToTest.getDeclaredMethod("gE", Double.class, Double.class); + Boolean result = (Boolean) gE.invoke(instanceOfClass, 5.0,7.0); + assertFalse(result); + } + + @Test + public void testLongInt() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { + Method gE = classToTest.getDeclaredMethod("gE", Long.class, Integer.class); + Boolean result = (Boolean) gE.invoke(instanceOfClass, 15L,7); + assertTrue(result); + } + + @Test + public void testFloatInt() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { + Method gE = classToTest.getDeclaredMethod("gE", Float.class, Integer.class); + Boolean result = (Boolean) gE.invoke(instanceOfClass, 5F,7); + assertFalse(result); + } + + @Test + public void testDoubleInt() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { + Method gE = classToTest.getDeclaredMethod("gE", Double.class, Integer.class); + Boolean result = (Boolean) gE.invoke(instanceOfClass, 25.0,17); + assertTrue(result); + } + + @Test + public void testFloatLong() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { + Method gE = classToTest.getDeclaredMethod("gE", Float.class, Long.class); + Boolean result = (Boolean) gE.invoke(instanceOfClass, 75F,70L); + assertTrue(result); + } + + @Test + public void testDoubleLong() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { + Method gE = classToTest.getDeclaredMethod("gE", Double.class, Long.class); + Boolean result = (Boolean) gE.invoke(instanceOfClass, 5.0,7L); + assertFalse(result); + } + + @Test + public void testEqDoubleFloat() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { + Method gE = classToTest.getDeclaredMethod("gE", Double.class, Float.class); + Boolean result = (Boolean) gE.invoke(instanceOfClass, 7.0,7F); + assertTrue(result); + } + + @Test + public void testDoubleFloat() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { + Method gE = classToTest.getDeclaredMethod("gE", Double.class, Float.class); + Boolean result = (Boolean) gE.invoke(instanceOfClass, 15.0,7F); + assertTrue(result); + } + + @Test + public void testDoubleFloat3() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { + Method gE = classToTest.getDeclaredMethod("gE", Double.class, Float.class); + Boolean result = (Boolean) gE.invoke(instanceOfClass, 9.0,17F); + assertFalse(result); + } + +} diff --git a/src/test/java/bytecode/GreaterThanTest.java b/src/test/java/bytecode/GreaterThanTest.java new file mode 100644 index 00000000..524dc43a --- /dev/null +++ b/src/test/java/bytecode/GreaterThanTest.java @@ -0,0 +1,139 @@ +package bytecode; + +import static org.junit.Assert.*; + +import java.io.File; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.net.URL; +import java.net.URLClassLoader; + +import org.junit.BeforeClass; +import org.junit.Test; + +import de.dhbwstuttgart.core.JavaTXCompiler; + +public class GreaterThanTest { + + private static String path; + private static File fileToTest; + private static JavaTXCompiler compiler; + private static ClassLoader loader; + private static Class classToTest; + private static String pathToClassFile; + private static Object instanceOfClass; + + @BeforeClass + public static void setUpBeforeClass() throws Exception { + path = System.getProperty("user.dir")+"/src/test/resources/javFiles/bytecode/GreaterThan.jav"; + fileToTest = new File(path); + compiler = new JavaTXCompiler(fileToTest); + pathToClassFile = System.getProperty("user.dir")+"/src/test/resources/testBytecode/generatedBC/"; + compiler.generateBytecode(pathToClassFile); + loader = new URLClassLoader(new URL[] {new URL("File://"+pathToClassFile)}); + classToTest = loader.loadClass("GreaterThan"); + instanceOfClass = classToTest.getDeclaredConstructor().newInstance(); + } + + @Test + public void testName() { + assertEquals("GreaterThan", classToTest.getName()); + } + + public void testIntegers() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { + Method gT = classToTest.getDeclaredMethod("gT", Integer.class, Integer.class); + Boolean result = (Boolean) gT.invoke(instanceOfClass, 7, 5); + assertTrue(result); + } + + @Test + public void testIntegers2() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { + Method gT = classToTest.getDeclaredMethod("gT", Integer.class, Integer.class); + Boolean result = (Boolean) gT.invoke(instanceOfClass, 5, 7); + assertFalse(result); + } + + @Test + public void testEqIntegers() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { + Method gT = classToTest.getDeclaredMethod("gT", Integer.class, Integer.class); + Boolean result = (Boolean) gT.invoke(instanceOfClass, 5, 5); + assertFalse(result); + } + + @Test + public void testLongs() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { + Method gT = classToTest.getDeclaredMethod("gT", Long.class, Long.class); + Boolean result = (Boolean) gT.invoke(instanceOfClass, 10L,7L); + assertTrue(result); + }@Test + + public void testFloats() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { + Method gT = classToTest.getDeclaredMethod("gT", Float.class, Float.class); + Boolean result = (Boolean) gT.invoke(instanceOfClass, 5F,7F); + assertFalse(result); + } + + @Test + public void testDoubles() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { + Method gT = classToTest.getDeclaredMethod("gT", Double.class, Double.class); + Boolean result = (Boolean) gT.invoke(instanceOfClass, 5.0,7.0); + assertFalse(result); + } + + @Test + public void testLongInt() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { + Method gT = classToTest.getDeclaredMethod("gT", Long.class, Integer.class); + Boolean result = (Boolean) gT.invoke(instanceOfClass, 15L,7); + assertTrue(result); + } + + @Test + public void testFloatInt() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { + Method gT = classToTest.getDeclaredMethod("gT", Float.class, Integer.class); + Boolean result = (Boolean) gT.invoke(instanceOfClass, 5F,7); + assertFalse(result); + } + + @Test + public void testDoubleInt() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { + Method gT = classToTest.getDeclaredMethod("gT", Double.class, Integer.class); + Boolean result = (Boolean) gT.invoke(instanceOfClass, 25.0,17); + assertTrue(result); + } + + @Test + public void testFloatLong() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { + Method gT = classToTest.getDeclaredMethod("gT", Float.class, Long.class); + Boolean result = (Boolean) gT.invoke(instanceOfClass, 75F,70L); + assertTrue(result); + } + + @Test + public void testDoubleLong() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { + Method gT = classToTest.getDeclaredMethod("gT", Double.class, Long.class); + Boolean result = (Boolean) gT.invoke(instanceOfClass, 5.0,7L); + assertFalse(result); + } + + @Test + public void testEqDoubleFloat() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { + Method gT = classToTest.getDeclaredMethod("gT", Double.class, Float.class); + Boolean result = (Boolean) gT.invoke(instanceOfClass, 7.0,7F); + assertFalse(result); + } + + @Test + public void testDoubleFloat() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { + Method gT = classToTest.getDeclaredMethod("gT", Double.class, Float.class); + Boolean result = (Boolean) gT.invoke(instanceOfClass, 15.0,7F); + assertTrue(result); + } + + @Test + public void testDoubleFloat3() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { + Method gT = classToTest.getDeclaredMethod("gT", Double.class, Float.class); + Boolean result = (Boolean) gT.invoke(instanceOfClass, 9.0,17F); + assertFalse(result); + } + +} diff --git a/src/test/java/bytecode/LambdaTest.java b/src/test/java/bytecode/LambdaTest.java new file mode 100644 index 00000000..6a66bd04 --- /dev/null +++ b/src/test/java/bytecode/LambdaTest.java @@ -0,0 +1,50 @@ +package bytecode; + +import static org.junit.Assert.assertEquals; + +import java.io.File; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.net.URL; +import java.net.URLClassLoader; + +import org.junit.Test; + +import de.dhbwstuttgart.core.JavaTXCompiler; + +public class LambdaTest { + private static String path; + private static File fileToTest; + private static JavaTXCompiler compiler; + private static ClassLoader loader; + private static Class classToTest; + private static String pathToClassFile; + private static Object instanceOfClass; + + @Test + public void generateBC() throws Exception { + path = System.getProperty("user.dir")+"/src/test/resources/javFiles/bytecode/Lambda.jav"; + fileToTest = new File(path); + compiler = new JavaTXCompiler(fileToTest); + compiler.generateBytecode(System.getProperty("user.dir")+"/src/test/resources/testBytecode/generatedBC/"); + pathToClassFile = System.getProperty("user.dir")+"/src/test/resources/testBytecode/generatedBC/"; + loader = new URLClassLoader(new URL[] {new URL("file://"+pathToClassFile)}); + classToTest = loader.loadClass("Lambda"); + instanceOfClass = classToTest.getDeclaredConstructor().newInstance(); + + Method m = classToTest.getDeclaredMethod("m"); + Class lambda = m.invoke(instanceOfClass).getClass(); + Method apply = lambda.getMethod("apply", Object.class); + + // Damit man auf die Methode zugreifen kann + apply.setAccessible(true); + + Integer i = 77; + + Integer result = (Integer) apply.invoke(m.invoke(instanceOfClass), i); + + assertEquals(Integer.valueOf(77), result); + } + + +} diff --git a/src/test/java/bytecode/LambdaVoidTest.java b/src/test/java/bytecode/LambdaVoidTest.java new file mode 100644 index 00000000..13c66d2c --- /dev/null +++ b/src/test/java/bytecode/LambdaVoidTest.java @@ -0,0 +1,47 @@ +package bytecode; + +import static org.junit.Assert.assertEquals; + +import java.io.File; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.net.URL; +import java.net.URLClassLoader; + +import org.junit.Test; + +import de.dhbwstuttgart.core.JavaTXCompiler; + +public class LambdaVoidTest { + private static String path; + private static File fileToTest; + private static JavaTXCompiler compiler; + private static ClassLoader loader; + private static Class classToTest; + private static String pathToClassFile; + private static Object instanceOfClass; + + @Test + public void generateBC() throws Exception { + path = System.getProperty("user.dir")+"/src/test/resources/javFiles/Lambda.jav"; + fileToTest = new File(path); + compiler = new JavaTXCompiler(fileToTest); + compiler.generateBytecode(System.getProperty("user.dir")+"/src/test/resources/testBytecode/generatedBC/"); + pathToClassFile = System.getProperty("user.dir")+"/src/test/resources/testBytecode/generatedBC/"; + loader = new URLClassLoader(new URL[] {new URL("file://"+pathToClassFile)}); + classToTest = loader.loadClass("Lambda"); + instanceOfClass = classToTest.getDeclaredConstructor().newInstance(); + + Method m = classToTest.getDeclaredMethod("m"); + Class lambda = m.invoke(instanceOfClass).getClass(); + Method apply = lambda.getMethod("apply", Object.class); + + // Damit man auf die Methode zugreifen kann + apply.setAccessible(true); + + Integer i = 77; + apply.invoke(m.invoke(instanceOfClass), i); + } + + +} diff --git a/src/test/java/bytecode/LessEqualTest.java b/src/test/java/bytecode/LessEqualTest.java new file mode 100644 index 00000000..c1a2da11 --- /dev/null +++ b/src/test/java/bytecode/LessEqualTest.java @@ -0,0 +1,133 @@ +package bytecode; + +import static org.junit.Assert.*; + +import java.io.File; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.net.URL; +import java.net.URLClassLoader; + +import org.junit.BeforeClass; +import org.junit.Test; + +import de.dhbwstuttgart.core.JavaTXCompiler; + +public class LessEqualTest { + + private static String path; + private static File fileToTest; + private static JavaTXCompiler compiler; + private static ClassLoader loader; + private static Class classToTest; + private static String pathToClassFile; + private static Object instanceOfClass; + + @BeforeClass + public static void setUpBeforeClass() throws Exception { + path = System.getProperty("user.dir")+"/src/test/resources/javFiles/bytecode/LessEqual.jav"; + fileToTest = new File(path); + compiler = new JavaTXCompiler(fileToTest); + pathToClassFile = System.getProperty("user.dir")+"/src/test/resources/testBytecode/generatedBC/"; + compiler.generateBytecode(pathToClassFile); + loader = new URLClassLoader(new URL[] {new URL("file://"+pathToClassFile)}); + classToTest = loader.loadClass("LessEqual"); + instanceOfClass = classToTest.getDeclaredConstructor().newInstance(); + } + + @Test + public void testName() { + assertEquals("LessEqual", classToTest.getName()); + } + + @Test + public void testIntegers() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { + Method lessEqual = classToTest.getDeclaredMethod("lessEqual", Integer.class, Integer.class); + Boolean result = (Boolean) lessEqual.invoke(instanceOfClass, 5,7); + assertTrue(result); + } + + @Test + public void testEqualIntegers() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { + Method lessEqual = classToTest.getDeclaredMethod("lessEqual", Integer.class, Integer.class); + Boolean result = (Boolean) lessEqual.invoke(instanceOfClass, 5,5); + assertTrue(result); + } + + @Test + public void testLongs() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { + Method lessEqual = classToTest.getDeclaredMethod("lessEqual", Long.class, Long.class); + Boolean result = (Boolean) lessEqual.invoke(instanceOfClass, 5L,7L); + assertTrue(result); + }@Test + + public void testFloats() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { + Method lessEqual = classToTest.getDeclaredMethod("lessEqual", Float.class, Float.class); + Boolean result = (Boolean) lessEqual.invoke(instanceOfClass, 5F,7F); + assertTrue(result); + } + + @Test + public void testDoubles() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { + Method lessEqual = classToTest.getDeclaredMethod("lessEqual", Double.class, Double.class); + Boolean result = (Boolean) lessEqual.invoke(instanceOfClass, 5.0,7.0); + assertTrue(result); + } + + @Test + public void testLongInt() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { + Method lessEqual = classToTest.getDeclaredMethod("lessEqual", Long.class, Integer.class); + Boolean result = (Boolean) lessEqual.invoke(instanceOfClass, 5L,7); + assertTrue(result); + } + + @Test + public void testFloatInt() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { + Method lessEqual = classToTest.getDeclaredMethod("lessEqual", Float.class, Integer.class); + Boolean result = (Boolean) lessEqual.invoke(instanceOfClass, 5F,7); + assertTrue(result); + } + + @Test + public void testDoubleInt() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { + Method lessEqual = classToTest.getDeclaredMethod("lessEqual", Double.class, Integer.class); + Boolean result = (Boolean) lessEqual.invoke(instanceOfClass, 5.0,7); + assertTrue(result); + } + + @Test + public void testFloatLong() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { + Method lessEqual = classToTest.getDeclaredMethod("lessEqual", Float.class, Long.class); + Boolean result = (Boolean) lessEqual.invoke(instanceOfClass, 5F,7L); + assertTrue(result); + } + + @Test + public void testDoubleLong() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { + Method lessEqual = classToTest.getDeclaredMethod("lessEqual", Double.class, Long.class); + Boolean result = (Boolean) lessEqual.invoke(instanceOfClass, 5.0,7L); + assertTrue(result); + } + + @Test + public void testEqDoubleFloat() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { + Method lessEqual = classToTest.getDeclaredMethod("lessEqual", Double.class, Float.class); + Boolean result = (Boolean) lessEqual.invoke(instanceOfClass, 7.0,7F); + assertTrue(result); + } + + @Test + public void testDoubleFloat() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { + Method lessEqual = classToTest.getDeclaredMethod("lessEqual", Double.class, Float.class); + Boolean result = (Boolean) lessEqual.invoke(instanceOfClass, 5.0,7F); + assertTrue(result); + } + + @Test + public void testDoubleFloat3() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { + Method lessEqual = classToTest.getDeclaredMethod("lessEqual", Double.class, Float.class); + Boolean result = (Boolean) lessEqual.invoke(instanceOfClass, 9.0,7F); + assertFalse(result); + } + +} diff --git a/src/test/java/bytecode/LessThanTest.java b/src/test/java/bytecode/LessThanTest.java new file mode 100644 index 00000000..17233ebb --- /dev/null +++ b/src/test/java/bytecode/LessThanTest.java @@ -0,0 +1,141 @@ +package bytecode; + +import static org.junit.Assert.*; + +import java.io.File; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.net.URL; +import java.net.URLClassLoader; + +import org.junit.BeforeClass; +import org.junit.Test; + +import de.dhbwstuttgart.core.JavaTXCompiler; + +public class LessThanTest { + + private static String path; + private static File fileToTest; + private static JavaTXCompiler compiler; + private static ClassLoader loader; + private static Class classToTest; + private static String pathToClassFile; + private static Object instanceOfClass; + + @BeforeClass + public static void setUpBeforeClass() throws Exception { + path = System.getProperty("user.dir")+"/src/test/resources/javFiles/bytecode/LessThan.jav"; + fileToTest = new File(path); + compiler = new JavaTXCompiler(fileToTest); + pathToClassFile = System.getProperty("user.dir")+"/src/test/resources/testBytecode/generatedBC/"; + compiler.generateBytecode(pathToClassFile); + loader = new URLClassLoader(new URL[] {new URL("file://"+pathToClassFile)}); + classToTest = loader.loadClass("LessThan"); + instanceOfClass = classToTest.getDeclaredConstructor().newInstance(); + } + + @Test + public void testClassName() { + assertEquals("LessThan", classToTest.getName()); + } + + @Test + public void testLessThanInt() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { + Method lessThan = classToTest.getDeclaredMethod("lessThan", Integer.class,Integer.class); + Boolean result = (Boolean) lessThan.invoke(instanceOfClass, 5, 7); + assertTrue(result); + } + + @Test + public void testLessThanInt2() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { + Method lessThan = classToTest.getDeclaredMethod("lessThan", Integer.class, Integer.class); + Boolean result = (Boolean) lessThan.invoke(instanceOfClass, 7, 5); + assertFalse(result); + } + + @Test + public void testLessThanInt3() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { + Method lessThan = classToTest.getDeclaredMethod("lessThan", Integer.class, Integer.class); + Boolean result = (Boolean) lessThan.invoke(instanceOfClass, 5, 5); + assertFalse(result); + } + + @Test + public void testLessThanLong() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { + Method lessThan = classToTest.getDeclaredMethod("lessThan", Long.class,Long.class); + Boolean result = (Boolean) lessThan.invoke(instanceOfClass, 5L, 7L); + assertTrue(result); + } + + @Test + public void testLessThanLong2() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { + Method lessThan = classToTest.getDeclaredMethod("lessThan", Long.class, Long.class); + Boolean result = (Boolean) lessThan.invoke(instanceOfClass, 7L, 5L); + assertFalse(result); + } + + @Test + public void testLessThanLong3() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { + Method lessThan = classToTest.getDeclaredMethod("lessThan", Long.class, Long.class); + Boolean result = (Boolean) lessThan.invoke(instanceOfClass, 5L, 5L); + assertFalse(result); + } + + @Test + public void testLessThanFloat() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { + Method lessThan = classToTest.getDeclaredMethod("lessThan", Float.class, Float.class); + Boolean result = (Boolean) lessThan.invoke(instanceOfClass, 7F, 5F); + assertFalse(result); + } + + @Test + public void testLessThanDouble() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { + Method lessThan = classToTest.getDeclaredMethod("lessThan", Double.class, Double.class); + Boolean result = (Boolean) lessThan.invoke(instanceOfClass, 7.0, 5.0); + assertFalse(result); + } + + @Test + public void testLessThanLongInt() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { + Method lessThan = classToTest.getDeclaredMethod("lessThan", Long.class, Integer.class); + Boolean result = (Boolean) lessThan.invoke(instanceOfClass, 7L, 5); + assertFalse(result); + } + + @Test + public void testLessThanFloatInt() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { + Method lessThan = classToTest.getDeclaredMethod("lessThan", Float.class, Integer.class); + Boolean result = (Boolean) lessThan.invoke(instanceOfClass, 7F, 5); + assertFalse(result); + } + + @Test + public void testLessThanDoubleInt() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { + Method lessThan = classToTest.getDeclaredMethod("lessThan", Double.class, Integer.class); + Boolean result = (Boolean) lessThan.invoke(instanceOfClass, 7.0, 5); + assertFalse(result); + } + + @Test + public void testLessThanFloatLong() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { + Method lessThan = classToTest.getDeclaredMethod("lessThan", Float.class, Long.class); + Boolean result = (Boolean) lessThan.invoke(instanceOfClass, 7F, 5L); + assertFalse(result); + } + + @Test + public void testLessThanDoubleLong() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { + Method lessThan = classToTest.getDeclaredMethod("lessThan", Double.class, Long.class); + Boolean result = (Boolean) lessThan.invoke(instanceOfClass, 7.0, 5L); + assertFalse(result); + } + + @Test + public void testLessThanDoubleFloat() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { + Method lessThan = classToTest.getDeclaredMethod("lessThan", Double.class, Float.class); + Boolean result = (Boolean) lessThan.invoke(instanceOfClass, 7.0, 5F); + assertFalse(result); + } + +} diff --git a/src/test/java/bytecode/MatrixOpTest.java b/src/test/java/bytecode/MatrixOpTest.java new file mode 100644 index 00000000..e1c368a3 --- /dev/null +++ b/src/test/java/bytecode/MatrixOpTest.java @@ -0,0 +1,91 @@ +package bytecode; + +import static org.junit.Assert.*; + +import java.io.File; +import java.io.IOException; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.net.URL; +import java.net.URLClassLoader; +import java.util.Vector; + +import org.junit.BeforeClass; +import org.junit.Test; + +import de.dhbwstuttgart.core.JavaTXCompiler; + +public class MatrixOpTest { + private static String path; + private static File fileToTest; + private static JavaTXCompiler compiler; + private static ClassLoader loader; + private static Class classToTest; + private static String pathToClassFile; + private static Object instanceOfClass_m1; + private static Object instanceOfClass_m2; + private static Object instanceOfClass_m3; + + @Test + public void test() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, ClassNotFoundException, IOException, InstantiationException { + path = System.getProperty("user.dir")+"/src/test/resources/javFiles/bytecode/MatrixOP.jav"; + fileToTest = new File(path); + compiler = new JavaTXCompiler(fileToTest); + pathToClassFile = System.getProperty("user.dir")+"/src/test/resources/testBytecode/generatedBC/"; +// compiler.generateBytecode(pathToClassFile); +// loader = new URLClassLoader(new URL[] {new URL("file://"+pathToClassFile)}); +// classToTest = loader.loadClass("MatrixOP"); +/* + Vector> vv = new Vector>(); + Vector v1 = new Vector (); + v1.addElement(2); + v1.addElement(2); + Vector v2 = new Vector (); + v2.addElement(3); + v2.addElement(3); + //Matrix m1 = new Matrix(); + //m1.addElement(v1); + //m1.addElement(v2); + vv.addElement(v1); + vv.addElement(v2); + instanceOfClass_m1 = classToTest.getDeclaredConstructor(Vector.class).newInstance(vv); //Matrix m1 = new Matrix(vv); + + Vector> vv1 = new Vector>(); + Vector v3 = new Vector (); + v3.addElement(2); + v3.addElement(2); + Vector v4 = new Vector (); + v4.addElement(3); + v4.addElement(3); + //Matrix m2 = new Matrix(); + //m2.addElement(v3); + //m2.addElement(v4); + vv1.addElement(v3); + vv1.addElement(v4); + instanceOfClass_m2 = classToTest.getDeclaredConstructor(Vector.class).newInstance(vv1);//Matrix m2 = new Matrix(vv1); + + + + //Matrix m3 = m1.mul(vv1); + Method mul = classToTest.getDeclaredMethod("mul", Vector.class); + Object result = mul.invoke(instanceOfClass_m1, instanceOfClass_m2); + System.out.println(instanceOfClass_m1.toString() + " * " + instanceOfClass_m2.toString() + " = " + result.toString()); + + Vector> res = new Vector>(); + Vector v5 = new Vector (); + v5.addElement(10); + v5.addElement(10); + Vector v6 = new Vector (); + v6.addElement(15); + v6.addElement(15); + //Matrix m2 = new Matrix(); + //m2.addElement(v3); + //m2.addElement(v4); + res.addElement(v5); + res.addElement(v6); + instanceOfClass_m3 = classToTest.getDeclaredConstructor(Vector.class).newInstance(res); + assertEquals(result, instanceOfClass_m3); +*/ + } + +} diff --git a/test/bytecode/MatrixTest.java b/src/test/java/bytecode/MatrixTest.java similarity index 94% rename from test/bytecode/MatrixTest.java rename to src/test/java/bytecode/MatrixTest.java index cd0a20b7..20e42df7 100644 --- a/test/bytecode/MatrixTest.java +++ b/src/test/java/bytecode/MatrixTest.java @@ -28,10 +28,10 @@ public class MatrixTest { @Test public void test() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, ClassNotFoundException, IOException, InstantiationException { - path = System.getProperty("user.dir")+"/test/bytecode/javFiles/Matrix.jav"; + path = System.getProperty("user.dir")+"/src/test/resources/javFiles/Matrix.jav"; fileToTest = new File(path); compiler = new JavaTXCompiler(fileToTest); - pathToClassFile = System.getProperty("user.dir")+"/testBytecode/generatedBC/"; + pathToClassFile = System.getProperty("user.dir")+"/src/test/resources/testBytecode/generatedBC/"; compiler.generateBytecode(pathToClassFile); loader = new URLClassLoader(new URL[] {new URL("file://"+pathToClassFile)}); classToTest = loader.loadClass("Matrix"); diff --git a/src/test/java/bytecode/MergeTest.java b/src/test/java/bytecode/MergeTest.java new file mode 100644 index 00000000..d0f2cc71 --- /dev/null +++ b/src/test/java/bytecode/MergeTest.java @@ -0,0 +1,41 @@ +package bytecode; + + +import static org.junit.Assert.assertEquals; + +import java.io.File; +import java.lang.reflect.Method; +import java.net.URL; +import java.net.URLClassLoader; + +import org.junit.Test; + +import de.dhbwstuttgart.core.JavaTXCompiler; + +public class MergeTest { + private static String path; + private static File fileToTest; + private static JavaTXCompiler compiler; + private static ClassLoader loader; + private static Class classToTest; + private static String pathToClassFile; + private static Object instanceOfClass; + + + @Test + public void generateBC() throws Exception { + path = System.getProperty("user.dir")+"/src/test/resources/javFiles/bytecode/Merge.jav"; + fileToTest = new File(path); + compiler = new JavaTXCompiler(fileToTest); + compiler.generateBytecode(System.getProperty("user.dir")+"/src/test/resources/testBytecode/generatedBC/"); +// pathToClassFile = System.getProperty("user.dir")+"/src/test/resources/testBytecode/generatedBC/"; +// loader = new URLClassLoader(new URL[] {new URL("file://"+pathToClassFile)}); +// classToTest = loader.loadClass("Merge"); + //instanceOfClass = classToTest.getDeclaredConstructor().newInstance(); + + //Method m = classToTest.getDeclaredMethod("m"); + //Object result = m.invoke(instanceOfClass); + + //assertEquals(result.getClass(), loader.loadClass("Apply")); + } +} diff --git a/src/test/java/bytecode/OLTest.java b/src/test/java/bytecode/OLTest.java new file mode 100644 index 00000000..3e5b076d --- /dev/null +++ b/src/test/java/bytecode/OLTest.java @@ -0,0 +1,92 @@ +package bytecode; + +import static org.junit.Assert.*; + +import java.io.File; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.net.URL; +import java.net.URLClassLoader; + +import org.junit.BeforeClass; +import org.junit.Test; + +import de.dhbwstuttgart.core.JavaTXCompiler; + +public class OLTest { + private static String path; + private static File fileToTest; + private static JavaTXCompiler compiler; + private static ClassLoader loader; + private static Class classToTest; + private static Class classToTest1; + private static String pathToClassFile; + private static Object instanceOfClass; + private static Object instanceOfClass1; + + @BeforeClass + public static void setUpBeforeClass() throws Exception { + path = System.getProperty("user.dir")+"/src/test/resources/javFiles/bytecode/OL.jav"; + fileToTest = new File(path); + compiler = new JavaTXCompiler(fileToTest); + pathToClassFile = System.getProperty("user.dir")+"/src/test/resources/testBytecode/generatedBC/"; + compiler.generateBytecode(pathToClassFile); + loader = new URLClassLoader(new URL[] {new URL("file://"+pathToClassFile)}); + classToTest = loader.loadClass("OL"); + instanceOfClass = classToTest.getDeclaredConstructor().newInstance(); + classToTest1 = loader.loadClass("OLMain"); + instanceOfClass1 = classToTest1.getDeclaredConstructor().newInstance(); + } + + @Test + public void testOLClassName() { + assertEquals("OL", classToTest.getName()); + } + + @Test + public void testmInt() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { + Method m = classToTest.getDeclaredMethod("m", Integer.class); + Integer result = (Integer) m.invoke(instanceOfClass, 5); + assertEquals(Integer.valueOf(10), result); + } + + @Test + public void testmDouble() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { + Method m = classToTest.getDeclaredMethod("m", Double.class); + Double result = (Double) m.invoke(instanceOfClass, 5.0); + assertEquals(Double.valueOf(10.0), result); + } + + @Test + public void testmString() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { + Method m = classToTest.getDeclaredMethod("m", String.class); + String result = (String) m.invoke(instanceOfClass, "xxx"); + assertEquals("xxxxxx", result); + } + + @Test + public void testOLMainClassName() { + assertEquals("OLMain", classToTest1.getName()); + } + + @Test + public void testmainInt() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { + Method main = classToTest1.getDeclaredMethod("main", Integer.class); + Integer result = (Integer) main.invoke(instanceOfClass1, 5); + assertEquals(Integer.valueOf(10), result); + } + + @Test + public void testmainDouble() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { + Method main = classToTest1.getDeclaredMethod("main", Double.class); + Double result = (Double) main.invoke(instanceOfClass1, 5.0); + assertEquals(Double.valueOf(10.0), result); + } + + @Test + public void testmainString() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { + Method main = classToTest1.getDeclaredMethod("main", String.class); + String result = (String) main.invoke(instanceOfClass1, "xxx"); + assertEquals("xxxxxx", result); + } +} diff --git a/src/test/java/bytecode/OpTest.java b/src/test/java/bytecode/OpTest.java new file mode 100644 index 00000000..c2aed4f6 --- /dev/null +++ b/src/test/java/bytecode/OpTest.java @@ -0,0 +1,61 @@ +package bytecode; + +import static org.junit.Assert.*; + +import java.io.File; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.net.URL; +import java.net.URLClassLoader; + +import org.junit.BeforeClass; +import org.junit.Test; +import org.objectweb.asm.Opcodes; + +import de.dhbwstuttgart.core.JavaTXCompiler; + +public class OpTest { + private static String path; + private static File fileToTest; + private static JavaTXCompiler compiler; + private static ClassLoader loader; + private static Class classToTest; + private static String pathToClassFile; + private static Object instanceOfClass; + + @BeforeClass + public static void setUpBeforeClass() throws Exception { + path = System.getProperty("user.dir")+"/src/test/resources/javFiles/bytecode/Op.jav"; + fileToTest = new File(path); + compiler = new JavaTXCompiler(fileToTest); + pathToClassFile = System.getProperty("user.dir")+"/src/test/resources/testBytecode/generatedBC/"; + compiler.generateBytecode(pathToClassFile); + loader = new URLClassLoader(new URL[] {new URL("file://"+pathToClassFile)}); + classToTest = loader.loadClass("Op"); + instanceOfClass = classToTest.getDeclaredConstructor().newInstance(); + } + + @Test + public void testAddString() throws NoSuchMethodException, SecurityException, IllegalAccessException, + IllegalArgumentException, InvocationTargetException, InstantiationException { + + Method m = classToTest.getDeclaredMethod("m", String.class,String.class); + + String result = (String) m.invoke(instanceOfClass, "Byte","Code"); + + assertEquals("ByteCode", result); + } + + @Test + public void testAddInt() throws NoSuchMethodException, SecurityException, IllegalAccessException, + IllegalArgumentException, InvocationTargetException, InstantiationException { + + Method m = classToTest.getDeclaredMethod("m", Integer.class,Integer.class); + + Integer result = (Integer) m.invoke(instanceOfClass, 7,3); + + assertEquals(Integer.valueOf(10), result); + } + + +} diff --git a/test/bytecode/OverloadingSortingTest.java b/src/test/java/bytecode/OverloadingSortingTest.java similarity index 90% rename from test/bytecode/OverloadingSortingTest.java rename to src/test/java/bytecode/OverloadingSortingTest.java index c6df11cd..bec86b4a 100644 --- a/test/bytecode/OverloadingSortingTest.java +++ b/src/test/java/bytecode/OverloadingSortingTest.java @@ -26,10 +26,10 @@ public class OverloadingSortingTest { @Test public void generateBC() throws Exception { - path = System.getProperty("user.dir")+"/test/bytecode/javFiles/Sorting.jav"; + path = System.getProperty("user.dir")+"/src/test/resources/javFiles/Sorting.jav"; fileToTest = new File(path); compiler = new JavaTXCompiler(fileToTest); - pathToClassFile = System.getProperty("user.dir")+"/testBytecode/generatedBC/"; + pathToClassFile = System.getProperty("user.dir")+"/src/test/resources/testBytecode/generatedBC/"; compiler.generateBytecode(pathToClassFile); // loader = new URLClassLoader(new URL[] {new URL("file://"+pathToClassFile)}); // classToTest = loader.loadClass("Sorting"); diff --git a/src/test/java/bytecode/OverloadingTest.java b/src/test/java/bytecode/OverloadingTest.java new file mode 100644 index 00000000..be5a5a4d --- /dev/null +++ b/src/test/java/bytecode/OverloadingTest.java @@ -0,0 +1,57 @@ +package bytecode; + +import static org.junit.Assert.*; + +import java.io.File; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.net.URL; +import java.net.URLClassLoader; + +import org.junit.BeforeClass; +import org.junit.Test; + +import de.dhbwstuttgart.core.JavaTXCompiler; + +public class OverloadingTest { + private static String path; + private static File fileToTest; + private static JavaTXCompiler compiler; + private static ClassLoader loader; + private static Class classToTest; + private static String pathToClassFile; + private static Object instanceOfClass; + + private static Class classOL2; + private static Object instanceOfClassOL2; + + @BeforeClass + public static void setUpBeforeClass() throws Exception { + path = System.getProperty("user.dir")+"/src/test/resources/javFiles/bytecode/Overloading.jav"; + fileToTest = new File(path); + compiler = new JavaTXCompiler(fileToTest); + pathToClassFile = System.getProperty("user.dir")+"/src/test/resources/testBytecode/generatedBC/"; + compiler.generateBytecode(pathToClassFile); + loader = new URLClassLoader(new URL[] {new URL("file://"+pathToClassFile)}); + classToTest = loader.loadClass("Overloading"); + instanceOfClass = classToTest.getDeclaredConstructor().newInstance(); + + classOL2 = loader.loadClass("Overloading2"); + instanceOfClassOL2 = classOL2.getDeclaredConstructor().newInstance(); + } + + @Test + public void test() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { + Method meth = classToTest.getDeclaredMethod("test", classToTest); + String res = (String) meth.invoke(instanceOfClass, instanceOfClass); + assertEquals("Overloading", res); + } + + @Test + public void test2() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { + Method meth = classToTest.getDeclaredMethod("test", classOL2); + String res = (String) meth.invoke(instanceOfClass, instanceOfClassOL2); + assertEquals("Overloading2", res); + } + +} diff --git a/src/test/java/bytecode/PlusTest.java b/src/test/java/bytecode/PlusTest.java new file mode 100644 index 00000000..eeaa8d18 --- /dev/null +++ b/src/test/java/bytecode/PlusTest.java @@ -0,0 +1,53 @@ +package bytecode; + +import static org.junit.Assert.*; + +import java.io.File; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.net.URL; +import java.net.URLClassLoader; + +import org.junit.BeforeClass; +import org.junit.Test; + +import de.dhbwstuttgart.core.JavaTXCompiler; + +public class PlusTest { + private static String path; + private static File fileToTest; + private static JavaTXCompiler compiler; + private static ClassLoader loader; + private static Class classToTest; + private static String pathToClassFile; + private static Object instanceOfClass; + + @BeforeClass + public static void setUpBeforeClass() throws Exception { + path = System.getProperty("user.dir")+"/src/test/resources/javFiles/bytecode/Plus.jav"; + fileToTest = new File(path); + compiler = new JavaTXCompiler(fileToTest); + pathToClassFile = System.getProperty("user.dir")+"/src/test/resources/testBytecode/generatedBC/"; + compiler.generateBytecode(pathToClassFile); + loader = new URLClassLoader(new URL[] {new URL("file://"+pathToClassFile)}); + classToTest = loader.loadClass("Plus"); + instanceOfClass = classToTest.getDeclaredConstructor().newInstance(); + } + + @Test + public void testAddInt() throws NoSuchMethodException, SecurityException, IllegalAccessException, + IllegalArgumentException, InvocationTargetException, InstantiationException { + Method addInt = classToTest.getDeclaredMethod("m", Integer.class,Integer.class); + Number result = (Number) addInt.invoke(instanceOfClass, 7,3); + assertEquals(10, result); + } + + @Test + public void testAddString() throws NoSuchMethodException, SecurityException, IllegalAccessException, + IllegalArgumentException, InvocationTargetException, InstantiationException { + Method addString = classToTest.getDeclaredMethod("m", String.class,String.class); + String result = (String) addString.invoke(instanceOfClass, "Byte","Code"); + assertEquals("ByteCode", result); + } + +} diff --git a/src/test/java/bytecode/PostIncTest.java b/src/test/java/bytecode/PostIncTest.java new file mode 100644 index 00000000..10535d46 --- /dev/null +++ b/src/test/java/bytecode/PostIncTest.java @@ -0,0 +1,65 @@ +package bytecode; + +import static org.junit.Assert.*; + +import java.io.File; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.net.URL; +import java.net.URLClassLoader; + +import org.junit.BeforeClass; +import org.junit.Test; + +import de.dhbwstuttgart.core.JavaTXCompiler; + +public class PostIncTest { + private static String path; + private static File fileToTest; + private static JavaTXCompiler compiler; + private static ClassLoader loader; + private static Class classToTest; + private static String pathToClassFile; + private static Object instanceOfClass; + + @BeforeClass + public static void setUpBeforeClass() throws Exception { + path = System.getProperty("user.dir")+"/src/test/resources/javFiles/bytecode/PostIncDec.jav"; + fileToTest = new File(path); + compiler = new JavaTXCompiler(fileToTest); + pathToClassFile = System.getProperty("user.dir")+"/src/test/resources/testBytecode/generatedBC/"; + compiler.generateBytecode(pathToClassFile); + loader = new URLClassLoader(new URL[] {new URL("file://"+pathToClassFile)}); + classToTest = loader.loadClass("PostIncDec"); + instanceOfClass = classToTest.getDeclaredConstructor().newInstance(); + } + + @Test + public void testM1() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { + Method m = classToTest.getDeclaredMethod("m"); + Integer res = (Integer) m.invoke(instanceOfClass); + assertEquals(Integer.valueOf(1), res); + } + + @Test + public void testM2() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { + Method m = classToTest.getDeclaredMethod("m2"); + Integer res = (Integer) m.invoke(instanceOfClass); + assertEquals(Integer.valueOf(0), res); + } + + @Test + public void testD1() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { + Method m = classToTest.getDeclaredMethod("d"); + Integer res = (Integer) m.invoke(instanceOfClass); + assertEquals(Integer.valueOf(-1), res); + } + + @Test + public void testD2() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { + Method m = classToTest.getDeclaredMethod("d2"); + Integer res = (Integer) m.invoke(instanceOfClass); + assertEquals(Integer.valueOf(0), res); + } + +} diff --git a/src/test/java/bytecode/PreIncTest.java b/src/test/java/bytecode/PreIncTest.java new file mode 100644 index 00000000..e6e3502d --- /dev/null +++ b/src/test/java/bytecode/PreIncTest.java @@ -0,0 +1,65 @@ +package bytecode; + +import static org.junit.Assert.*; + +import java.io.File; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.net.URL; +import java.net.URLClassLoader; + +import org.junit.BeforeClass; +import org.junit.Test; + +import de.dhbwstuttgart.core.JavaTXCompiler; + +public class PreIncTest { + private static String path; + private static File fileToTest; + private static JavaTXCompiler compiler; + private static ClassLoader loader; + private static Class classToTest; + private static String pathToClassFile; + private static Object instanceOfClass; + + @BeforeClass + public static void setUpBeforeClass() throws Exception { + path = System.getProperty("user.dir")+"/src/test/resources/javFiles/bytecode/PreInc.jav"; + fileToTest = new File(path); + compiler = new JavaTXCompiler(fileToTest); + pathToClassFile = System.getProperty("user.dir")+"/src/test/resources/testBytecode/generatedBC/"; + compiler.generateBytecode(pathToClassFile); + loader = new URLClassLoader(new URL[] {new URL("file://" + pathToClassFile)}); + classToTest = loader.loadClass("PreInc"); + instanceOfClass = classToTest.getDeclaredConstructor().newInstance(); + } + + @Test + public void testM() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { + Method m = classToTest.getDeclaredMethod("m"); + Integer res = (Integer) m.invoke(instanceOfClass); + assertEquals(Integer.valueOf(1), res); + } + + @Test + public void testM2() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { + Method m = classToTest.getDeclaredMethod("m2"); + Integer res = (Integer) m.invoke(instanceOfClass); + assertEquals(Integer.valueOf(1), res); + } + + @Test + public void testD() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { + Method m = classToTest.getDeclaredMethod("d"); + Integer res = (Integer) m.invoke(instanceOfClass); + assertEquals(Integer.valueOf(-1), res); + } + + @Test + public void testD2() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { + Method m = classToTest.getDeclaredMethod("d2"); + Integer res = (Integer) m.invoke(instanceOfClass); + assertEquals(Integer.valueOf(-1), res); + } + +} diff --git a/src/test/java/bytecode/RelOpsTest.java b/src/test/java/bytecode/RelOpsTest.java new file mode 100644 index 00000000..a2cfbba0 --- /dev/null +++ b/src/test/java/bytecode/RelOpsTest.java @@ -0,0 +1,44 @@ +package bytecode; + +import static org.junit.Assert.*; + +import java.io.File; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.net.URL; +import java.net.URLClassLoader; + +import org.junit.BeforeClass; +import org.junit.Test; + +import de.dhbwstuttgart.core.JavaTXCompiler; + +public class RelOpsTest { + private static String path; + private static File fileToTest; + private static JavaTXCompiler compiler; + private static ClassLoader loader; + private static Class classToTest; + private static String pathToClassFile; + private static Object instanceOfClass; + + @BeforeClass + public static void setUpBeforeClass() throws Exception { + path = System.getProperty("user.dir")+"/src/test/resources/javFiles/bytecode/RelOps.jav"; + fileToTest = new File(path); + compiler = new JavaTXCompiler(fileToTest); + pathToClassFile = System.getProperty("user.dir")+"/src/test/resources/testBytecode/generatedBC/"; + compiler.generateBytecode(pathToClassFile); + loader = new URLClassLoader(new URL[] {new URL("file://"+pathToClassFile)}); + classToTest = loader.loadClass("RelOps"); + instanceOfClass = classToTest.getDeclaredConstructor().newInstance(); + } + + @Test + public void test() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { + Method m = classToTest.getDeclaredMethod("m", Integer.class,Integer.class); + Boolean result = (Boolean) m.invoke(instanceOfClass, 7,3); + assertFalse(result); + } + +} diff --git a/test/bytecode/SortingTest.java b/src/test/java/bytecode/SortingTest.java similarity index 81% rename from test/bytecode/SortingTest.java rename to src/test/java/bytecode/SortingTest.java index 2704fc68..16fbde55 100644 --- a/test/bytecode/SortingTest.java +++ b/src/test/java/bytecode/SortingTest.java @@ -23,11 +23,11 @@ public class SortingTest { @Test public void generateBC() throws Exception { - path = System.getProperty("user.dir")+"/test/bytecode/javFiles/Sorting.jav"; + path = System.getProperty("user.dir")+"/src/test/resources/javFiles/Sorting.jav"; fileToTest = new File(path); compiler = new JavaTXCompiler(fileToTest); - compiler.generateBytecode(System.getProperty("user.dir")+"/testBytecode/generatedBC/"); - pathToClassFile = System.getProperty("user.dir")+"/testBytecode/generatedBC/"; + compiler.generateBytecode(System.getProperty("user.dir")+"/src/test/resources/testBytecode/generatedBC/"); + pathToClassFile = System.getProperty("user.dir")+"/src/test/resources/testBytecode/generatedBC/"; loader = new URLClassLoader(new URL[] {new URL("file://"+pathToClassFile)}); classToTest = loader.loadClass("Sorting"); /* diff --git a/src/test/java/bytecode/SubMatTest.java b/src/test/java/bytecode/SubMatTest.java new file mode 100644 index 00000000..c7018e7c --- /dev/null +++ b/src/test/java/bytecode/SubMatTest.java @@ -0,0 +1,27 @@ +package bytecode; + +import static org.junit.Assert.*; + +import java.io.File; +import java.io.IOException; + +import org.junit.Test; + +import de.dhbwstuttgart.core.JavaTXCompiler; + +public class SubMatTest { + private static String path; + private static File fileToTest; + private static JavaTXCompiler compiler; + private static String pathToClassFile; + + @Test + public void test() throws ClassNotFoundException, IOException { + path = System.getProperty("user.dir")+"/src/test/resources/javFiles/bytecode/SubMatrix.jav"; + fileToTest = new File(path); + compiler = new JavaTXCompiler(fileToTest); + pathToClassFile = System.getProperty("user.dir")+"/src/test/resources/testBytecode/generatedBC/"; + compiler.generateBytecode(pathToClassFile); + } + +} diff --git a/src/test/java/bytecode/Tph2Test.java b/src/test/java/bytecode/Tph2Test.java new file mode 100644 index 00000000..8ecb31b1 --- /dev/null +++ b/src/test/java/bytecode/Tph2Test.java @@ -0,0 +1,69 @@ +package bytecode; + +import static org.junit.Assert.*; + +import java.io.File; +import java.lang.reflect.Method; +import java.net.URL; +import java.net.URLClassLoader; + +import org.junit.BeforeClass; +import org.junit.Test; + +import de.dhbwstuttgart.core.JavaTXCompiler; + +public class Tph2Test { + + private static String path; + private static File fileToTest; + private static JavaTXCompiler compiler; + private static ClassLoader loader; + private static Class classToTest; + private static String pathToClassFile; + private static Object instanceOfClass; + + @BeforeClass + public static void setUpBeforeClass() throws Exception { + path = System.getProperty("user.dir")+"/src/test/resources/javFiles/bytecode/Tph2.jav"; + fileToTest = new File(path); + compiler = new JavaTXCompiler(fileToTest); + pathToClassFile = System.getProperty("user.dir")+"/src/test/resources/testBytecode/generatedBC/"; + compiler.generateBytecode(pathToClassFile); + loader = new URLClassLoader(new URL[] {new URL("file://"+pathToClassFile)}); + classToTest = loader.loadClass("Tph2"); + instanceOfClass = classToTest.getDeclaredConstructor().newInstance(); + } + + @Test + public void test1() throws Exception { + Method m = classToTest.getDeclaredMethod("m", Object.class, Object.class); + Object result = m.invoke(instanceOfClass, 1,2); + + assertEquals(1,result); + } + + @Test + public void test2() throws Exception { + Method m = classToTest.getDeclaredMethod("m", Object.class, Object.class); + Object result = m.invoke(instanceOfClass, "sss",2); + + assertEquals("sss",result); + } + + @Test + public void test3() throws Exception { + Method m = classToTest.getDeclaredMethod("m2", Object.class, Object.class); + Object result = m.invoke(instanceOfClass, 1,2); + + assertEquals(2,result); + } + + @Test + public void test4() throws Exception { + Method m = classToTest.getDeclaredMethod("m2", Object.class, Object.class); + Object result = m.invoke(instanceOfClass, 1,"xxx"); + + assertEquals("xxx",result); + } + +} diff --git a/src/test/java/bytecode/Tph3Test.java b/src/test/java/bytecode/Tph3Test.java new file mode 100644 index 00000000..dc856935 --- /dev/null +++ b/src/test/java/bytecode/Tph3Test.java @@ -0,0 +1,31 @@ +package bytecode; + +import static org.junit.Assert.*; + +import java.io.File; +import java.lang.reflect.Method; +import java.net.URL; +import java.net.URLClassLoader; + +import org.junit.BeforeClass; +import org.junit.Test; + +import de.dhbwstuttgart.core.JavaTXCompiler; + +public class Tph3Test { + + private static String path; + private static File fileToTest; + private static JavaTXCompiler compiler; + private static String pathToClassFile; + + @Test + public void generateBC() throws Exception { + path = System.getProperty("user.dir")+"/src/test/resources/javFiles/bytecode/Tph3.jav"; + fileToTest = new File(path); + compiler = new JavaTXCompiler(fileToTest); + pathToClassFile = System.getProperty("user.dir")+"/src/test/resources/testBytecode/generatedBC/"; + compiler.generateBytecode(pathToClassFile); + } + +} diff --git a/src/test/java/bytecode/Tph5Test.java b/src/test/java/bytecode/Tph5Test.java new file mode 100644 index 00000000..0bee721d --- /dev/null +++ b/src/test/java/bytecode/Tph5Test.java @@ -0,0 +1,45 @@ +package bytecode; + +import static org.junit.Assert.*; + +import java.io.File; +import java.lang.reflect.Method; +import java.net.URL; +import java.net.URLClassLoader; + +import org.junit.BeforeClass; +import org.junit.Test; + +import de.dhbwstuttgart.core.JavaTXCompiler; + +public class Tph5Test { + + private static String path; + private static File fileToTest; + private static JavaTXCompiler compiler; + private static ClassLoader loader; + private static Class classToTest; + private static String pathToClassFile; + private static Object instanceOfClass; + + @BeforeClass + public static void setUpBeforeClass() throws Exception { + path = System.getProperty("user.dir")+"/src/test/resources/javFiles/bytecode/Tph5.jav"; + fileToTest = new File(path); + compiler = new JavaTXCompiler(fileToTest); + pathToClassFile = System.getProperty("user.dir")+"/src/test/resources/testBytecode/generatedBC/"; + compiler.generateBytecode(pathToClassFile); + loader = new URLClassLoader(new URL[] {new URL("file://"+pathToClassFile)}); + classToTest = loader.loadClass("Tph5"); + instanceOfClass = classToTest.getDeclaredConstructor().newInstance(); + } + + @Test + public void test() throws Exception { +// Method m = classToTest.getDeclaredMethod("m", Object.class, Object.class, Object.class); + Method m = classToTest.getDeclaredMethod("m", Object.class, Object.class); +// Object result = m.invoke(instanceOfClass, "xx",2,3); + + //assertEquals(2,result); + } +} diff --git a/src/test/java/bytecode/TphTest.java b/src/test/java/bytecode/TphTest.java new file mode 100644 index 00000000..9b8144a5 --- /dev/null +++ b/src/test/java/bytecode/TphTest.java @@ -0,0 +1,69 @@ +package bytecode; + +import static org.junit.Assert.*; + +import java.io.File; +import java.lang.reflect.Method; +import java.net.URL; +import java.net.URLClassLoader; + +import org.junit.BeforeClass; +import org.junit.Test; + +import de.dhbwstuttgart.core.JavaTXCompiler; + +public class TphTest { + + private static String path; + private static File fileToTest; + private static JavaTXCompiler compiler; + private static ClassLoader loader; + private static Class classToTest; + private static String pathToClassFile; + private static Object instanceOfClass; + + @BeforeClass + public static void setUpBeforeClass() throws Exception { + path = System.getProperty("user.dir")+"/src/test/resources/javFiles/bytecode/Tph.jav"; + fileToTest = new File(path); + compiler = new JavaTXCompiler(fileToTest); + pathToClassFile = System.getProperty("user.dir")+"/src/test/resources/testBytecode/generatedBC/"; + compiler.generateBytecode(pathToClassFile); + loader = new URLClassLoader(new URL[] {new URL("file://"+pathToClassFile)}); + classToTest = loader.loadClass("Tph"); + instanceOfClass = classToTest.getDeclaredConstructor().newInstance(); + } + + @Test + public void test1() throws Exception { + Method m = classToTest.getDeclaredMethod("m", Object.class, Object.class); + Object result = m.invoke(instanceOfClass, 1,2); + + assertEquals(2,result); + } + + @Test + public void test2() throws Exception { + Method m = classToTest.getDeclaredMethod("m", Object.class, Object.class); + Object result = m.invoke(instanceOfClass, 1, "sss"); + + assertEquals("sss",result); + } + + @Test + public void test3() throws Exception { + Method m = classToTest.getDeclaredMethod("m2", Object.class); + Object result = m.invoke(instanceOfClass, 2); + + assertEquals(2,result); + } + + @Test + public void test4() throws Exception { + Method m = classToTest.getDeclaredMethod("m2", Object.class); + Object result = m.invoke(instanceOfClass,"xxx"); + + assertEquals("xxx",result); + } + +} diff --git a/src/test/java/bytecode/WhileTest.java b/src/test/java/bytecode/WhileTest.java new file mode 100644 index 00000000..6cc96d58 --- /dev/null +++ b/src/test/java/bytecode/WhileTest.java @@ -0,0 +1,58 @@ +package bytecode; + +import static org.junit.Assert.*; + +import java.io.File; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.net.URL; +import java.net.URLClassLoader; + +import org.junit.BeforeClass; +import org.junit.Test; + +import de.dhbwstuttgart.core.JavaTXCompiler; + +public class WhileTest { + private static String path; + private static File fileToTest; + private static JavaTXCompiler compiler; + private static ClassLoader loader; + private static Class classToTest; + private static String pathToClassFile; + private static Object instanceOfClass; + + @BeforeClass + public static void setUpBeforeClass() throws Exception { + path = System.getProperty("user.dir")+"/src/test/resources/javFiles/bytecode/While.jav"; + fileToTest = new File(path); + compiler = new JavaTXCompiler(fileToTest); + pathToClassFile = System.getProperty("user.dir")+"/src/test/resources/testBytecode/generatedBC/"; + compiler.generateBytecode(pathToClassFile); + loader = new URLClassLoader(new URL[] {new URL("file://"+pathToClassFile)}); + classToTest = loader.loadClass("While"); + instanceOfClass = classToTest.getDeclaredConstructor().newInstance(); + } + + @Test + public void test() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { + Method m = classToTest.getDeclaredMethod("m", Integer.class); + Integer result = (Integer) m.invoke(instanceOfClass, 0); + assertEquals(Integer.valueOf(2), result); + } + + @Test + public void testDouble() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { + Method m = classToTest.getDeclaredMethod("m", Double.class); + Double result = (Double) m.invoke(instanceOfClass, 0.0); + assertEquals(Double.valueOf(2.0), result); + } + + @Test + public void testLong() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { + Method m = classToTest.getDeclaredMethod("m", Long.class); + Long result = (Long) m.invoke(instanceOfClass, 0l); + assertEquals(Long.valueOf(2l), result); + } + +} diff --git a/src/test/java/bytecode/YTest.java b/src/test/java/bytecode/YTest.java new file mode 100644 index 00000000..160a0b07 --- /dev/null +++ b/src/test/java/bytecode/YTest.java @@ -0,0 +1,54 @@ +package bytecode; + +import static org.junit.Assert.assertEquals; + +import java.io.File; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.net.URL; +import java.net.URLClassLoader; + +import org.junit.Ignore; +import org.junit.Test; + +import de.dhbwstuttgart.core.JavaTXCompiler; + +public class YTest { + private static String path; + private static File fileToTest; + private static JavaTXCompiler compiler; + private static ClassLoader loader; + private static Class classToTest; + private static String pathToClassFile; + private static Object instanceOfClass; + + @Test + @Ignore + public void generateBC() throws Exception { + path = System.getProperty("user.dir")+"/src/test/resources/javFiles/bytecode/Y.jav"; + fileToTest = new File(path); + compiler = new JavaTXCompiler(fileToTest); + compiler.generateBytecode(System.getProperty("user.dir")+"/src/test/resources/testBytecode/generatedBC/"); + pathToClassFile = System.getProperty("user.dir")+"/src/test/resources/testBytecode/generatedBC/"; + loader = new URLClassLoader(new URL[] {new URL("file://"+pathToClassFile)}); + classToTest = loader.loadClass("Y"); + /* + instanceOfClass = classToTest.getDeclaredConstructor().newInstance(); + + Method m = classToTest.getDeclaredMethod("m"); + Class lambda = m.invoke(instanceOfClass).getClass(); + Method apply = lambda.getMethod("apply", Object.class); + + // Damit man auf die Methode zugreifen kann + apply.setAccessible(true); + + Integer i = 77; + + Integer result = (Integer) apply.invoke(m.invoke(instanceOfClass), i); + + assertEquals(77, result); + */ + } + + +} diff --git a/src/test/java/bytecode/applyLambdaTest.java b/src/test/java/bytecode/applyLambdaTest.java new file mode 100644 index 00000000..ec0b6f57 --- /dev/null +++ b/src/test/java/bytecode/applyLambdaTest.java @@ -0,0 +1,39 @@ +package bytecode; + +import static org.junit.Assert.assertEquals; + +import java.io.File; +import java.lang.reflect.Method; +import java.net.URL; +import java.net.URLClassLoader; + +import org.junit.Test; + +import de.dhbwstuttgart.core.JavaTXCompiler; + +public class applyLambdaTest { + private static String path; + private static File fileToTest; + private static JavaTXCompiler compiler; + private static ClassLoader loader; + private static Class classToTest; + private static String pathToClassFile; + private static Object instanceOfClass; + + @Test + public void generateBC() throws Exception { + path = System.getProperty("user.dir")+"/src/test/resources/javFiles/bytecode/applyLambda.jav"; + fileToTest = new File(path); + compiler = new JavaTXCompiler(fileToTest); + compiler.generateBytecode(System.getProperty("user.dir")+"/src/test/resources/testBytecode/generatedBC/"); + pathToClassFile = System.getProperty("user.dir")+"/src/test/resources/testBytecode/generatedBC/"; + loader = new URLClassLoader(new URL[] {new URL("file://"+pathToClassFile)}); + classToTest = loader.loadClass("applyLambda"); + instanceOfClass = classToTest.getDeclaredConstructor().newInstance(); + + Method m = classToTest.getDeclaredMethod("m"); + Object result = m.invoke(instanceOfClass); + + assertEquals(result.getClass(), loader.loadClass("Apply")); + } +} diff --git a/test/finiteClosure/SuperInterfacesTest.java b/src/test/java/finiteClosure/SuperInterfacesTest.java similarity index 100% rename from test/finiteClosure/SuperInterfacesTest.java rename to src/test/java/finiteClosure/SuperInterfacesTest.java diff --git a/test/logFiles/.gitignore b/src/test/java/logFiles/.gitignore similarity index 100% rename from test/logFiles/.gitignore rename to src/test/java/logFiles/.gitignore diff --git a/src/test/java/parser/GeneralParserTest.java b/src/test/java/parser/GeneralParserTest.java new file mode 100644 index 00000000..f7180a74 --- /dev/null +++ b/src/test/java/parser/GeneralParserTest.java @@ -0,0 +1,55 @@ +package parser; + +import static org.junit.Assert.*; + +import java.io.File; +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Collectors; + +import de.dhbwstuttgart.core.JavaTXCompiler; +import de.dhbwstuttgart.parser.JavaTXParser; + +import org.junit.Test; + + +/** + * Dieser Test pr�ft nur, ob .java-Dateien fehlerfrei geparst werden. + * Der dabei erstellte Syntaxbaum wird nicht kontrolliert. + * @author janulrich + * + */ +public class GeneralParserTest{ + private static final String rootDirectory = System.getProperty("user.dir")+"/src/test/resources/javFiles/parser/"; + + @Test + public void run(){ + + + List filenames = new ArrayList(); + /* + filenames.add("NewTest.jav"); + filenames.add("FieldInitializationTest.jav"); + filenames.add("ImportTest.jav"); + filenames.add("CastTest.jav"); + filenames.add("StatementsTest.jav"); + //filenames.add("Methods.jav"); + filenames.add("ImportTestGeneric.jav"); + filenames.add("CastTest.jav"); + //filenames.add("BoundedParameter.jav"); + //filenames.add("GenericFieldVarTest.jav"); + filenames.add("FieldVarTest.jav"); + filenames.add("StructuralTypes.jav"); + */ +// filenames.add("ExtendsTest.jav"); + filenames.add("PackageNameTest.jav"); + try{ + new JavaTXCompiler(filenames.stream().map(s -> new File(rootDirectory + s)).collect(Collectors.toList())); + }catch(Exception exc){ + exc.printStackTrace(); + fail(); + } + assertTrue("Tests durchlaufen",filenames.size()>0); + } + +} diff --git a/test/typeinference/JavaTXCompilerTest.java b/src/test/java/typeinference/JavaTXCompilerTest.java similarity index 99% rename from test/typeinference/JavaTXCompilerTest.java rename to src/test/java/typeinference/JavaTXCompilerTest.java index 233e8b24..26f5db09 100644 --- a/test/typeinference/JavaTXCompilerTest.java +++ b/src/test/java/typeinference/JavaTXCompilerTest.java @@ -22,7 +22,7 @@ import java.util.Set; public class JavaTXCompilerTest { - public static final String rootDirectory = System.getProperty("user.dir")+"/test/javFiles/"; + public static final String rootDirectory = System.getProperty("user.dir")+"/src/test/resources/javFiles/"; @Test public void finiteClosure() throws IOException, ClassNotFoundException { execute(new File(rootDirectory+"fc.jav")); diff --git a/test/typeinference/Meth_GenTest.java b/src/test/java/typeinference/Meth_GenTest.java similarity index 99% rename from test/typeinference/Meth_GenTest.java rename to src/test/java/typeinference/Meth_GenTest.java index f5e64f9f..d879408c 100644 --- a/test/typeinference/Meth_GenTest.java +++ b/src/test/java/typeinference/Meth_GenTest.java @@ -22,7 +22,7 @@ import java.util.Set; public class Meth_GenTest { - public static final String rootDirectory = System.getProperty("user.dir")+"/test/javFiles/"; + public static final String rootDirectory = System.getProperty("user.dir")+"/src/test/resources/javFiles/"; /* @Test public void finiteClosure() throws IOException, ClassNotFoundException { diff --git a/test/typeinference/UnifyTest.java b/src/test/java/typeinference/UnifyTest.java similarity index 96% rename from test/typeinference/UnifyTest.java rename to src/test/java/typeinference/UnifyTest.java index f8b6ec2e..dd352f85 100644 --- a/test/typeinference/UnifyTest.java +++ b/src/test/java/typeinference/UnifyTest.java @@ -22,7 +22,7 @@ import java.util.Set; public class UnifyTest { - public static final String rootDirectory = System.getProperty("user.dir")+"/test/javFiles/"; + public static final String rootDirectory = System.getProperty("user.dir")+"/src/test/resources/javFiles/"; /* @Test public void finiteClosure() throws IOException, ClassNotFoundException { @@ -53,12 +53,12 @@ public class UnifyTest { public void lambda3() throws IOException, ClassNotFoundException { execute(new File(rootDirectory+"Lambda3.jav")); } - + @Test public void lambdafield() throws IOException, ClassNotFoundException { execute(new File(rootDirectory+"LambdaField.jav")); } - + @Test public void mathStruc() throws IOException, ClassNotFoundException { execute(new File(rootDirectory+"mathStruc.jav")); @@ -80,16 +80,16 @@ public class UnifyTest { execute(new File(rootDirectory+"FacultyTyped.jav")); } */ - + @Test public void matrix() throws IOException, ClassNotFoundException { execute(new File(rootDirectory+"Matrix.jav")); - //JavaTXCompiler compiler = new JavaTXCompiler(new File(rootDirectory+"Matrix.jav")); - //compiler.generateBytecode(); + //JavaTXCompiler compiler = new JavaTXCompiler(new File(rootDirectory+"Matrix.jav")); + //compiler.generateBytecode(); } - -/* + +/* @Test public void vector() throws IOException, ClassNotFoundException { execute(new File(rootDirectory+"Vector.jav")); diff --git a/test/visualisation/ToString.java b/src/test/java/visualisation/ToString.java similarity index 100% rename from test/visualisation/ToString.java rename to src/test/java/visualisation/ToString.java diff --git a/test/javFiles/AddLong.jav b/src/test/resources/javFiles/AddLong.jav similarity index 100% rename from test/javFiles/AddLong.jav rename to src/test/resources/javFiles/AddLong.jav diff --git a/test/javFiles/EmptyClass.jav b/src/test/resources/javFiles/EmptyClass.jav similarity index 100% rename from test/javFiles/EmptyClass.jav rename to src/test/resources/javFiles/EmptyClass.jav diff --git a/test/javFiles/EmptyMethod.jav b/src/test/resources/javFiles/EmptyMethod.jav similarity index 100% rename from test/javFiles/EmptyMethod.jav rename to src/test/resources/javFiles/EmptyMethod.jav diff --git a/test/javFiles/Expressions.jav b/src/test/resources/javFiles/Expressions.jav similarity index 100% rename from test/javFiles/Expressions.jav rename to src/test/resources/javFiles/Expressions.jav diff --git a/test/javFiles/FC_Matrix.jav b/src/test/resources/javFiles/FC_Matrix.jav similarity index 100% rename from test/javFiles/FC_Matrix.jav rename to src/test/resources/javFiles/FC_Matrix.jav diff --git a/test/javFiles/Faculty.jav b/src/test/resources/javFiles/Faculty.jav similarity index 100% rename from test/javFiles/Faculty.jav rename to src/test/resources/javFiles/Faculty.jav diff --git a/test/javFiles/FacultyIf.jav b/src/test/resources/javFiles/FacultyIf.jav similarity index 100% rename from test/javFiles/FacultyIf.jav rename to src/test/resources/javFiles/FacultyIf.jav diff --git a/test/javFiles/FacultyTyped.jav b/src/test/resources/javFiles/FacultyTyped.jav similarity index 100% rename from test/javFiles/FacultyTyped.jav rename to src/test/resources/javFiles/FacultyTyped.jav diff --git a/test/javFiles/Fields.jav b/src/test/resources/javFiles/Fields.jav similarity index 100% rename from test/javFiles/Fields.jav rename to src/test/resources/javFiles/Fields.jav diff --git a/test/javFiles/Generics.jav b/src/test/resources/javFiles/Generics.jav similarity index 100% rename from test/javFiles/Generics.jav rename to src/test/resources/javFiles/Generics.jav diff --git a/test/javFiles/IfTest.jav b/src/test/resources/javFiles/IfTest.jav similarity index 100% rename from test/javFiles/IfTest.jav rename to src/test/resources/javFiles/IfTest.jav diff --git a/test/javFiles/Import.jav b/src/test/resources/javFiles/Import.jav similarity index 100% rename from test/javFiles/Import.jav rename to src/test/resources/javFiles/Import.jav diff --git a/test/javFiles/Lambda.jav b/src/test/resources/javFiles/Lambda.jav similarity index 100% rename from test/javFiles/Lambda.jav rename to src/test/resources/javFiles/Lambda.jav diff --git a/test/javFiles/Lambda2.jav b/src/test/resources/javFiles/Lambda2.jav similarity index 100% rename from test/javFiles/Lambda2.jav rename to src/test/resources/javFiles/Lambda2.jav diff --git a/test/javFiles/Lambda3.jav b/src/test/resources/javFiles/Lambda3.jav similarity index 100% rename from test/javFiles/Lambda3.jav rename to src/test/resources/javFiles/Lambda3.jav diff --git a/test/javFiles/LambdaField.jav b/src/test/resources/javFiles/LambdaField.jav similarity index 100% rename from test/javFiles/LambdaField.jav rename to src/test/resources/javFiles/LambdaField.jav diff --git a/test/javFiles/LambdaRunnable.jav b/src/test/resources/javFiles/LambdaRunnable.jav similarity index 100% rename from test/javFiles/LambdaRunnable.jav rename to src/test/resources/javFiles/LambdaRunnable.jav diff --git a/test/javFiles/ListenerOverload.jav b/src/test/resources/javFiles/ListenerOverload.jav similarity index 100% rename from test/javFiles/ListenerOverload.jav rename to src/test/resources/javFiles/ListenerOverload.jav diff --git a/test/javFiles/Matrix.jav b/src/test/resources/javFiles/Matrix.jav similarity index 100% rename from test/javFiles/Matrix.jav rename to src/test/resources/javFiles/Matrix.jav diff --git a/test/javFiles/Meth_Gen.jav b/src/test/resources/javFiles/Meth_Gen.jav similarity index 100% rename from test/javFiles/Meth_Gen.jav rename to src/test/resources/javFiles/Meth_Gen.jav diff --git a/test/javFiles/MethodCallGenerics.jav b/src/test/resources/javFiles/MethodCallGenerics.jav similarity index 100% rename from test/javFiles/MethodCallGenerics.jav rename to src/test/resources/javFiles/MethodCallGenerics.jav diff --git a/test/javFiles/Methods.jav b/src/test/resources/javFiles/Methods.jav similarity index 100% rename from test/javFiles/Methods.jav rename to src/test/resources/javFiles/Methods.jav diff --git a/test/javFiles/MethodsEasy.jav b/src/test/resources/javFiles/MethodsEasy.jav similarity index 100% rename from test/javFiles/MethodsEasy.jav rename to src/test/resources/javFiles/MethodsEasy.jav diff --git a/test/javFiles/Op1.jav b/src/test/resources/javFiles/Op1.jav similarity index 100% rename from test/javFiles/Op1.jav rename to src/test/resources/javFiles/Op1.jav diff --git a/test/javFiles/Package.jav b/src/test/resources/javFiles/Package.jav similarity index 100% rename from test/javFiles/Package.jav rename to src/test/resources/javFiles/Package.jav diff --git a/test/javFiles/Sorting.jav b/src/test/resources/javFiles/Sorting.jav similarity index 100% rename from test/javFiles/Sorting.jav rename to src/test/resources/javFiles/Sorting.jav diff --git a/test/javFiles/Subclass.jav b/src/test/resources/javFiles/Subclass.jav similarity index 100% rename from test/javFiles/Subclass.jav rename to src/test/resources/javFiles/Subclass.jav diff --git a/test/javFiles/Superclass.jav b/src/test/resources/javFiles/Superclass.jav similarity index 100% rename from test/javFiles/Superclass.jav rename to src/test/resources/javFiles/Superclass.jav diff --git a/test/javFiles/Vector.jav b/src/test/resources/javFiles/Vector.jav similarity index 100% rename from test/javFiles/Vector.jav rename to src/test/resources/javFiles/Vector.jav diff --git a/test/bytecode/javFiles/AssignToLit.jav b/src/test/resources/javFiles/bytecode/AssignToLit.jav similarity index 100% rename from test/bytecode/javFiles/AssignToLit.jav rename to src/test/resources/javFiles/bytecode/AssignToLit.jav diff --git a/test/bytecode/javFiles/BinaryInMeth.jav b/src/test/resources/javFiles/bytecode/BinaryInMeth.jav similarity index 100% rename from test/bytecode/javFiles/BinaryInMeth.jav rename to src/test/resources/javFiles/bytecode/BinaryInMeth.jav diff --git a/test/bytecode/javFiles/DuMethod.jav b/src/test/resources/javFiles/bytecode/DuMethod.jav similarity index 100% rename from test/bytecode/javFiles/DuMethod.jav rename to src/test/resources/javFiles/bytecode/DuMethod.jav diff --git a/test/bytecode/javFiles/EmptyMethod.jav b/src/test/resources/javFiles/bytecode/EmptyMethod.jav similarity index 100% rename from test/bytecode/javFiles/EmptyMethod.jav rename to src/test/resources/javFiles/bytecode/EmptyMethod.jav diff --git a/test/bytecode/javFiles/Example.jav b/src/test/resources/javFiles/bytecode/Example.jav similarity index 100% rename from test/bytecode/javFiles/Example.jav rename to src/test/resources/javFiles/bytecode/Example.jav diff --git a/test/bytecode/javFiles/Exceptions.jav b/src/test/resources/javFiles/bytecode/Exceptions.jav similarity index 100% rename from test/bytecode/javFiles/Exceptions.jav rename to src/test/resources/javFiles/bytecode/Exceptions.jav diff --git a/test/bytecode/javFiles/Fac.jav b/src/test/resources/javFiles/bytecode/Fac.jav similarity index 100% rename from test/bytecode/javFiles/Fac.jav rename to src/test/resources/javFiles/bytecode/Fac.jav diff --git a/test/bytecode/javFiles/Faculty.jav b/src/test/resources/javFiles/bytecode/Faculty.jav similarity index 100% rename from test/bytecode/javFiles/Faculty.jav rename to src/test/resources/javFiles/bytecode/Faculty.jav diff --git a/test/bytecode/javFiles/Faculty2.jav b/src/test/resources/javFiles/bytecode/Faculty2.jav similarity index 100% rename from test/bytecode/javFiles/Faculty2.jav rename to src/test/resources/javFiles/bytecode/Faculty2.jav diff --git a/test/bytecode/javFiles/Field.jav b/src/test/resources/javFiles/bytecode/Field.jav similarity index 100% rename from test/bytecode/javFiles/Field.jav rename to src/test/resources/javFiles/bytecode/Field.jav diff --git a/test/bytecode/javFiles/For.jav b/src/test/resources/javFiles/bytecode/For.jav similarity index 100% rename from test/bytecode/javFiles/For.jav rename to src/test/resources/javFiles/bytecode/For.jav diff --git a/test/bytecode/javFiles/FunOL.jav b/src/test/resources/javFiles/bytecode/FunOL.jav similarity index 100% rename from test/bytecode/javFiles/FunOL.jav rename to src/test/resources/javFiles/bytecode/FunOL.jav diff --git a/test/bytecode/javFiles/Gen.jav b/src/test/resources/javFiles/bytecode/Gen.jav similarity index 100% rename from test/bytecode/javFiles/Gen.jav rename to src/test/resources/javFiles/bytecode/Gen.jav diff --git a/test/bytecode/javFiles/Generics.jav b/src/test/resources/javFiles/bytecode/Generics.jav similarity index 100% rename from test/bytecode/javFiles/Generics.jav rename to src/test/resources/javFiles/bytecode/Generics.jav diff --git a/test/bytecode/javFiles/Generics2.jav b/src/test/resources/javFiles/bytecode/Generics2.jav similarity index 100% rename from test/bytecode/javFiles/Generics2.jav rename to src/test/resources/javFiles/bytecode/Generics2.jav diff --git a/test/bytecode/javFiles/GreaterEqual.jav b/src/test/resources/javFiles/bytecode/GreaterEqual.jav similarity index 100% rename from test/bytecode/javFiles/GreaterEqual.jav rename to src/test/resources/javFiles/bytecode/GreaterEqual.jav diff --git a/test/bytecode/javFiles/GreaterThan.jav b/src/test/resources/javFiles/bytecode/GreaterThan.jav similarity index 100% rename from test/bytecode/javFiles/GreaterThan.jav rename to src/test/resources/javFiles/bytecode/GreaterThan.jav diff --git a/test/bytecode/javFiles/IfTest.jav b/src/test/resources/javFiles/bytecode/IfTest.jav similarity index 100% rename from test/bytecode/javFiles/IfTest.jav rename to src/test/resources/javFiles/bytecode/IfTest.jav diff --git a/test/bytecode/javFiles/Import.jav b/src/test/resources/javFiles/bytecode/Import.jav similarity index 100% rename from test/bytecode/javFiles/Import.jav rename to src/test/resources/javFiles/bytecode/Import.jav diff --git a/test/bytecode/javFiles/Interface1.jav b/src/test/resources/javFiles/bytecode/Interface1.jav similarity index 100% rename from test/bytecode/javFiles/Interface1.jav rename to src/test/resources/javFiles/bytecode/Interface1.jav diff --git a/test/bytecode/javFiles/LamRunnable.jav b/src/test/resources/javFiles/bytecode/LamRunnable.jav similarity index 100% rename from test/bytecode/javFiles/LamRunnable.jav rename to src/test/resources/javFiles/bytecode/LamRunnable.jav diff --git a/test/bytecode/javFiles/Lambda.jav b/src/test/resources/javFiles/bytecode/Lambda.jav similarity index 100% rename from test/bytecode/javFiles/Lambda.jav rename to src/test/resources/javFiles/bytecode/Lambda.jav diff --git a/test/bytecode/javFiles/Lambda2.jav b/src/test/resources/javFiles/bytecode/Lambda2.jav similarity index 100% rename from test/bytecode/javFiles/Lambda2.jav rename to src/test/resources/javFiles/bytecode/Lambda2.jav diff --git a/test/bytecode/javFiles/Lambda3.jav b/src/test/resources/javFiles/bytecode/Lambda3.jav similarity index 100% rename from test/bytecode/javFiles/Lambda3.jav rename to src/test/resources/javFiles/bytecode/Lambda3.jav diff --git a/test/bytecode/javFiles/Lambda4.jav b/src/test/resources/javFiles/bytecode/Lambda4.jav similarity index 100% rename from test/bytecode/javFiles/Lambda4.jav rename to src/test/resources/javFiles/bytecode/Lambda4.jav diff --git a/test/bytecode/javFiles/LambdaVoid.jav b/src/test/resources/javFiles/bytecode/LambdaVoid.jav similarity index 100% rename from test/bytecode/javFiles/LambdaVoid.jav rename to src/test/resources/javFiles/bytecode/LambdaVoid.jav diff --git a/test/bytecode/javFiles/LessEqual.jav b/src/test/resources/javFiles/bytecode/LessEqual.jav similarity index 100% rename from test/bytecode/javFiles/LessEqual.jav rename to src/test/resources/javFiles/bytecode/LessEqual.jav diff --git a/test/bytecode/javFiles/LessThan.jav b/src/test/resources/javFiles/bytecode/LessThan.jav similarity index 100% rename from test/bytecode/javFiles/LessThan.jav rename to src/test/resources/javFiles/bytecode/LessThan.jav diff --git a/test/bytecode/javFiles/Matrix.jav b/src/test/resources/javFiles/bytecode/Matrix.jav similarity index 100% rename from test/bytecode/javFiles/Matrix.jav rename to src/test/resources/javFiles/bytecode/Matrix.jav diff --git a/test/bytecode/javFiles/MatrixOP.jav b/src/test/resources/javFiles/bytecode/MatrixOP.jav similarity index 100% rename from test/bytecode/javFiles/MatrixOP.jav rename to src/test/resources/javFiles/bytecode/MatrixOP.jav diff --git a/test/bytecode/javFiles/Merge.jav b/src/test/resources/javFiles/bytecode/Merge.jav similarity index 100% rename from test/bytecode/javFiles/Merge.jav rename to src/test/resources/javFiles/bytecode/Merge.jav diff --git a/test/bytecode/javFiles/Methods.jav b/src/test/resources/javFiles/bytecode/Methods.jav similarity index 100% rename from test/bytecode/javFiles/Methods.jav rename to src/test/resources/javFiles/bytecode/Methods.jav diff --git a/test/bytecode/javFiles/OL.jav b/src/test/resources/javFiles/bytecode/OL.jav similarity index 100% rename from test/bytecode/javFiles/OL.jav rename to src/test/resources/javFiles/bytecode/OL.jav diff --git a/test/bytecode/javFiles/Op.jav b/src/test/resources/javFiles/bytecode/Op.jav similarity index 100% rename from test/bytecode/javFiles/Op.jav rename to src/test/resources/javFiles/bytecode/Op.jav diff --git a/test/bytecode/javFiles/Op2.jav b/src/test/resources/javFiles/bytecode/Op2.jav similarity index 100% rename from test/bytecode/javFiles/Op2.jav rename to src/test/resources/javFiles/bytecode/Op2.jav diff --git a/test/bytecode/javFiles/OverlaodGen.jav b/src/test/resources/javFiles/bytecode/OverlaodGen.jav similarity index 100% rename from test/bytecode/javFiles/OverlaodGen.jav rename to src/test/resources/javFiles/bytecode/OverlaodGen.jav diff --git a/test/bytecode/javFiles/Overloading.jav b/src/test/resources/javFiles/bytecode/Overloading.jav similarity index 100% rename from test/bytecode/javFiles/Overloading.jav rename to src/test/resources/javFiles/bytecode/Overloading.jav diff --git a/test/bytecode/javFiles/Plus.jav b/src/test/resources/javFiles/bytecode/Plus.jav similarity index 100% rename from test/bytecode/javFiles/Plus.jav rename to src/test/resources/javFiles/bytecode/Plus.jav diff --git a/test/bytecode/javFiles/PostIncDec.jav b/src/test/resources/javFiles/bytecode/PostIncDec.jav similarity index 100% rename from test/bytecode/javFiles/PostIncDec.jav rename to src/test/resources/javFiles/bytecode/PostIncDec.jav diff --git a/test/bytecode/javFiles/PreInc.jav b/src/test/resources/javFiles/bytecode/PreInc.jav similarity index 100% rename from test/bytecode/javFiles/PreInc.jav rename to src/test/resources/javFiles/bytecode/PreInc.jav diff --git a/test/bytecode/javFiles/RecursiveMeth.jav b/src/test/resources/javFiles/bytecode/RecursiveMeth.jav similarity index 100% rename from test/bytecode/javFiles/RecursiveMeth.jav rename to src/test/resources/javFiles/bytecode/RecursiveMeth.jav diff --git a/test/bytecode/javFiles/RelOps.jav b/src/test/resources/javFiles/bytecode/RelOps.jav similarity index 100% rename from test/bytecode/javFiles/RelOps.jav rename to src/test/resources/javFiles/bytecode/RelOps.jav diff --git a/test/bytecode/javFiles/ReturnMethod.jav b/src/test/resources/javFiles/bytecode/ReturnMethod.jav similarity index 100% rename from test/bytecode/javFiles/ReturnMethod.jav rename to src/test/resources/javFiles/bytecode/ReturnMethod.jav diff --git a/test/bytecode/javFiles/Sorting.jav b/src/test/resources/javFiles/bytecode/Sorting.jav similarity index 100% rename from test/bytecode/javFiles/Sorting.jav rename to src/test/resources/javFiles/bytecode/Sorting.jav diff --git a/test/bytecode/javFiles/StaticM.jav b/src/test/resources/javFiles/bytecode/StaticM.jav similarity index 100% rename from test/bytecode/javFiles/StaticM.jav rename to src/test/resources/javFiles/bytecode/StaticM.jav diff --git a/test/bytecode/javFiles/SubMatrix.jav b/src/test/resources/javFiles/bytecode/SubMatrix.jav similarity index 100% rename from test/bytecode/javFiles/SubMatrix.jav rename to src/test/resources/javFiles/bytecode/SubMatrix.jav diff --git a/test/bytecode/javFiles/Tph.jav b/src/test/resources/javFiles/bytecode/Tph.jav similarity index 100% rename from test/bytecode/javFiles/Tph.jav rename to src/test/resources/javFiles/bytecode/Tph.jav diff --git a/test/bytecode/javFiles/Tph2.jav b/src/test/resources/javFiles/bytecode/Tph2.jav similarity index 100% rename from test/bytecode/javFiles/Tph2.jav rename to src/test/resources/javFiles/bytecode/Tph2.jav diff --git a/test/bytecode/javFiles/Tph3.jav b/src/test/resources/javFiles/bytecode/Tph3.jav similarity index 100% rename from test/bytecode/javFiles/Tph3.jav rename to src/test/resources/javFiles/bytecode/Tph3.jav diff --git a/test/bytecode/javFiles/Tph4.jav b/src/test/resources/javFiles/bytecode/Tph4.jav similarity index 100% rename from test/bytecode/javFiles/Tph4.jav rename to src/test/resources/javFiles/bytecode/Tph4.jav diff --git a/test/bytecode/javFiles/Tph5.jav b/src/test/resources/javFiles/bytecode/Tph5.jav similarity index 100% rename from test/bytecode/javFiles/Tph5.jav rename to src/test/resources/javFiles/bytecode/Tph5.jav diff --git a/test/bytecode/javFiles/VectorAdd.jav b/src/test/resources/javFiles/bytecode/VectorAdd.jav similarity index 100% rename from test/bytecode/javFiles/VectorAdd.jav rename to src/test/resources/javFiles/bytecode/VectorAdd.jav diff --git a/test/bytecode/javFiles/VoidMeth.jav b/src/test/resources/javFiles/bytecode/VoidMeth.jav similarity index 100% rename from test/bytecode/javFiles/VoidMeth.jav rename to src/test/resources/javFiles/bytecode/VoidMeth.jav diff --git a/test/bytecode/javFiles/WC.jav b/src/test/resources/javFiles/bytecode/WC.jav similarity index 100% rename from test/bytecode/javFiles/WC.jav rename to src/test/resources/javFiles/bytecode/WC.jav diff --git a/test/bytecode/javFiles/While.jav b/src/test/resources/javFiles/bytecode/While.jav similarity index 100% rename from test/bytecode/javFiles/While.jav rename to src/test/resources/javFiles/bytecode/While.jav diff --git a/test/bytecode/javFiles/Y.jav b/src/test/resources/javFiles/bytecode/Y.jav similarity index 100% rename from test/bytecode/javFiles/Y.jav rename to src/test/resources/javFiles/bytecode/Y.jav diff --git a/test/bytecode/javFiles/applyLambda.jav b/src/test/resources/javFiles/bytecode/applyLambda.jav similarity index 100% rename from test/bytecode/javFiles/applyLambda.jav rename to src/test/resources/javFiles/bytecode/applyLambda.jav diff --git a/test/javFiles/fc.jav b/src/test/resources/javFiles/fc.jav similarity index 100% rename from test/javFiles/fc.jav rename to src/test/resources/javFiles/fc.jav diff --git a/test/javFiles/mathStruc.jav b/src/test/resources/javFiles/mathStruc.jav similarity index 100% rename from test/javFiles/mathStruc.jav rename to src/test/resources/javFiles/mathStruc.jav diff --git a/test/parser/AntlrTest.jav b/src/test/resources/javFiles/parser/AntlrTest.jav similarity index 100% rename from test/parser/AntlrTest.jav rename to src/test/resources/javFiles/parser/AntlrTest.jav diff --git a/test/parser/BoundedParameter.jav b/src/test/resources/javFiles/parser/BoundedParameter.jav similarity index 100% rename from test/parser/BoundedParameter.jav rename to src/test/resources/javFiles/parser/BoundedParameter.jav diff --git a/test/parser/CastTest.jav b/src/test/resources/javFiles/parser/CastTest.jav similarity index 100% rename from test/parser/CastTest.jav rename to src/test/resources/javFiles/parser/CastTest.jav diff --git a/test/parser/ExtendsTest.jav b/src/test/resources/javFiles/parser/ExtendsTest.jav similarity index 100% rename from test/parser/ExtendsTest.jav rename to src/test/resources/javFiles/parser/ExtendsTest.jav diff --git a/test/parser/FeatherWeightJava.jav b/src/test/resources/javFiles/parser/FeatherWeightJava.jav similarity index 100% rename from test/parser/FeatherWeightJava.jav rename to src/test/resources/javFiles/parser/FeatherWeightJava.jav diff --git a/test/parser/FieldInitializationTest.jav b/src/test/resources/javFiles/parser/FieldInitializationTest.jav similarity index 100% rename from test/parser/FieldInitializationTest.jav rename to src/test/resources/javFiles/parser/FieldInitializationTest.jav diff --git a/test/parser/FieldVarTest.jav b/src/test/resources/javFiles/parser/FieldVarTest.jav similarity index 100% rename from test/parser/FieldVarTest.jav rename to src/test/resources/javFiles/parser/FieldVarTest.jav diff --git a/test/parser/GenericFieldVarTest.jav b/src/test/resources/javFiles/parser/GenericFieldVarTest.jav similarity index 100% rename from test/parser/GenericFieldVarTest.jav rename to src/test/resources/javFiles/parser/GenericFieldVarTest.jav diff --git a/test/parser/ImportTest.jav b/src/test/resources/javFiles/parser/ImportTest.jav similarity index 100% rename from test/parser/ImportTest.jav rename to src/test/resources/javFiles/parser/ImportTest.jav diff --git a/test/parser/ImportTest2.jav b/src/test/resources/javFiles/parser/ImportTest2.jav similarity index 100% rename from test/parser/ImportTest2.jav rename to src/test/resources/javFiles/parser/ImportTest2.jav diff --git a/test/parser/ImportTestGeneric.jav b/src/test/resources/javFiles/parser/ImportTestGeneric.jav similarity index 100% rename from test/parser/ImportTestGeneric.jav rename to src/test/resources/javFiles/parser/ImportTestGeneric.jav diff --git a/test/parser/NewTest.jav b/src/test/resources/javFiles/parser/NewTest.jav similarity index 100% rename from test/parser/NewTest.jav rename to src/test/resources/javFiles/parser/NewTest.jav diff --git a/test/parser/OpratorTest.jav b/src/test/resources/javFiles/parser/OpratorTest.jav similarity index 100% rename from test/parser/OpratorTest.jav rename to src/test/resources/javFiles/parser/OpratorTest.jav diff --git a/test/parser/PackageNameTest.jav b/src/test/resources/javFiles/parser/PackageNameTest.jav similarity index 100% rename from test/parser/PackageNameTest.jav rename to src/test/resources/javFiles/parser/PackageNameTest.jav diff --git a/test/parser/StatementsTest.jav b/src/test/resources/javFiles/parser/StatementsTest.jav similarity index 100% rename from test/parser/StatementsTest.jav rename to src/test/resources/javFiles/parser/StatementsTest.jav diff --git a/test/parser/StructuralTypes.jav b/src/test/resources/javFiles/parser/StructuralTypes.jav similarity index 100% rename from test/parser/StructuralTypes.jav rename to src/test/resources/javFiles/parser/StructuralTypes.jav diff --git a/test/parser/WhileTest.jav b/src/test/resources/javFiles/parser/WhileTest.jav similarity index 100% rename from test/parser/WhileTest.jav rename to src/test/resources/javFiles/parser/WhileTest.jav diff --git a/test/javFiles/test.jav b/src/test/resources/javFiles/test.jav similarity index 100% rename from test/javFiles/test.jav rename to src/test/resources/javFiles/test.jav diff --git a/test/javFiles/test1.jav b/src/test/resources/javFiles/test1.jav similarity index 100% rename from test/javFiles/test1.jav rename to src/test/resources/javFiles/test1.jav diff --git a/test/log4jTesting.xml b/src/test/resources/log4jTesting.xml similarity index 100% rename from test/log4jTesting.xml rename to src/test/resources/log4jTesting.xml diff --git a/testBytecode/Field.java b/src/test/resources/testBytecode/Field.java similarity index 100% rename from testBytecode/Field.java rename to src/test/resources/testBytecode/Field.java diff --git a/testBytecode/Import.java b/src/test/resources/testBytecode/Import.java similarity index 100% rename from testBytecode/Import.java rename to src/test/resources/testBytecode/Import.java diff --git a/testBytecode/Lam1.java b/src/test/resources/testBytecode/Lam1.java similarity index 100% rename from testBytecode/Lam1.java rename to src/test/resources/testBytecode/Lam1.java diff --git a/testBytecode/LamRun.java b/src/test/resources/testBytecode/LamRun.java similarity index 100% rename from testBytecode/LamRun.java rename to src/test/resources/testBytecode/LamRun.java diff --git a/testBytecode/MethFieldVar.java b/src/test/resources/testBytecode/MethFieldVar.java similarity index 100% rename from testBytecode/MethFieldVar.java rename to src/test/resources/testBytecode/MethFieldVar.java diff --git a/testBytecode/Subclass.java b/src/test/resources/testBytecode/Subclass.java similarity index 100% rename from testBytecode/Subclass.java rename to src/test/resources/testBytecode/Subclass.java diff --git a/testBytecode/SuperTest.java b/src/test/resources/testBytecode/SuperTest.java similarity index 100% rename from testBytecode/SuperTest.java rename to src/test/resources/testBytecode/SuperTest.java diff --git a/testBytecode/Superclass.java b/src/test/resources/testBytecode/Superclass.java similarity index 100% rename from testBytecode/Superclass.java rename to src/test/resources/testBytecode/Superclass.java diff --git a/testBytecode/TestMyTest.java b/src/test/resources/testBytecode/TestMyTest.java similarity index 100% rename from testBytecode/TestMyTest.java rename to src/test/resources/testBytecode/TestMyTest.java diff --git a/target/repository/.gitignore b/src/test/resources/testBytecode/generatedBC/.gitignore similarity index 100% rename from target/repository/.gitignore rename to src/test/resources/testBytecode/generatedBC/.gitignore diff --git a/testBytecode/manually/Fac1.java b/src/test/resources/testBytecode/manually/Fac1.java similarity index 100% rename from testBytecode/manually/Fac1.java rename to src/test/resources/testBytecode/manually/Fac1.java diff --git a/testBytecode/manually/Fac2.java b/src/test/resources/testBytecode/manually/Fac2.java similarity index 100% rename from testBytecode/manually/Fac2.java rename to src/test/resources/testBytecode/manually/Fac2.java diff --git a/testBytecode/manually/LamAssign.java b/src/test/resources/testBytecode/manually/LamAssign.java similarity index 100% rename from testBytecode/manually/LamAssign.java rename to src/test/resources/testBytecode/manually/LamAssign.java diff --git a/testBytecode/manually/LamAssignWithM.java b/src/test/resources/testBytecode/manually/LamAssignWithM.java similarity index 100% rename from testBytecode/manually/LamAssignWithM.java rename to src/test/resources/testBytecode/manually/LamAssignWithM.java diff --git a/testBytecode/manually/LamWithAnField.java b/src/test/resources/testBytecode/manually/LamWithAnField.java similarity index 100% rename from testBytecode/manually/LamWithAnField.java rename to src/test/resources/testBytecode/manually/LamWithAnField.java diff --git a/testBytecode/manually/LamWithField.java b/src/test/resources/testBytecode/manually/LamWithField.java similarity index 100% rename from testBytecode/manually/LamWithField.java rename to src/test/resources/testBytecode/manually/LamWithField.java diff --git a/testBytecode/manually/ReturnM1.java b/src/test/resources/testBytecode/manually/ReturnM1.java similarity index 100% rename from testBytecode/manually/ReturnM1.java rename to src/test/resources/testBytecode/manually/ReturnM1.java diff --git a/testBytecode/public b/src/test/resources/testBytecode/public similarity index 100% rename from testBytecode/public rename to src/test/resources/testBytecode/public diff --git a/testBytecode/testF.java b/src/test/resources/testBytecode/testF.java similarity index 100% rename from testBytecode/testF.java rename to src/test/resources/testBytecode/testF.java diff --git a/testBytecode/testTets.java b/src/test/resources/testBytecode/testTets.java similarity index 100% rename from testBytecode/testTets.java rename to src/test/resources/testBytecode/testTets.java diff --git a/testBytecode/testTetsF.java b/src/test/resources/testBytecode/testTetsF.java similarity index 100% rename from testBytecode/testTetsF.java rename to src/test/resources/testBytecode/testTetsF.java diff --git a/test/bytecode/BinaryTest.java b/test/bytecode/BinaryTest.java deleted file mode 100644 index 84f102b7..00000000 --- a/test/bytecode/BinaryTest.java +++ /dev/null @@ -1,50 +0,0 @@ -package bytecode; - -import static org.junit.Assert.*; - -import java.io.File; -import java.lang.reflect.Method; -import java.net.URL; -import java.net.URLClassLoader; - -import org.junit.BeforeClass; -import org.junit.Test; - -import de.dhbwstuttgart.core.JavaTXCompiler; - -public class BinaryTest { - private static String path; - private static File fileToTest; - private static JavaTXCompiler compiler; - private static ClassLoader loader; - private static Class classToTest; - private static String pathToClassFile; - private static Object instanceOfClass; - - @BeforeClass - public static void setUpBeforeClass() throws Exception { - path = System.getProperty("user.dir")+"/test/bytecode/javFiles/BinaryInMeth.jav"; - fileToTest = new File(path); - compiler = new JavaTXCompiler(fileToTest); - pathToClassFile = System.getProperty("user.dir")+"/testBytecode/generatedBC/"; - compiler.generateBytecode(pathToClassFile); - loader = new URLClassLoader(new URL[] {new URL("file://"+pathToClassFile)}); - classToTest = loader.loadClass("BinaryInMeth"); - instanceOfClass = classToTest.getDeclaredConstructor().newInstance(); - } - - @Test - public void test() throws Exception { - Method m2 = classToTest.getDeclaredMethod("m2", Integer.class,Integer.class); - Integer res = (Integer) m2.invoke(instanceOfClass, 2,3); - assertEquals(6, res); - } - - @Test - public void testM3() throws Exception { - Method m3 = classToTest.getDeclaredMethod("m3", Integer.class); - Integer res = (Integer) m3.invoke(instanceOfClass, 2); - assertEquals(4, res); - } - -} diff --git a/test/bytecode/FacTest.java b/test/bytecode/FacTest.java deleted file mode 100644 index 387d7387..00000000 --- a/test/bytecode/FacTest.java +++ /dev/null @@ -1,44 +0,0 @@ -package bytecode; - -import static org.junit.Assert.*; - -import java.io.File; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.net.URL; -import java.net.URLClassLoader; - -import org.junit.BeforeClass; -import org.junit.Test; - -import de.dhbwstuttgart.core.JavaTXCompiler; - -public class FacTest { - private static String path; - private static File fileToTest; - private static JavaTXCompiler compiler; - private static ClassLoader loader; - private static Class classToTest; - private static String pathToClassFile; - private static Object instanceOfClass; - - @BeforeClass - public static void setUpBeforeClass() throws Exception { - path = System.getProperty("user.dir")+"/test/bytecode/javFiles/Fac.jav"; - fileToTest = new File(path); - compiler = new JavaTXCompiler(fileToTest); - pathToClassFile = System.getProperty("user.dir")+"/testBytecode/generatedBC/"; - compiler.generateBytecode(pathToClassFile); - loader = new URLClassLoader(new URL[] {new URL("file://"+pathToClassFile)}); - classToTest = loader.loadClass("Fac"); - instanceOfClass = classToTest.getDeclaredConstructor().newInstance(); - } - - @Test - public void testInteger() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { - Method getFac = classToTest.getDeclaredMethod("getFac", Integer.class); - Integer result = (Integer) getFac.invoke(instanceOfClass,3); - assertEquals(result, 6); - } - -} diff --git a/test/bytecode/FacultyTest.java b/test/bytecode/FacultyTest.java deleted file mode 100644 index fb8f4fad..00000000 --- a/test/bytecode/FacultyTest.java +++ /dev/null @@ -1,54 +0,0 @@ -package bytecode; - -import static org.junit.Assert.assertEquals; - -import java.io.File; -import java.lang.reflect.Field; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.net.URL; -import java.net.URLClassLoader; - -import org.junit.Test; - -import de.dhbwstuttgart.core.JavaTXCompiler; - -public class FacultyTest { - private static String path; - private static File fileToTest; - private static JavaTXCompiler compiler; - private static ClassLoader loader; - private static Class classToTest; - private static String pathToClassFile; - private static Object instanceOfClass; - - @Test - public void generateBC() throws Exception { - path = System.getProperty("user.dir")+"/test/bytecode/javFiles/Faculty.jav"; - fileToTest = new File(path); - compiler = new JavaTXCompiler(fileToTest); - compiler.generateBytecode(System.getProperty("user.dir")+"/testBytecode/generatedBC/"); - pathToClassFile = System.getProperty("user.dir")+"/testBytecode/generatedBC/"; - loader = new URLClassLoader(new URL[] {new URL("file://"+pathToClassFile)}); - classToTest = loader.loadClass("Faculty"); - instanceOfClass = classToTest.getDeclaredConstructor().newInstance(); - -// Method m = classToTest.getDeclaredMethod("m", Integer.class); - Field fact = classToTest.getDeclaredField("fact"); -// Class lambda = m.invoke(instanceOfClass).getClass(); - Class lambda = fact.getType(); - Method apply = lambda.getMethod("apply", Object.class); -// -// // Damit man auf die Methode zugreifen kann - apply.setAccessible(true); - - Integer i = 3; - - Integer result = (Integer) apply.invoke(instanceOfClass, i); -// Integer result = (Integer) m.invoke(instanceOfClass,i); - - assertEquals(6, result); - } - - -} diff --git a/test/bytecode/FieldTest.java b/test/bytecode/FieldTest.java deleted file mode 100644 index a5528b00..00000000 --- a/test/bytecode/FieldTest.java +++ /dev/null @@ -1,43 +0,0 @@ -package bytecode; - -import static org.junit.Assert.*; - -import java.io.File; -import java.lang.reflect.Field; - -import org.junit.BeforeClass; -import org.junit.Test; -import java.net.URL; -import java.net.URLClassLoader; - -import de.dhbwstuttgart.core.JavaTXCompiler; - -public class FieldTest { - - private static String path; - private static File fileToTest; - private static JavaTXCompiler compiler; - private static ClassLoader loader; - private static Class classToTest; - private static String pathToClassFile; - private static Object instanceOfClass; - - @BeforeClass - public static void setUpBeforeClass() throws Exception { - path = System.getProperty("user.dir")+"/test/bytecode/javFiles/Field.jav"; - fileToTest = new File(path); - compiler = new JavaTXCompiler(fileToTest); - compiler.generateBytecode(System.getProperty("user.dir")+"/testBytecode/generatedBC/"); - pathToClassFile = System.getProperty("user.dir")+"/testBytecode/generatedBC/"; - loader = new URLClassLoader(new URL[] {new URL("file://"+pathToClassFile)}); - classToTest = loader.loadClass("Field"); - instanceOfClass = classToTest.getDeclaredConstructor().newInstance(); - } - - @Test - public void test() { - Field[] fields = classToTest.getFields(); - assertEquals(1, fields.length); - } - -} diff --git a/test/bytecode/FunOLTest.java b/test/bytecode/FunOLTest.java deleted file mode 100644 index 55aba31c..00000000 --- a/test/bytecode/FunOLTest.java +++ /dev/null @@ -1,52 +0,0 @@ -package bytecode; - -import static org.junit.Assert.assertEquals; - -import java.io.File; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.net.URL; -import java.net.URLClassLoader; - -import org.junit.Test; - -import de.dhbwstuttgart.core.JavaTXCompiler; - -public class FunOLTest { - private static String path; - private static File fileToTest; - private static JavaTXCompiler compiler; - private static ClassLoader loader; - private static Class classToTest; - private static String pathToClassFile; - private static Object instanceOfClass; - - @Test - public void generateBC() throws Exception { - path = System.getProperty("user.dir")+"/test/bytecode/javFiles/FunOL.jav"; - fileToTest = new File(path); - compiler = new JavaTXCompiler(fileToTest); - compiler.generateBytecode(System.getProperty("user.dir")+"/testBytecode/generatedBC/"); - pathToClassFile = System.getProperty("user.dir")+"/testBytecode/generatedBC/"; - loader = new URLClassLoader(new URL[] {new URL("file://"+pathToClassFile)}); - classToTest = loader.loadClass("FunOL"); - /* - instanceOfClass = classToTest.getDeclaredConstructor().newInstance(); - - Method m = classToTest.getDeclaredMethod("m"); - Class lambda = m.invoke(instanceOfClass).getClass(); - Method apply = lambda.getMethod("apply", Object.class); - - // Damit man auf die Methode zugreifen kann - apply.setAccessible(true); - - Integer i = 77; - - Integer result = (Integer) apply.invoke(m.invoke(instanceOfClass), i); - - assertEquals(77, result); - */ - } - - -} diff --git a/test/bytecode/GenTest.java b/test/bytecode/GenTest.java deleted file mode 100644 index 3ed2f3c3..00000000 --- a/test/bytecode/GenTest.java +++ /dev/null @@ -1,30 +0,0 @@ -package bytecode; - -import static org.junit.Assert.*; - -import java.io.File; -import java.net.URL; -import java.net.URLClassLoader; - -import org.junit.BeforeClass; -import org.junit.Test; - -import de.dhbwstuttgart.core.JavaTXCompiler; - -public class GenTest { - - private static String path; - private static File fileToTest; - private static JavaTXCompiler compiler; - private static String pathToClassFile; - - @Test - public void generateBC() throws Exception { - path = System.getProperty("user.dir")+"/test/bytecode/javFiles/Gen.jav"; - fileToTest = new File(path); - compiler = new JavaTXCompiler(fileToTest); - pathToClassFile = System.getProperty("user.dir")+"/testBytecode/generatedBC/"; - compiler.generateBytecode(pathToClassFile); - } - -} diff --git a/test/bytecode/GreaterEqualTest.java b/test/bytecode/GreaterEqualTest.java deleted file mode 100644 index b60c446c..00000000 --- a/test/bytecode/GreaterEqualTest.java +++ /dev/null @@ -1,140 +0,0 @@ -package bytecode; - -import static org.junit.Assert.*; - -import java.io.File; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.net.URL; -import java.net.URLClassLoader; - -import org.junit.BeforeClass; -import org.junit.Test; - -import de.dhbwstuttgart.core.JavaTXCompiler; - -public class GreaterEqualTest { - - private static String path; - private static File fileToTest; - private static JavaTXCompiler compiler; - private static ClassLoader loader; - private static Class classToTest; - private static String pathToClassFile; - private static Object instanceOfClass; - - @BeforeClass - public static void setUpBeforeClass() throws Exception { - path = System.getProperty("user.dir")+"/test/bytecode/javFiles/GreaterEqual.jav"; - fileToTest = new File(path); - compiler = new JavaTXCompiler(fileToTest); - pathToClassFile = System.getProperty("user.dir")+"/testBytecode/generatedBC/"; - compiler.generateBytecode(pathToClassFile); - loader = new URLClassLoader(new URL[] {new URL("File://"+pathToClassFile)}); - classToTest = loader.loadClass("GreaterEqual"); - instanceOfClass = classToTest.getDeclaredConstructor().newInstance(); - } - - @Test - public void testName() { - assertEquals("GreaterEqual", classToTest.getName()); - } - @Test - public void testIntegers() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { - Method gE = classToTest.getDeclaredMethod("gE", Integer.class, Integer.class); - Boolean result = (Boolean) gE.invoke(instanceOfClass, 7, 5); - assertTrue(result); - } - - @Test - public void testIntegers2() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { - Method gE = classToTest.getDeclaredMethod("gE", Integer.class, Integer.class); - Boolean result = (Boolean) gE.invoke(instanceOfClass, 5, 7); - assertFalse(result); - } - - @Test - public void testEqIntegers() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { - Method gE = classToTest.getDeclaredMethod("gE", Integer.class, Integer.class); - Boolean result = (Boolean) gE.invoke(instanceOfClass, 5, 5); - assertTrue(result); - } - - @Test - public void testLongs() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { - Method gE = classToTest.getDeclaredMethod("gE", Long.class, Long.class); - Boolean result = (Boolean) gE.invoke(instanceOfClass, 10L,7L); - assertTrue(result); - } - - @Test - public void testFloats() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { - Method gE = classToTest.getDeclaredMethod("gE", Float.class, Float.class); - Boolean result = (Boolean) gE.invoke(instanceOfClass, 5F,7F); - assertFalse(result); - } - - @Test - public void testDoubles() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { - Method gE = classToTest.getDeclaredMethod("gE", Double.class, Double.class); - Boolean result = (Boolean) gE.invoke(instanceOfClass, 5.0,7.0); - assertFalse(result); - } - - @Test - public void testLongInt() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { - Method gE = classToTest.getDeclaredMethod("gE", Long.class, Integer.class); - Boolean result = (Boolean) gE.invoke(instanceOfClass, 15L,7); - assertTrue(result); - } - - @Test - public void testFloatInt() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { - Method gE = classToTest.getDeclaredMethod("gE", Float.class, Integer.class); - Boolean result = (Boolean) gE.invoke(instanceOfClass, 5F,7); - assertFalse(result); - } - - @Test - public void testDoubleInt() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { - Method gE = classToTest.getDeclaredMethod("gE", Double.class, Integer.class); - Boolean result = (Boolean) gE.invoke(instanceOfClass, 25.0,17); - assertTrue(result); - } - - @Test - public void testFloatLong() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { - Method gE = classToTest.getDeclaredMethod("gE", Float.class, Long.class); - Boolean result = (Boolean) gE.invoke(instanceOfClass, 75F,70L); - assertTrue(result); - } - - @Test - public void testDoubleLong() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { - Method gE = classToTest.getDeclaredMethod("gE", Double.class, Long.class); - Boolean result = (Boolean) gE.invoke(instanceOfClass, 5.0,7L); - assertFalse(result); - } - - @Test - public void testEqDoubleFloat() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { - Method gE = classToTest.getDeclaredMethod("gE", Double.class, Float.class); - Boolean result = (Boolean) gE.invoke(instanceOfClass, 7.0,7F); - assertTrue(result); - } - - @Test - public void testDoubleFloat() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { - Method gE = classToTest.getDeclaredMethod("gE", Double.class, Float.class); - Boolean result = (Boolean) gE.invoke(instanceOfClass, 15.0,7F); - assertTrue(result); - } - - @Test - public void testDoubleFloat3() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { - Method gE = classToTest.getDeclaredMethod("gE", Double.class, Float.class); - Boolean result = (Boolean) gE.invoke(instanceOfClass, 9.0,17F); - assertFalse(result); - } - -} diff --git a/test/bytecode/GreaterThanTest.java b/test/bytecode/GreaterThanTest.java deleted file mode 100644 index 1a460a8c..00000000 --- a/test/bytecode/GreaterThanTest.java +++ /dev/null @@ -1,139 +0,0 @@ -package bytecode; - -import static org.junit.Assert.*; - -import java.io.File; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.net.URL; -import java.net.URLClassLoader; - -import org.junit.BeforeClass; -import org.junit.Test; - -import de.dhbwstuttgart.core.JavaTXCompiler; - -public class GreaterThanTest { - - private static String path; - private static File fileToTest; - private static JavaTXCompiler compiler; - private static ClassLoader loader; - private static Class classToTest; - private static String pathToClassFile; - private static Object instanceOfClass; - - @BeforeClass - public static void setUpBeforeClass() throws Exception { - path = System.getProperty("user.dir")+"/test/bytecode/javFiles/GreaterThan.jav"; - fileToTest = new File(path); - compiler = new JavaTXCompiler(fileToTest); - pathToClassFile = System.getProperty("user.dir")+"/testBytecode/generatedBC/"; - compiler.generateBytecode(pathToClassFile); - loader = new URLClassLoader(new URL[] {new URL("File://"+pathToClassFile)}); - classToTest = loader.loadClass("GreaterThan"); - instanceOfClass = classToTest.getDeclaredConstructor().newInstance(); - } - - @Test - public void testName() { - assertEquals("GreaterThan", classToTest.getName()); - } - - public void testIntegers() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { - Method gT = classToTest.getDeclaredMethod("gT", Integer.class, Integer.class); - Boolean result = (Boolean) gT.invoke(instanceOfClass, 7, 5); - assertTrue(result); - } - - @Test - public void testIntegers2() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { - Method gT = classToTest.getDeclaredMethod("gT", Integer.class, Integer.class); - Boolean result = (Boolean) gT.invoke(instanceOfClass, 5, 7); - assertFalse(result); - } - - @Test - public void testEqIntegers() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { - Method gT = classToTest.getDeclaredMethod("gT", Integer.class, Integer.class); - Boolean result = (Boolean) gT.invoke(instanceOfClass, 5, 5); - assertFalse(result); - } - - @Test - public void testLongs() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { - Method gT = classToTest.getDeclaredMethod("gT", Long.class, Long.class); - Boolean result = (Boolean) gT.invoke(instanceOfClass, 10L,7L); - assertTrue(result); - }@Test - - public void testFloats() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { - Method gT = classToTest.getDeclaredMethod("gT", Float.class, Float.class); - Boolean result = (Boolean) gT.invoke(instanceOfClass, 5F,7F); - assertFalse(result); - } - - @Test - public void testDoubles() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { - Method gT = classToTest.getDeclaredMethod("gT", Double.class, Double.class); - Boolean result = (Boolean) gT.invoke(instanceOfClass, 5.0,7.0); - assertFalse(result); - } - - @Test - public void testLongInt() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { - Method gT = classToTest.getDeclaredMethod("gT", Long.class, Integer.class); - Boolean result = (Boolean) gT.invoke(instanceOfClass, 15L,7); - assertTrue(result); - } - - @Test - public void testFloatInt() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { - Method gT = classToTest.getDeclaredMethod("gT", Float.class, Integer.class); - Boolean result = (Boolean) gT.invoke(instanceOfClass, 5F,7); - assertFalse(result); - } - - @Test - public void testDoubleInt() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { - Method gT = classToTest.getDeclaredMethod("gT", Double.class, Integer.class); - Boolean result = (Boolean) gT.invoke(instanceOfClass, 25.0,17); - assertTrue(result); - } - - @Test - public void testFloatLong() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { - Method gT = classToTest.getDeclaredMethod("gT", Float.class, Long.class); - Boolean result = (Boolean) gT.invoke(instanceOfClass, 75F,70L); - assertTrue(result); - } - - @Test - public void testDoubleLong() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { - Method gT = classToTest.getDeclaredMethod("gT", Double.class, Long.class); - Boolean result = (Boolean) gT.invoke(instanceOfClass, 5.0,7L); - assertFalse(result); - } - - @Test - public void testEqDoubleFloat() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { - Method gT = classToTest.getDeclaredMethod("gT", Double.class, Float.class); - Boolean result = (Boolean) gT.invoke(instanceOfClass, 7.0,7F); - assertFalse(result); - } - - @Test - public void testDoubleFloat() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { - Method gT = classToTest.getDeclaredMethod("gT", Double.class, Float.class); - Boolean result = (Boolean) gT.invoke(instanceOfClass, 15.0,7F); - assertTrue(result); - } - - @Test - public void testDoubleFloat3() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { - Method gT = classToTest.getDeclaredMethod("gT", Double.class, Float.class); - Boolean result = (Boolean) gT.invoke(instanceOfClass, 9.0,17F); - assertFalse(result); - } - -} diff --git a/test/bytecode/LambdaTest.java b/test/bytecode/LambdaTest.java deleted file mode 100644 index b79ed16e..00000000 --- a/test/bytecode/LambdaTest.java +++ /dev/null @@ -1,50 +0,0 @@ -package bytecode; - -import static org.junit.Assert.assertEquals; - -import java.io.File; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.net.URL; -import java.net.URLClassLoader; - -import org.junit.Test; - -import de.dhbwstuttgart.core.JavaTXCompiler; - -public class LambdaTest { - private static String path; - private static File fileToTest; - private static JavaTXCompiler compiler; - private static ClassLoader loader; - private static Class classToTest; - private static String pathToClassFile; - private static Object instanceOfClass; - - @Test - public void generateBC() throws Exception { - path = System.getProperty("user.dir")+"/test/bytecode/javFiles/Lambda.jav"; - fileToTest = new File(path); - compiler = new JavaTXCompiler(fileToTest); - compiler.generateBytecode(System.getProperty("user.dir")+"/testBytecode/generatedBC/"); - pathToClassFile = System.getProperty("user.dir")+"/testBytecode/generatedBC/"; - loader = new URLClassLoader(new URL[] {new URL("file://"+pathToClassFile)}); - classToTest = loader.loadClass("Lambda"); - instanceOfClass = classToTest.getDeclaredConstructor().newInstance(); - - Method m = classToTest.getDeclaredMethod("m"); - Class lambda = m.invoke(instanceOfClass).getClass(); - Method apply = lambda.getMethod("apply", Object.class); - - // Damit man auf die Methode zugreifen kann - apply.setAccessible(true); - - Integer i = 77; - - Integer result = (Integer) apply.invoke(m.invoke(instanceOfClass), i); - - assertEquals(77, result); - } - - -} diff --git a/test/bytecode/LambdaVoidTest.java b/test/bytecode/LambdaVoidTest.java deleted file mode 100644 index ea83dbe0..00000000 --- a/test/bytecode/LambdaVoidTest.java +++ /dev/null @@ -1,47 +0,0 @@ -package bytecode; - -import static org.junit.Assert.assertEquals; - -import java.io.File; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.net.URL; -import java.net.URLClassLoader; - -import org.junit.Test; - -import de.dhbwstuttgart.core.JavaTXCompiler; - -public class LambdaVoidTest { - private static String path; - private static File fileToTest; - private static JavaTXCompiler compiler; - private static ClassLoader loader; - private static Class classToTest; - private static String pathToClassFile; - private static Object instanceOfClass; - - @Test - public void generateBC() throws Exception { - path = System.getProperty("user.dir")+"/test/bytecode/javFiles/Lambda.jav"; - fileToTest = new File(path); - compiler = new JavaTXCompiler(fileToTest); - compiler.generateBytecode(System.getProperty("user.dir")+"/testBytecode/generatedBC/"); - pathToClassFile = System.getProperty("user.dir")+"/testBytecode/generatedBC/"; - loader = new URLClassLoader(new URL[] {new URL("file://"+pathToClassFile)}); - classToTest = loader.loadClass("Lambda"); - instanceOfClass = classToTest.getDeclaredConstructor().newInstance(); - - Method m = classToTest.getDeclaredMethod("m"); - Class lambda = m.invoke(instanceOfClass).getClass(); - Method apply = lambda.getMethod("apply", Object.class); - - // Damit man auf die Methode zugreifen kann - apply.setAccessible(true); - - Integer i = 77; - apply.invoke(m.invoke(instanceOfClass), i); - } - - -} diff --git a/test/bytecode/LessEqualTest.java b/test/bytecode/LessEqualTest.java deleted file mode 100644 index dc439af9..00000000 --- a/test/bytecode/LessEqualTest.java +++ /dev/null @@ -1,133 +0,0 @@ -package bytecode; - -import static org.junit.Assert.*; - -import java.io.File; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.net.URL; -import java.net.URLClassLoader; - -import org.junit.BeforeClass; -import org.junit.Test; - -import de.dhbwstuttgart.core.JavaTXCompiler; - -public class LessEqualTest { - - private static String path; - private static File fileToTest; - private static JavaTXCompiler compiler; - private static ClassLoader loader; - private static Class classToTest; - private static String pathToClassFile; - private static Object instanceOfClass; - - @BeforeClass - public static void setUpBeforeClass() throws Exception { - path = System.getProperty("user.dir")+"/test/bytecode/javFiles/LessEqual.jav"; - fileToTest = new File(path); - compiler = new JavaTXCompiler(fileToTest); - pathToClassFile = System.getProperty("user.dir")+"/testBytecode/generatedBC/"; - compiler.generateBytecode(pathToClassFile); - loader = new URLClassLoader(new URL[] {new URL("file://"+pathToClassFile)}); - classToTest = loader.loadClass("LessEqual"); - instanceOfClass = classToTest.getDeclaredConstructor().newInstance(); - } - - @Test - public void testName() { - assertEquals("LessEqual", classToTest.getName()); - } - - @Test - public void testIntegers() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { - Method lessEqual = classToTest.getDeclaredMethod("lessEqual", Integer.class, Integer.class); - Boolean result = (Boolean) lessEqual.invoke(instanceOfClass, 5,7); - assertTrue(result); - } - - @Test - public void testEqualIntegers() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { - Method lessEqual = classToTest.getDeclaredMethod("lessEqual", Integer.class, Integer.class); - Boolean result = (Boolean) lessEqual.invoke(instanceOfClass, 5,5); - assertTrue(result); - } - - @Test - public void testLongs() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { - Method lessEqual = classToTest.getDeclaredMethod("lessEqual", Long.class, Long.class); - Boolean result = (Boolean) lessEqual.invoke(instanceOfClass, 5L,7L); - assertTrue(result); - }@Test - - public void testFloats() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { - Method lessEqual = classToTest.getDeclaredMethod("lessEqual", Float.class, Float.class); - Boolean result = (Boolean) lessEqual.invoke(instanceOfClass, 5F,7F); - assertTrue(result); - } - - @Test - public void testDoubles() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { - Method lessEqual = classToTest.getDeclaredMethod("lessEqual", Double.class, Double.class); - Boolean result = (Boolean) lessEqual.invoke(instanceOfClass, 5.0,7.0); - assertTrue(result); - } - - @Test - public void testLongInt() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { - Method lessEqual = classToTest.getDeclaredMethod("lessEqual", Long.class, Integer.class); - Boolean result = (Boolean) lessEqual.invoke(instanceOfClass, 5L,7); - assertTrue(result); - } - - @Test - public void testFloatInt() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { - Method lessEqual = classToTest.getDeclaredMethod("lessEqual", Float.class, Integer.class); - Boolean result = (Boolean) lessEqual.invoke(instanceOfClass, 5F,7); - assertTrue(result); - } - - @Test - public void testDoubleInt() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { - Method lessEqual = classToTest.getDeclaredMethod("lessEqual", Double.class, Integer.class); - Boolean result = (Boolean) lessEqual.invoke(instanceOfClass, 5.0,7); - assertTrue(result); - } - - @Test - public void testFloatLong() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { - Method lessEqual = classToTest.getDeclaredMethod("lessEqual", Float.class, Long.class); - Boolean result = (Boolean) lessEqual.invoke(instanceOfClass, 5F,7L); - assertTrue(result); - } - - @Test - public void testDoubleLong() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { - Method lessEqual = classToTest.getDeclaredMethod("lessEqual", Double.class, Long.class); - Boolean result = (Boolean) lessEqual.invoke(instanceOfClass, 5.0,7L); - assertTrue(result); - } - - @Test - public void testEqDoubleFloat() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { - Method lessEqual = classToTest.getDeclaredMethod("lessEqual", Double.class, Float.class); - Boolean result = (Boolean) lessEqual.invoke(instanceOfClass, 7.0,7F); - assertTrue(result); - } - - @Test - public void testDoubleFloat() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { - Method lessEqual = classToTest.getDeclaredMethod("lessEqual", Double.class, Float.class); - Boolean result = (Boolean) lessEqual.invoke(instanceOfClass, 5.0,7F); - assertTrue(result); - } - - @Test - public void testDoubleFloat3() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { - Method lessEqual = classToTest.getDeclaredMethod("lessEqual", Double.class, Float.class); - Boolean result = (Boolean) lessEqual.invoke(instanceOfClass, 9.0,7F); - assertFalse(result); - } - -} diff --git a/test/bytecode/LessThanTest.java b/test/bytecode/LessThanTest.java deleted file mode 100644 index 99eba80c..00000000 --- a/test/bytecode/LessThanTest.java +++ /dev/null @@ -1,141 +0,0 @@ -package bytecode; - -import static org.junit.Assert.*; - -import java.io.File; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.net.URL; -import java.net.URLClassLoader; - -import org.junit.BeforeClass; -import org.junit.Test; - -import de.dhbwstuttgart.core.JavaTXCompiler; - -public class LessThanTest { - - private static String path; - private static File fileToTest; - private static JavaTXCompiler compiler; - private static ClassLoader loader; - private static Class classToTest; - private static String pathToClassFile; - private static Object instanceOfClass; - - @BeforeClass - public static void setUpBeforeClass() throws Exception { - path = System.getProperty("user.dir")+"/test/bytecode/javFiles/LessThan.jav"; - fileToTest = new File(path); - compiler = new JavaTXCompiler(fileToTest); - pathToClassFile = System.getProperty("user.dir")+"/testBytecode/generatedBC/"; - compiler.generateBytecode(pathToClassFile); - loader = new URLClassLoader(new URL[] {new URL("file://"+pathToClassFile)}); - classToTest = loader.loadClass("LessThan"); - instanceOfClass = classToTest.getDeclaredConstructor().newInstance(); - } - - @Test - public void testClassName() { - assertEquals("LessThan", classToTest.getName()); - } - - @Test - public void testLessThanInt() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { - Method lessThan = classToTest.getDeclaredMethod("lessThan", Integer.class,Integer.class); - Boolean result = (Boolean) lessThan.invoke(instanceOfClass, 5, 7); - assertTrue(result); - } - - @Test - public void testLessThanInt2() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { - Method lessThan = classToTest.getDeclaredMethod("lessThan", Integer.class, Integer.class); - Boolean result = (Boolean) lessThan.invoke(instanceOfClass, 7, 5); - assertFalse(result); - } - - @Test - public void testLessThanInt3() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { - Method lessThan = classToTest.getDeclaredMethod("lessThan", Integer.class, Integer.class); - Boolean result = (Boolean) lessThan.invoke(instanceOfClass, 5, 5); - assertFalse(result); - } - - @Test - public void testLessThanLong() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { - Method lessThan = classToTest.getDeclaredMethod("lessThan", Long.class,Long.class); - Boolean result = (Boolean) lessThan.invoke(instanceOfClass, 5L, 7L); - assertTrue(result); - } - - @Test - public void testLessThanLong2() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { - Method lessThan = classToTest.getDeclaredMethod("lessThan", Long.class, Long.class); - Boolean result = (Boolean) lessThan.invoke(instanceOfClass, 7L, 5L); - assertFalse(result); - } - - @Test - public void testLessThanLong3() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { - Method lessThan = classToTest.getDeclaredMethod("lessThan", Long.class, Long.class); - Boolean result = (Boolean) lessThan.invoke(instanceOfClass, 5L, 5L); - assertFalse(result); - } - - @Test - public void testLessThanFloat() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { - Method lessThan = classToTest.getDeclaredMethod("lessThan", Float.class, Float.class); - Boolean result = (Boolean) lessThan.invoke(instanceOfClass, 7F, 5F); - assertFalse(result); - } - - @Test - public void testLessThanDouble() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { - Method lessThan = classToTest.getDeclaredMethod("lessThan", Double.class, Double.class); - Boolean result = (Boolean) lessThan.invoke(instanceOfClass, 7.0, 5.0); - assertFalse(result); - } - - @Test - public void testLessThanLongInt() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { - Method lessThan = classToTest.getDeclaredMethod("lessThan", Long.class, Integer.class); - Boolean result = (Boolean) lessThan.invoke(instanceOfClass, 7L, 5); - assertFalse(result); - } - - @Test - public void testLessThanFloatInt() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { - Method lessThan = classToTest.getDeclaredMethod("lessThan", Float.class, Integer.class); - Boolean result = (Boolean) lessThan.invoke(instanceOfClass, 7F, 5); - assertFalse(result); - } - - @Test - public void testLessThanDoubleInt() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { - Method lessThan = classToTest.getDeclaredMethod("lessThan", Double.class, Integer.class); - Boolean result = (Boolean) lessThan.invoke(instanceOfClass, 7.0, 5); - assertFalse(result); - } - - @Test - public void testLessThanFloatLong() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { - Method lessThan = classToTest.getDeclaredMethod("lessThan", Float.class, Long.class); - Boolean result = (Boolean) lessThan.invoke(instanceOfClass, 7F, 5L); - assertFalse(result); - } - - @Test - public void testLessThanDoubleLong() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { - Method lessThan = classToTest.getDeclaredMethod("lessThan", Double.class, Long.class); - Boolean result = (Boolean) lessThan.invoke(instanceOfClass, 7.0, 5L); - assertFalse(result); - } - - @Test - public void testLessThanDoubleFloat() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { - Method lessThan = classToTest.getDeclaredMethod("lessThan", Double.class, Float.class); - Boolean result = (Boolean) lessThan.invoke(instanceOfClass, 7.0, 5F); - assertFalse(result); - } - -} diff --git a/test/bytecode/MatrixOpTest.java b/test/bytecode/MatrixOpTest.java deleted file mode 100644 index 8fe538aa..00000000 --- a/test/bytecode/MatrixOpTest.java +++ /dev/null @@ -1,91 +0,0 @@ -package bytecode; - -import static org.junit.Assert.*; - -import java.io.File; -import java.io.IOException; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.net.URL; -import java.net.URLClassLoader; -import java.util.Vector; - -import org.junit.BeforeClass; -import org.junit.Test; - -import de.dhbwstuttgart.core.JavaTXCompiler; - -public class MatrixOpTest { - private static String path; - private static File fileToTest; - private static JavaTXCompiler compiler; - private static ClassLoader loader; - private static Class classToTest; - private static String pathToClassFile; - private static Object instanceOfClass_m1; - private static Object instanceOfClass_m2; - private static Object instanceOfClass_m3; - - @Test - public void test() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, ClassNotFoundException, IOException, InstantiationException { - path = System.getProperty("user.dir")+"/test/bytecode/javFiles/MatrixOP.jav"; - fileToTest = new File(path); - compiler = new JavaTXCompiler(fileToTest); - pathToClassFile = System.getProperty("user.dir")+"/testBytecode/generatedBC/"; -// compiler.generateBytecode(pathToClassFile); -// loader = new URLClassLoader(new URL[] {new URL("file://"+pathToClassFile)}); -// classToTest = loader.loadClass("MatrixOP"); -/* - Vector> vv = new Vector>(); - Vector v1 = new Vector (); - v1.addElement(2); - v1.addElement(2); - Vector v2 = new Vector (); - v2.addElement(3); - v2.addElement(3); - //Matrix m1 = new Matrix(); - //m1.addElement(v1); - //m1.addElement(v2); - vv.addElement(v1); - vv.addElement(v2); - instanceOfClass_m1 = classToTest.getDeclaredConstructor(Vector.class).newInstance(vv); //Matrix m1 = new Matrix(vv); - - Vector> vv1 = new Vector>(); - Vector v3 = new Vector (); - v3.addElement(2); - v3.addElement(2); - Vector v4 = new Vector (); - v4.addElement(3); - v4.addElement(3); - //Matrix m2 = new Matrix(); - //m2.addElement(v3); - //m2.addElement(v4); - vv1.addElement(v3); - vv1.addElement(v4); - instanceOfClass_m2 = classToTest.getDeclaredConstructor(Vector.class).newInstance(vv1);//Matrix m2 = new Matrix(vv1); - - - - //Matrix m3 = m1.mul(vv1); - Method mul = classToTest.getDeclaredMethod("mul", Vector.class); - Object result = mul.invoke(instanceOfClass_m1, instanceOfClass_m2); - System.out.println(instanceOfClass_m1.toString() + " * " + instanceOfClass_m2.toString() + " = " + result.toString()); - - Vector> res = new Vector>(); - Vector v5 = new Vector (); - v5.addElement(10); - v5.addElement(10); - Vector v6 = new Vector (); - v6.addElement(15); - v6.addElement(15); - //Matrix m2 = new Matrix(); - //m2.addElement(v3); - //m2.addElement(v4); - res.addElement(v5); - res.addElement(v6); - instanceOfClass_m3 = classToTest.getDeclaredConstructor(Vector.class).newInstance(res); - assertEquals(result, instanceOfClass_m3); -*/ - } - -} diff --git a/test/bytecode/MergeTest.java b/test/bytecode/MergeTest.java deleted file mode 100644 index 9f3943ca..00000000 --- a/test/bytecode/MergeTest.java +++ /dev/null @@ -1,41 +0,0 @@ -package bytecode; - - -import static org.junit.Assert.assertEquals; - -import java.io.File; -import java.lang.reflect.Method; -import java.net.URL; -import java.net.URLClassLoader; - -import org.junit.Test; - -import de.dhbwstuttgart.core.JavaTXCompiler; - -public class MergeTest { - private static String path; - private static File fileToTest; - private static JavaTXCompiler compiler; - private static ClassLoader loader; - private static Class classToTest; - private static String pathToClassFile; - private static Object instanceOfClass; - - - @Test - public void generateBC() throws Exception { - path = System.getProperty("user.dir")+"/test/bytecode/javFiles/Merge.jav"; - fileToTest = new File(path); - compiler = new JavaTXCompiler(fileToTest); - compiler.generateBytecode(System.getProperty("user.dir")+"/testBytecode/generatedBC/"); -// pathToClassFile = System.getProperty("user.dir")+"/testBytecode/generatedBC/"; -// loader = new URLClassLoader(new URL[] {new URL("file://"+pathToClassFile)}); -// classToTest = loader.loadClass("Merge"); - //instanceOfClass = classToTest.getDeclaredConstructor().newInstance(); - - //Method m = classToTest.getDeclaredMethod("m"); - //Object result = m.invoke(instanceOfClass); - - //assertEquals(result.getClass(), loader.loadClass("Apply")); - } -} diff --git a/test/bytecode/OLTest.java b/test/bytecode/OLTest.java deleted file mode 100644 index d6ab4dd1..00000000 --- a/test/bytecode/OLTest.java +++ /dev/null @@ -1,92 +0,0 @@ -package bytecode; - -import static org.junit.Assert.*; - -import java.io.File; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.net.URL; -import java.net.URLClassLoader; - -import org.junit.BeforeClass; -import org.junit.Test; - -import de.dhbwstuttgart.core.JavaTXCompiler; - -public class OLTest { - private static String path; - private static File fileToTest; - private static JavaTXCompiler compiler; - private static ClassLoader loader; - private static Class classToTest; - private static Class classToTest1; - private static String pathToClassFile; - private static Object instanceOfClass; - private static Object instanceOfClass1; - - @BeforeClass - public static void setUpBeforeClass() throws Exception { - path = System.getProperty("user.dir")+"/test/bytecode/javFiles/OL.jav"; - fileToTest = new File(path); - compiler = new JavaTXCompiler(fileToTest); - pathToClassFile = System.getProperty("user.dir")+"/testBytecode/generatedBC/"; - compiler.generateBytecode(pathToClassFile); - loader = new URLClassLoader(new URL[] {new URL("file://"+pathToClassFile)}); - classToTest = loader.loadClass("OL"); - instanceOfClass = classToTest.getDeclaredConstructor().newInstance(); - classToTest1 = loader.loadClass("OLMain"); - instanceOfClass1 = classToTest1.getDeclaredConstructor().newInstance(); - } - - @Test - public void testOLClassName() { - assertEquals("OL", classToTest.getName()); - } - - @Test - public void testmInt() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { - Method m = classToTest.getDeclaredMethod("m", Integer.class); - Integer result = (Integer) m.invoke(instanceOfClass, 5); - assertEquals(10, result); - } - - @Test - public void testmDouble() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { - Method m = classToTest.getDeclaredMethod("m", Double.class); - Double result = (Double) m.invoke(instanceOfClass, 5.0); - assertEquals(10.0, result); - } - - @Test - public void testmString() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { - Method m = classToTest.getDeclaredMethod("m", String.class); - String result = (String) m.invoke(instanceOfClass, "xxx"); - assertEquals("xxxxxx", result); - } - - @Test - public void testOLMainClassName() { - assertEquals("OLMain", classToTest1.getName()); - } - - @Test - public void testmainInt() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { - Method main = classToTest1.getDeclaredMethod("main", Integer.class); - Integer result = (Integer) main.invoke(instanceOfClass1, 5); - assertEquals(10, result); - } - - @Test - public void testmainDouble() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { - Method main = classToTest1.getDeclaredMethod("main", Double.class); - Double result = (Double) main.invoke(instanceOfClass1, 5.0); - assertEquals(10.0, result); - } - - @Test - public void testmainString() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { - Method main = classToTest1.getDeclaredMethod("main", String.class); - String result = (String) main.invoke(instanceOfClass1, "xxx"); - assertEquals("xxxxxx", result); - } -} diff --git a/test/bytecode/OpTest.java b/test/bytecode/OpTest.java deleted file mode 100644 index 3909f0cd..00000000 --- a/test/bytecode/OpTest.java +++ /dev/null @@ -1,61 +0,0 @@ -package bytecode; - -import static org.junit.Assert.*; - -import java.io.File; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.net.URL; -import java.net.URLClassLoader; - -import org.junit.BeforeClass; -import org.junit.Test; -import org.objectweb.asm.Opcodes; - -import de.dhbwstuttgart.core.JavaTXCompiler; - -public class OpTest { - private static String path; - private static File fileToTest; - private static JavaTXCompiler compiler; - private static ClassLoader loader; - private static Class classToTest; - private static String pathToClassFile; - private static Object instanceOfClass; - - @BeforeClass - public static void setUpBeforeClass() throws Exception { - path = System.getProperty("user.dir")+"/test/bytecode/javFiles/Op.jav"; - fileToTest = new File(path); - compiler = new JavaTXCompiler(fileToTest); - pathToClassFile = System.getProperty("user.dir")+"/testBytecode/generatedBC/"; - compiler.generateBytecode(pathToClassFile); - loader = new URLClassLoader(new URL[] {new URL("file://"+pathToClassFile)}); - classToTest = loader.loadClass("Op"); - instanceOfClass = classToTest.getDeclaredConstructor().newInstance(); - } - - @Test - public void testAddString() throws NoSuchMethodException, SecurityException, IllegalAccessException, - IllegalArgumentException, InvocationTargetException, InstantiationException { - - Method m = classToTest.getDeclaredMethod("m", String.class,String.class); - - String result = (String) m.invoke(instanceOfClass, "Byte","Code"); - - assertEquals("ByteCode", result); - } - - @Test - public void testAddInt() throws NoSuchMethodException, SecurityException, IllegalAccessException, - IllegalArgumentException, InvocationTargetException, InstantiationException { - - Method m = classToTest.getDeclaredMethod("m", Integer.class,Integer.class); - - Integer result = (Integer) m.invoke(instanceOfClass, 7,3); - - assertEquals(10, result); - } - - -} diff --git a/test/bytecode/OverloadingTest.java b/test/bytecode/OverloadingTest.java deleted file mode 100644 index 6b4bf8eb..00000000 --- a/test/bytecode/OverloadingTest.java +++ /dev/null @@ -1,57 +0,0 @@ -package bytecode; - -import static org.junit.Assert.*; - -import java.io.File; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.net.URL; -import java.net.URLClassLoader; - -import org.junit.BeforeClass; -import org.junit.Test; - -import de.dhbwstuttgart.core.JavaTXCompiler; - -public class OverloadingTest { - private static String path; - private static File fileToTest; - private static JavaTXCompiler compiler; - private static ClassLoader loader; - private static Class classToTest; - private static String pathToClassFile; - private static Object instanceOfClass; - - private static Class classOL2; - private static Object instanceOfClassOL2; - - @BeforeClass - public static void setUpBeforeClass() throws Exception { - path = System.getProperty("user.dir")+"/test/bytecode/javFiles/Overloading.jav"; - fileToTest = new File(path); - compiler = new JavaTXCompiler(fileToTest); - pathToClassFile = System.getProperty("user.dir")+"/testBytecode/generatedBC/"; - compiler.generateBytecode(pathToClassFile); - loader = new URLClassLoader(new URL[] {new URL("file://"+pathToClassFile)}); - classToTest = loader.loadClass("Overloading"); - instanceOfClass = classToTest.getDeclaredConstructor().newInstance(); - - classOL2 = loader.loadClass("Overloading2"); - instanceOfClassOL2 = classOL2.getDeclaredConstructor().newInstance(); - } - - @Test - public void test() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { - Method meth = classToTest.getDeclaredMethod("test", classToTest); - String res = (String) meth.invoke(instanceOfClass, instanceOfClass); - assertEquals("Overloading", res); - } - - @Test - public void test2() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { - Method meth = classToTest.getDeclaredMethod("test", classOL2); - String res = (String) meth.invoke(instanceOfClass, instanceOfClassOL2); - assertEquals("Overloading2", res); - } - -} diff --git a/test/bytecode/PlusTest.java b/test/bytecode/PlusTest.java deleted file mode 100644 index 85f05b75..00000000 --- a/test/bytecode/PlusTest.java +++ /dev/null @@ -1,53 +0,0 @@ -package bytecode; - -import static org.junit.Assert.*; - -import java.io.File; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.net.URL; -import java.net.URLClassLoader; - -import org.junit.BeforeClass; -import org.junit.Test; - -import de.dhbwstuttgart.core.JavaTXCompiler; - -public class PlusTest { - private static String path; - private static File fileToTest; - private static JavaTXCompiler compiler; - private static ClassLoader loader; - private static Class classToTest; - private static String pathToClassFile; - private static Object instanceOfClass; - - @BeforeClass - public static void setUpBeforeClass() throws Exception { - path = System.getProperty("user.dir")+"/test/bytecode/javFiles/Plus.jav"; - fileToTest = new File(path); - compiler = new JavaTXCompiler(fileToTest); - pathToClassFile = System.getProperty("user.dir")+"/testBytecode/generatedBC/"; - compiler.generateBytecode(pathToClassFile); - loader = new URLClassLoader(new URL[] {new URL("file://"+pathToClassFile)}); - classToTest = loader.loadClass("Plus"); - instanceOfClass = classToTest.getDeclaredConstructor().newInstance(); - } - - @Test - public void testAddInt() throws NoSuchMethodException, SecurityException, IllegalAccessException, - IllegalArgumentException, InvocationTargetException, InstantiationException { - Method addInt = classToTest.getDeclaredMethod("m", Integer.class,Integer.class); - Number result = (Number) addInt.invoke(instanceOfClass, 7,3); - assertEquals(10, result); - } - - @Test - public void testAddString() throws NoSuchMethodException, SecurityException, IllegalAccessException, - IllegalArgumentException, InvocationTargetException, InstantiationException { - Method addString = classToTest.getDeclaredMethod("m", String.class,String.class); - String result = (String) addString.invoke(instanceOfClass, "Byte","Code"); - assertEquals("ByteCode", result); - } - -} diff --git a/test/bytecode/PostIncTest.java b/test/bytecode/PostIncTest.java deleted file mode 100644 index 6c3ebc33..00000000 --- a/test/bytecode/PostIncTest.java +++ /dev/null @@ -1,65 +0,0 @@ -package bytecode; - -import static org.junit.Assert.*; - -import java.io.File; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.net.URL; -import java.net.URLClassLoader; - -import org.junit.BeforeClass; -import org.junit.Test; - -import de.dhbwstuttgart.core.JavaTXCompiler; - -public class PostIncTest { - private static String path; - private static File fileToTest; - private static JavaTXCompiler compiler; - private static ClassLoader loader; - private static Class classToTest; - private static String pathToClassFile; - private static Object instanceOfClass; - - @BeforeClass - public static void setUpBeforeClass() throws Exception { - path = System.getProperty("user.dir")+"/test/bytecode/javFiles/PostIncDec.jav"; - fileToTest = new File(path); - compiler = new JavaTXCompiler(fileToTest); - pathToClassFile = System.getProperty("user.dir")+"/testBytecode/generatedBC/"; - compiler.generateBytecode(pathToClassFile); - loader = new URLClassLoader(new URL[] {new URL("file://"+pathToClassFile)}); - classToTest = loader.loadClass("PostIncDec"); - instanceOfClass = classToTest.getDeclaredConstructor().newInstance(); - } - - @Test - public void testM1() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { - Method m = classToTest.getDeclaredMethod("m"); - Integer res = (Integer) m.invoke(instanceOfClass); - assertEquals(1, res); - } - - @Test - public void testM2() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { - Method m = classToTest.getDeclaredMethod("m2"); - Integer res = (Integer) m.invoke(instanceOfClass); - assertEquals(0, res); - } - - @Test - public void testD1() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { - Method m = classToTest.getDeclaredMethod("d"); - Integer res = (Integer) m.invoke(instanceOfClass); - assertEquals(-1, res); - } - - @Test - public void testD2() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { - Method m = classToTest.getDeclaredMethod("d2"); - Integer res = (Integer) m.invoke(instanceOfClass); - assertEquals(0, res); - } - -} diff --git a/test/bytecode/PreIncTest.java b/test/bytecode/PreIncTest.java deleted file mode 100644 index 29feac33..00000000 --- a/test/bytecode/PreIncTest.java +++ /dev/null @@ -1,65 +0,0 @@ -package bytecode; - -import static org.junit.Assert.*; - -import java.io.File; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.net.URL; -import java.net.URLClassLoader; - -import org.junit.BeforeClass; -import org.junit.Test; - -import de.dhbwstuttgart.core.JavaTXCompiler; - -public class PreIncTest { - private static String path; - private static File fileToTest; - private static JavaTXCompiler compiler; - private static ClassLoader loader; - private static Class classToTest; - private static String pathToClassFile; - private static Object instanceOfClass; - - @BeforeClass - public static void setUpBeforeClass() throws Exception { - path = System.getProperty("user.dir")+"/test/bytecode/javFiles/PreInc.jav"; - fileToTest = new File(path); - compiler = new JavaTXCompiler(fileToTest); - pathToClassFile = System.getProperty("user.dir")+"/testBytecode/generatedBC/"; - compiler.generateBytecode(pathToClassFile); - loader = new URLClassLoader(new URL[] {new URL("file://" + pathToClassFile)}); - classToTest = loader.loadClass("PreInc"); - instanceOfClass = classToTest.getDeclaredConstructor().newInstance(); - } - - @Test - public void testM() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { - Method m = classToTest.getDeclaredMethod("m"); - Integer res = (Integer) m.invoke(instanceOfClass); - assertEquals(1, res); - } - - @Test - public void testM2() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { - Method m = classToTest.getDeclaredMethod("m2"); - Integer res = (Integer) m.invoke(instanceOfClass); - assertEquals(1, res); - } - - @Test - public void testD() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { - Method m = classToTest.getDeclaredMethod("d"); - Integer res = (Integer) m.invoke(instanceOfClass); - assertEquals(-1, res); - } - - @Test - public void testD2() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { - Method m = classToTest.getDeclaredMethod("d2"); - Integer res = (Integer) m.invoke(instanceOfClass); - assertEquals(-1, res); - } - -} diff --git a/test/bytecode/RelOpsTest.java b/test/bytecode/RelOpsTest.java deleted file mode 100644 index 1bdf1a1d..00000000 --- a/test/bytecode/RelOpsTest.java +++ /dev/null @@ -1,44 +0,0 @@ -package bytecode; - -import static org.junit.Assert.*; - -import java.io.File; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.net.URL; -import java.net.URLClassLoader; - -import org.junit.BeforeClass; -import org.junit.Test; - -import de.dhbwstuttgart.core.JavaTXCompiler; - -public class RelOpsTest { - private static String path; - private static File fileToTest; - private static JavaTXCompiler compiler; - private static ClassLoader loader; - private static Class classToTest; - private static String pathToClassFile; - private static Object instanceOfClass; - - @BeforeClass - public static void setUpBeforeClass() throws Exception { - path = System.getProperty("user.dir")+"/test/bytecode/javFiles/RelOps.jav"; - fileToTest = new File(path); - compiler = new JavaTXCompiler(fileToTest); - pathToClassFile = System.getProperty("user.dir")+"/testBytecode/generatedBC/"; - compiler.generateBytecode(pathToClassFile); - loader = new URLClassLoader(new URL[] {new URL("file://"+pathToClassFile)}); - classToTest = loader.loadClass("RelOps"); - instanceOfClass = classToTest.getDeclaredConstructor().newInstance(); - } - - @Test - public void test() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { - Method m = classToTest.getDeclaredMethod("m", Integer.class,Integer.class); - Boolean result = (Boolean) m.invoke(instanceOfClass, 7,3); - assertFalse(result); - } - -} diff --git a/test/bytecode/SubMatTest.java b/test/bytecode/SubMatTest.java deleted file mode 100644 index 8818bd40..00000000 --- a/test/bytecode/SubMatTest.java +++ /dev/null @@ -1,27 +0,0 @@ -package bytecode; - -import static org.junit.Assert.*; - -import java.io.File; -import java.io.IOException; - -import org.junit.Test; - -import de.dhbwstuttgart.core.JavaTXCompiler; - -public class SubMatTest { - private static String path; - private static File fileToTest; - private static JavaTXCompiler compiler; - private static String pathToClassFile; - - @Test - public void test() throws ClassNotFoundException, IOException { - path = System.getProperty("user.dir")+"/test/bytecode/javFiles/SubMatrix.jav"; - fileToTest = new File(path); - compiler = new JavaTXCompiler(fileToTest); - pathToClassFile = System.getProperty("user.dir")+"/testBytecode/generatedBC/"; - compiler.generateBytecode(pathToClassFile); - } - -} diff --git a/test/bytecode/Tph2Test.java b/test/bytecode/Tph2Test.java deleted file mode 100644 index f267f45a..00000000 --- a/test/bytecode/Tph2Test.java +++ /dev/null @@ -1,69 +0,0 @@ -package bytecode; - -import static org.junit.Assert.*; - -import java.io.File; -import java.lang.reflect.Method; -import java.net.URL; -import java.net.URLClassLoader; - -import org.junit.BeforeClass; -import org.junit.Test; - -import de.dhbwstuttgart.core.JavaTXCompiler; - -public class Tph2Test { - - private static String path; - private static File fileToTest; - private static JavaTXCompiler compiler; - private static ClassLoader loader; - private static Class classToTest; - private static String pathToClassFile; - private static Object instanceOfClass; - - @BeforeClass - public static void setUpBeforeClass() throws Exception { - path = System.getProperty("user.dir")+"/test/bytecode/javFiles/Tph2.jav"; - fileToTest = new File(path); - compiler = new JavaTXCompiler(fileToTest); - pathToClassFile = System.getProperty("user.dir")+"/testBytecode/generatedBC/"; - compiler.generateBytecode(pathToClassFile); - loader = new URLClassLoader(new URL[] {new URL("file://"+pathToClassFile)}); - classToTest = loader.loadClass("Tph2"); - instanceOfClass = classToTest.getDeclaredConstructor().newInstance(); - } - - @Test - public void test1() throws Exception { - Method m = classToTest.getDeclaredMethod("m", Object.class, Object.class); - Object result = m.invoke(instanceOfClass, 1,2); - - assertEquals(1,result); - } - - @Test - public void test2() throws Exception { - Method m = classToTest.getDeclaredMethod("m", Object.class, Object.class); - Object result = m.invoke(instanceOfClass, "sss",2); - - assertEquals("sss",result); - } - - @Test - public void test3() throws Exception { - Method m = classToTest.getDeclaredMethod("m2", Object.class, Object.class); - Object result = m.invoke(instanceOfClass, 1,2); - - assertEquals(2,result); - } - - @Test - public void test4() throws Exception { - Method m = classToTest.getDeclaredMethod("m2", Object.class, Object.class); - Object result = m.invoke(instanceOfClass, 1,"xxx"); - - assertEquals("xxx",result); - } - -} diff --git a/test/bytecode/Tph3Test.java b/test/bytecode/Tph3Test.java deleted file mode 100644 index 58bc9e64..00000000 --- a/test/bytecode/Tph3Test.java +++ /dev/null @@ -1,31 +0,0 @@ -package bytecode; - -import static org.junit.Assert.*; - -import java.io.File; -import java.lang.reflect.Method; -import java.net.URL; -import java.net.URLClassLoader; - -import org.junit.BeforeClass; -import org.junit.Test; - -import de.dhbwstuttgart.core.JavaTXCompiler; - -public class Tph3Test { - - private static String path; - private static File fileToTest; - private static JavaTXCompiler compiler; - private static String pathToClassFile; - - @Test - public void generateBC() throws Exception { - path = System.getProperty("user.dir")+"/test/bytecode/javFiles/Tph3.jav"; - fileToTest = new File(path); - compiler = new JavaTXCompiler(fileToTest); - pathToClassFile = System.getProperty("user.dir")+"/testBytecode/generatedBC/"; - compiler.generateBytecode(pathToClassFile); - } - -} diff --git a/test/bytecode/Tph5Test.java b/test/bytecode/Tph5Test.java deleted file mode 100644 index 4107cca2..00000000 --- a/test/bytecode/Tph5Test.java +++ /dev/null @@ -1,45 +0,0 @@ -package bytecode; - -import static org.junit.Assert.*; - -import java.io.File; -import java.lang.reflect.Method; -import java.net.URL; -import java.net.URLClassLoader; - -import org.junit.BeforeClass; -import org.junit.Test; - -import de.dhbwstuttgart.core.JavaTXCompiler; - -public class Tph5Test { - - private static String path; - private static File fileToTest; - private static JavaTXCompiler compiler; - private static ClassLoader loader; - private static Class classToTest; - private static String pathToClassFile; - private static Object instanceOfClass; - - @BeforeClass - public static void setUpBeforeClass() throws Exception { - path = System.getProperty("user.dir")+"/test/bytecode/javFiles/Tph5.jav"; - fileToTest = new File(path); - compiler = new JavaTXCompiler(fileToTest); - pathToClassFile = System.getProperty("user.dir")+"/testBytecode/generatedBC/"; - compiler.generateBytecode(pathToClassFile); - loader = new URLClassLoader(new URL[] {new URL("file://"+pathToClassFile)}); - classToTest = loader.loadClass("Tph5"); - instanceOfClass = classToTest.getDeclaredConstructor().newInstance(); - } - - @Test - public void test() throws Exception { -// Method m = classToTest.getDeclaredMethod("m", Object.class, Object.class, Object.class); - Method m = classToTest.getDeclaredMethod("m", Object.class, Object.class); -// Object result = m.invoke(instanceOfClass, "xx",2,3); - - //assertEquals(2,result); - } -} diff --git a/test/bytecode/TphTest.java b/test/bytecode/TphTest.java deleted file mode 100644 index 3f0a7bb3..00000000 --- a/test/bytecode/TphTest.java +++ /dev/null @@ -1,69 +0,0 @@ -package bytecode; - -import static org.junit.Assert.*; - -import java.io.File; -import java.lang.reflect.Method; -import java.net.URL; -import java.net.URLClassLoader; - -import org.junit.BeforeClass; -import org.junit.Test; - -import de.dhbwstuttgart.core.JavaTXCompiler; - -public class TphTest { - - private static String path; - private static File fileToTest; - private static JavaTXCompiler compiler; - private static ClassLoader loader; - private static Class classToTest; - private static String pathToClassFile; - private static Object instanceOfClass; - - @BeforeClass - public static void setUpBeforeClass() throws Exception { - path = System.getProperty("user.dir")+"/test/bytecode/javFiles/Tph.jav"; - fileToTest = new File(path); - compiler = new JavaTXCompiler(fileToTest); - pathToClassFile = System.getProperty("user.dir")+"/testBytecode/generatedBC/"; - compiler.generateBytecode(pathToClassFile); - loader = new URLClassLoader(new URL[] {new URL("file://"+pathToClassFile)}); - classToTest = loader.loadClass("Tph"); - instanceOfClass = classToTest.getDeclaredConstructor().newInstance(); - } - - @Test - public void test1() throws Exception { - Method m = classToTest.getDeclaredMethod("m", Object.class, Object.class); - Object result = m.invoke(instanceOfClass, 1,2); - - assertEquals(2,result); - } - - @Test - public void test2() throws Exception { - Method m = classToTest.getDeclaredMethod("m", Object.class, Object.class); - Object result = m.invoke(instanceOfClass, 1, "sss"); - - assertEquals("sss",result); - } - - @Test - public void test3() throws Exception { - Method m = classToTest.getDeclaredMethod("m2", Object.class); - Object result = m.invoke(instanceOfClass, 2); - - assertEquals(2,result); - } - - @Test - public void test4() throws Exception { - Method m = classToTest.getDeclaredMethod("m2", Object.class); - Object result = m.invoke(instanceOfClass,"xxx"); - - assertEquals("xxx",result); - } - -} diff --git a/test/bytecode/WhileTest.java b/test/bytecode/WhileTest.java deleted file mode 100644 index 67c80c19..00000000 --- a/test/bytecode/WhileTest.java +++ /dev/null @@ -1,58 +0,0 @@ -package bytecode; - -import static org.junit.Assert.*; - -import java.io.File; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.net.URL; -import java.net.URLClassLoader; - -import org.junit.BeforeClass; -import org.junit.Test; - -import de.dhbwstuttgart.core.JavaTXCompiler; - -public class WhileTest { - private static String path; - private static File fileToTest; - private static JavaTXCompiler compiler; - private static ClassLoader loader; - private static Class classToTest; - private static String pathToClassFile; - private static Object instanceOfClass; - - @BeforeClass - public static void setUpBeforeClass() throws Exception { - path = System.getProperty("user.dir")+"/test/bytecode/javFiles/While.jav"; - fileToTest = new File(path); - compiler = new JavaTXCompiler(fileToTest); - pathToClassFile = System.getProperty("user.dir")+"/testBytecode/generatedBC/"; - compiler.generateBytecode(pathToClassFile); - loader = new URLClassLoader(new URL[] {new URL("file://"+pathToClassFile)}); - classToTest = loader.loadClass("While"); - instanceOfClass = classToTest.getDeclaredConstructor().newInstance(); - } - - @Test - public void test() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { - Method m = classToTest.getDeclaredMethod("m", Integer.class); - Integer result = (Integer) m.invoke(instanceOfClass, 0); - assertEquals(2, result); - } - - @Test - public void testDouble() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { - Method m = classToTest.getDeclaredMethod("m", Double.class); - Double result = (Double) m.invoke(instanceOfClass, 0.0); - assertEquals(2.0, result); - } - - @Test - public void testLong() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { - Method m = classToTest.getDeclaredMethod("m", Long.class); - Long result = (Long) m.invoke(instanceOfClass, 0l); - assertEquals(2l, result); - } - -} diff --git a/test/bytecode/YTest.java b/test/bytecode/YTest.java deleted file mode 100644 index 80d37c6a..00000000 --- a/test/bytecode/YTest.java +++ /dev/null @@ -1,52 +0,0 @@ -package bytecode; - -import static org.junit.Assert.assertEquals; - -import java.io.File; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.net.URL; -import java.net.URLClassLoader; - -import org.junit.Test; - -import de.dhbwstuttgart.core.JavaTXCompiler; - -public class YTest { - private static String path; - private static File fileToTest; - private static JavaTXCompiler compiler; - private static ClassLoader loader; - private static Class classToTest; - private static String pathToClassFile; - private static Object instanceOfClass; - - @Test - public void generateBC() throws Exception { - path = System.getProperty("user.dir")+"/test/bytecode/javFiles/Y.jav"; - fileToTest = new File(path); - compiler = new JavaTXCompiler(fileToTest); - compiler.generateBytecode(System.getProperty("user.dir")+"/testBytecode/generatedBC/"); - pathToClassFile = System.getProperty("user.dir")+"/testBytecode/generatedBC/"; - loader = new URLClassLoader(new URL[] {new URL("file://"+pathToClassFile)}); - classToTest = loader.loadClass("Y"); - /* - instanceOfClass = classToTest.getDeclaredConstructor().newInstance(); - - Method m = classToTest.getDeclaredMethod("m"); - Class lambda = m.invoke(instanceOfClass).getClass(); - Method apply = lambda.getMethod("apply", Object.class); - - // Damit man auf die Methode zugreifen kann - apply.setAccessible(true); - - Integer i = 77; - - Integer result = (Integer) apply.invoke(m.invoke(instanceOfClass), i); - - assertEquals(77, result); - */ - } - - -} diff --git a/test/bytecode/applyLambdaTest.java b/test/bytecode/applyLambdaTest.java deleted file mode 100644 index b73cf507..00000000 --- a/test/bytecode/applyLambdaTest.java +++ /dev/null @@ -1,39 +0,0 @@ -package bytecode; - -import static org.junit.Assert.assertEquals; - -import java.io.File; -import java.lang.reflect.Method; -import java.net.URL; -import java.net.URLClassLoader; - -import org.junit.Test; - -import de.dhbwstuttgart.core.JavaTXCompiler; - -public class applyLambdaTest { - private static String path; - private static File fileToTest; - private static JavaTXCompiler compiler; - private static ClassLoader loader; - private static Class classToTest; - private static String pathToClassFile; - private static Object instanceOfClass; - - @Test - public void generateBC() throws Exception { - path = System.getProperty("user.dir")+"/test/bytecode/javFiles/applyLambda.jav"; - fileToTest = new File(path); - compiler = new JavaTXCompiler(fileToTest); - compiler.generateBytecode(System.getProperty("user.dir")+"/testBytecode/generatedBC/"); - pathToClassFile = System.getProperty("user.dir")+"/testBytecode/generatedBC/"; - loader = new URLClassLoader(new URL[] {new URL("file://"+pathToClassFile)}); - classToTest = loader.loadClass("applyLambda"); - instanceOfClass = classToTest.getDeclaredConstructor().newInstance(); - - Method m = classToTest.getDeclaredMethod("m"); - Object result = m.invoke(instanceOfClass); - - assertEquals(result.getClass(), loader.loadClass("Apply")); - } -} diff --git a/test/parser/GeneralParserTest.java b/test/parser/GeneralParserTest.java deleted file mode 100644 index 4e7d9868..00000000 --- a/test/parser/GeneralParserTest.java +++ /dev/null @@ -1,55 +0,0 @@ -package parser; - -import static org.junit.Assert.*; - -import java.io.File; -import java.util.ArrayList; -import java.util.List; -import java.util.stream.Collectors; - -import de.dhbwstuttgart.core.JavaTXCompiler; -import de.dhbwstuttgart.parser.JavaTXParser; - -import org.junit.Test; - - -/** - * Dieser Test pr�ft nur, ob .java-Dateien fehlerfrei geparst werden. - * Der dabei erstellte Syntaxbaum wird nicht kontrolliert. - * @author janulrich - * - */ -public class GeneralParserTest{ - private static final String rootDirectory = System.getProperty("user.dir")+"/test/parser/"; - - @Test - public void run(){ - - - List filenames = new ArrayList(); - /* - filenames.add("NewTest.jav"); - filenames.add("FieldInitializationTest.jav"); - filenames.add("ImportTest.jav"); - filenames.add("CastTest.jav"); - filenames.add("StatementsTest.jav"); - //filenames.add("Methods.jav"); - filenames.add("ImportTestGeneric.jav"); - filenames.add("CastTest.jav"); - //filenames.add("BoundedParameter.jav"); - //filenames.add("GenericFieldVarTest.jav"); - filenames.add("FieldVarTest.jav"); - filenames.add("StructuralTypes.jav"); - */ -// filenames.add("ExtendsTest.jav"); - filenames.add("PackageNameTest.jav"); - try{ - new JavaTXCompiler(filenames.stream().map(s -> new File(rootDirectory + s)).collect(Collectors.toList())); - }catch(Exception exc){ - exc.printStackTrace(); - fail(); - } - assertTrue("Tests durchlaufen",filenames.size()>0); - } - -} diff --git a/testBytecode/generatedBC/.gitignore b/testBytecode/generatedBC/.gitignore deleted file mode 100644 index 5e7d2734..00000000 --- a/testBytecode/generatedBC/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -# Ignore everything in this directory -* -# Except this file -!.gitignore