diff --git a/src/test/java/NegativeTests/ForbiddenParticularitiesInImplementation.java b/src/test/java/NegativeTests/ForbiddenParticularitiesInImplementation.java index 65e25db..bae1ea0 100644 --- a/src/test/java/NegativeTests/ForbiddenParticularitiesInImplementation.java +++ b/src/test/java/NegativeTests/ForbiddenParticularitiesInImplementation.java @@ -22,19 +22,19 @@ public class ForbiddenParticularitiesInImplementation { "AddressingFieldWithoutThis.java"))); } -// @Test -// public void ForbiddenParticularitiesInImplementationIMinusMinus() { -// assertThrows(Exception.class, () -> Compiler.generateByteCodeFilesFromFiles(List.of( -// "src/test/testFiles/Negative/ForbiddenParticularitiesInImplementation/" + -// "IMinusMinus.java"))); -// } -// -// @Test -// public void ForbiddenParticularitiesInImplementationIPlusPlus() { -// assertThrows(Exception.class, () -> Compiler.generateByteCodeFilesFromFiles(List.of( -// "src/test/testFiles/Negative/ForbiddenParticularitiesInImplementation/" + -// "IPlusPlus.java"))); -// } + @Test + public void ForbiddenParticularitiesInImplementationIMinusMinus() { + assertThrows(Exception.class, () -> Compiler.generateByteCodeFilesFromFiles(List.of( + "src/test/testFiles/Negative/ForbiddenParticularitiesInImplementation/" + + "IMinusMinus.java"))); + } + + @Test + public void ForbiddenParticularitiesInImplementationIPlusPlus() { + assertThrows(Exception.class, () -> Compiler.generateByteCodeFilesFromFiles(List.of( + "src/test/testFiles/Negative/ForbiddenParticularitiesInImplementation/" + + "IPlusPlus.java"))); + } @Test public void ForbiddenParticularitiesInImplementationUsingSystemOut() { diff --git a/src/test/java/NegativeTests/MissingComponents.java b/src/test/java/NegativeTests/MissingComponents.java index 4e771ab..94c0657 100644 --- a/src/test/java/NegativeTests/MissingComponents.java +++ b/src/test/java/NegativeTests/MissingComponents.java @@ -9,277 +9,277 @@ import static org.junit.jupiter.api.Assertions.assertThrows; public class MissingComponents { -// @Test -// public void MissingComponentsBraceInClass() { -// assertThrows(Exception.class, () -> { -// Compiler.generateByteCodeFilesFromFiles(List.of( -// "src/test/testFiles/Negative/MissingComponents/Brace/InClass.java")); -// }); -// } -// -// @Test -// public void MissingComponentsBraceInConstructor() { -// assertThrows(Exception.class, () -> { -// Compiler.generateByteCodeFilesFromFiles(List.of( -// "src/test/testFiles/Negative/MissingComponents/Brace/InConstructor.java")); -// }); -// } -// -// @Test -// public void MissingComponentsBraceInDoWhile() { -// assertThrows(Exception.class, () -> { -// Compiler.generateByteCodeFilesFromFiles(List.of( -// "src/test/testFiles/Negative/MissingComponents/Brace/InDoWhile.java")); -// }); -// } -// -// @Test -// public void MissingComponentsBraceInFor() { -// assertThrows(Exception.class, () -> { -// Compiler.generateByteCodeFilesFromFiles(List.of( -// "src/test/testFiles/Negative/MissingComponents/Brace/InFor.java")); -// }); -// } -// -// @Test -// public void MissingComponentsBraceInIf() { -// assertThrows(Exception.class, () -> { -// Compiler.generateByteCodeFilesFromFiles(List.of( -// "src/test/testFiles/Negative/MissingComponents/Brace/InIf.java")); -// }); -// } -// -// @Test -// public void MissingComponentsBraceInMethod() { -// assertThrows(Exception.class, () -> { -// Compiler.generateByteCodeFilesFromFiles(List.of( -// "src/test/testFiles/Negative/MissingComponents/Brace/InMethod.java")); -// }); -// } -// -// @Test -// public void MissingComponentsBraceInWhile() { -// assertThrows(Exception.class, () -> { -// Compiler.generateByteCodeFilesFromFiles(List.of( -// "src/test/testFiles/Negative/MissingComponents/Brace/InWhile.java")); -// }); -// } -// -// @Test -// public void MissingComponentsIdentifierInClass() { -// assertThrows(Exception.class, () -> { -// Compiler.generateByteCodeFilesFromFiles(List.of( -// "src/test/testFiles/Negative/MissingComponents/Identifier/InClass.java")); -// }); -// } -// -// @Test -// public void MissingComponentsIdentifierInConstructor() { -// assertThrows(Exception.class, () -> { -// Compiler.generateByteCodeFilesFromFiles(List.of( -// "src/test/testFiles/Negative/MissingComponents/Identifier/InConstructor.java")); -// }); -// } -// -// @Test -// public void MissingComponentsIdentifierInField() { -// assertThrows(Exception.class, () -> { -// Compiler.generateByteCodeFilesFromFiles(List.of( -// "src/test/testFiles/Negative/MissingComponents/Identifier/InField.java")); -// }); -// } -// -// @Test -// public void MissingComponentsIdentifierInFieldCall() { -// assertThrows(Exception.class, () -> { -// Compiler.generateByteCodeFilesFromFiles(List.of( -// "src/test/testFiles/Negative/MissingComponents/Identifier/InFieldCall.java")); -// }); -// } -// -// @Test -// public void MissingComponentsIdentifierInMethod() { -// assertThrows(Exception.class, () -> { -// Compiler.generateByteCodeFilesFromFiles(List.of( -// "src/test/testFiles/Negative/MissingComponents/Identifier/InMethod.java")); -// }); -// } -// -// @Test -// public void MissingComponentsIdentifierInMethodCall() { -// assertThrows(Exception.class, () -> { -// Compiler.generateByteCodeFilesFromFiles(List.of( -// "src/test/testFiles/Negative/MissingComponents/Identifier/InMethodCall.java")); -// }); -// } -// -// @Test -// public void MissingComponentsIdentifierInVariable() { -// assertThrows(Exception.class, () -> { -// Compiler.generateByteCodeFilesFromFiles(List.of( -// "src/test/testFiles/Negative/MissingComponents/Identifier/InVariable.java")); -// }); -// } -// -// @Test -// public void MissingComponentsPublicInClass() { -// assertThrows(Exception.class, () -> { -// Compiler.generateByteCodeFilesFromFiles(List.of( -// "src/test/testFiles/Negative/MissingComponents/Public/InClass.java")); -// }); -// } -// -// @Test -// public void MissingComponentsPublicInMethod() { -// assertThrows(Exception.class, () -> { -// Compiler.generateByteCodeFilesFromFiles(List.of( -// "src/test/testFiles/Negative/MissingComponents/Public/InMethod.java")); -// }); -// } -// -// @Test -// public void MissingComponentsRoundBracketsInConstructor() { -// assertThrows(Exception.class, () -> { -// Compiler.generateByteCodeFilesFromFiles(List.of( -// "src/test/testFiles/Negative/MissingComponents/RoundBrackets/InConstructor.java")); -// }); -// } -// -// @Test -// public void MissingComponentsRoundBracketsInDoWhile() { -// assertThrows(Exception.class, () -> { -// Compiler.generateByteCodeFilesFromFiles(List.of( -// "src/test/testFiles/Negative/MissingComponents/RoundBrackets/InDoWhile.java")); -// }); -// } -// -// @Test -// public void MissingComponentsRoundBracketsInElseIf() { -// assertThrows(Exception.class, () -> { -// Compiler.generateByteCodeFilesFromFiles(List.of( -// "src/test/testFiles/Negative/MissingComponents/RoundBrackets/InElseIf.java")); -// }); -// } -// -// @Test -// public void MissingComponentsRoundBracketsInFor() { -// assertThrows(Exception.class, () -> { -// Compiler.generateByteCodeFilesFromFiles(List.of( -// "src/test/testFiles/Negative/MissingComponents/RoundBrackets/InFor.java")); -// }); -// } -// -// @Test -// public void MissingComponentsRoundBracketsInIf() { -// assertThrows(Exception.class, () -> { -// Compiler.generateByteCodeFilesFromFiles(List.of( -// "src/test/testFiles/Negative/MissingComponents/RoundBrackets/InIf.java")); -// }); -// } -// -// @Test -// public void MissingComponentsRoundBracketsInMethod() { -// assertThrows(Exception.class, () -> { -// Compiler.generateByteCodeFilesFromFiles(List.of( -// "src/test/testFiles/Negative/MissingComponents/RoundBrackets/InMethod.java")); -// }); -// } -// -// @Test -// public void MissingComponentsRoundBracketsInMethodCall() { -// assertThrows(Exception.class, () -> { -// Compiler.generateByteCodeFilesFromFiles(List.of( -// "src/test/testFiles/Negative/MissingComponents/RoundBrackets/InMethodCall.java")); -// }); -// } -// -// @Test -// public void MissingComponentsRoundBracketsInNewObject() { -// assertThrows(Exception.class, () -> { -// Compiler.generateByteCodeFilesFromFiles(List.of( -// "src/test/testFiles/Negative/MissingComponents/RoundBrackets/InNewObject.java")); -// }); -// } -// -// @Test -// public void MissingComponentsRoundBracketsInWhile() { -// assertThrows(Exception.class, () -> { -// Compiler.generateByteCodeFilesFromFiles(List.of( -// "src/test/testFiles/Negative/MissingComponents/RoundBrackets/InWhile.java")); -// }); -// } -// -// @Test -// public void MissingComponentsSemicolonInAssignment() { -// assertThrows(Exception.class, () -> { -// Compiler.generateByteCodeFilesFromFiles(List.of( -// "src/test/testFiles/Negative/MissingComponents/Semicolon/InAssignment.java")); -// }); -// } -// -// @Test -// public void MissingComponentsSemicolonInDoWhile() { -// assertThrows(Exception.class, () -> { -// Compiler.generateByteCodeFilesFromFiles(List.of( -// "src/test/testFiles/Negative/MissingComponents/Semicolon/InDoWhile.java")); -// }); -// } -// -// @Test -// public void MissingComponentsSemicolonInField() { -// assertThrows(Exception.class, () -> { -// Compiler.generateByteCodeFilesFromFiles(List.of( -// "src/test/testFiles/Negative/MissingComponents/Semicolon/InField.java")); -// }); -// } -// -// @Test -// public void MissingComponentsSemicolonInMethodCall() { -// assertThrows(Exception.class, () -> { -// Compiler.generateByteCodeFilesFromFiles(List.of( -// "src/test/testFiles/Negative/MissingComponents/Semicolon/InMethodCall.java")); -// }); -// } -// -// @Test -// public void MissingComponentsSemicolonInReturn() { -// assertThrows(Exception.class, () -> { -// Compiler.generateByteCodeFilesFromFiles(List.of( -// "src/test/testFiles/Negative/MissingComponents/Semicolon/InReturn.java")); -// }); -// } -// -// @Test -// public void MissingComponentsTypeInField() { -// assertThrows(Exception.class, () -> { -// Compiler.generateByteCodeFilesFromFiles(List.of( -// "src/test/testFiles/Negative/MissingComponents/Type/InField.java")); -// }); -// } -// -// @Test -// public void MissingComponentsTypeInMethodSignature() { -// assertThrows(Exception.class, () -> { -// Compiler.generateByteCodeFilesFromFiles(List.of( -// "src/test/testFiles/Negative/MissingComponents/Type/InMethodSignature.java")); -// }); -// } -// -// @Test -// public void MissingComponentsTypeInParameter() { -// assertThrows(Exception.class, () -> { -// Compiler.generateByteCodeFilesFromFiles(List.of( -// "src/test/testFiles/Negative/MissingComponents/Type/InParameter.java")); -// }); -// } -// -// @Test -// public void MissingComponentsClassInClass() { -// assertThrows(Exception.class, () -> { -// Compiler.generateByteCodeFilesFromFiles(List.of( -// "src/test/testFiles/Negative/MissingComponents/ClassInClass.java")); -// }); -// } + @Test + public void MissingComponentsBraceInClass() { + assertThrows(Exception.class, () -> { + Compiler.generateByteCodeFilesFromFiles(List.of( + "src/test/testFiles/Negative/MissingComponents/Brace/InClass.java")); + }); + } + + @Test + public void MissingComponentsBraceInConstructor() { + assertThrows(Exception.class, () -> { + Compiler.generateByteCodeFilesFromFiles(List.of( + "src/test/testFiles/Negative/MissingComponents/Brace/InConstructor.java")); + }); + } + + @Test + public void MissingComponentsBraceInDoWhile() { + assertThrows(Exception.class, () -> { + Compiler.generateByteCodeFilesFromFiles(List.of( + "src/test/testFiles/Negative/MissingComponents/Brace/InDoWhile.java")); + }); + } + + @Test + public void MissingComponentsBraceInFor() { + assertThrows(Exception.class, () -> { + Compiler.generateByteCodeFilesFromFiles(List.of( + "src/test/testFiles/Negative/MissingComponents/Brace/InFor.java")); + }); + } + + @Test + public void MissingComponentsBraceInIf() { + assertThrows(Exception.class, () -> { + Compiler.generateByteCodeFilesFromFiles(List.of( + "src/test/testFiles/Negative/MissingComponents/Brace/InIf.java")); + }); + } + + @Test + public void MissingComponentsBraceInMethod() { + assertThrows(Exception.class, () -> { + Compiler.generateByteCodeFilesFromFiles(List.of( + "src/test/testFiles/Negative/MissingComponents/Brace/InMethod.java")); + }); + } + + @Test + public void MissingComponentsBraceInWhile() { + assertThrows(Exception.class, () -> { + Compiler.generateByteCodeFilesFromFiles(List.of( + "src/test/testFiles/Negative/MissingComponents/Brace/InWhile.java")); + }); + } + + @Test + public void MissingComponentsIdentifierInClass() { + assertThrows(Exception.class, () -> { + Compiler.generateByteCodeFilesFromFiles(List.of( + "src/test/testFiles/Negative/MissingComponents/Identifier/InClass.java")); + }); + } + + @Test + public void MissingComponentsIdentifierInConstructor() { + assertThrows(Exception.class, () -> { + Compiler.generateByteCodeFilesFromFiles(List.of( + "src/test/testFiles/Negative/MissingComponents/Identifier/InConstructor.java")); + }); + } + + @Test + public void MissingComponentsIdentifierInField() { + assertThrows(Exception.class, () -> { + Compiler.generateByteCodeFilesFromFiles(List.of( + "src/test/testFiles/Negative/MissingComponents/Identifier/InField.java")); + }); + } + + @Test + public void MissingComponentsIdentifierInFieldCall() { + assertThrows(Exception.class, () -> { + Compiler.generateByteCodeFilesFromFiles(List.of( + "src/test/testFiles/Negative/MissingComponents/Identifier/InFieldCall.java")); + }); + } + + @Test + public void MissingComponentsIdentifierInMethod() { + assertThrows(Exception.class, () -> { + Compiler.generateByteCodeFilesFromFiles(List.of( + "src/test/testFiles/Negative/MissingComponents/Identifier/InMethod.java")); + }); + } + + @Test + public void MissingComponentsIdentifierInMethodCall() { + assertThrows(Exception.class, () -> { + Compiler.generateByteCodeFilesFromFiles(List.of( + "src/test/testFiles/Negative/MissingComponents/Identifier/InMethodCall.java")); + }); + } + + @Test + public void MissingComponentsIdentifierInVariable() { + assertThrows(Exception.class, () -> { + Compiler.generateByteCodeFilesFromFiles(List.of( + "src/test/testFiles/Negative/MissingComponents/Identifier/InVariable.java")); + }); + } + + @Test + public void MissingComponentsPublicInClass() { + assertThrows(Exception.class, () -> { + Compiler.generateByteCodeFilesFromFiles(List.of( + "src/test/testFiles/Negative/MissingComponents/Public/InClass.java")); + }); + } + + @Test + public void MissingComponentsPublicInMethod() { + assertThrows(Exception.class, () -> { + Compiler.generateByteCodeFilesFromFiles(List.of( + "src/test/testFiles/Negative/MissingComponents/Public/InMethod.java")); + }); + } + + @Test + public void MissingComponentsRoundBracketsInConstructor() { + assertThrows(Exception.class, () -> { + Compiler.generateByteCodeFilesFromFiles(List.of( + "src/test/testFiles/Negative/MissingComponents/RoundBrackets/InConstructor.java")); + }); + } + + @Test + public void MissingComponentsRoundBracketsInDoWhile() { + assertThrows(Exception.class, () -> { + Compiler.generateByteCodeFilesFromFiles(List.of( + "src/test/testFiles/Negative/MissingComponents/RoundBrackets/InDoWhile.java")); + }); + } + + @Test + public void MissingComponentsRoundBracketsInElseIf() { + assertThrows(Exception.class, () -> { + Compiler.generateByteCodeFilesFromFiles(List.of( + "src/test/testFiles/Negative/MissingComponents/RoundBrackets/InElseIf.java")); + }); + } + + @Test + public void MissingComponentsRoundBracketsInFor() { + assertThrows(Exception.class, () -> { + Compiler.generateByteCodeFilesFromFiles(List.of( + "src/test/testFiles/Negative/MissingComponents/RoundBrackets/InFor.java")); + }); + } + + @Test + public void MissingComponentsRoundBracketsInIf() { + assertThrows(Exception.class, () -> { + Compiler.generateByteCodeFilesFromFiles(List.of( + "src/test/testFiles/Negative/MissingComponents/RoundBrackets/InIf.java")); + }); + } + + @Test + public void MissingComponentsRoundBracketsInMethod() { + assertThrows(Exception.class, () -> { + Compiler.generateByteCodeFilesFromFiles(List.of( + "src/test/testFiles/Negative/MissingComponents/RoundBrackets/InMethod.java")); + }); + } + + @Test + public void MissingComponentsRoundBracketsInMethodCall() { + assertThrows(Exception.class, () -> { + Compiler.generateByteCodeFilesFromFiles(List.of( + "src/test/testFiles/Negative/MissingComponents/RoundBrackets/InMethodCall.java")); + }); + } + + @Test + public void MissingComponentsRoundBracketsInNewObject() { + assertThrows(Exception.class, () -> { + Compiler.generateByteCodeFilesFromFiles(List.of( + "src/test/testFiles/Negative/MissingComponents/RoundBrackets/InNewObject.java")); + }); + } + + @Test + public void MissingComponentsRoundBracketsInWhile() { + assertThrows(Exception.class, () -> { + Compiler.generateByteCodeFilesFromFiles(List.of( + "src/test/testFiles/Negative/MissingComponents/RoundBrackets/InWhile.java")); + }); + } + + @Test + public void MissingComponentsSemicolonInAssignment() { + assertThrows(Exception.class, () -> { + Compiler.generateByteCodeFilesFromFiles(List.of( + "src/test/testFiles/Negative/MissingComponents/Semicolon/InAssignment.java")); + }); + } + + @Test + public void MissingComponentsSemicolonInDoWhile() { + assertThrows(Exception.class, () -> { + Compiler.generateByteCodeFilesFromFiles(List.of( + "src/test/testFiles/Negative/MissingComponents/Semicolon/InDoWhile.java")); + }); + } + + @Test + public void MissingComponentsSemicolonInField() { + assertThrows(Exception.class, () -> { + Compiler.generateByteCodeFilesFromFiles(List.of( + "src/test/testFiles/Negative/MissingComponents/Semicolon/InField.java")); + }); + } + + @Test + public void MissingComponentsSemicolonInMethodCall() { + assertThrows(Exception.class, () -> { + Compiler.generateByteCodeFilesFromFiles(List.of( + "src/test/testFiles/Negative/MissingComponents/Semicolon/InMethodCall.java")); + }); + } + + @Test + public void MissingComponentsSemicolonInReturn() { + assertThrows(Exception.class, () -> { + Compiler.generateByteCodeFilesFromFiles(List.of( + "src/test/testFiles/Negative/MissingComponents/Semicolon/InReturn.java")); + }); + } + + @Test + public void MissingComponentsTypeInField() { + assertThrows(Exception.class, () -> { + Compiler.generateByteCodeFilesFromFiles(List.of( + "src/test/testFiles/Negative/MissingComponents/Type/InField.java")); + }); + } + + @Test + public void MissingComponentsTypeInMethodSignature() { + assertThrows(Exception.class, () -> { + Compiler.generateByteCodeFilesFromFiles(List.of( + "src/test/testFiles/Negative/MissingComponents/Type/InMethodSignature.java")); + }); + } + + @Test + public void MissingComponentsTypeInParameter() { + assertThrows(Exception.class, () -> { + Compiler.generateByteCodeFilesFromFiles(List.of( + "src/test/testFiles/Negative/MissingComponents/Type/InParameter.java")); + }); + } + + @Test + public void MissingComponentsClassInClass() { + assertThrows(Exception.class, () -> { + Compiler.generateByteCodeFilesFromFiles(List.of( + "src/test/testFiles/Negative/MissingComponents/ClassInClass.java")); + }); + } @Test public void MissingComponentsClassOfObject() {