From b7d16ecaa8696c116125c099c6d48a5364da6512 Mon Sep 17 00:00:00 2001 From: Ewan Warburton <77669019+warburec@users.noreply.github.com> Date: Mon, 28 Sep 2026 23:36:36 +0100 Subject: [PATCH] Revert "Storable custom compilers & Compiler interface rework (#51)" This reverts commit 800e073724130ce1e51bbe25e70b79892c070923. --- .gitignore | 2 +- build.gradle | 35 +- docs/diagrams/CustomCompilers.drawio.svg | 1283 --------------- docs/diagrams/Storage.drawio.svg | 728 -------- gradle/wrapper/gradle-wrapper.jar | Bin 48966 -> 43462 bytes gradle/wrapper/gradle-wrapper.properties | 2 +- gradlew | 15 +- gradlew.bat | 25 +- .../java/component_construction/Compiler.java | 34 +- .../builders/CompilerBuilder.java | 189 +++ .../builders/CompilerBuilderTemplate.java | 226 --- .../builders/CustomCompilerBuilder.java | 29 - .../custom_components/CustomCompiler.java | 53 - .../CustomCompilerFactory.java | 62 - .../syntax_analysis/CLR1ParserFactory.java | 1 - .../storable/CompilerStorage.java | 279 ---- .../storable/StorableCustomCompiler.java | 61 - .../StorableCustomCompilerBuilder.java | 32 - .../storable/dynamic_loading/LoadableBy.java | 51 - .../storable/dynamic_loading/Loader.java | 42 - .../ReflectiveClassConstructor.java | 128 -- .../dynamic_loading/ReflectivelyLoadable.java | 8 - .../exceptions/ComponentCastException.java | 11 - .../exceptions/IncorrectLoadValueFormat.java | 11 - .../IncorrectlyFormattedException.java | 8 - .../MissingEmptyConstructorException.java | 10 - .../exceptions/MissingKeyException.java | 26 - .../NonExistentComponentException.java | 11 - .../NonStorableComponentException.java | 11 - .../exceptions/ReflectiveLoadFailure.java | 9 - .../storable/factories/Factory.java | 11 - .../StorableCustomCompilerFactory.java | 236 --- .../java/helper_objects/TypeReference.java | 29 - src/main/java/helper_objects/ValueEnum.java | 5 - src/main/java/storage/Storage.java | 493 ------ .../exceptions/FormatParseException.java | 9 - .../exceptions/FormattingException.java | 9 - .../exceptions/LoadFailureException.java | 9 - .../NullStorageObjectException.java | 9 - .../StorageFormatMismatchException.java | 14 - .../exceptions/StoreFailureException.java | 9 - .../storage/external_interfaces/Loadable.java | 16 - .../storage/external_interfaces/Storable.java | 16 - .../file_editors/DefaultUTF8StreamEditor.java | 22 - .../storage/file_editors/StreamEditor.java | 3 - .../storage/file_editors/StreamReader.java | 7 - .../storage/file_editors/StreamWriter.java | 7 - .../StorageValueAdapter.java | 13 - .../UnsupportedValueException.java | 18 - .../storage_values/IntegerStorageValue.java | 13 - .../storage_values/ListStorageValue.java | 27 - .../storage_values/MapStorageValue.java | 27 - .../storage_values/NullStorageValue.java | 14 - .../storage/storage_values/StorageValue.java | 27 - .../storage_values/StringStorageValue.java | 14 - .../value_formatters/ValueFormatter.java | 27 - .../ValueToStringFormatter.java | 161 -- .../{parsing/parsers => }/CLR1Parser.java | 2 +- .../{parsing/parsers => }/LR0Parser.java | 4 +- .../{parsing/parsers => }/SLR1Parser.java | 2 +- .../java/syntax_analysis/SyntaxAnalyser.java | 41 +- .../parsing/parsers/Parser.java | 48 - .../BasicCodeGeneratorTests.java | 4 +- .../component_construction/CompilerTests.java | 6 +- .../builders/CompilerBuilderTests.java | 20 +- .../storable/CompilerStorageTests.java | 1061 ------------ .../storable/StorableCustomCompilerTests.java | 5 - .../StorableCustomCompilerBuilderTests.java | 217 --- .../dynamic_loading/LoadableByTests.java | 63 - .../storable/dynamic_loading/LoaderTests.java | 27 - .../ReflectiveClassConstructorTests.java | 598 ------- .../StorableCustomCompilerFactoryTests.java | 464 ------ src/test/java/storage/StorageTests.java | 1465 ----------------- .../storage_values/StorageValueTests.java | 54 - .../ValueToStringFormatterTests.java | 718 -------- .../java/syntax_analysis/CLR1ParserTests.java | 1 - .../java/syntax_analysis/LR0ParserTests.java | 1 - .../java/syntax_analysis/SLR1ParserTests.java | 1 - .../exceptions/ExampleException.java | 8 - .../IncorrectlyFormedLoader.java | 17 - .../storage_entities/TestDynamicObject.java | 97 -- .../TestDynamicObjectSubclass.java | 24 - .../storage_entities/TestObject.java | 3 - .../storage_entities/TestObjectLoader.java | 13 - .../ConstructableStorableLexicalAnalyser.java | 34 - .../NonConstructableLexicalAnalyser.java | 28 - .../TestCustomCodeGenerator.java | 13 - .../TestCustomFalseLexicalAnalyser.java | 14 - .../TestCustomLexicalAnalyser.java | 13 - .../TestCustomSyntaxAnalyser.java | 14 - .../TestStorableCustomCodeGenerator.java | 26 - .../TestStorableCustomCompiler.java | 16 - .../TestStorableCustomLexicalAnalyser.java | 26 - .../TestStorableCustomSyntaxAnalyser.java | 27 - .../TestCustomCodeGeneratorFactory.java | 15 - .../TestCustomLexicalAnalyserFactory.java | 20 - .../TestCustomSyntaxAnalyserFactory.java | 15 - ...estStorableCustomCodeGeneratorFactory.java | 15 - ...tStorableCustomLexicalAnalyserFactory.java | 20 - ...stStorableCustomSyntaxAnalyserFactory.java | 15 - .../LoadableStorableCustomCodeGenerator.java | 36 - ...LoadableStorableCustomLexicalAnalyser.java | 36 - .../LoadableStorableCustomSyntaxAnalyser.java | 37 - .../LoadableTestStorableCustomCompiler.java | 36 - ...LoadableByCustomLexicalAnalyserLoader.java | 16 - ...adableByStorableCustomLexicalAnalyser.java | 35 - .../ConcretisedGenericTestLoadableObject.java | 5 - .../GenercicTestInterface.java | 8 - .../loadableby_entities/GenericLoader.java | 18 - .../GenericTestInterface.java | 3 - .../GenericTestLoadableObject.java | 5 - .../GenericallyLoadableObject.java | 6 - .../loadableby_entities/LoadableObject.java | 6 - .../loadableby_entities/StandardLoader.java | 13 - .../loadableby_entities/TestInterface.java | 3 - .../TestLoadableObject.java | 5 - .../WildcardLoadableObject.java | 6 - .../test_files/UseTestFile.java | 7 - .../test_files/UseTestFileExtension.java | 67 - .../test_storage/TestIntegerStreamEditor.java | 23 - .../TestIntegerValueFormatter.java | 19 - .../test_aids/test_storage/TestLoadable.java | 18 - .../test_aids/test_storage/TestStorable.java | 17 - .../test_storage/TestStorageValue.java | 16 - .../TestStringErrorStreamEditor.java | 19 - .../TestStringErrorValueFormatter.java | 20 - .../test_storage/TestStringStreamEditor.java | 23 - .../TestStringValueFormatter.java | 19 - 128 files changed, 305 insertions(+), 10119 deletions(-) delete mode 100644 docs/diagrams/CustomCompilers.drawio.svg delete mode 100644 docs/diagrams/Storage.drawio.svg create mode 100644 src/main/java/component_construction/builders/CompilerBuilder.java delete mode 100644 src/main/java/component_construction/builders/CompilerBuilderTemplate.java delete mode 100644 src/main/java/component_construction/builders/CustomCompilerBuilder.java delete mode 100644 src/main/java/component_construction/custom_components/CustomCompiler.java delete mode 100644 src/main/java/component_construction/custom_components/CustomCompilerFactory.java delete mode 100644 src/main/java/component_construction/storable/CompilerStorage.java delete mode 100644 src/main/java/component_construction/storable/StorableCustomCompiler.java delete mode 100644 src/main/java/component_construction/storable/builders/StorableCustomCompilerBuilder.java delete mode 100644 src/main/java/component_construction/storable/dynamic_loading/LoadableBy.java delete mode 100644 src/main/java/component_construction/storable/dynamic_loading/Loader.java delete mode 100644 src/main/java/component_construction/storable/dynamic_loading/ReflectiveClassConstructor.java delete mode 100644 src/main/java/component_construction/storable/dynamic_loading/ReflectivelyLoadable.java delete mode 100644 src/main/java/component_construction/storable/exceptions/ComponentCastException.java delete mode 100644 src/main/java/component_construction/storable/exceptions/IncorrectLoadValueFormat.java delete mode 100644 src/main/java/component_construction/storable/exceptions/IncorrectlyFormattedException.java delete mode 100644 src/main/java/component_construction/storable/exceptions/MissingEmptyConstructorException.java delete mode 100644 src/main/java/component_construction/storable/exceptions/MissingKeyException.java delete mode 100644 src/main/java/component_construction/storable/exceptions/NonExistentComponentException.java delete mode 100644 src/main/java/component_construction/storable/exceptions/NonStorableComponentException.java delete mode 100644 src/main/java/component_construction/storable/exceptions/ReflectiveLoadFailure.java delete mode 100644 src/main/java/component_construction/storable/factories/Factory.java delete mode 100644 src/main/java/component_construction/storable/factories/StorableCustomCompilerFactory.java delete mode 100644 src/main/java/helper_objects/TypeReference.java delete mode 100644 src/main/java/helper_objects/ValueEnum.java delete mode 100644 src/main/java/storage/Storage.java delete mode 100644 src/main/java/storage/exceptions/FormatParseException.java delete mode 100644 src/main/java/storage/exceptions/FormattingException.java delete mode 100644 src/main/java/storage/exceptions/LoadFailureException.java delete mode 100644 src/main/java/storage/exceptions/NullStorageObjectException.java delete mode 100644 src/main/java/storage/exceptions/StorageFormatMismatchException.java delete mode 100644 src/main/java/storage/exceptions/StoreFailureException.java delete mode 100644 src/main/java/storage/external_interfaces/Loadable.java delete mode 100644 src/main/java/storage/external_interfaces/Storable.java delete mode 100644 src/main/java/storage/file_editors/DefaultUTF8StreamEditor.java delete mode 100644 src/main/java/storage/file_editors/StreamEditor.java delete mode 100644 src/main/java/storage/file_editors/StreamReader.java delete mode 100644 src/main/java/storage/file_editors/StreamWriter.java delete mode 100644 src/main/java/storage/storage_value_adapters/StorageValueAdapter.java delete mode 100644 src/main/java/storage/storage_value_adapters/UnsupportedValueException.java delete mode 100644 src/main/java/storage/storage_values/IntegerStorageValue.java delete mode 100644 src/main/java/storage/storage_values/ListStorageValue.java delete mode 100644 src/main/java/storage/storage_values/MapStorageValue.java delete mode 100644 src/main/java/storage/storage_values/NullStorageValue.java delete mode 100644 src/main/java/storage/storage_values/StorageValue.java delete mode 100644 src/main/java/storage/storage_values/StringStorageValue.java delete mode 100644 src/main/java/storage/value_formatters/ValueFormatter.java delete mode 100644 src/main/java/storage/value_formatters/ValueToStringFormatter.java rename src/main/java/syntax_analysis/{parsing/parsers => }/CLR1Parser.java (99%) rename src/main/java/syntax_analysis/{parsing/parsers => }/LR0Parser.java (99%) rename src/main/java/syntax_analysis/{parsing/parsers => }/SLR1Parser.java (99%) delete mode 100644 src/main/java/syntax_analysis/parsing/parsers/Parser.java delete mode 100644 src/test/java/component_construction/storable/CompilerStorageTests.java delete mode 100644 src/test/java/component_construction/storable/StorableCustomCompilerTests.java delete mode 100644 src/test/java/component_construction/storable/builders/StorableCustomCompilerBuilderTests.java delete mode 100644 src/test/java/component_construction/storable/dynamic_loading/LoadableByTests.java delete mode 100644 src/test/java/component_construction/storable/dynamic_loading/LoaderTests.java delete mode 100644 src/test/java/component_construction/storable/dynamic_loading/ReflectiveClassConstructorTests.java delete mode 100644 src/test/java/component_construction/storable/factories/StorableCustomCompilerFactoryTests.java delete mode 100644 src/test/java/storage/StorageTests.java delete mode 100644 src/test/java/storage/storage_values/StorageValueTests.java delete mode 100644 src/test/java/storage/value_formatters/ValueToStringFormatterTests.java delete mode 100644 src/test/java/test_aids/exceptions/ExampleException.java delete mode 100644 src/test/java/test_aids/storage_entities/IncorrectlyFormedLoader.java delete mode 100644 src/test/java/test_aids/storage_entities/TestDynamicObject.java delete mode 100644 src/test/java/test_aids/storage_entities/TestDynamicObjectSubclass.java delete mode 100644 src/test/java/test_aids/storage_entities/TestObject.java delete mode 100644 src/test/java/test_aids/storage_entities/TestObjectLoader.java delete mode 100644 src/test/java/test_aids/storage_entities/custom_components/ConstructableStorableLexicalAnalyser.java delete mode 100644 src/test/java/test_aids/storage_entities/custom_components/NonConstructableLexicalAnalyser.java delete mode 100644 src/test/java/test_aids/storage_entities/custom_components/TestCustomCodeGenerator.java delete mode 100644 src/test/java/test_aids/storage_entities/custom_components/TestCustomFalseLexicalAnalyser.java delete mode 100644 src/test/java/test_aids/storage_entities/custom_components/TestCustomLexicalAnalyser.java delete mode 100644 src/test/java/test_aids/storage_entities/custom_components/TestCustomSyntaxAnalyser.java delete mode 100644 src/test/java/test_aids/storage_entities/custom_components/TestStorableCustomCodeGenerator.java delete mode 100644 src/test/java/test_aids/storage_entities/custom_components/TestStorableCustomCompiler.java delete mode 100644 src/test/java/test_aids/storage_entities/custom_components/TestStorableCustomLexicalAnalyser.java delete mode 100644 src/test/java/test_aids/storage_entities/custom_components/TestStorableCustomSyntaxAnalyser.java delete mode 100644 src/test/java/test_aids/storage_entities/custom_components/factories/TestCustomCodeGeneratorFactory.java delete mode 100644 src/test/java/test_aids/storage_entities/custom_components/factories/TestCustomLexicalAnalyserFactory.java delete mode 100644 src/test/java/test_aids/storage_entities/custom_components/factories/TestCustomSyntaxAnalyserFactory.java delete mode 100644 src/test/java/test_aids/storage_entities/custom_components/factories/TestStorableCustomCodeGeneratorFactory.java delete mode 100644 src/test/java/test_aids/storage_entities/custom_components/factories/TestStorableCustomLexicalAnalyserFactory.java delete mode 100644 src/test/java/test_aids/storage_entities/custom_components/factories/TestStorableCustomSyntaxAnalyserFactory.java delete mode 100644 src/test/java/test_aids/storage_entities/custom_components/loadable/LoadableStorableCustomCodeGenerator.java delete mode 100644 src/test/java/test_aids/storage_entities/custom_components/loadable/LoadableStorableCustomLexicalAnalyser.java delete mode 100644 src/test/java/test_aids/storage_entities/custom_components/loadable/LoadableStorableCustomSyntaxAnalyser.java delete mode 100644 src/test/java/test_aids/storage_entities/custom_components/loadable/LoadableTestStorableCustomCompiler.java delete mode 100644 src/test/java/test_aids/storage_entities/custom_components/loadableBy/LoadableByCustomLexicalAnalyserLoader.java delete mode 100644 src/test/java/test_aids/storage_entities/custom_components/loadableBy/LoadableByStorableCustomLexicalAnalyser.java delete mode 100644 src/test/java/test_aids/storage_entities/loadableby_entities/ConcretisedGenericTestLoadableObject.java delete mode 100644 src/test/java/test_aids/storage_entities/loadableby_entities/GenercicTestInterface.java delete mode 100644 src/test/java/test_aids/storage_entities/loadableby_entities/GenericLoader.java delete mode 100644 src/test/java/test_aids/storage_entities/loadableby_entities/GenericTestInterface.java delete mode 100644 src/test/java/test_aids/storage_entities/loadableby_entities/GenericTestLoadableObject.java delete mode 100644 src/test/java/test_aids/storage_entities/loadableby_entities/GenericallyLoadableObject.java delete mode 100644 src/test/java/test_aids/storage_entities/loadableby_entities/LoadableObject.java delete mode 100644 src/test/java/test_aids/storage_entities/loadableby_entities/StandardLoader.java delete mode 100644 src/test/java/test_aids/storage_entities/loadableby_entities/TestInterface.java delete mode 100644 src/test/java/test_aids/storage_entities/loadableby_entities/TestLoadableObject.java delete mode 100644 src/test/java/test_aids/storage_entities/loadableby_entities/WildcardLoadableObject.java delete mode 100644 src/test/java/test_aids/test_extensions/test_files/UseTestFile.java delete mode 100644 src/test/java/test_aids/test_extensions/test_files/UseTestFileExtension.java delete mode 100644 src/test/java/test_aids/test_storage/TestIntegerStreamEditor.java delete mode 100644 src/test/java/test_aids/test_storage/TestIntegerValueFormatter.java delete mode 100644 src/test/java/test_aids/test_storage/TestLoadable.java delete mode 100644 src/test/java/test_aids/test_storage/TestStorable.java delete mode 100644 src/test/java/test_aids/test_storage/TestStorageValue.java delete mode 100644 src/test/java/test_aids/test_storage/TestStringErrorStreamEditor.java delete mode 100644 src/test/java/test_aids/test_storage/TestStringErrorValueFormatter.java delete mode 100644 src/test/java/test_aids/test_storage/TestStringStreamEditor.java delete mode 100644 src/test/java/test_aids/test_storage/TestStringValueFormatter.java diff --git a/.gitignore b/.gitignore index 3f9d58b..d35b73a 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,4 @@ .gradle build -bin +bin \ No newline at end of file diff --git a/build.gradle b/build.gradle index 3d78ca6..054f743 100644 --- a/build.gradle +++ b/build.gradle @@ -17,21 +17,16 @@ sourceSets { srcDirs = ['src/test/java'] } } - playground { - java { - srcDirs = ['src/playground/java'] - } - } } dependencies { + implementation platform('org.junit:junit-bom:5.10.3') + implementation 'org.junit.jupiter:junit-jupiter' + testImplementation platform('org.junit:junit-bom:5.10.3') testImplementation 'org.junit.jupiter:junit-jupiter' + testRuntimeOnly 'org.junit.platform:junit-platform-launcher' - - playgroundImplementation sourceSets.main.output - // playgroundImplementation configurations.implementation - // playgroundRuntimeOnly configurations.runtimeClasspath } import org.gradle.api.tasks.testing.logging.TestExceptionFormat @@ -54,25 +49,17 @@ tasks.named('test') { events = [TestLogEvent.STARTED, TestLogEvent.FAILED, TestLogEvent.PASSED, TestLogEvent.SKIPPED, TestLogEvent.STANDARD_ERROR, TestLogEvent.STANDARD_OUT] exceptionFormat = TestExceptionFormat.FULL } - + info.events = debug.events info.exceptionFormat = debug.exceptionFormat afterSuite { desc, result -> - if (desc.parent) return - - def output = "Results: ${result.resultType} (${result.testCount} tests, ${result.successfulTestCount} passed, ${result.failedTestCount} failed, ${result.skippedTestCount} skipped)" - def startItem = '| ', endItem = ' |' - def repeatLength = startItem.length() + output.length() + endItem.length() - - println('\n' + ('-' * repeatLength) + '\n' + startItem + output + endItem + '\n' + ('-' * repeatLength)) + if (!desc.parent) { + def output = "Results: ${result.resultType} (${result.testCount} tests, ${result.successfulTestCount} passed, ${result.failedTestCount} failed, ${result.skippedTestCount} skipped)" + def startItem = '| ', endItem = ' |' + def repeatLength = startItem.length() + output.length() + endItem.length() + println('\n' + ('-' * repeatLength) + '\n' + startItem + output + endItem + '\n' + ('-' * repeatLength)) + } } } } - -tasks.register('playground', JavaExec) { - group = 'application' - description = 'Runs the playground main method' - classpath = sourceSets.playground.runtimeClasspath - mainClass = 'Test' -} \ No newline at end of file diff --git a/docs/diagrams/CustomCompilers.drawio.svg b/docs/diagrams/CustomCompilers.drawio.svg deleted file mode 100644 index 0cbb1f4..0000000 --- a/docs/diagrams/CustomCompilers.drawio.svg +++ /dev/null @@ -1,1283 +0,0 @@ - - - - - - - - - - - - - - -
-
-
-
-
- - StorableCustomCompilerBuilder - -
-
-
-
-
-
- - StorableCustomCompilerBuilder - -
-
-
-
- - - - - - - - - - -
-
-
- Loads -
-
-
-
- - Loads - -
-
-
-
- - - - - -
-
-
- Load -
-
-
-
- - Load - -
-
-
-
-
- - - - - - - - -
-
-
-
-
- - CompilerStorage - -
-
-
-
-
-
- - CompilerStorage - -
-
-
-
- - - - - - - - -
-
-
-
- - <A> - - - CompilerBuilderTemplate - -
-
-
-
-
- - <A> CompilerBuilderTemplate - -
-
-
-
- - - - - - - - - - -
-
-
- Store -
-
-
-
- - Store - -
-
-
-
-
- - - - - - - - - - -
-
-
- User creates -
-
-
-
- - User creates - -
-
-
-
-
- - - - - - - - -
-
-
-
-
- - StorableCustomCompiler - -
-
-
-
-
-
- - StorableCustomCompiler - -
-
-
-
- - - - - - - - -
-
-
-
-
- - <I> LexicalAnalyserFactory - -
-
-
-
-
-
- - <I> LexicalAnalyserFactory - -
-
-
-
- - - - - - - - -
-
-
-
-
- - <I> SyntaxAnalyserFactory - -
-
-
-
-
-
- - <I> SyntaxAnalyserFactory - -
-
-
-
- - - - - - - - -
-
-
-
-
- - <I> CodeGeneratorFactory - -
-
-
-
-
-
- - <I> CodeGeneratorFactory - -
-
-
-
- - - - - - - - -
-
-
-
-
- - CustomCompiler - -
-
-
-
-
-
- - CustomCompiler - -
-
-
-
- - - - - - - - -
-
-
-
- <I> Compiler -
-
-
-
-
- - <I> Compiler - -
-
-
-
- - - - - - - - - - - - - - -
-
-
-
- <I> Storable -
-
-
-
-
- - <I> Storable - -
-
-
-
- - - - - - - - - - -
-
-
- References -
-
-
-
- - References - -
-
-
-
-
- - - - - - - - -
-
-
-
- <I> LoadableBy<T> -
- T = StorableCustomCompilerFactory> -
-
-
-
-
- - - <I> LoadableBy<T> - - - T = StorableCustomCompilerFactory> - - -
-
-
-
- - - - - - - - - - -
-
-
- Uses -
-
-
-
- - Uses - -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - -
-
-
-
-
- - StorableCustomCompilerFactory - -
-
-
-
-
-
- - StorableCustomCompilerFactory - -
-
-
-
- - - - - - - - - - - - - - -
-
-
-
- <I> Loader<T> -
- T = StorableCustomCompiler -
-
-
-
-
- - - <I> Loader<T> - - - T = StorableCustomCompiler - - -
-
-
-
- - - - - - - - - -
-
-
- Extends -
-
-
-
- - Extends - -
-
-
-
- - - - - - - - -
-
-
-
-
- - ReflectiveClassConstructor - -
-
-
-
-
-
- - ReflectiveClassConstructor - -
-
-
-
- - - - - - - - -
-
-
-
- <I> Factory<T> -
-
-
-
-
- - <I> Factory<T> - -
-
-
-
- - - - - - - - -
-
-
-
- Storage -
-
-
-
-
- - Storage - -
-
-
-
- - - - - - - - - -
-
-
- Component Construcion -
-
-
-
- - Component Construcion - -
-
-
-
- - - - - - - - - -
-
-
- Factories -
-
-
-
- - Factories - -
-
-
-
- - - - - - - - - -
-
-
- Builders -
-
-
-
- - Builders - -
-
-
-
- - - - - - - - - - - - - - -
-
-
-
-
- - CustomCompilerFactory - -
-
-
-
-
-
- - CustomCompilerFactory - -
-
-
-
- - - - - - - - - -
-
-
- Custom Compiler -
-
-
-
- - Custom Compiler - -
-
-
-
- - - - - - - - -
-
-
-
- <I> Loader<T> -
-
-
-
-
- - <I> Loader<T> - -
-
-
-
- - - - - - - - - -
-
-
- Dynamic Loading -
-
-
-
- - Dynamic Loading - -
-
-
-
- - - - - - - - - - - - - - - - -
-
-
- Builds -
-
-
-
- - Builds - -
-
-
-
-
- - - - - - - - - - - - - - - - -
-
-
- Uses -
-
-
-
- - Uses - -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - -
-
-
- Uses -
-
-
-
- - Uses - -
-
-
-
-
- - - - - - - - - -
-
-
- Storable -
-
-
-
- - Storable - -
-
-
-
- - - - - - - - - -
-
-
- Builders -
-
-
-
- - Builders - -
-
-
-
- - - - - - - - -
-
-
-
-
- - ComponentCastException - -
-
-
-
-
-
- - ComponentCastException - -
-
-
-
- - - - - - - - -
-
-
-
-
- - IncorrectLoadValueFormat - -
-
-
-
-
-
- - IncorrectLoadValueFormat - -
-
-
-
- - - - - - - - -
-
-
-
-
- - IncorrectlyFormattedException - -
-
-
-
-
-
- - IncorrectlyFormattedException - -
-
-
-
- - - - - - - - -
-
-
-
-
- - MissingEmptyConstructorException - -
-
-
-
-
-
- - MissingEmptyConstructorException - -
-
-
-
- - - - - - - - -
-
-
-
-
- - MissingKeyException - -
-
-
-
-
-
- - MissingKeyException - -
-
-
-
- - - - - - - - -
-
-
-
-
- - NonExistentComponentException - -
-
-
-
-
-
- - NonExistentComponentException - -
-
-
-
- - - - - - - - -
-
-
-
-
- - NonStorableComponentException - -
-
-
-
-
-
- - NonStorableComponentException - -
-
-
-
- - - - - - - - -
-
-
-
-
- - ReflectiveLoadFailure - -
-
-
-
-
-
- - ReflectiveLoadFailure - -
-
-
-
- - - - - - - - - -
-
-
- Exceptions -
-
-
-
- - Exceptions - -
-
-
-
- - - - - - - - - -
-
-
- Extends -
-
-
-
- - Extends - -
-
-
-
-
-
-
- - - - - Text is not SVG - cannot display - - - -
\ No newline at end of file diff --git a/docs/diagrams/Storage.drawio.svg b/docs/diagrams/Storage.drawio.svg deleted file mode 100644 index 174ce39..0000000 --- a/docs/diagrams/Storage.drawio.svg +++ /dev/null @@ -1,728 +0,0 @@ - - - - - - - - - - -
-
-
- Storable <I> -
-
-
-
- - Storable <... - -
-
-
- - - - - - - - - -
-
-
- Storage Values -
-
-
-
- - Storage Values - -
-
-
- - - - - - - -
-
-
- StorageValue<T> -
- <A> -
-
-
-
- - StorageValue<T>... - -
-
-
- - - - - - - -
-
-
- StringStorageValue -
-
-
-
- - StringStorageValue - -
-
-
- - - - - - - - -
-
-
- Extends -
-
-
-
- - Extends - -
-
-
- - - - - - - - - - - - -
-
-
- Value Formatters -
-
-
-
- - Value Formatters - -
-
-
- - - - - - - -
-
-
- ValueFormatter<T> -
- <I> -
-
-
-
- - ValueFormatter<T>... - -
-
-
- - - - - - - -
-
-
- ValueToStringFormatter -
-
-
-
- - ValueToStringFormatter - -
-
-
- - - - - - - - -
-
-
- Extends -
-
-
-
- - Extends - -
-
-
- - - - - - - -
-
-
- Loadable <I> -
-
-
-
- - Loadable <... - -
-
-
- - - - - - - - -
-
-
- Produces a set of -
-
-
-
- - Produces a set of - -
-
-
- - - - - - - -
-
-
- Component -
-
-
-
- - Component - -
-
-
- - - - - - - - - -
-
-
- Storage Value Adapters -
-
-
-
- - Storage Value Adapters - -
-
-
- - - - - - - -
-
-
- StorageValueAdapter <I> -
-
-
-
- - StorageValueAdapter <... - -
-
-
- - - - - - - -
-
-
- StringValueToString -
-
-
-
- - StringValueToString - -
-
-
- - - - - - - -
-
-
- UnsupportedValueException -
-
-
-
- - UnsupportedValueException - -
-
-
- - - - - - - - - - - - -
-
-
- Passed into -
-
-
-
- - Passed into - -
-
-
- - - - - - - -
-
-
- RuntimeException -
-
-
-
- - RuntimeException - -
-
-
- - - - - - - - -
-
-
- Extends -
-
-
-
- - Extends - -
-
-
- - - - - - - - - - - - -
-
-
- Throws -
-
-
-
- - Throws - -
-
-
- - - - - - - - -
-
-
- String Data Stream -
-
-
-
- - String Data... - -
-
-
- - - - - - - - -
-
-
- Produces -
-
-
-
- - Produces - -
-
-
- - - - - - - - - - - -
-
-
- Storage Representation -
-
-
-
- - Storage Represen... - -
-
-
- - - - - - - - - -
-
-
- Stream Editors -
-
-
-
- - Stream Editors - -
-
-
- - - - - - - -
-
-
- StreamWriter<T> -
- <I> -
-
-
-
- - StreamWriter<T>... - -
-
-
- - - - - - - -
-
-
- StringStreamWriter -
-
-
-
- - StringStreamWriter - -
-
-
- - - - - - - -
-
-
- StreamReader<T> -
- <I> -
-
-
-
- - StreamReader<T>... - -
-
-
- - - - - - - -
-
-
- StreamEditor<T> -
- <A> -
-
-
-
- - StreamEditor<T>... - -
-
-
- - - - - - - - -
-
-
- Extends -
-
-
-
- - Extends - -
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
- Text -
-
-
-
- - Text - -
-
-
- - - - - - - - -
-
-
- Data File -
-
-
-
- - Data File - -
-
-
-
- - - - - Text is not SVG - cannot display - - - -
\ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index d997cfc60f4cff0e7451d19d49a82fa986695d07..d64cd4917707c1f8861d8cb53dd15194d4248596 100644 GIT binary patch delta 35303 zcmX7vV|$!!7lqrfv2EM7ZQFLzxWP1<*tTt(6Q?m7n~m+aecnGXAMR_dy^nRSJ;NVh z!}DNuc8H3%3cn`g#25n%eD< zG_zQ`ODc$zIGhfJv|Y3vu^7R(3!Tz9_lUNEG}euSOh73Vs}R!L?`Ex+KAMEIN}QcM zOwlIvxLIw`aRz!-!k3jBk6a}J?_(WmIFD^wmg!m%&wOU0D8-=RXrs%732>@^pqAl<-Bi(F5S(=atv72#=azm(iPZp#MnlP zo=9upJ~ke$;%57RW1=gKXz7{3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6gT2tnF?+Vc}?skeHk)Q$@^fqwAZvy|G8h580KCWdoUT zyUzR^nVfcTBvn@TCRTIDh?(B1YESn(ruL=Qn5%J&{VL)?C46q$IsW>buSoY(i6o`p zqsJlSR%<@L21Hf3UdCOJMUKZ+j)(;J=D6Z3WJ9&OWu8lft&Lm|-NYoxNW3u~dlA=# zjul5Fsh=JO|80&`OTl&wj%e%Rs#zvdFS?ww8h8Epu>PFFwD# zxM)FUj-f)+!*%l{6)S*tfkT>DH@p`bH^QaDy!#d+42I6St_cuPNQgQMy3~M42bpR z3&fWffQ2ak-wy#kEcgu&7Lfy@wx|f-jYq89zag?HKe`8H!p0Fsrd8=x{;ceq5U-5< z_pXN%BaAS@G>EBT%ee$VLJ&+|8({>70RTwc169cGz>m2Cz~b9^d@}?fh7SNp-h=R| z?jW8wfM?eNZaD->iGy+gTC|%vRlFxK!LZHq{VcfU^~co7f-LiQW~uFw98Oa3=FA_NO4kOBUq ziimK5^Ir2+;s}5Nc2&R({44tP-#23^36m&P2mY0lLS)LmXJtDi{L)DntMPJokVUHCRXyDGXF32>hGi z{=a>UR!2Z4z`v=!0RVw}Rv_94;314gk^Zhz|1&co{XMW<4*}A^idF7O~D_C^#2WB{TU;u zf8MfTNM&TmH^q16xXbu~f1h0d0P8(-n(zJ%VZbuVXz>^UjDTfaM4HLkKhLlK0nf+Y AEdT%j diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index dbc3ce4..9355b41 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-9.4.0-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/gradlew b/gradlew index 0262dcb..1aa94a4 100644 --- a/gradlew +++ b/gradlew @@ -1,7 +1,7 @@ #!/bin/sh # -# Copyright © 2015 the original authors. +# Copyright © 2015-2021 the original authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -15,8 +15,6 @@ # See the License for the specific language governing permissions and # limitations under the License. # -# SPDX-License-Identifier: Apache-2.0 -# ############################################################################## # @@ -57,7 +55,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/b631911858264c0b6e4d6603d677ff5218766cee/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -86,7 +84,7 @@ done # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} # Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) -APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -114,6 +112,7 @@ case "$( uname )" in #( NONSTOP* ) nonstop=true ;; esac +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. @@ -171,6 +170,7 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) JAVACMD=$( cygpath --unix "$JAVACMD" ) @@ -203,14 +203,15 @@ fi DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' # Collect all arguments for the java command: -# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, # and any embedded shellness will be escaped. # * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be # treated as '${Hostname}' itself on the command line. set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ "$@" # Stop when "xargs" is not available. diff --git a/gradlew.bat b/gradlew.bat index c4bdd3a..93e3f59 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -13,8 +13,6 @@ @rem See the License for the specific language governing permissions and @rem limitations under the License. @rem -@rem SPDX-License-Identifier: Apache-2.0 -@rem @if "%DEBUG%"=="" @echo off @rem ########################################################################## @@ -45,11 +43,11 @@ set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 if %ERRORLEVEL% equ 0 goto execute -echo. 1>&2 -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 -echo. 1>&2 -echo Please set the JAVA_HOME variable in your environment to match the 1>&2 -echo location of your Java installation. 1>&2 +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. goto fail @@ -59,21 +57,22 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. 1>&2 -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 -echo. 1>&2 -echo Please set the JAVA_HOME variable in your environment to match the 1>&2 -echo location of your Java installation. 1>&2 +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. goto fail :execute @rem Setup the command line +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar @rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* :end @rem End local scope for the variables with windows NT shell diff --git a/src/main/java/component_construction/Compiler.java b/src/main/java/component_construction/Compiler.java index 92486ef..7ff7b57 100644 --- a/src/main/java/component_construction/Compiler.java +++ b/src/main/java/component_construction/Compiler.java @@ -1,14 +1,30 @@ package component_construction; -import syntax_analysis.parsing.ParseFailedException; -public interface Compiler { +import code_generation.CodeGenerator; +import grammar_objects.Token; +import lexical_analysis.LexicalAnalyser; +import syntax_analysis.SyntaxAnalyser; +import syntax_analysis.parsing.ParseFailedException; +import syntax_analysis.parsing.ParseState; - /** - * Compiles an input sentence - * @param input The sentence to be compiled - * @return The output of compilation - * @throws ParseFailedException An error occurred when parsing the sentence - */ - public String compile(String input) throws ParseFailedException; +public class Compiler { + protected LexicalAnalyser lexicalAnalyser; + protected SyntaxAnalyser syntaxAnalyser; + protected CodeGenerator codeGenerator; + + public Compiler( + LexicalAnalyser lexicalAnalyser, + SyntaxAnalyser syntaxAnalyser, + CodeGenerator codeGenerator + ) { + this.lexicalAnalyser = lexicalAnalyser; + this.syntaxAnalyser = syntaxAnalyser; + this.codeGenerator = codeGenerator; + } + public String compile(String input) throws ParseFailedException { + Token[] tokens = lexicalAnalyser.analyse(input); + ParseState parseRoot = syntaxAnalyser.analyse(tokens); + return codeGenerator.generate(parseRoot); + } } diff --git a/src/main/java/component_construction/builders/CompilerBuilder.java b/src/main/java/component_construction/builders/CompilerBuilder.java new file mode 100644 index 0000000..2a11c63 --- /dev/null +++ b/src/main/java/component_construction/builders/CompilerBuilder.java @@ -0,0 +1,189 @@ +package component_construction.builders; + +import java.util.*; + +import grammar_objects.*; +import lexical_analysis.*; +import syntax_analysis.SyntaxAnalyser; +import code_generation.CodeGenerator; +import component_construction.Compiler; +import component_construction.ParameterError; +import component_construction.bundles.GrammarBundle; +import component_construction.factories.code_generation.CodeGeneratorFactory; +import component_construction.factories.lexical_analysis.LexicalAnalyserFactory; +import component_construction.factories.syntax_analysis.SyntaxAnalyserFactory; + +public class CompilerBuilder { + protected LexicalAnalyserFactory lexicalAnalyserFactory; + protected SyntaxAnalyserFactory syntaxAnalyserFactory; + protected CodeGeneratorFactory codeGeneratorFactory; + + protected Grammar grammar; + protected RuleConvertor ruleConvertor; + + protected String[] whitespaceDelimiters; + protected String[] stronglyReservedWords; + protected String[] weaklyReservedWords; + protected DynamicTokenRegex[] dynamicTokenRegex; + + /** + * A shortcut setter method for all components necessary for building a compiler + * @param lexicalAnalyserFactory + * @param syntaxAnalyserFactory + * @param codeGeneratorFactory + * @param grammarBundle + */ + public CompilerBuilder setComponents( + LexicalAnalyserFactory lexicalAnalyserFactory, + SyntaxAnalyserFactory syntaxAnalyserFactory, + CodeGeneratorFactory codeGeneratorFactory, + GrammarBundle grammarBundle + ) { + return setComponents( + lexicalAnalyserFactory, + syntaxAnalyserFactory, + codeGeneratorFactory, + grammarBundle.getGrammar(), + grammarBundle.getRuleConvertor(), + grammarBundle.getWhitespaceDelimiters(), + grammarBundle.getStronglyReservedWords(), + grammarBundle.getWeaklyReservedWords(), + grammarBundle.getDynamicTokenRegex() + ); + } + + /** + * A shortcut setter method for all components necessary for building a compiler + * @param lexicalAnalyserFactory + * @param syntaxAnalyserFactory + * @param codeGeneratorFactory + * @param grammar + * @param ruleConvertor + * @param whitespaceDelimiters May be null + * @param stronglyReservedWords May be null + * @param weaklyReservedWords May be null + * @param dynamicTokenRegex May be null + */ + public CompilerBuilder setComponents( + LexicalAnalyserFactory lexicalAnalyserFactory, + SyntaxAnalyserFactory syntaxAnalyserFactory, + CodeGeneratorFactory codeGeneratorFactory, + Grammar grammar, + RuleConvertor ruleConvertor, + String[] whitespaceDelimiters, + String[] stronglyReservedWords, + String[] weaklyReservedWords, + DynamicTokenRegex[] dynamicTokenRegex + ) { + setLexicalAnalyser(lexicalAnalyserFactory); + setSyntaxAnalyser(syntaxAnalyserFactory); + setCodeGenerator(codeGeneratorFactory); + setGrammar(grammar); + setRuleConvertor(ruleConvertor); + setWhitespaceDelimiters(whitespaceDelimiters); + setStronglyReservedWords(stronglyReservedWords); + setWeaklyReservedWords(weaklyReservedWords); + setDynamicTokenRegex(dynamicTokenRegex); + + return this; + } + + + public CompilerBuilder setLexicalAnalyser(LexicalAnalyserFactory factory) { + this.lexicalAnalyserFactory = factory; + return this; + } + + public CompilerBuilder setSyntaxAnalyser(SyntaxAnalyserFactory factory) { + this.syntaxAnalyserFactory = factory; + return this; + } + + public CompilerBuilder setCodeGenerator(CodeGeneratorFactory factory) { + this.codeGeneratorFactory = factory; + return this; + } + + + public CompilerBuilder setGrammar(Grammar grammar) { + this.grammar = grammar; + return this; + } + + public CompilerBuilder setRuleConvertor(RuleConvertor ruleConvertor) { + this.ruleConvertor = ruleConvertor; + return this; + } + + + public CompilerBuilder setWhitespaceDelimiters(String[] whitespaceDelimiters) { + this.whitespaceDelimiters = whitespaceDelimiters; + return this; + } + + public CompilerBuilder setStronglyReservedWords(String[] stronglyReservedWords) { + this.stronglyReservedWords = stronglyReservedWords; + return this; + } + + public CompilerBuilder setWeaklyReservedWords(String[] weaklyReservedWords) { + this.weaklyReservedWords = weaklyReservedWords; + return this; + } + + public CompilerBuilder setDynamicTokenRegex(DynamicTokenRegex[] dynamicTokenRegex) { + this.dynamicTokenRegex = dynamicTokenRegex; + return this; + } + + + public Compiler createCompiler() { + checkForCompleteBuild(); + + if(whitespaceDelimiters == null) whitespaceDelimiters = new String[]{}; + if(stronglyReservedWords == null) stronglyReservedWords = new String[]{}; + if(weaklyReservedWords == null) weaklyReservedWords = new String[]{}; + if(dynamicTokenRegex == null) dynamicTokenRegex = new DynamicTokenRegex[]{}; + + GrammarParts parts = grammar.getParts(); + + LexicalAnalyser lexicalAnalyser = lexicalAnalyserFactory.produceAnalyser( + whitespaceDelimiters, + stronglyReservedWords, + weaklyReservedWords, + dynamicTokenRegex + ); + SyntaxAnalyser syntaxAnalyser = syntaxAnalyserFactory.produceAnalyser(parts); + CodeGenerator codeGenerator = codeGeneratorFactory.produceGenerator(ruleConvertor); + + return new Compiler( + lexicalAnalyser, + syntaxAnalyser, + codeGenerator + ); + } + + private void checkForCompleteBuild() { + List msgParts = new ArrayList<>(); + + if(lexicalAnalyserFactory == null) msgParts.add("lexical analyser factory"); + if(syntaxAnalyserFactory == null) msgParts.add("syntax analyser factory"); + if(codeGeneratorFactory == null) msgParts.add("code generator factory"); + if(grammar == null) msgParts.add("grammar"); + if(ruleConvertor == null) msgParts.add("rule convertor"); + //Note: Allowing null lexical components + + if(msgParts.size() == 0) return; //No error + if(msgParts.size() == 1) throw new ParameterError(msgParts.get(0) + " not provided"); + + String msg = msgParts.get(0); + + for(int i = 1; i < msgParts.size() - 1; i++) { + msg += ", " + msgParts.get(i); + } + + msg += " and " + msgParts.get(msgParts.size() - 1) + " not provided"; + + throw new ParameterError(msg); + } +} diff --git a/src/main/java/component_construction/builders/CompilerBuilderTemplate.java b/src/main/java/component_construction/builders/CompilerBuilderTemplate.java deleted file mode 100644 index 8872179..0000000 --- a/src/main/java/component_construction/builders/CompilerBuilderTemplate.java +++ /dev/null @@ -1,226 +0,0 @@ -package component_construction.builders; - -import java.util.*; - -import grammar_objects.*; -import lexical_analysis.*; -import component_construction.ParameterError; -import component_construction.bundles.GrammarBundle; -import component_construction.custom_components.*; -import component_construction.factories.code_generation.CodeGeneratorFactory; -import component_construction.factories.lexical_analysis.LexicalAnalyserFactory; -import component_construction.factories.syntax_analysis.SyntaxAnalyserFactory; - -/** - * An template for builders of CustomCompilers - * @param The type of the current implementing subclass of this template - * @param The type of CustomCompiler that will be built by the implemented builder - */ -public abstract class CompilerBuilderTemplate , C extends CustomCompiler> { - protected LexicalAnalyserFactory lexicalAnalyserFactory; - protected SyntaxAnalyserFactory syntaxAnalyserFactory; - protected CodeGeneratorFactory codeGeneratorFactory; - - protected Grammar grammar; - protected RuleConvertor ruleConvertor; - - protected String[] whitespaceDelimiters; - protected String[] stronglyReservedWords; - protected String[] weaklyReservedWords; - protected DynamicTokenRegex[] dynamicTokenRegex; - - /** - * A shortcut setter method for all components necessary for building a compiler - * @param lexicalAnalyserFactory A factory which produces lexical analysers - * @param syntaxAnalyserFactory A factory which produces syntax analysers - * @param codeGeneratorFactory A factory which produces code generators - * @param grammarBundle A {@code GrammarBundle} for the grammar to be compiled - * @return This object for method chaining - */ - public B setComponents( - LexicalAnalyserFactory lexicalAnalyserFactory, - SyntaxAnalyserFactory syntaxAnalyserFactory, - CodeGeneratorFactory codeGeneratorFactory, - GrammarBundle grammarBundle - ) { - return setComponents( - lexicalAnalyserFactory, - syntaxAnalyserFactory, - codeGeneratorFactory, - grammarBundle.getGrammar(), - grammarBundle.getRuleConvertor(), - grammarBundle.getWhitespaceDelimiters(), - grammarBundle.getStronglyReservedWords(), - grammarBundle.getWeaklyReservedWords(), - grammarBundle.getDynamicTokenRegex() - ); - } - - /** - * A shortcut setter method for all components necessary for building a compiler - * @param lexicalAnalyserFactory A factory which produces lexical analysers - * @param syntaxAnalyserFactory A factory which produces syntax analysers - * @param codeGeneratorFactory A factory which produces code generators - * @param grammar The {@code grammar} to be used for compilation - * @param ruleConvertor The {@code RuleConvertor} to produce output code from compiled input sentences - * @param whitespaceDelimiters An array of strings to be conidered as whitespace in compiled sentences. May be null - * @param stronglyReservedWords An array of strings which may only be used by reserved words within the provided grammar. May be null - * @param weaklyReservedWords An array of strings to be used by reserved words within the provided grammar, they may appear as part of other tokens. May be null - * @param dynamicTokenRegex An array of {@code DynamicTokenRegex} for grammar tokens which may take different forms according to provided regex. May be null - * @return This object for method chaining - */ - public B setComponents( - LexicalAnalyserFactory lexicalAnalyserFactory, - SyntaxAnalyserFactory syntaxAnalyserFactory, - CodeGeneratorFactory codeGeneratorFactory, - Grammar grammar, - RuleConvertor ruleConvertor, - String[] whitespaceDelimiters, - String[] stronglyReservedWords, - String[] weaklyReservedWords, - DynamicTokenRegex[] dynamicTokenRegex - ) { - setLexicalAnalyser(lexicalAnalyserFactory); - setSyntaxAnalyser(syntaxAnalyserFactory); - setCodeGenerator(codeGeneratorFactory); - setGrammar(grammar); - setRuleConvertor(ruleConvertor); - setWhitespaceDelimiters(whitespaceDelimiters); - setStronglyReservedWords(stronglyReservedWords); - setWeaklyReservedWords(weaklyReservedWords); - setDynamicTokenRegex(dynamicTokenRegex); - - return getThis(); - } - - - /** - * Sets the lexical analyser for the produced compiler - * @param factory A factory which produces lexical analysers - * @return This object for method chaining - */ - public B setLexicalAnalyser(LexicalAnalyserFactory factory) { - this.lexicalAnalyserFactory = factory; - return getThis(); - } - - /** - * Sets the syntax analyser for the produced compiler - * @param factory A factory which produces syntax analysers - * @return This object for method chaining - */ - public B setSyntaxAnalyser(SyntaxAnalyserFactory factory) { - this.syntaxAnalyserFactory = factory; - return getThis(); - } - - /** - * Sets the code generator for the produced compiler - * @param factory A factory which produces code generators - * @return This object for method chaining - */ - public B setCodeGenerator(CodeGeneratorFactory factory) { - this.codeGeneratorFactory = factory; - return getThis(); - } - - - /** - * Sets the grammar for the produced compiler - * @param grammar The {@code grammar} to be used for compilation - * @return This object for method chaining - */ - public B setGrammar(Grammar grammar) { - this.grammar = grammar; - return getThis(); - } - - /** - * Sets the rule convertor for the produced compiler - * @param ruleConvertor The {@code RuleConvertor} to produce output code from compiled input sentences - * @return This object for method chaining - */ - public B setRuleConvertor(RuleConvertor ruleConvertor) { - this.ruleConvertor = ruleConvertor; - return getThis(); - } - - - /** - * Sets the designated whitespace delimiters for compilation - * @param whitespaceDelimiters An array of strings to be conidered as whitespace in compiled sentences - * @return This object for method chaining - */ - public B setWhitespaceDelimiters(String[] whitespaceDelimiters) { - this.whitespaceDelimiters = whitespaceDelimiters; - return getThis(); - } - - /** - * Sets designated reserved words for compilation. These may not be used within other tokens - * @param stronglyReservedWords An array of strings which may only be used by reserved words within the provided grammar - * @return This object for method chaining - */ - public B setStronglyReservedWords(String[] stronglyReservedWords) { - this.stronglyReservedWords = stronglyReservedWords; - return getThis(); - } - - /** - * Sets reserved words for compilation that may be used as part of other tokens - * @param weaklyReservedWords An array of strings to be used by reserved words within the provided grammar, they may appear within other tokens - * @return This object for method chaining - */ - public B setWeaklyReservedWords(String[] weaklyReservedWords) { - this.weaklyReservedWords = weaklyReservedWords; - return getThis(); - } - - /** - * Sets the dynaic tokens for comiplation - * @param dynamicTokenRegex An array of {@code DynamicTokenRegex} for grammar tokens which may take different forms according to provided regex - * @return This object for method chaining - */ - public B setDynamicTokenRegex(DynamicTokenRegex[] dynamicTokenRegex) { - this.dynamicTokenRegex = dynamicTokenRegex; - return getThis(); - } - - - /** - * Creates a new compiler according to the components provided to this builder - * @return The produced compiler - */ - public abstract C createCompiler(); - - - /** - * A simple helper method to be filled with "{@code return this;}" by subclasses of this builder - * @return The current builder object "this" - */ - protected abstract B getThis(); - - protected void checkForCompleteBuild() { - List msgParts = new ArrayList<>(); - - if(lexicalAnalyserFactory == null) msgParts.add("lexical analyser factory"); - if(syntaxAnalyserFactory == null) msgParts.add("syntax analyser factory"); - if(codeGeneratorFactory == null) msgParts.add("code generator factory"); - if(grammar == null) msgParts.add("grammar"); - if(ruleConvertor == null) msgParts.add("rule convertor"); - // Note: Allowing null lexical components - - if(msgParts.size() == 0) return; // No error - if(msgParts.size() == 1) throw new ParameterError(msgParts.get(0) + " not provided"); - - String msg = msgParts.get(0); - - for(int i = 1; i < msgParts.size() - 1; i++) { - msg += ", " + msgParts.get(i); - } - - msg += " and " + msgParts.get(msgParts.size() - 1) + " not provided"; - - throw new ParameterError(msg); - } -} diff --git a/src/main/java/component_construction/builders/CustomCompilerBuilder.java b/src/main/java/component_construction/builders/CustomCompilerBuilder.java deleted file mode 100644 index 9ced170..0000000 --- a/src/main/java/component_construction/builders/CustomCompilerBuilder.java +++ /dev/null @@ -1,29 +0,0 @@ -package component_construction.builders; - -import component_construction.custom_components.*; - -public class CustomCompilerBuilder extends CompilerBuilderTemplate { - - @Override - protected CustomCompilerBuilder getThis() { - return this; - } - - @Override - public CustomCompiler createCompiler() { - checkForCompleteBuild(); - - return new CustomCompilerFactory().produce( - lexicalAnalyserFactory, - syntaxAnalyserFactory, - codeGeneratorFactory, - grammar, - ruleConvertor, - whitespaceDelimiters, - stronglyReservedWords, - weaklyReservedWords, - dynamicTokenRegex - ); - } - -} diff --git a/src/main/java/component_construction/custom_components/CustomCompiler.java b/src/main/java/component_construction/custom_components/CustomCompiler.java deleted file mode 100644 index 5a8626f..0000000 --- a/src/main/java/component_construction/custom_components/CustomCompiler.java +++ /dev/null @@ -1,53 +0,0 @@ -package component_construction.custom_components; - -import code_generation.CodeGenerator; -import component_construction.Compiler; -import grammar_objects.Token; -import lexical_analysis.LexicalAnalyser; -import syntax_analysis.SyntaxAnalyser; -import syntax_analysis.parsing.*; - -/** - * A compiler that can be built with user-definable inner components - */ -public class CustomCompiler implements Compiler { - protected LexicalAnalyser lexicalAnalyser; - protected SyntaxAnalyser syntaxAnalyser; - protected CodeGenerator codeGenerator; - - public CustomCompiler( - LexicalAnalyser lexicalAnalyser, - SyntaxAnalyser syntaxAnalyser, - CodeGenerator codeGenerator - ) { - this.lexicalAnalyser = lexicalAnalyser; - this.syntaxAnalyser = syntaxAnalyser; - this.codeGenerator = codeGenerator; - } - - public String compile(String input) throws ParseFailedException { - Token[] tokens = lexicalAnalyser.analyse(input); - ParseState parseRoot = syntaxAnalyser.analyse(tokens); - return codeGenerator.generate(parseRoot); - } - - @Override - public boolean equals(Object obj) { - if (!(obj instanceof CustomCompiler)) return false; - - CustomCompiler other = (CustomCompiler)obj; - if (!this.lexicalAnalyser.equals(other.lexicalAnalyser)) return false; - if (!this.syntaxAnalyser.equals(other.syntaxAnalyser)) return false; - if (!this.codeGenerator.equals(other.codeGenerator)) return false; - - return true; - } - - @Override - public int hashCode() { - return 31 - * lexicalAnalyser.hashCode() - * syntaxAnalyser.hashCode() - * codeGenerator.hashCode(); - } -} \ No newline at end of file diff --git a/src/main/java/component_construction/custom_components/CustomCompilerFactory.java b/src/main/java/component_construction/custom_components/CustomCompilerFactory.java deleted file mode 100644 index 04d139c..0000000 --- a/src/main/java/component_construction/custom_components/CustomCompilerFactory.java +++ /dev/null @@ -1,62 +0,0 @@ -package component_construction.custom_components; - -import code_generation.CodeGenerator; -import component_construction.factories.code_generation.CodeGeneratorFactory; -import component_construction.factories.lexical_analysis.LexicalAnalyserFactory; -import component_construction.factories.syntax_analysis.SyntaxAnalyserFactory; -import grammar_objects.Grammar; -import grammar_objects.RuleConvertor; -import lexical_analysis.*; -import syntax_analysis.SyntaxAnalyser; - -/** - * A factory for {@code CustomCompilers} - */ -public class CustomCompilerFactory { - - /** - * Builds and produces a {@code CustomCompiler} with user-specified components - * @param lexicalAnalyserFactory A factory for producing {@code LexicalAnalysers} for use within produced {@code CustomCompilers} - * @param syntaxAnalyserFactory A factory for producing {@code SyntaxAnalysers} for use within produced {@code CustomCompilers} - * @param codeGeneratorFactory A factory for producing {@code CodeGenerators} for use within produced {@code CustomCompilers} - * @param grammar The grammar to be used by produced {@code CustomCompilers} - * @param ruleConvertor The convertor to sanction grammar rules within produced {@code CustomCompilers} - * @param whitespaceDelimiters An array of designated whitespace delimiter strings for compilation - * @param stronglyReservedWords An array of designated reserved words for compilation. These words may not be used within other tokens - * @param weaklyReservedWords An array of reserved words that may be used as part of other tokens - * @param dynamicTokenRegex An array of {@code DynamicTokenRegex} for tokens whix may take many forms according to the provided regex - * @return A produced {@code CustomCompiler} - */ - public CustomCompiler produce( - LexicalAnalyserFactory lexicalAnalyserFactory, - SyntaxAnalyserFactory syntaxAnalyserFactory, - CodeGeneratorFactory codeGeneratorFactory, - Grammar grammar, - RuleConvertor ruleConvertor, - String[] whitespaceDelimiters, - String[] stronglyReservedWords, - String[] weaklyReservedWords, - DynamicTokenRegex[] dynamicTokenRegex - ) { - if(whitespaceDelimiters == null) whitespaceDelimiters = new String[]{}; - if(stronglyReservedWords == null) stronglyReservedWords = new String[]{}; - if(weaklyReservedWords == null) weaklyReservedWords = new String[]{}; - if(dynamicTokenRegex == null) dynamicTokenRegex = new DynamicTokenRegex[]{}; - - LexicalAnalyser lexicalAnalyser = lexicalAnalyserFactory.produceAnalyser( - whitespaceDelimiters, - stronglyReservedWords, - weaklyReservedWords, - dynamicTokenRegex - ); - SyntaxAnalyser syntaxAnalyser = syntaxAnalyserFactory.produceAnalyser(grammar.getParts()); - CodeGenerator codeGenerator = codeGeneratorFactory.produceGenerator(ruleConvertor); - - return new CustomCompiler( - lexicalAnalyser, - syntaxAnalyser, - codeGenerator - ); - } - -} diff --git a/src/main/java/component_construction/factories/syntax_analysis/CLR1ParserFactory.java b/src/main/java/component_construction/factories/syntax_analysis/CLR1ParserFactory.java index ec9a800..ca65ce4 100644 --- a/src/main/java/component_construction/factories/syntax_analysis/CLR1ParserFactory.java +++ b/src/main/java/component_construction/factories/syntax_analysis/CLR1ParserFactory.java @@ -2,7 +2,6 @@ import grammar_objects.GrammarParts; import syntax_analysis.*; -import syntax_analysis.parsing.parsers.CLR1Parser; public class CLR1ParserFactory implements SyntaxAnalyserFactory { diff --git a/src/main/java/component_construction/storable/CompilerStorage.java b/src/main/java/component_construction/storable/CompilerStorage.java deleted file mode 100644 index 91f5465..0000000 --- a/src/main/java/component_construction/storable/CompilerStorage.java +++ /dev/null @@ -1,279 +0,0 @@ -package component_construction.storable; - -import java.io.*; -import java.nio.file.Path; - -import component_construction.storable.factories.StorableCustomCompilerFactory; -import storage.Storage; -import storage.exceptions.*; -import storage.external_interfaces.Loadable; -import storage.file_editors.*; -import storage.storage_value_adapters.UnsupportedValueException; -import storage.storage_values.StorageValue; -import storage.value_formatters.ValueFormatter; - -public class CompilerStorage { - protected Storage storage = new Storage(); - protected StorableCustomCompilerFactory storableCustomCompilerFactory = new StorableCustomCompilerFactory(); - - //#region Getters - - /** - * Gets the currently tagetted filepath being used for storage - * @return The targeted filepath - */ - public Path getTargetFilepath() { - return storage.getTargetFilepath(); - } - - //#endregion - - //#region Configuration - - /** - * Sets the target filepath the be use for storage - * @param filepath The filepath to target - * @return This object for method chaining - */ - public CompilerStorage setTargetPath(Path filepath) { - storage.setTargetPath(filepath); - return this; - } - - /** - * Sets the target filepath the be use for storage - * @param filepath The absolute filepath to be targeted - * @return This object for method chaining - */ - public CompilerStorage setAbsoluteTargetPath(String filepath) { - storage.setAbsoluteTargetPath(filepath); - return this; - } - - /** - * Sets the target filepath the be use for storage - * @param filepath The relative filepath to be targeted - * @return This object for method chaining - */ - public CompilerStorage setRelativeTargetPath(String filepath) { - storage.setRelativeTargetPath(filepath); - return this; - } - - /** - * Sets the formatter to be used for converting StorageValues into storage representations - * @param The target format to convert values to/from - * @param formatter The formatter to be used - * @return This object for method chaining - */ - public CompilerStorage setFormatter(ValueFormatter formatter) { - storage.setFormatter(formatter); - return this; - } - - /** - * Sets the stream writer to be used for storing storage values - * @param The data format expected to be writen - * @param streamWriter The stream writer to be selected - * @return This object for method chaining - */ - public CompilerStorage setStreamWriter(StreamWriter streamWriter) { - storage.setStreamWriter(streamWriter); - return this; - } - - /** - * Sets the stream reader to be used for reading values from storage - * @param The data format expected to be output when read - * @param streamReader The stream reader to be selected - * @return This object for method chaining - */ - public CompilerStorage setStreamReader(StreamReader streamReader) { - storage.setStreamReader(streamReader); - return this; - } - - /** - * Sets the stream reader to be used for reading and storing values in storage - * @param The data format expected to be read or stored - * @param streamEditor The stream editor to be selected - * @return This object for method chaining - */ - public CompilerStorage setStreamEditor(StreamEditor streamEditor) { - storage.setStreamEditor(streamEditor); - return this; - } - - //#endregion - - //#region ConvenienceMethods - - /** - * Sets the file reader to be used for reading and storing values in storage. - * An equvalent method to setStreamWriter(StreamWriter streamWriter) - * @param The data format expected to be writen - * @param fileWriter The file writer to be selected - * @return This object for method chaining - */ - public CompilerStorage setFileWriter(StreamWriter fileWriter) { - storage.setStreamWriter(fileWriter); - return this; - } - - /** - * Sets the file reader to be used for reading values from storage. - * An equvalent method to setStreamReader(StreamReader streamReader) - * @param The data format expected to be writen - * @param fileReader The file reader to be selected - * @return This object for method chaining - */ - public CompilerStorage setFileReader(StreamReader fileReader) { - storage.setStreamReader(fileReader); - return this; - } - - /** - * Sets the stream reader to be used for reading and storing values in storage. - * An equvalent method to setStreamEditor(StreamEditor streamEditor) - * @param The data format expected to be read or stored - * @param fileEditor The stream editor to be selected - * @return This object for method chaining - */ - public CompilerStorage setFileEditor(StreamEditor fileEditor) { - storage.setStreamEditor(fileEditor); - return this; - } - - //#endregion - - //#region StreamStorage - - /** - * Stores the given compiler to the given output stream, converting the compiler using the specified formatter to produce a storable data format - * @param The data format to be used for storage - * @param compiler The compiler to be stored - * @param formatter The formatter to be used to convert values for storage. Only set for execution of this function. Use setFormatter to use this for multiple executions. - * @param outputStream The stream to be used - * @throws StoreFailureException - * @throws FormattingException - * @throws StorageFormatMismatchException - * @throws NullStorageObjectException - */ - public void convertAndStore(StorableCustomCompiler compiler, ValueFormatter formatter, OutputStream outputStream) throws StoreFailureException, FormattingException, StorageFormatMismatchException, NullStorageObjectException { - storage.convertAndStore(compiler, formatter, outputStream); - } - - /** - * Stores a specified compiler in the given output stream - * @param compiler The compiler to be stored - * @param outputStream The stream to be used - * @throws StoreFailureException - * @throws FormattingException - * @throws StorageFormatMismatchException - * @throws NullStorageObjectException - */ - public void store(StorableCustomCompiler compiler, OutputStream outputStream) throws StoreFailureException, FormattingException, StorageFormatMismatchException, NullStorageObjectException { - storage.store(compiler, outputStream); - } - - /** - * Reads a value from the given input stream, converts the value using the chosen formatter and loads it into the given compiler - * @param compiler An existing to load the value into - * @param inputStream The input stream to be read - * @throws LoadFailureException - * @throws FormatParseException - * @throws StorageFormatMismatchException - */ - public void convertAndLoadInto(Loadable compiler, InputStream inputStream) throws LoadFailureException, FormatParseException, StorageFormatMismatchException { - storage.convertAndLoadInto(compiler, inputStream); - } - - /** - * Reads a value from the given input stream, converts the value using the provided formatter and loads it into the given compiler - * @param The expected value format to be read and provided to the formatter - * @param compiler The compiler to load the value into - * @param formatter The formatter to be used to convert data from the stream - * @param inputStream The input stream to be read - * @throws LoadFailureException - * @throws FormatParseException - * @throws StorageFormatMismatchException - */ - public void convertAndLoadInto(Loadable compiler, ValueFormatter formatter, InputStream inputStream) throws LoadFailureException, FormatParseException, StorageFormatMismatchException { - storage.convertAndLoadInto(compiler, formatter, inputStream); - } - - /** - * Loads a compiler from the given input stream - * @param inputStream The input stream to read from - * @return The compiler built for the stream, once formatted by the chosen formatter - * @throws LoadFailureException - * @throws FormatParseException - * @throws StorageFormatMismatchException - */ - public StorableCustomCompiler load(InputStream inputStream) throws LoadFailureException, FormatParseException, StorageFormatMismatchException { - StorageValue storageValue = storage.load(inputStream); - return storableCustomCompilerFactory.produce(storageValue); - } - - //#endregion - - //#region FileStorage - - /** - * Stores the compiler in the targetted file - * @param compiler The compiler to be stored - * @throws UnsupportedValueException - * @throws UncheckedIOException - * @throws RuntimeException - * @throws UncheckedIOException - * @throws NullStorageObjectException - */ - public void store(StorableCustomCompiler compiler) throws UnsupportedValueException, UncheckedIOException, RuntimeException, UncheckedIOException, NullStorageObjectException { - storage.store(compiler); - } - - /** - * Stores the compiler in the given file - * @param compiler The compiler to be stored - * @param filePath The target file to use for storage - * @throws UnsupportedValueException - * @throws UncheckedIOException - * @throws RuntimeException - * @throws UncheckedIOException - * @throws NullStorageObjectException - */ - public void store(StorableCustomCompiler compiler, String filePath) throws UnsupportedValueException, UncheckedIOException, RuntimeException, UncheckedIOException, NullStorageObjectException { - storage.store(compiler, filePath); - } - - - /** - * Loads a compiler from the chosen file - * @return The loaded compiler - * @throws LoadFailureException - * @throws FormatParseException - * @throws StorageFormatMismatchException - * @throws UncheckedIOException - */ - public StorableCustomCompiler load() throws LoadFailureException, FormatParseException, StorageFormatMismatchException, UncheckedIOException { - StorageValue storageValue = storage.load(); - return storableCustomCompilerFactory.produce(storageValue); - } - - /** - * Loads a value from the chosen file into the given compiler - * @param compiler An existing compiler to load stored values into - * @throws LoadFailureException - * @throws FormatParseException - * @throws StorageFormatMismatchException - * @throws UncheckedIOException - */ - public void loadInto(Loadable compiler) throws LoadFailureException, FormatParseException, StorageFormatMismatchException, UncheckedIOException { - storage.loadInto(compiler); - } - - //#endregion - - // TODO: Implement and test LoadableBy - -} diff --git a/src/main/java/component_construction/storable/StorableCustomCompiler.java b/src/main/java/component_construction/storable/StorableCustomCompiler.java deleted file mode 100644 index bfcdf7b..0000000 --- a/src/main/java/component_construction/storable/StorableCustomCompiler.java +++ /dev/null @@ -1,61 +0,0 @@ -package component_construction.storable; - -import java.util.Map; - -import code_generation.CodeGenerator; -import component_construction.custom_components.*; -import component_construction.storable.dynamic_loading.LoadableBy; -import component_construction.storable.exceptions.NonStorableComponentException; -import component_construction.storable.factories.StorableCustomCompilerFactory; -import component_construction.storable.StorableCustomCompiler; -import lexical_analysis.LexicalAnalyser; -import storage.external_interfaces.Storable; -import storage.storage_values.*; -import syntax_analysis.SyntaxAnalyser; - -public class StorableCustomCompiler extends CustomCompiler implements Storable, LoadableBy { - - /** - * Creates a new StorableCustomCompiler. All components must implement Storable. - * @param lexicalAnalyser A Storable LexicalAnalyser for this compiler - * @param syntaxAnalyser A Storable SyntaxAnalyser for this compiler - * @param codeGenerator A Storable CodeGenerator for this compiler - * @throws NonStorableComponentException A component was introduced without implementing Storable - */ - public StorableCustomCompiler( - LexicalAnalyser lexicalAnalyser, - SyntaxAnalyser syntaxAnalyser, - CodeGenerator codeGenerator - ) throws NonStorableComponentException { - super(lexicalAnalyser, syntaxAnalyser, codeGenerator); - - if (!(lexicalAnalyser instanceof Storable)) throw new NonStorableComponentException(lexicalAnalyser); - if (!(syntaxAnalyser instanceof Storable)) throw new NonStorableComponentException(syntaxAnalyser); - if (!(codeGenerator instanceof Storable)) throw new NonStorableComponentException(codeGenerator); - } - - @Override - public MapStorageValue getStorageRepresentation() { - return new MapStorageValue(Map.of( - "lexicalAnalyser", new ListStorageValue( - new StringStorageValue(lexicalAnalyser.getClass().getName()), - ((Storable)lexicalAnalyser).getStorageRepresentation() - ), - "syntaxAnalyser", new ListStorageValue( - new StringStorageValue(syntaxAnalyser.getClass().getName()), - ((Storable)syntaxAnalyser).getStorageRepresentation() - ), - "codeGenerator", new ListStorageValue( - new StringStorageValue(codeGenerator.getClass().getName()), - ((Storable)codeGenerator).getStorageRepresentation() - ) - )); - } - - @Override - public boolean equals(Object obj) { - if (!(obj instanceof StorableCustomCompiler)) return false; - return super.equals(obj); - } - -} diff --git a/src/main/java/component_construction/storable/builders/StorableCustomCompilerBuilder.java b/src/main/java/component_construction/storable/builders/StorableCustomCompilerBuilder.java deleted file mode 100644 index c5420c8..0000000 --- a/src/main/java/component_construction/storable/builders/StorableCustomCompilerBuilder.java +++ /dev/null @@ -1,32 +0,0 @@ -package component_construction.storable.builders; - -import component_construction.builders.CompilerBuilderTemplate; -import component_construction.storable.StorableCustomCompiler; -import component_construction.storable.exceptions.NonStorableComponentException; -import grammar_objects.GrammarParts; - -public class StorableCustomCompilerBuilder extends CompilerBuilderTemplate { - - @Override - protected StorableCustomCompilerBuilder getThis() { - return this; - } - - @Override - public StorableCustomCompiler createCompiler() throws NonStorableComponentException { - checkForCompleteBuild(); - - GrammarParts parts = grammar.getParts(); - - return new StorableCustomCompiler( - lexicalAnalyserFactory.produceAnalyser( - whitespaceDelimiters, - stronglyReservedWords, - weaklyReservedWords, - dynamicTokenRegex - ), - syntaxAnalyserFactory.produceAnalyser(parts), - codeGeneratorFactory.produceGenerator(ruleConvertor) - ); - } -} diff --git a/src/main/java/component_construction/storable/dynamic_loading/LoadableBy.java b/src/main/java/component_construction/storable/dynamic_loading/LoadableBy.java deleted file mode 100644 index f9e3839..0000000 --- a/src/main/java/component_construction/storable/dynamic_loading/LoadableBy.java +++ /dev/null @@ -1,51 +0,0 @@ -package component_construction.storable.dynamic_loading; - -import java.lang.reflect.*; - -import component_construction.storable.exceptions.IncorrectlyFormattedException; - -/** - * A class specifying a designated loader for the current class. - * Loaders will be loaded using reflection. - * @param The concrete Loader class - */ -public interface LoadableBy> { - - /** - * Gets the {@code Loader} referenced by a given {@code LoadableBy} object - * @param The object type that may be loaded through the referenced {@code Loader} type - * @param The type of {@code Loader} referenced by this {@code LoadableBy} object - * @param loadableByClass The class implementing {@code LoadableBy} - * @return The class of the referenced {@code Loader} type - * @throws IllegalArgumentException The provided class does not directly implement {@code LoadableBy} - * @throws IncorrectlyFormattedException The provided {@code Loader} type is not a constructable/concrete {@code Class} object - */ - @SuppressWarnings("unchecked") - public static > Class getTargetLoader(Class> loadableByClass) throws IllegalArgumentException, IncorrectlyFormattedException { - ParameterizedType loadableByInterface = null; - - for (Type currentInterface : loadableByClass.getGenericInterfaces()) { - if (!(currentInterface instanceof ParameterizedType)) continue; - - ParameterizedType paramType = (ParameterizedType) currentInterface; - if (!paramType.getRawType().equals(LoadableBy.class)) continue; - - loadableByInterface = paramType; - break; - } - - if (loadableByInterface == null) - throw new IllegalArgumentException("Class " + loadableByClass.getName() + " does not directly implement LoadableBy."); - - Type actualTypeArgument = loadableByInterface.getActualTypeArguments()[0]; - - if (actualTypeArgument instanceof ParameterizedType) - throw new IncorrectlyFormattedException("Class " + loadableByClass.getName() + " provides a nested generic loader (" + actualTypeArgument.getTypeName() + "). Loaders must be direct, concrete Class objects."); - - if (!(actualTypeArgument instanceof Class)) - throw new IncorrectlyFormattedException("Class " + loadableByClass.getName() + " provides an abstract or unbound type token (" + actualTypeArgument.getTypeName() + "). The loader must be a direct, concrete Class object."); - - return (Class) actualTypeArgument; - } - -} diff --git a/src/main/java/component_construction/storable/dynamic_loading/Loader.java b/src/main/java/component_construction/storable/dynamic_loading/Loader.java deleted file mode 100644 index dd13bce..0000000 --- a/src/main/java/component_construction/storable/dynamic_loading/Loader.java +++ /dev/null @@ -1,42 +0,0 @@ -package component_construction.storable.dynamic_loading; - -import java.lang.reflect.InvocationTargetException; - -import component_construction.storable.exceptions.MissingEmptyConstructorException; -import component_construction.storable.factories.Factory; - -/** - * An interface defining the ability construct objects of the specified type - * @param The type of object to be constructed - */ -public interface Loader extends Factory { - - /** - * Constructs a new object of the specified {@code Loader} - * @param The type of object constructable by the {@code Loader} - * @param loaderClass The class of the {@code Loader} to be reflectively constructed - * @return An object of the specified {@code Loader} - * @throws MissingEmptyConstructorException The {@code Loader} did not contain the required empty constructor - * @throws IllegalArgumentException The specified {@code Loader} could not be constructed as it is either abstract or the constructor is inaccessible - */ - public static Loader construct(Class> loaderClass) throws MissingEmptyConstructorException, IllegalArgumentException { - try { - return loaderClass - .getConstructor() - .newInstance(); - } - catch (NoSuchMethodException e) { - throw new MissingEmptyConstructorException(loaderClass); - } - catch ( - InstantiationException - | IllegalAccessException - | IllegalArgumentException - | InvocationTargetException - e - ) { - throw new IllegalArgumentException(e); - } - } - -} diff --git a/src/main/java/component_construction/storable/dynamic_loading/ReflectiveClassConstructor.java b/src/main/java/component_construction/storable/dynamic_loading/ReflectiveClassConstructor.java deleted file mode 100644 index e9ccfdf..0000000 --- a/src/main/java/component_construction/storable/dynamic_loading/ReflectiveClassConstructor.java +++ /dev/null @@ -1,128 +0,0 @@ -package component_construction.storable.dynamic_loading; - -import java.lang.reflect.InvocationTargetException; -import java.util.*; -import java.util.stream.Collectors; - -public class ReflectiveClassConstructor { - - /** - * Constructs an object of the specified name and returns it as the target type, using reflection. - * @param The output target type - * @param className The name of the class to be loaded. Provided following the format provided by {@code someObject.class.getName()} - * @param targetType The specified target output type - * @return The constructed object of the target type - * @throws ClassNotFoundException The specified class could not be found - * @throws IllegalArgumentException One or more of the provided arguments has caused a failure to construct the specifed class - */ - public T construct( - String className, - Class targetType - ) - throws - ClassNotFoundException, - IllegalArgumentException - { - return construct( - className, - targetType, - new Class[] {}, - new Object[] {} - ); - } - - /** - * Constructs an object of the specified name and returns it as the target type, using reflection. - * @param The output target type - * @param className The name of the class to be loaded. Provided following the format provided by {@code someObject.class.getName()} - * @param targetType The specified target output type - * @param parameterType The type expected by the constructor for the specified class - * @param parameter The value to be passed to the constructor of the specified class. Note: Inner classes require an additional initial parameter to be a parent object of the outer class - * @return The constructed object of the target type - * @throws ClassNotFoundException The specified class could not be found - * @throws IllegalArgumentException One or more of the provided arguments has caused a failure to construct the specifed class - */ - public T construct( - String className, - Class targetType, - Class parameterType, - Object parameter - ) - throws - ClassNotFoundException, - IllegalArgumentException - { - return construct( - className, - targetType, - new Class[] { parameterType }, - new Object[] { parameter } - ); - } - - /** - * Constructs an object of the specified name and returns it as the target type, using reflection. - * @param The output target type - * @param className The name of the class to be loaded. Provided following the format provided by {@code someObject.class.getName()} - * @param targetType The specified target output type - * @param parameterTypes The types expected by the constructor for the specified class - * @param parameters The values to be passes to the constructor of the specified class. Note: Inner classes require an additional initial parameter to be a parent object of the outer class - * @return The constructed object of the target type - * @throws ClassNotFoundException The specified class could not be found - * @throws IllegalArgumentException One or more of the provided arguments has caused a failure to construct the specifed class - */ - public T construct( - String className, - Class targetType, - Class[] parameterTypes, - Object[] parameters - ) - throws - ClassNotFoundException, - IllegalArgumentException - { - try { - return Class - .forName(className) - .asSubclass(targetType) - .getDeclaredConstructor(parameterTypes) - .newInstance(parameters); - } - catch (ClassNotFoundException e) { - throw new ClassNotFoundException("Target class not found: " + className, e); - } - catch (NoSuchMethodException e) { - throw new IllegalArgumentException( - "No constructor found in " + className + " matching types: [" + getTypesString(parameterTypes) + "]", - e - ); - } - catch (IllegalArgumentException e) { - throw new IllegalArgumentException( - "Type mismatch between declared types [" + getTypesString(parameterTypes) + "] and parameter types [" + getParameterTypesString(parameters) + "]", - e - ); - } - catch (IllegalAccessException e) { - throw new IllegalArgumentException("Constructor is private or inaccessible in class: " + className, e); - } - catch (InstantiationException e) { - throw new IllegalArgumentException("Cannot instantiate abstract class or interface: " + className, e); - } - catch (InvocationTargetException e) { - throw new IllegalArgumentException("The constructor for " + className + " threw an exception", e.getCause()); - } - } - - protected String getTypesString(Class[] parameterTypes) { - return Arrays.stream(parameterTypes) - .map(Class::getSimpleName) - .collect(Collectors.joining(", ")); - } - - protected String getParameterTypesString(Object[] parameters) { - return Arrays.stream(parameters) - .map(parameter -> parameter.getClass().getSimpleName()) - .collect(Collectors.joining(", ")); - } -} diff --git a/src/main/java/component_construction/storable/dynamic_loading/ReflectivelyLoadable.java b/src/main/java/component_construction/storable/dynamic_loading/ReflectivelyLoadable.java deleted file mode 100644 index 0e61c86..0000000 --- a/src/main/java/component_construction/storable/dynamic_loading/ReflectivelyLoadable.java +++ /dev/null @@ -1,8 +0,0 @@ -package component_construction.storable.dynamic_loading; - -import storage.external_interfaces.Loadable; - -/** - * Classes of this type must have a constructor that may be used to reflectively construct objects. - */ -public interface ReflectivelyLoadable extends Loadable {} \ No newline at end of file diff --git a/src/main/java/component_construction/storable/exceptions/ComponentCastException.java b/src/main/java/component_construction/storable/exceptions/ComponentCastException.java deleted file mode 100644 index 4cb2bc8..0000000 --- a/src/main/java/component_construction/storable/exceptions/ComponentCastException.java +++ /dev/null @@ -1,11 +0,0 @@ -package component_construction.storable.exceptions; - -public class ComponentCastException extends RuntimeException { - - public ComponentCastException(String componentClassName, String expectedType, Throwable cause) { - super( - "The provided component class \"" + componentClassName + "\" could not be cast to the expected type \"" + expectedType + "\". Ensure \"" + componentClassName + "\" implements \"" + expectedType + "\".", - cause - ); - } -} diff --git a/src/main/java/component_construction/storable/exceptions/IncorrectLoadValueFormat.java b/src/main/java/component_construction/storable/exceptions/IncorrectLoadValueFormat.java deleted file mode 100644 index 27b7b63..0000000 --- a/src/main/java/component_construction/storable/exceptions/IncorrectLoadValueFormat.java +++ /dev/null @@ -1,11 +0,0 @@ -package component_construction.storable.exceptions; - -public class IncorrectLoadValueFormat extends RuntimeException { - - public IncorrectLoadValueFormat(String expectedFormat, String actualFormat, Throwable cause) { - super( - "A load value was provided in an incorrect format. Expected - " + expectedFormat + ", Actual - " + actualFormat, - cause - ); - } -} diff --git a/src/main/java/component_construction/storable/exceptions/IncorrectlyFormattedException.java b/src/main/java/component_construction/storable/exceptions/IncorrectlyFormattedException.java deleted file mode 100644 index 5890745..0000000 --- a/src/main/java/component_construction/storable/exceptions/IncorrectlyFormattedException.java +++ /dev/null @@ -1,8 +0,0 @@ -package component_construction.storable.exceptions; - -public class IncorrectlyFormattedException extends RuntimeException { - - public IncorrectlyFormattedException(String message) { - super(message); - } -} diff --git a/src/main/java/component_construction/storable/exceptions/MissingEmptyConstructorException.java b/src/main/java/component_construction/storable/exceptions/MissingEmptyConstructorException.java deleted file mode 100644 index c143e05..0000000 --- a/src/main/java/component_construction/storable/exceptions/MissingEmptyConstructorException.java +++ /dev/null @@ -1,10 +0,0 @@ -package component_construction.storable.exceptions; - -import component_construction.storable.dynamic_loading.Loader; - -public class MissingEmptyConstructorException extends RuntimeException { - - public MissingEmptyConstructorException(Class> loaderClass) { - super("The specified Loaded \"" + loaderClass.getName() + "\" is missing a required default/empty constructor"); - } -} diff --git a/src/main/java/component_construction/storable/exceptions/MissingKeyException.java b/src/main/java/component_construction/storable/exceptions/MissingKeyException.java deleted file mode 100644 index 127d341..0000000 --- a/src/main/java/component_construction/storable/exceptions/MissingKeyException.java +++ /dev/null @@ -1,26 +0,0 @@ -package component_construction.storable.exceptions; - -import java.util.Collection; -import java.util.stream.Collectors; - -public class MissingKeyException extends RuntimeException { - public Collection missingKeys; - - public MissingKeyException(Collection missingKeys) { - super(); - this.missingKeys = missingKeys; - } - - @Override - public String getMessage() { - if (missingKeys.size() == 1) - return "The key \"" + missingKeys.iterator().next() + "\" is missing"; - - String missingKeysString = missingKeys - .stream() - .map(value -> "\"" + value + "\"") - .collect(Collectors.joining(", ")); - - return "The keys " + missingKeysString + " are missing"; - } -} diff --git a/src/main/java/component_construction/storable/exceptions/NonExistentComponentException.java b/src/main/java/component_construction/storable/exceptions/NonExistentComponentException.java deleted file mode 100644 index 2652ce3..0000000 --- a/src/main/java/component_construction/storable/exceptions/NonExistentComponentException.java +++ /dev/null @@ -1,11 +0,0 @@ -package component_construction.storable.exceptions; - -public class NonExistentComponentException extends RuntimeException { - - public NonExistentComponentException(String attemptedComponentClassName, Throwable cause) { - super( - "The component class \"" + attemptedComponentClassName + "\" could not be found or does not exist. Check the provided component name correctly references the intended class.", - cause - ); - } -} diff --git a/src/main/java/component_construction/storable/exceptions/NonStorableComponentException.java b/src/main/java/component_construction/storable/exceptions/NonStorableComponentException.java deleted file mode 100644 index 44929d7..0000000 --- a/src/main/java/component_construction/storable/exceptions/NonStorableComponentException.java +++ /dev/null @@ -1,11 +0,0 @@ -package component_construction.storable.exceptions; - -import storage.external_interfaces.Storable; - -public class NonStorableComponentException extends RuntimeException { - - public NonStorableComponentException(Object component) { - super("The selected component \"" + component.getClass().getName() + "\" must implement " + Storable.class.getSimpleName()); - } - -} diff --git a/src/main/java/component_construction/storable/exceptions/ReflectiveLoadFailure.java b/src/main/java/component_construction/storable/exceptions/ReflectiveLoadFailure.java deleted file mode 100644 index 6685d55..0000000 --- a/src/main/java/component_construction/storable/exceptions/ReflectiveLoadFailure.java +++ /dev/null @@ -1,9 +0,0 @@ -package component_construction.storable.exceptions; - -public class ReflectiveLoadFailure extends RuntimeException { - - public ReflectiveLoadFailure(String message, Throwable cause) { - super(message, cause); - } - -} diff --git a/src/main/java/component_construction/storable/factories/Factory.java b/src/main/java/component_construction/storable/factories/Factory.java deleted file mode 100644 index 892b688..0000000 --- a/src/main/java/component_construction/storable/factories/Factory.java +++ /dev/null @@ -1,11 +0,0 @@ -package component_construction.storable.factories; - -import storage.storage_values.StorageValue; - -/** - * A class for objects which may produce other objects from a specified {@code StorageValue} - * @param The type of object to be produced - */ -public interface Factory { - public T produce(StorageValue loadValue); -} \ No newline at end of file diff --git a/src/main/java/component_construction/storable/factories/StorableCustomCompilerFactory.java b/src/main/java/component_construction/storable/factories/StorableCustomCompilerFactory.java deleted file mode 100644 index 9a01a72..0000000 --- a/src/main/java/component_construction/storable/factories/StorableCustomCompilerFactory.java +++ /dev/null @@ -1,236 +0,0 @@ -package component_construction.storable.factories; - -import java.util.*; - -import code_generation.CodeGenerator; -import component_construction.storable.StorableCustomCompiler; -import component_construction.storable.dynamic_loading.*; -import component_construction.storable.exceptions.*; -import component_construction.storable.factories.Factory; -import lexical_analysis.LexicalAnalyser; -import storage.storage_values.*; -import syntax_analysis.SyntaxAnalyser; - -/** - * A factory for producing StorableCustomCompilers. - */ -public class StorableCustomCompilerFactory implements Loader { - protected ReflectiveClassConstructor reflectiveClassLoader = new ReflectiveClassConstructor(); - protected Map> lexicalAnalyserFactoryRepository = new HashMap<>(); - protected Map> syntaxAnalyserFactoryRepository = new HashMap<>(); - protected Map> codeGeneratorFactoryRepository = new HashMap<>(); - protected final Set expectedKeys = Set.of( - "lexicalAnalyser", - "syntaxAnalyser", - "codeGenerator" - ); - - public StorableCustomCompilerFactory addLexicalAnalyserFactory(String name, Factory factory) { - lexicalAnalyserFactoryRepository.put(name, factory); - return this; - } - - public StorableCustomCompilerFactory addSyntaxAnalyserFactory(String name, Factory factory) { - syntaxAnalyserFactoryRepository.put(name, factory); - return this; - } - - public StorableCustomCompilerFactory addCodeGeneratorFactory(String name, Factory factory) { - codeGeneratorFactoryRepository.put(name, factory); - return this; - } - - @Override - /** - * Builds a {@code StorableCustomCompiler} from a map of specified StorageValues. - * - * The format of the loadValue for loading {@code StorableCustomCompiler} components is a {@code MapStorageValue} containing the keys "lexicalAnalyser", "syntaxAnalyser", and "codeGenerator" mapped to their respective {@code StorageValue} descriptions - * - * In order to be loadable, components must be one of: - * - registered with a factory - * - {@code LoadableBy} - * - {@code Loadable} - * - Have a constructor taking a single {@code StorageValue} parameter - * @param loadValue The StorageValue to be used for building a {@code StorableCustomCompiler} - * @return The produced {@code StorableCustomCompiler} - * @throws IncorrectLoadValueFormat The provided load value was in an incorrect format - * @throws MissingKeyException The provided load value was missing one or more required keys - * @throws NonExistentComponentException A specified component class does not exist - * @throws ComponentCastException A specified component class could not be cast to its intended type - * @throws ReflectiveLoadFailure A specified component class does not contain a constructor taing a single {@code StorageValue} parameter - * @throws IncorrectLoadValueFormat A provided component's description was not the expected type {@code ListStorageValue} - * @throws NonStorableComponentException A pecified component class does not implement Storable - */ - public StorableCustomCompiler produce(StorageValue loadValue) throws - IncorrectLoadValueFormat, - MissingKeyException, - NonExistentComponentException, - ComponentCastException, - ReflectiveLoadFailure, - NonStorableComponentException - { - Map> mapValue = tryGetMapValue(loadValue); - Set keys = mapValue.keySet(); - - if (!keys.containsAll(expectedKeys)) { - Set missingKeys = new HashSet(expectedKeys); - missingKeys.removeAll(keys); - throw new MissingKeyException(missingKeys); - } - - return new StorableCustomCompiler( - buildComponent( - lexicalAnalyserFactoryRepository, - mapValue.get("lexicalAnalyser"), - LexicalAnalyser.class - ), - buildComponent( - syntaxAnalyserFactoryRepository, - mapValue.get("syntaxAnalyser"), - SyntaxAnalyser.class - ), - buildComponent( - codeGeneratorFactoryRepository, - mapValue.get("codeGenerator"), - CodeGenerator.class - ) - ); - } - - private Map> tryGetMapValue(StorageValue loadValue) throws IncorrectLoadValueFormat { - MapStorageValue map; - Map> mapValue; - - try { - map = (MapStorageValue) loadValue; - } - catch (ClassCastException e) { - throw new IncorrectLoadValueFormat( - "MapStorageValue which maps String to ListStorageValue", - loadValue.getClass().getSimpleName(), - e - ); - } - - mapValue = map.getValue(); - return mapValue; - } - - /** - * Converts a given description into a {@code ComponentInformation} object - * @param description The component's description as a {@code ListStorageValue} - * @return The ComponentInformation representation of the description - * @throws IncorrectLoadValueFormat The provided component description was not the expected type {@code ListStorageValue} - */ - protected ComponentInformation getComponentDescription(StorageValue description) throws IncorrectLoadValueFormat { - List> entry; - - try { - entry = ((ListStorageValue)description).getValue(); - } - catch (ClassCastException e) { - throw new IncorrectLoadValueFormat( - "MapStorageValue which maps String to ListStorageValue", - "MapStorageValue which maps String to " + description.getClass().getSimpleName(), - e - ); - } - - return new ComponentInformation( - ((StringStorageValue)entry.get(0)).getValue(), - entry.get(1) - ); - } - - protected record ComponentInformation(String name, StorageValue description) {} - - @SuppressWarnings("unchecked") - /** - * Builds a component with the provided description. - * Components must be: registered with a factory; LoadableBy; Loadable; Or, have a constructor taking a single {@code StorageValue} parameter. - * @param The abstract type of the component - * @param repository The repository to query for registered factories for the specific component type - * @param description The description with which to load the component with - * @param selectedType The subclass with which to produce and use the component - * @return The built component - * @throws NonExistentComponentException The specified component class does not exist - * @throws ComponentCastException The specified component class could not be cast to the selectedType - * @throws ReflectiveLoadFailure The specified component class does not contain a constructor taing a single {@code StorageValue} parameter - * @throws IncorrectLoadValueFormat The provided component description was not the expected type {@code ListStorageValue} - */ - protected T buildComponent( - Map> repository, - StorageValue description, - Class selectedType - ) throws - NonExistentComponentException, - ComponentCastException, - ReflectiveLoadFailure, - IncorrectLoadValueFormat - { - ComponentInformation componentDescription = getComponentDescription(description); - - if (repository.containsKey(componentDescription.name())) - return repository - .get(componentDescription.name()) - .produce(componentDescription.description()); - - Class clazz; - - try { - clazz = (Class) Class - .forName(componentDescription.name()) - .asSubclass(selectedType); - } - catch (ClassNotFoundException e) { - throw new NonExistentComponentException(componentDescription.name(), e); - } - catch (ClassCastException e) { - throw new ComponentCastException(componentDescription.name(), selectedType.getName(), e); - } - - if (LoadableBy.class.isAssignableFrom(clazz)) { - Class>> loadableBy = (Class>>) clazz.asSubclass(LoadableBy.class); - Class> targetLoader = LoadableBy.getTargetLoader(loadableBy); - Loader loader = Loader.construct(targetLoader); - return loader.produce(componentDescription.description()); - } - - if (ReflectivelyLoadable.class.isAssignableFrom(clazz)) { - T component; - - try { - component = reflectiveClassLoader.construct( - componentDescription.name(), - selectedType - ); - } - catch (ClassNotFoundException | IllegalArgumentException e) { - // ClassNotFoundException cannot occur as the cast succeeded earlier in this method - // There are also no arguments to cause an IllegalArgumentException - return null; - } - - ((ReflectivelyLoadable)component).load(componentDescription.description()); - - return component; - } - - // Use constructor - try { - return reflectiveClassLoader.construct( - componentDescription.name(), - selectedType, - StorageValue.class, - componentDescription.description() - ); - } - catch (ClassNotFoundException e) { - // ClassNotFoundException cannot occur as the cast succeeded earlier in this method - return null; - } - catch (IllegalArgumentException e) { - throw new ReflectiveLoadFailure("Failed to construct an object of class \"" + componentDescription.name() + "\" as no constructor exists taking \"StorageValue\" as its only parameter.", e); - } - } -} diff --git a/src/main/java/helper_objects/TypeReference.java b/src/main/java/helper_objects/TypeReference.java deleted file mode 100644 index 9b2b9d1..0000000 --- a/src/main/java/helper_objects/TypeReference.java +++ /dev/null @@ -1,29 +0,0 @@ -package helper_objects; - -import java.lang.reflect.*; - -/** - * A class for holding compile-time type information during runtime. - * Implementation of the "Type Token" design pattern. - */ -public abstract class TypeReference { - private Type type; - - private TypeReference() { - Type superClass = getClass().getGenericSuperclass(); - this.type = ((ParameterizedType) superClass).getActualTypeArguments()[0]; - } - - public Type getType() { - return type; - } - - @SuppressWarnings("unchecked") - public Class getContainedClass() { - return (Class) type.getClass(); - } - - public static TypeReference instantiate() { - return new TypeReference() {}; - } -} diff --git a/src/main/java/helper_objects/ValueEnum.java b/src/main/java/helper_objects/ValueEnum.java deleted file mode 100644 index 74baf21..0000000 --- a/src/main/java/helper_objects/ValueEnum.java +++ /dev/null @@ -1,5 +0,0 @@ -package helper_objects; - -public interface ValueEnum { - public T getValue(); -} diff --git a/src/main/java/storage/Storage.java b/src/main/java/storage/Storage.java deleted file mode 100644 index 42b8ad8..0000000 --- a/src/main/java/storage/Storage.java +++ /dev/null @@ -1,493 +0,0 @@ -package storage; - -import java.io.*; -import java.lang.reflect.ParameterizedType; -import java.nio.file.Path; - -import helper_objects.TypeReference; -import storage.exceptions.*; -import storage.file_editors.*; -import storage.external_interfaces.*; -import storage.storage_value_adapters.UnsupportedValueException; -import storage.storage_values.StorageValue; -import storage.value_formatters.*; - -/** - * A utility class for storage - */ -public class Storage { - - private Path targetFilepath = Path.of("." + File.separator + "storageFile.txt"); - private ChosenFormatter formatter = new ChosenFormatter<>(new ValueToStringFormatter()); - private ChosenStreamWriter streamWriter = new ChosenStreamWriter<>(new DefaultUTF8StreamEditor()); - private ChosenStreamReader streamReader = new ChosenStreamReader<>(new DefaultUTF8StreamEditor()); - - //#region Constructors - - public Storage() {} - - //#endregion - - //#region Getters - - /** - * Gets the currently tagetted filepath being used for storage - * @return The targeted filepath - */ - public Path getTargetFilepath() { - return targetFilepath; - } - - //#endregion - - //#region Configuration - - /** - * Sets the target filepath the be use for storage - * @param filepath The filepath to target - * @return This Storage object for method chaining - */ - public Storage setTargetPath(Path filepath) { - targetFilepath = filepath; - return this; - } - - /** - * Sets the target filepath the be use for storage - * @param filepath The absolute filepath to be targeted - * @return This Storage object for method chaining - */ - public Storage setAbsoluteTargetPath(String filepath) { - targetFilepath = Path.of(filepath); - return this; - } - - /** - * Sets the target filepath the be use for storage - * @param filepath The relative filepath to be targeted - * @return This Storage object for method chaining - */ - public Storage setRelativeTargetPath(String filepath) { - targetFilepath = Path.of("." + File.separator + filepath); - return this; - } - - /** - * Sets the formatter to be used for converting StorageValues into storage representations - * @param The target format to convert values to/from - * @param formatter The formatter to be used - * @return This Storage object for method chaining - */ - public Storage setFormatter(ValueFormatter formatter) { - this.formatter = new ChosenFormatter(formatter); - return this; - } - - /** - * Sets the stream writer to be used for storing storage values - * @param The data format expected to be writen - * @param streamWriter The stream writer to be selected - * @return This Storage object for method chaining - */ - public Storage setStreamWriter(StreamWriter streamWriter) { - this.streamWriter = new ChosenStreamWriter<>(streamWriter); - return this; - } - - /** - * Sets the stream reader to be used for reading values from storage - * @param The data format expected to be output when read - * @param streamReader The stream reader to be selected - * @return This Storage object for method chaining - */ - public Storage setStreamReader(StreamReader streamReader) { - this.streamReader = new ChosenStreamReader<>(streamReader); - return this; - } - - /** - * Sets the stream reader to be used for reading and storing values in storage - * @param The data format expected to be read or stored - * @param streamEditor The stream editor to be selected - * @return This Storage object for method chaining - */ - public Storage setStreamEditor(StreamEditor streamEditor) { - this.streamWriter = new ChosenStreamWriter<>(streamEditor); - this.streamReader = new ChosenStreamReader<>(streamEditor); - return this; - } - - //#endregion - - //#region ConvenienceMethods - - /** - * Sets the file reader to be used for reading and storing values in storage. - * An equvalent method to setStreamWriter(StreamWriter streamWriter) - * @param The data format expected to be writen - * @param fileWriter The file writer to be selected - * @return This Storage object for method chaining - */ - public Storage setFileWriter(StreamWriter fileWriter) { - return setStreamWriter(fileWriter); - } - - /** - * Sets the file reader to be used for reading values from storage. - * An equvalent method to setStreamReader(StreamReader streamReader) - * @param The data format expected to be writen - * @param fileReader The file reader to be selected - * @return This Storage object for method chaining - */ - public Storage setFileReader(StreamReader fileReader) { - return setStreamReader(fileReader); - } - - /** - * Sets the stream reader to be used for reading and storing values in storage. - * An equvalent method to setStreamEditor(StreamEditor streamEditor) - * @param The data format expected to be read or stored - * @param fileEditor The stream editor to be selected - * @return This Storage object for method chaining - */ - public Storage setFileEditor(StreamEditor fileEditor) { - return setStreamEditor(fileEditor); - } - - //#endregion - - //#region StreamStorage - - /** - * Stores the given object to the given output stream, converting the object using the specified formatter to produce a storable data format - * @param The data format to be used for storage - * @param storageObject The object to be stored - * @param formatter The formatter to be used to convert values for storage. Only set for execution of this function. Use setFormatter to use this for multiple executions. - * @param outputStream The stream to be used - * @throws StoreFailureException - * @throws FormattingException - * @throws StorageFormatMismatchException - * @throws NullStorageObjectException - */ - public void convertAndStore(Storable storageObject, ValueFormatter formatter, OutputStream outputStream) throws StoreFailureException, FormattingException, StorageFormatMismatchException, NullStorageObjectException { - if(storageObject == null) throw new NullStorageObjectException(); - - convertAndStore_Inner(storageObject.getStorageRepresentation(), new ChosenFormatter(formatter), streamWriter, outputStream); - } - - /** - * Stores the given object in the given output stream - * @param storageObject The object to be stored - * @param outputStream The stream to be used - * @throws StoreFailureException - * @throws FormattingException - * @throws StorageFormatMismatchException - * @throws NullStorageObjectException - */ - public void store(Storable storageObject, OutputStream outputStream) throws StoreFailureException, FormattingException, StorageFormatMismatchException, NullStorageObjectException { - if(storageObject == null) throw new NullStorageObjectException(); - - convertAndStore_Inner(storageObject.getStorageRepresentation(), formatter, streamWriter, outputStream); - } - - /** - * Reads a value from the given input stream, converts the value using the chosen formatter and loads it into the given object - * @param objectToLoad The object to load the value into - * @param inputStream The input stream to be read - * @throws LoadFailureException - * @throws FormatParseException - * @throws StorageFormatMismatchException - */ - public void convertAndLoadInto(Loadable objectToLoad, InputStream inputStream) throws LoadFailureException, FormatParseException, StorageFormatMismatchException { - objectToLoad.load(load_Inner(inputStream, formatter, streamReader)); - } - - /** - * Reads a value from the given input stream, converts the value using the provided formatter and loads it into the given object - * @param The expected value format to be read and provided to the formatter - * @param objectToLoad The object to load the value into - * @param formatter The formatter to be used to convert data from the stream - * @param inputStream The input stream to be read - * @throws LoadFailureException - * @throws FormatParseException - * @throws StorageFormatMismatchException - */ - public void convertAndLoadInto(Loadable objectToLoad, ValueFormatter formatter, InputStream inputStream) throws LoadFailureException, FormatParseException, StorageFormatMismatchException { - objectToLoad.load(load_Inner(inputStream, new ChosenFormatter(formatter), streamReader)); - } - - /** - * Loads a value from the given input stream - * @param inputStream The input stream to read from - * @return The value read from the stream, once formatted by the chosen formatter - * @throws LoadFailureException - * @throws FormatParseException - * @throws StorageFormatMismatchException - */ - public StorageValue load(InputStream inputStream) throws LoadFailureException, FormatParseException, StorageFormatMismatchException { - return load_Inner(inputStream, formatter, streamReader); - } - - /** - * Loads a value from the given input stream and specifies the expected type - * @param The expected inner type of the returned storage value - * @param inputStream The input stream to be read - * @return The value read from the stream, once formatted by the chosen formatter - * @throws LoadFailureException - * @throws FormatParseException - * @throws StorageFormatMismatchException - */ - @SuppressWarnings("unchecked") - public StorageValue loadWithType(InputStream inputStream) throws LoadFailureException, FormatParseException, StorageFormatMismatchException { - try { - return (StorageValue)load(inputStream); - } - catch (ClassCastException e) { - Class chosenType = TypeReference.instantiate().getContainedClass(); - - throw new ClassCastException( - "The format " - + chosenType.getSimpleName() - + " is inconsistant with the type " - + formatter.format.getSimpleName() - + " produced by the chosen formatter." - ); - } - } - - //#endregion - - //#region FileStorage - - /** - * Stores the given object in the targetted file - * @param storageObject The object to be stored - * @throws UnsupportedValueException - * @throws UncheckedIOException - * @throws RuntimeException - * @throws UncheckedIOException - * @throws NullStorageObjectException - */ - public void store(Storable storageObject) throws UnsupportedValueException, UncheckedIOException, RuntimeException, UncheckedIOException, NullStorageObjectException { - if(storageObject == null) throw new NullStorageObjectException(); - - usingTargetFileOutputStream( - (outputStream) -> convertAndStore_Inner(storageObject.getStorageRepresentation(), formatter, streamWriter, outputStream) - ); - } - - /** - * Stores the given object in the given file - * @param storageObject The object to be stored - * @param filePath The target file to use for storage - * @throws UnsupportedValueException - * @throws UncheckedIOException - * @throws RuntimeException - * @throws UncheckedIOException - * @throws NullStorageObjectException - */ - public void store(Storable storageObject, String filePath) throws UnsupportedValueException, UncheckedIOException, RuntimeException, UncheckedIOException, NullStorageObjectException { - if(storageObject == null) throw new NullStorageObjectException(); - - usingFileOutputStream( - new File(filePath), - (outputStream) -> convertAndStore_Inner(storageObject.getStorageRepresentation(), formatter, streamWriter, outputStream) - ); - } - - /** - * Stores the given object in the targetted file - * @param The type of storage value to be stored - * @param storageObject The object to be stored - * @throws StoreFailureException - * @throws FormattingException - * @throws StorageFormatMismatchException - * @throws UncheckedIOException - * @throws NullStorageObjectException - */ - public void store(StorageValue storageObject) throws StoreFailureException, FormattingException, StorageFormatMismatchException, UncheckedIOException, NullStorageObjectException { - if(storageObject == null) throw new NullStorageObjectException(); - - usingTargetFileOutputStream( - (outputStream) -> convertAndStore_Inner(storageObject, formatter, streamWriter, outputStream) - ); - } - - /** - * Loads a value from the chosen file - * @return The loaded value - * @throws LoadFailureException - * @throws FormatParseException - * @throws StorageFormatMismatchException - * @throws UncheckedIOException - */ - public StorageValue load() throws LoadFailureException, FormatParseException, StorageFormatMismatchException, UncheckedIOException { - return usingTargetFileInputStream( - (inputStream) -> load(inputStream) - ); - } - - /** - * Loads a value from the chosen file into the given object - * @param targetObject The object to load stored values into - * @throws LoadFailureException - * @throws FormatParseException - * @throws StorageFormatMismatchException - * @throws UncheckedIOException - */ - public void loadInto(Loadable targetObject) throws LoadFailureException, FormatParseException, StorageFormatMismatchException, UncheckedIOException { - targetObject.load(load()); - } - - //#endregion - - //#region StorageOperations - - private StorageValue load_Inner(InputStream inputStream, ChosenFormatter formatter, ChosenStreamReader streamReader) throws LoadFailureException, FormatParseException, StorageFormatMismatchException { - checkForFormatMismatch(formatter, streamReader); - - Object format; - - try { - format = streamReader.readFrom(inputStream); - } - catch (Exception e) { - throw new LoadFailureException(e); - } - - try { - return formatter.parse(format); - } - catch (Exception e) { - throw new FormatParseException(e); - } - } - - private void convertAndStore_Inner(StorageValue storageObject, ChosenFormatter formatter, ChosenStreamWriter streamWriter, OutputStream outputStream) throws StoreFailureException, FormattingException, StorageFormatMismatchException { - checkForFormatMismatch(formatter, streamWriter); - - Object format; - - try { - format = formatter.format(storageObject); - } - catch (Exception e) { - throw new FormattingException(e); - } - - try { - streamWriter.addTo(outputStream, format); - } catch (Exception e) { - throw new StoreFailureException(e); - } - } - - //#endregion - - //#region ComponentWrappers - - private abstract class FormatHolder { - public Class format; - - @SuppressWarnings("unchecked") - public FormatHolder(Object genericTarget) { - ParameterizedType targetType = (ParameterizedType)(genericTarget.getClass().getGenericInterfaces()[0]); - format = (Class)targetType.getActualTypeArguments()[0]; - } - } - - private class ChosenFormatter extends FormatHolder implements ValueFormatter { - ValueFormatter innerFormatter; - - public ChosenFormatter(ValueFormatter formatter) { - super(formatter); - innerFormatter = formatter; - } - - @Override - public F format(StorageValue value) throws UnsupportedValueException { - return innerFormatter.format(value); - } - - @Override - public StorageValue parse(Object formattedData) throws UnsupportedValueException { - F data = format.cast(formattedData); - return innerFormatter.parse(data); - } - } - - private class ChosenStreamWriter extends FormatHolder { - StreamWriter innerStreamWriter; - - public ChosenStreamWriter(StreamWriter streamWriter) { - super(streamWriter); - innerStreamWriter = streamWriter; - } - - public void addTo(OutputStream stream, Object contents) throws IOException, RuntimeException { - innerStreamWriter.addTo(stream, format.cast(contents)); - } - } - - private class ChosenStreamReader extends FormatHolder { - StreamReader innerStreamReader; - - public ChosenStreamReader(StreamReader streamReader) { - super(streamReader); - innerStreamReader = streamReader; - } - - public F readFrom(InputStream stream) throws IOException { - return innerStreamReader.readFrom(stream); - } - } - - //#endregion - - //#region Helpers - - private void checkForFormatMismatch(FormatHolder holder1, FormatHolder holder2) throws StorageFormatMismatchException { - if (holder1.format.equals(holder2.format)) return; - - throw new StorageFormatMismatchException( - holder1.format.getSimpleName(), - holder2.format.getSimpleName() - ); - } - - private interface OutputStreamReceiver { - void run(OutputStream outputStream); - } - - private interface InputStreamReceiver { - T run(InputStream inputStream); - } - - private void usingFileOutputStream(File file, OutputStreamReceiver function) throws UncheckedIOException { - try (FileOutputStream outputStream = new FileOutputStream(file)) { - function.run(outputStream); - } - catch (IOException e) { - throw new UncheckedIOException(e); - } - } - - private void usingTargetFileOutputStream(OutputStreamReceiver function) throws UncheckedIOException { - usingFileOutputStream(targetFilepath.toFile(), function); - } - - private T usingFileInputStream(File file, InputStreamReceiver function) throws UncheckedIOException { - try (FileInputStream inputStream = new FileInputStream(file)) { - return function.run(inputStream); - } - catch (IOException e) { - throw new UncheckedIOException(e); - } - } - - private T usingTargetFileInputStream(InputStreamReceiver function) throws UncheckedIOException { - return usingFileInputStream(targetFilepath.toFile(), function); - } - - //#endregion -} diff --git a/src/main/java/storage/exceptions/FormatParseException.java b/src/main/java/storage/exceptions/FormatParseException.java deleted file mode 100644 index 3092584..0000000 --- a/src/main/java/storage/exceptions/FormatParseException.java +++ /dev/null @@ -1,9 +0,0 @@ -package storage.exceptions; - -public class FormatParseException extends RuntimeException { - - public FormatParseException(Exception cause) { - super("An error occurred when attempting to parse formatted data.", cause); - } - -} diff --git a/src/main/java/storage/exceptions/FormattingException.java b/src/main/java/storage/exceptions/FormattingException.java deleted file mode 100644 index 99b08b3..0000000 --- a/src/main/java/storage/exceptions/FormattingException.java +++ /dev/null @@ -1,9 +0,0 @@ -package storage.exceptions; - -public class FormattingException extends RuntimeException { - - public FormattingException(Exception cause) { - super("An error occurred when attempting to format data for storage.", cause); - } - -} diff --git a/src/main/java/storage/exceptions/LoadFailureException.java b/src/main/java/storage/exceptions/LoadFailureException.java deleted file mode 100644 index c4f2f55..0000000 --- a/src/main/java/storage/exceptions/LoadFailureException.java +++ /dev/null @@ -1,9 +0,0 @@ -package storage.exceptions; - -public class LoadFailureException extends RuntimeException { - - public LoadFailureException(Exception cause) { - super("An error occurred when attempting a load operation.", cause); - } - -} \ No newline at end of file diff --git a/src/main/java/storage/exceptions/NullStorageObjectException.java b/src/main/java/storage/exceptions/NullStorageObjectException.java deleted file mode 100644 index b460783..0000000 --- a/src/main/java/storage/exceptions/NullStorageObjectException.java +++ /dev/null @@ -1,9 +0,0 @@ -package storage.exceptions; - -public class NullStorageObjectException extends RuntimeException { - - public NullStorageObjectException() { - super("The provided storage object was null. Enusre a valid Storable is provided."); - } - -} diff --git a/src/main/java/storage/exceptions/StorageFormatMismatchException.java b/src/main/java/storage/exceptions/StorageFormatMismatchException.java deleted file mode 100644 index 980fd4e..0000000 --- a/src/main/java/storage/exceptions/StorageFormatMismatchException.java +++ /dev/null @@ -1,14 +0,0 @@ -package storage.exceptions; - -public class StorageFormatMismatchException extends RuntimeException { - - public StorageFormatMismatchException(String type1Name, String type2Name) { - super( - "The formatter and stream editor types were mismatched. Formatter - " - + type1Name.getClass().getSimpleName() - + ", Stream - " - + type2Name.getClass().getSimpleName() - ); - } - -} diff --git a/src/main/java/storage/exceptions/StoreFailureException.java b/src/main/java/storage/exceptions/StoreFailureException.java deleted file mode 100644 index 0515ea3..0000000 --- a/src/main/java/storage/exceptions/StoreFailureException.java +++ /dev/null @@ -1,9 +0,0 @@ -package storage.exceptions; - -public class StoreFailureException extends RuntimeException { - - public StoreFailureException(Exception cause) { - super("An error occurred when attempting a store operation.", cause); - } - -} \ No newline at end of file diff --git a/src/main/java/storage/external_interfaces/Loadable.java b/src/main/java/storage/external_interfaces/Loadable.java deleted file mode 100644 index a69ebb9..0000000 --- a/src/main/java/storage/external_interfaces/Loadable.java +++ /dev/null @@ -1,16 +0,0 @@ -package storage.external_interfaces; - -import storage.storage_values.StorageValue; - -/** - * An interface denoting the state of this object may be loaded from a specified {@code StorageValue} - */ -public interface Loadable { - - /** - * Loads the given state into this object - * @param data The {@code StorageValue} state to be loaded - */ - public void load(StorageValue data); - -} diff --git a/src/main/java/storage/external_interfaces/Storable.java b/src/main/java/storage/external_interfaces/Storable.java deleted file mode 100644 index 189ad0c..0000000 --- a/src/main/java/storage/external_interfaces/Storable.java +++ /dev/null @@ -1,16 +0,0 @@ -package storage.external_interfaces; - -import storage.storage_values.StorageValue; - -/** - * An interface denoting that this object's state can be fetched - */ -public interface Storable { - - /** - * Gets the storage representation of this object - * @return A {@code StoraageValue} representing the storable state of this object - */ - public StorageValue getStorageRepresentation(); - -} diff --git a/src/main/java/storage/file_editors/DefaultUTF8StreamEditor.java b/src/main/java/storage/file_editors/DefaultUTF8StreamEditor.java deleted file mode 100644 index a18371a..0000000 --- a/src/main/java/storage/file_editors/DefaultUTF8StreamEditor.java +++ /dev/null @@ -1,22 +0,0 @@ -package storage.file_editors; - -import java.io.*; -import java.nio.charset.StandardCharsets; - -public class DefaultUTF8StreamEditor implements StreamEditor { - - @Override - public String readFrom(InputStream stream) throws IOException { - try (stream) { - return new String(stream.readAllBytes(), StandardCharsets.UTF_8); - } - } - - @Override - public void addTo(OutputStream stream, String contents) throws IOException { - try (stream) { - stream.write(contents.getBytes(StandardCharsets.UTF_8)); - } - } - -} diff --git a/src/main/java/storage/file_editors/StreamEditor.java b/src/main/java/storage/file_editors/StreamEditor.java deleted file mode 100644 index 454a994..0000000 --- a/src/main/java/storage/file_editors/StreamEditor.java +++ /dev/null @@ -1,3 +0,0 @@ -package storage.file_editors; - -public interface StreamEditor extends StreamReader, StreamWriter {} diff --git a/src/main/java/storage/file_editors/StreamReader.java b/src/main/java/storage/file_editors/StreamReader.java deleted file mode 100644 index f63a314..0000000 --- a/src/main/java/storage/file_editors/StreamReader.java +++ /dev/null @@ -1,7 +0,0 @@ -package storage.file_editors; - -import java.io.*; - -public interface StreamReader { - public abstract T readFrom(InputStream stream) throws IOException; -} diff --git a/src/main/java/storage/file_editors/StreamWriter.java b/src/main/java/storage/file_editors/StreamWriter.java deleted file mode 100644 index 63ff81e..0000000 --- a/src/main/java/storage/file_editors/StreamWriter.java +++ /dev/null @@ -1,7 +0,0 @@ -package storage.file_editors; - -import java.io.*; - -public interface StreamWriter { - public abstract void addTo(OutputStream stream, T contents) throws IOException; -} \ No newline at end of file diff --git a/src/main/java/storage/storage_value_adapters/StorageValueAdapter.java b/src/main/java/storage/storage_value_adapters/StorageValueAdapter.java deleted file mode 100644 index d9e70cf..0000000 --- a/src/main/java/storage/storage_value_adapters/StorageValueAdapter.java +++ /dev/null @@ -1,13 +0,0 @@ -package storage.storage_value_adapters; - -import storage.storage_values.StorageValue; - -/** - * An interface that defines an adapter converting StorageValues to a chosen representation for use within a StorageMethod - */ -public interface StorageValueAdapter { - - public E retreiveValue(StorageValue storageValue); - public StorageValue packageValue(E value); - -} diff --git a/src/main/java/storage/storage_value_adapters/UnsupportedValueException.java b/src/main/java/storage/storage_value_adapters/UnsupportedValueException.java deleted file mode 100644 index a0fe439..0000000 --- a/src/main/java/storage/storage_value_adapters/UnsupportedValueException.java +++ /dev/null @@ -1,18 +0,0 @@ -package storage.storage_value_adapters; - -import storage.storage_values.StorageValue; - -public class UnsupportedValueException extends RuntimeException { - - public UnsupportedValueException(StorageValue value) { - super(value.getClass().toString() + " is not supported by this formatter."); - } - - public UnsupportedValueException() { - super( - "The input could not be parsed by this formatter.\n" + - "If the data was intended for this formatter, the data may be malformed." + - "Otherwise, Try a different formatter or develop a custom formatter for this data." - ); - } -} \ No newline at end of file diff --git a/src/main/java/storage/storage_values/IntegerStorageValue.java b/src/main/java/storage/storage_values/IntegerStorageValue.java deleted file mode 100644 index 2cc2738..0000000 --- a/src/main/java/storage/storage_values/IntegerStorageValue.java +++ /dev/null @@ -1,13 +0,0 @@ -package storage.storage_values; - -public class IntegerStorageValue extends StorageValue { - - public IntegerStorageValue(Integer integer) { - super(integer); - } - - @Override - public String toString() { - return "IntegerStorageValue(" + this.value + ")"; - } -} diff --git a/src/main/java/storage/storage_values/ListStorageValue.java b/src/main/java/storage/storage_values/ListStorageValue.java deleted file mode 100644 index 555ea7e..0000000 --- a/src/main/java/storage/storage_values/ListStorageValue.java +++ /dev/null @@ -1,27 +0,0 @@ -package storage.storage_values; - -import java.util.*; - -public class ListStorageValue extends StorageValue>> { - - public ListStorageValue(List> list) { - super(list); - } - - public ListStorageValue(StorageValue ...list) { - super(List.of(list)); - } - - @Override - public String toString() { - String msg = "ListStorageValue(["; - - for (StorageValue entry : this.value) { - msg += entry.toString() + ", "; - } - - msg.substring(0, msg.length() - 3); // Remove ending ", " - - return msg + "])"; - } -} diff --git a/src/main/java/storage/storage_values/MapStorageValue.java b/src/main/java/storage/storage_values/MapStorageValue.java deleted file mode 100644 index 456cb7f..0000000 --- a/src/main/java/storage/storage_values/MapStorageValue.java +++ /dev/null @@ -1,27 +0,0 @@ -package storage.storage_values; - -import java.util.Map; -import java.util.Map.Entry; - -public class MapStorageValue extends StorageValue>> { - - public MapStorageValue(Map> map) { - super(map); - } - - @Override - public String toString() { - String msg = "MapStorageValue({"; - - for (Entry> entries : this.value.entrySet()) { - msg += entries.getKey(); - msg += ":"; - msg += entries.getValue().toString() + ", "; - } - - msg.substring(0, msg.length() - 3); // Remove ending ", " - - return msg + "})"; - } - -} \ No newline at end of file diff --git a/src/main/java/storage/storage_values/NullStorageValue.java b/src/main/java/storage/storage_values/NullStorageValue.java deleted file mode 100644 index 923b415..0000000 --- a/src/main/java/storage/storage_values/NullStorageValue.java +++ /dev/null @@ -1,14 +0,0 @@ -package storage.storage_values; - -public class NullStorageValue extends StorageValue { - - public NullStorageValue() { - super(null); - } - - @Override - public String toString() { - return "NullStorageValue()"; - } - -} diff --git a/src/main/java/storage/storage_values/StorageValue.java b/src/main/java/storage/storage_values/StorageValue.java deleted file mode 100644 index 24865f0..0000000 --- a/src/main/java/storage/storage_values/StorageValue.java +++ /dev/null @@ -1,27 +0,0 @@ -package storage.storage_values; - -public abstract class StorageValue { - protected T value; - - public StorageValue(T value) { - this.value = value; - } - - public T getValue() { - return value; - } - - @Override - public abstract String toString(); - - @Override - public boolean equals(Object obj) { - if (this == obj) return true; - if (obj == null) return false; - if (getClass() != obj.getClass()) return false; - - StorageValue other = (StorageValue) obj; - if (value == null) return other.value == null; - return value.equals(other.value); - } -} diff --git a/src/main/java/storage/storage_values/StringStorageValue.java b/src/main/java/storage/storage_values/StringStorageValue.java deleted file mode 100644 index 9dd5634..0000000 --- a/src/main/java/storage/storage_values/StringStorageValue.java +++ /dev/null @@ -1,14 +0,0 @@ -package storage.storage_values; - -public class StringStorageValue extends StorageValue { - - public StringStorageValue(String string) { - super(string); - } - - @Override - public String toString() { - return "StringStorageValue(" + this.value + ")"; - } - -} diff --git a/src/main/java/storage/value_formatters/ValueFormatter.java b/src/main/java/storage/value_formatters/ValueFormatter.java deleted file mode 100644 index 575b5cb..0000000 --- a/src/main/java/storage/value_formatters/ValueFormatter.java +++ /dev/null @@ -1,27 +0,0 @@ -package storage.value_formatters; - -import storage.storage_value_adapters.UnsupportedValueException; -import storage.storage_values.StorageValue; - -/** - * An interface denoting the ability of this object to format and parse {@code StorageValues} into objects for storage - * @param The target object format - */ -public interface ValueFormatter { - - /** - * Formats the provided {@code StorageValue} - * @param value The provided {@code StorageValue} - * @return The formatted {@code StorageValue} - * @throws UnsupportedValueException The {@code StorageValue} provided was not supported by this formatter - */ - public F format(StorageValue value) throws UnsupportedValueException; - - /** - * Parses a given value into a {@code StorageValue} representation - * @param formattedData An object containing data to be parsed - * @return The object parsed into a {@code StorageValue} - * @throws UnsupportedValueException The object provided was not supported by this formatter - */ - public StorageValue parse(F formattedData) throws UnsupportedValueException; -} diff --git a/src/main/java/storage/value_formatters/ValueToStringFormatter.java b/src/main/java/storage/value_formatters/ValueToStringFormatter.java deleted file mode 100644 index 0102e75..0000000 --- a/src/main/java/storage/value_formatters/ValueToStringFormatter.java +++ /dev/null @@ -1,161 +0,0 @@ -package storage.value_formatters; - -import java.util.*; -import java.util.Map.Entry; - -import storage.storage_value_adapters.UnsupportedValueException; -import storage.storage_values.*; - -/** - * A simple ValueFormatter - * Parses and produces strings in the form { "entry1":value1, ..., "entryN":value } - */ -public class ValueToStringFormatter implements ValueFormatter { - - protected static final String INDENT = " "; - protected static final String ANY_WHITESPACE = "[\n\t ]*"; - - @Override - public String format(StorageValue value) throws UnsupportedValueException { - if (value instanceof NullStorageValue) return "null"; - if (value instanceof ListStorageValue) return formatValue((ListStorageValue)value); - if (value instanceof MapStorageValue) return formatValue((MapStorageValue)value); - if (value instanceof StringStorageValue) return formatValue((StringStorageValue)value); - if (value instanceof IntegerStorageValue) return formatValue((IntegerStorageValue)value); - - //TODO: Add more value types and ensure types are differentiable from their stored formats - throw new UnsupportedValueException(value); - } - - /** - * Produces a StorageValue representation of the provided data. - * Note: Errors will not be thrown for incorrect values, ensure the input data is correctly formed. - * @param formattedData The formatted data to be parsed. - * @return The StorageValue representation of the input data. - */ - @Override - public StorageValue parse(String formattedData) throws UnsupportedValueException { - if (formattedData.startsWith("null")) return new NullStorageValue(); - if (formattedData.startsWith("[")) return parseListFormat(formattedData); - if (formattedData.startsWith("{")) return parseMapFormat(formattedData); - if (formattedData.startsWith("\"")) return parseStringFormat(formattedData); - if (formattedData.matches("[0-9]+.*")) return parseIntegerFormat(formattedData); - - //TODO: Add more value types - throw new UnsupportedValueException(); - } - - - private String formatValue(StringStorageValue value) { - return "\"" + - value.getValue().replace("\"", "\\\"").replace("\\", "\\\\") + - "\""; - } - - private StringStorageValue parseStringFormat(String formattedData) { - if (!formattedData.endsWith("\"")) throw new RuntimeException("The string " + formattedData + " must end with \""); - - formattedData = formattedData.substring(1, formattedData.length() - 1); - formattedData = formattedData.replace("\\\\", "\\"); - - return new StringStorageValue(formattedData); - } - - private String formatValue(IntegerStorageValue value) { - return String.valueOf(value.getValue()); - } - - private IntegerStorageValue parseIntegerFormat(String formattedData) { - return new IntegerStorageValue(Integer.parseInt(formattedData)); - } - - private String formatValue(ListStorageValue value) { - String out = ""; - List> entries = value.getValue(); - - if (entries.isEmpty()) return "[]"; - - for (StorageValue entry : entries) { - out += format(entry) + ",\n"; - } - - out = out.substring(0, out.length() - 2); //Remove trailing ",\n" - - return "[\n" + indent(out) + "\n]"; - } - - private ListStorageValue parseListFormat(String formattedData) { - formattedData = formattedData.substring(1, formattedData.length() - 1).trim(); - List> list = new ArrayList<>(); - int i = 0; - - while (i < formattedData.length()) { - int endOfValue = findNextElementBoundary(formattedData, i); - list.add(parse(formattedData.substring(i, endOfValue).trim())); - i = endOfValue + 1; // Skip the comma - } - - return new ListStorageValue(list); - } - - private String formatValue(MapStorageValue value) { - String out = ""; - Set>> mapEntries = value.getValue().entrySet(); - - if (mapEntries.isEmpty()) return "{}"; - - for (Entry> entry : mapEntries) { - out += "\"" + entry.getKey() + "\":" + format(entry.getValue()) + ",\n"; - } - - out = out.substring(0, out.length() - 2); //Remove trailing ",\n" - - return "{\n" + indent(out) + "\n}"; - } - - private MapStorageValue parseMapFormat(String formattedData) { - if (!formattedData.endsWith("}")) throw new RuntimeException("The map " + formattedData + " must end with }"); - if (formattedData.matches("\\{" + ANY_WHITESPACE + "\\}")) return new MapStorageValue(Map.of()); - - formattedData = formattedData.substring(1, formattedData.length() - 1).trim(); - Map> map = new HashMap<>(); - int i = 0; - - while (i < formattedData.length()) { - int colonIndex = formattedData.indexOf(':', i); - String key = formattedData.substring(i, colonIndex).trim().replace("\"", ""); - - int startOfValue = colonIndex + 1; - int endOfValue = findNextElementBoundary(formattedData, startOfValue); - - map.put(key, parse(formattedData.substring(startOfValue, endOfValue).trim())); - i = endOfValue + 1; // Skip the comma - } - - return new MapStorageValue(map); - } - - private int findNextElementBoundary(String formattedData, int start) { - int depth = 0; - boolean inQuotes = false; - - for (int i = start; i < formattedData.length(); i++) { - char c = formattedData.charAt(i); - - if (c == '"' && (i == 0 || formattedData.charAt(i - 1) != '\\')) inQuotes = !inQuotes; - if (inQuotes) continue; - - if (c == '{' || c == '[') depth++; - else if (c == '}' || c == ']') depth--; - else if (c == ',' && depth == 0) return i; - } - - return formattedData.length(); - } - - private String indent(String string) { - return INDENT + string.replace("\n", "\n" + INDENT); - } - - protected record ValueFormat(String startDelimiter, String internalRegex, String endDelimiter) {} -} diff --git a/src/main/java/syntax_analysis/parsing/parsers/CLR1Parser.java b/src/main/java/syntax_analysis/CLR1Parser.java similarity index 99% rename from src/main/java/syntax_analysis/parsing/parsers/CLR1Parser.java rename to src/main/java/syntax_analysis/CLR1Parser.java index 571cfa5..a77454a 100644 --- a/src/main/java/syntax_analysis/parsing/parsers/CLR1Parser.java +++ b/src/main/java/syntax_analysis/CLR1Parser.java @@ -1,4 +1,4 @@ -package syntax_analysis.parsing.parsers; +package syntax_analysis; import java.util.*; diff --git a/src/main/java/syntax_analysis/parsing/parsers/LR0Parser.java b/src/main/java/syntax_analysis/LR0Parser.java similarity index 99% rename from src/main/java/syntax_analysis/parsing/parsers/LR0Parser.java rename to src/main/java/syntax_analysis/LR0Parser.java index ecac4d1..c733c66 100644 --- a/src/main/java/syntax_analysis/parsing/parsers/LR0Parser.java +++ b/src/main/java/syntax_analysis/LR0Parser.java @@ -1,4 +1,4 @@ -package syntax_analysis.parsing.parsers; +package syntax_analysis; import java.util.*; @@ -6,7 +6,7 @@ import syntax_analysis.grammar_structure_creation.*; import syntax_analysis.parsing.*; -public class LR0Parser extends Parser { +public class LR0Parser extends SyntaxAnalyser { protected Map> productionMap; protected Set states; diff --git a/src/main/java/syntax_analysis/parsing/parsers/SLR1Parser.java b/src/main/java/syntax_analysis/SLR1Parser.java similarity index 99% rename from src/main/java/syntax_analysis/parsing/parsers/SLR1Parser.java rename to src/main/java/syntax_analysis/SLR1Parser.java index 91f92f1..cdc1cac 100644 --- a/src/main/java/syntax_analysis/parsing/parsers/SLR1Parser.java +++ b/src/main/java/syntax_analysis/SLR1Parser.java @@ -1,4 +1,4 @@ -package syntax_analysis.parsing.parsers; +package syntax_analysis; import java.util.*; diff --git a/src/main/java/syntax_analysis/SyntaxAnalyser.java b/src/main/java/syntax_analysis/SyntaxAnalyser.java index 406603f..6903cb5 100644 --- a/src/main/java/syntax_analysis/SyntaxAnalyser.java +++ b/src/main/java/syntax_analysis/SyntaxAnalyser.java @@ -1,10 +1,47 @@ package syntax_analysis; +import java.util.*; + import grammar_objects.*; +import helper_objects.LexElementFinder; import syntax_analysis.parsing.*; -public interface SyntaxAnalyser { +public abstract class SyntaxAnalyser { + + protected final Set tokens; + protected final Set nonTerminals; + protected final NonTerminal sentinel; + protected final Set productionRules; - public abstract ParseState analyse(Token[] inputTokens) throws ParseFailedException; + protected Map> productionsForNonTerminal; + + public SyntaxAnalyser(Set tokens, Set nonTerminals, Set productionRules, NonTerminal sentinel) { + this.tokens = tokens; + this.nonTerminals = nonTerminals; + this.productionRules = productionRules; + this.sentinel = sentinel; + } + + public SyntaxAnalyser(Token[] tokens, NonTerminal[] nonTerminals, ProductionRule[] productionRules, NonTerminal sentinel) { + this.tokens = Set.of(tokens); + this.nonTerminals = Set.of(nonTerminals); + this.productionRules = Set.of(productionRules); + this.sentinel = sentinel; + } + + public SyntaxAnalyser(Set productionRules, NonTerminal sentinel) { + this.tokens = LexElementFinder.tokens(productionRules); + this.nonTerminals = LexElementFinder.nonTerminals(productionRules); + this.productionRules = productionRules; + this.sentinel = sentinel; + } + public SyntaxAnalyser(ProductionRule[] productionRules, NonTerminal sentinel) { + this.tokens = LexElementFinder.tokens(productionRules); + this.nonTerminals = LexElementFinder.nonTerminals(productionRules); + this.productionRules = Set.of(productionRules); + this.sentinel = sentinel; + } + + public abstract ParseState analyse(Token[] inputTokens) throws ParseFailedException; } \ No newline at end of file diff --git a/src/main/java/syntax_analysis/parsing/parsers/Parser.java b/src/main/java/syntax_analysis/parsing/parsers/Parser.java deleted file mode 100644 index a546c5e..0000000 --- a/src/main/java/syntax_analysis/parsing/parsers/Parser.java +++ /dev/null @@ -1,48 +0,0 @@ -package syntax_analysis.parsing.parsers; - -import java.util.*; - -import grammar_objects.*; -import helper_objects.LexElementFinder; -import syntax_analysis.SyntaxAnalyser; -import syntax_analysis.parsing.*; - -public abstract class Parser implements SyntaxAnalyser { - - protected final Set tokens; - protected final Set nonTerminals; - protected final NonTerminal sentinel; - protected final Set productionRules; - - protected Map> productionsForNonTerminal; - - public Parser(Set tokens, Set nonTerminals, Set productionRules, NonTerminal sentinel) { - this.tokens = tokens; - this.nonTerminals = nonTerminals; - this.productionRules = productionRules; - this.sentinel = sentinel; - } - - public Parser(Token[] tokens, NonTerminal[] nonTerminals, ProductionRule[] productionRules, NonTerminal sentinel) { - this.tokens = Set.of(tokens); - this.nonTerminals = Set.of(nonTerminals); - this.productionRules = Set.of(productionRules); - this.sentinel = sentinel; - } - - public Parser(Set productionRules, NonTerminal sentinel) { - this.tokens = LexElementFinder.tokens(productionRules); - this.nonTerminals = LexElementFinder.nonTerminals(productionRules); - this.productionRules = productionRules; - this.sentinel = sentinel; - } - - public Parser(ProductionRule[] productionRules, NonTerminal sentinel) { - this.tokens = LexElementFinder.tokens(productionRules); - this.nonTerminals = LexElementFinder.nonTerminals(productionRules); - this.productionRules = Set.of(productionRules); - this.sentinel = sentinel; - } - - public abstract ParseState analyse(Token[] inputTokens) throws ParseFailedException; -} \ No newline at end of file diff --git a/src/test/java/code_generation/BasicCodeGeneratorTests.java b/src/test/java/code_generation/BasicCodeGeneratorTests.java index 1722b28..f487b47 100644 --- a/src/test/java/code_generation/BasicCodeGeneratorTests.java +++ b/src/test/java/code_generation/BasicCodeGeneratorTests.java @@ -1,5 +1,4 @@ package code_generation; - import static org.junit.jupiter.api.Assertions.*; import org.junit.jupiter.api.Test; @@ -8,7 +7,8 @@ import grammar_objects.RuleConvertor; import syntax_analysis.parsing.ParseState; import test_aids.*; -import test_aids.test_grammars.*; +import test_aids.test_grammars.BasicIdentifierTestGrammar; +import test_aids.test_grammars.SmallTestGrammar; public class BasicCodeGeneratorTests { diff --git a/src/test/java/component_construction/CompilerTests.java b/src/test/java/component_construction/CompilerTests.java index 14f3f1f..8f3f7c7 100644 --- a/src/test/java/component_construction/CompilerTests.java +++ b/src/test/java/component_construction/CompilerTests.java @@ -1,9 +1,9 @@ package component_construction; - import static org.junit.jupiter.api.Assertions.*; + import org.junit.jupiter.api.Test; -import component_construction.builders.CustomCompilerBuilder; +import component_construction.builders.CompilerBuilder; import component_construction.factories.code_generation.BasicCodeGenFactory; import component_construction.factories.lexical_analysis.GeneralLexicalAnalyserFactory; import component_construction.factories.syntax_analysis.CLR1ParserFactory; @@ -18,7 +18,7 @@ public class CompilerTests { @Test public void basicIdentifierCompiler() throws ParseFailedException { - CustomCompilerBuilder builder = new CustomCompilerBuilder(); + CompilerBuilder builder = new CompilerBuilder(); builder.setComponents( new GeneralLexicalAnalyserFactory(), diff --git a/src/test/java/component_construction/builders/CompilerBuilderTests.java b/src/test/java/component_construction/builders/CompilerBuilderTests.java index bae9028..f5c0bb7 100644 --- a/src/test/java/component_construction/builders/CompilerBuilderTests.java +++ b/src/test/java/component_construction/builders/CompilerBuilderTests.java @@ -1,6 +1,6 @@ package component_construction.builders; - import static org.junit.jupiter.api.Assertions.*; + import org.junit.jupiter.api.Test; import component_construction.ParameterError; @@ -15,7 +15,7 @@ public class CompilerBuilderTests { @Test public void basicCompilerBuilder() { - CustomCompilerBuilder builder = new CustomCompilerBuilder(); + CompilerBuilder builder = new CompilerBuilder(); builder.setComponents( new GeneralLexicalAnalyserFactory(), new CLR1ParserFactory(), @@ -32,16 +32,16 @@ public void basicCompilerBuilder() { ); - assertDoesNotThrow(() -> builder.createCompiler()); + builder.createCompiler(); } @Test public void nullComponentInputs() { - CustomCompilerBuilder builder1 = new CustomCompilerBuilder(); - CustomCompilerBuilder builder2 = new CustomCompilerBuilder(); - CustomCompilerBuilder builder3 = new CustomCompilerBuilder(); - CustomCompilerBuilder builder4 = new CustomCompilerBuilder(); - CustomCompilerBuilder builder5 = new CustomCompilerBuilder(); + CompilerBuilder builder1 = new CompilerBuilder(); + CompilerBuilder builder2 = new CompilerBuilder(); + CompilerBuilder builder3 = new CompilerBuilder(); + CompilerBuilder builder4 = new CompilerBuilder(); + CompilerBuilder builder5 = new CompilerBuilder(); builder1.setComponents( null, @@ -124,7 +124,7 @@ public void nullComponentInputs() { @Test public void nullLexicalInputs() { - CustomCompilerBuilder builder = new CustomCompilerBuilder(); + CompilerBuilder builder = new CompilerBuilder(); builder.setComponents( new GeneralLexicalAnalyserFactory(), new CLR1ParserFactory(), @@ -138,6 +138,6 @@ public void nullLexicalInputs() { ); - assertDoesNotThrow(() -> builder.createCompiler()); + builder.createCompiler(); } } diff --git a/src/test/java/component_construction/storable/CompilerStorageTests.java b/src/test/java/component_construction/storable/CompilerStorageTests.java deleted file mode 100644 index 7b58a0d..0000000 --- a/src/test/java/component_construction/storable/CompilerStorageTests.java +++ /dev/null @@ -1,1061 +0,0 @@ -package component_construction.storable; - -import static org.junit.jupiter.api.Assertions.*; -import java.io.*; -import java.nio.file.*; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.ExtendWith; - -import storage.exceptions.*; -import storage.value_formatters.*; -import test_aids.exceptions.ExampleException; -import test_aids.storage_entities.custom_components.*; -import test_aids.storage_entities.custom_components.loadable.LoadableTestStorableCustomCompiler; -import test_aids.test_extensions.test_files.*; -import test_aids.test_storage.*; - -@ExtendWith(UseTestFileExtension.class) -public class CompilerStorageTests { - - @Test - public void setTargetPath() { - Path expectedPath = Path.of("./testPath"); - CompilerStorage storage = new CompilerStorage(); - - - storage.setTargetPath(expectedPath); - Path actualPath = storage.getTargetFilepath(); - - - assertEquals(expectedPath, actualPath); - } - - @Test - public void setAbsoluteTargetPath() { - Path expectedPath = Path.of("testPath"); - CompilerStorage storage = new CompilerStorage(); - - - storage.setAbsoluteTargetPath(expectedPath.toString()); - Path actualPath = storage.getTargetFilepath(); - - - assertEquals(expectedPath, actualPath); - } - - @Test - public void setRelativeTargetPath() { - String fileName = "testPath.txt"; - CompilerStorage storage = new CompilerStorage(); - - - storage.setRelativeTargetPath(fileName); - Path actualPath = storage.getTargetFilepath(); - - - Path expectedPath = Path.of("./" + fileName); - assertEquals(expectedPath, actualPath); - } - - @Test - @UseTestFile - public void storeNull(Path testFile) throws IOException { - StorableCustomCompiler compiler = null; - CompilerStorage storage = new CompilerStorage() - .setTargetPath(testFile) - .setFileEditor(new TestStringStreamEditor()) - .setFormatter(new TestStringValueFormatter()); - - - assertThrows(NullStorageObjectException.class, () -> storage.store(compiler)); - } - - @Test - @UseTestFile - public void store(Path testFile) throws IOException { - StorableCustomCompiler compiler = new TestStorableCustomCompiler(); - ValueFormatter formatter = new TestStringValueFormatter(); - String expectedString = formatter.format(compiler.getStorageRepresentation()); - CompilerStorage storage = new CompilerStorage() - .setTargetPath(testFile) - .setFileEditor(new TestStringStreamEditor()) - .setFormatter(formatter); - - - storage.store(compiler); - String actualString = Files.readString(testFile); - - - assertEquals(expectedString, actualString); - } - - @Test - @UseTestFile - public void store_IncorrectFormatter(Path testFile) throws IOException { - StorableCustomCompiler compiler = new TestStorableCustomCompiler(); - CompilerStorage storage = new CompilerStorage() - .setTargetPath(testFile) - .setFileEditor(new TestStringStreamEditor()) - .setFormatter(new TestIntegerValueFormatter()); - - - assertThrows(StorageFormatMismatchException.class, () -> storage.store(compiler)); - } - - @Test - @UseTestFile - public void store_FileWriteError(Path testFile) throws IOException { - StorableCustomCompiler compiler = new TestStorableCustomCompiler(); - CompilerStorage storage = new CompilerStorage() - .setTargetPath(testFile) - .setFileEditor(new TestStringErrorStreamEditor()) - .setFormatter(new TestStringValueFormatter()); - - - StoreFailureException exception = assertThrows( - StoreFailureException.class, - () -> storage.store(compiler) - ); - assertInstanceOf(ExampleException.class, exception.getCause()); - } - - @Test - @UseTestFile - public void store_FormatterError(Path testFile) throws IOException { - StorableCustomCompiler compiler = new TestStorableCustomCompiler(); - CompilerStorage storage = new CompilerStorage() - .setTargetPath(testFile) - .setFileEditor(new TestStringStreamEditor()) - .setFormatter(new TestStringErrorValueFormatter()); - - - FormattingException exception = assertThrows( - FormattingException.class, - () -> storage.store(compiler) - ); - assertInstanceOf(ExampleException.class, exception.getCause()); - } - - @Test - @UseTestFile - public void load(Path testFile) throws IOException { - StorableCustomCompiler expectedCompiler = new TestStorableCustomCompiler(); - ValueFormatter formatter = new ValueToStringFormatter(); - String testString = formatter.format(expectedCompiler.getStorageRepresentation()); - CompilerStorage storage = new CompilerStorage() - .setTargetPath(testFile) - .setFileEditor(new TestStringStreamEditor()) - .setFormatter(formatter); - - Files.writeString(testFile, testString); - - - StorableCustomCompiler actualCompiler = storage.load(); - - - assertEquals(expectedCompiler, actualCompiler); - } - - @Test - @UseTestFile - public void load_IncorrectFormatter(Path testFile) throws IOException { - CompilerStorage storage = new CompilerStorage() - .setTargetPath(testFile) - .setFileEditor(new TestStringStreamEditor()) - .setFormatter(new TestIntegerValueFormatter()); - - - assertThrows(StorageFormatMismatchException.class, () -> storage.load()); - } - - @Test - @UseTestFile - public void load_FileWriteError(Path testFile) throws IOException { - StorableCustomCompiler expectedCompiler = new TestStorableCustomCompiler(); - String testString = expectedCompiler.getStorageRepresentation().toString(); - CompilerStorage storage = new CompilerStorage() - .setTargetPath(testFile) - .setFileEditor(new TestStringErrorStreamEditor()) - .setFormatter(new TestStringValueFormatter()); - - Files.writeString(testFile, testString); - - - LoadFailureException exception = assertThrows( - LoadFailureException.class, - () -> storage.load() - ); - assertInstanceOf(ExampleException.class, exception.getCause()); - } - - @Test - @UseTestFile - public void load_FormatterError(Path testFile) throws IOException { - StorableCustomCompiler expectedCompiler = new TestStorableCustomCompiler(); - String testString = expectedCompiler.getStorageRepresentation().toString(); - CompilerStorage storage = new CompilerStorage() - .setTargetPath(testFile) - .setFileEditor(new TestStringStreamEditor()) - .setFormatter(new TestStringErrorValueFormatter()); - - Files.writeString(testFile, testString); - - - FormatParseException exception = assertThrows( - FormatParseException.class, - () -> storage.load() - ); - assertInstanceOf(ExampleException.class, exception.getCause()); - } - - @Test - @UseTestFile - void convertAndStoreNull(Path testFile) throws IOException { - StorableCustomCompiler compiler = null; - ValueFormatter formatter = new TestStringValueFormatter(); - CompilerStorage storage = new CompilerStorage() - .setTargetPath(testFile) - .setFileEditor(new TestStringStreamEditor()); - - OutputStream outputStream = new FileOutputStream(testFile.toFile()); - - - assertThrows(NullStorageObjectException.class, () -> { - try (outputStream) { - storage.convertAndStore(compiler, formatter, outputStream); - } - }); - } - - @Test - @UseTestFile - void convertAndStoreString(Path testFile) throws IOException { - StorableCustomCompiler compiler = new TestStorableCustomCompiler(); - ValueFormatter formatter = new TestStringValueFormatter(); - String expectedString = formatter.format(compiler.getStorageRepresentation()); - CompilerStorage storage = new CompilerStorage() - .setTargetPath(testFile) - .setFileEditor(new TestStringStreamEditor()); - - OutputStream outputStream = new FileOutputStream(testFile.toFile()); - - - try (outputStream) { - storage.convertAndStore(compiler, formatter, outputStream); - } - - - String actualString = Files.readString(testFile); - assertEquals(expectedString, actualString); - } - - @Test - @UseTestFile - public void convertAndStoreString_IncorrectFormatter(Path testFile) throws IOException { - StorableCustomCompiler compiler = new TestStorableCustomCompiler(); - ValueFormatter formatter = new TestIntegerValueFormatter(); - CompilerStorage storage = new CompilerStorage() - .setTargetPath(testFile) - .setFileEditor(new TestStringStreamEditor()); - - OutputStream outputStream = new FileOutputStream(testFile.toFile()); - - try (outputStream) { - assertThrows(StorageFormatMismatchException.class, () -> storage.convertAndStore(compiler, formatter, outputStream)); - } - } - - @Test - @UseTestFile - public void convertAndStoreString_FileWriteError(Path testFile) throws IOException { - StorableCustomCompiler compiler = new TestStorableCustomCompiler(); - ValueFormatter formatter = new TestStringValueFormatter(); - CompilerStorage storage = new CompilerStorage() - .setTargetPath(testFile) - .setFileEditor(new TestStringErrorStreamEditor()); - - OutputStream outputStream = new FileOutputStream(testFile.toFile()); - - try (outputStream) { - StoreFailureException exception = assertThrows( - StoreFailureException.class, - () -> storage.convertAndStore(compiler, formatter, outputStream) - ); - assertInstanceOf(ExampleException.class, exception.getCause()); - } - } - - @Test - @UseTestFile - public void convertAndStoreString_FormatterError(Path testFile) throws IOException { - StorableCustomCompiler compiler = new TestStorableCustomCompiler(); - ValueFormatter formatter = new TestStringErrorValueFormatter(); - CompilerStorage storage = new CompilerStorage() - .setTargetPath(testFile) - .setFileEditor(new TestStringStreamEditor()); - - OutputStream outputStream = new FileOutputStream(testFile.toFile()); - - try (outputStream) { - FormattingException exception = assertThrows( - FormattingException.class, - () -> storage.convertAndStore(compiler, formatter, outputStream) - ); - assertInstanceOf(ExampleException.class, exception.getCause()); - } - } - - @Test - @UseTestFile - void convertAndLoadStringInto(Path testFile) throws IOException { - LoadableTestStorableCustomCompiler expectedCompiler = new LoadableTestStorableCustomCompiler(); - LoadableTestStorableCustomCompiler actualCompiler = new LoadableTestStorableCustomCompiler(); - ValueFormatter formatter = new ValueToStringFormatter(); - String expectedString = formatter.format(expectedCompiler.getStorageRepresentation()); - CompilerStorage storage = new CompilerStorage() - .setTargetPath(testFile) - .setFormatter(formatter) - .setFileEditor(new TestStringStreamEditor()); - - Files.writeString(testFile, expectedString); - - InputStream inputStream = new FileInputStream(testFile.toFile()); - - - try (inputStream) { - storage.convertAndLoadInto(actualCompiler, inputStream); - } - - - assertEquals(expectedCompiler, actualCompiler); - } - - @Test - @UseTestFile - public void convertAndLoadStringInto_IncorrectFormatter(Path testFile) throws IOException { - LoadableTestStorableCustomCompiler actualCompiler = new LoadableTestStorableCustomCompiler(); - CompilerStorage storage = new CompilerStorage() - .setTargetPath(testFile) - .setFormatter(new TestIntegerValueFormatter()) - .setFileEditor(new TestStringStreamEditor()); - - InputStream inputStream = new FileInputStream(testFile.toFile()); - - - try (inputStream) { - assertThrows(StorageFormatMismatchException.class, () -> storage.convertAndLoadInto(actualCompiler, inputStream)); - } - } - - @Test - @UseTestFile - public void convertAndLoadStringInto_FileWriteError(Path testFile) throws IOException { - LoadableTestStorableCustomCompiler expectedCompiler = new LoadableTestStorableCustomCompiler(); - LoadableTestStorableCustomCompiler actualComipler = new LoadableTestStorableCustomCompiler(); - String expectedString = expectedCompiler.getStorageRepresentation().toString(); - CompilerStorage storage = new CompilerStorage() - .setTargetPath(testFile) - .setFormatter(new TestStringValueFormatter()) - .setFileEditor(new TestStringErrorStreamEditor()); - - Files.writeString(testFile, expectedString); - - InputStream inputStream = new FileInputStream(testFile.toFile()); - - - try (inputStream) { - LoadFailureException exception = assertThrows( - LoadFailureException.class, - () -> storage.convertAndLoadInto(actualComipler, inputStream) - ); - assertInstanceOf(ExampleException.class, exception.getCause()); - } - } - - @Test - @UseTestFile - public void convertAndLoadStringInto_FormatterError(Path testFile) throws IOException { - LoadableTestStorableCustomCompiler expectedCompiler = new LoadableTestStorableCustomCompiler(); - LoadableTestStorableCustomCompiler actualCompiler = new LoadableTestStorableCustomCompiler(); - String expectedString = expectedCompiler.getStorageRepresentation().toString(); - CompilerStorage storage = new CompilerStorage() - .setTargetPath(testFile) - .setFormatter(new TestStringErrorValueFormatter()) - .setFileEditor(new TestStringStreamEditor()); - - Files.writeString(testFile, expectedString); - - InputStream inputStream = new FileInputStream(testFile.toFile()); - - - try (inputStream) { - FormatParseException exception = assertThrows( - FormatParseException.class, - () -> storage.convertAndLoadInto(actualCompiler, inputStream) - ); - assertInstanceOf(ExampleException.class, exception.getCause()); - } - } - - @Test - @UseTestFile - void convertThenFormatAndLoadStringInto(Path testFile) throws IOException { - LoadableTestStorableCustomCompiler expectedCompiler = new LoadableTestStorableCustomCompiler(); - LoadableTestStorableCustomCompiler actualCompiler = new LoadableTestStorableCustomCompiler(); - ValueFormatter formatter = new ValueToStringFormatter(); - String expectedString = formatter.format(expectedCompiler.getStorageRepresentation()); - - CompilerStorage storage = new CompilerStorage() - .setTargetPath(testFile) - .setFileEditor(new TestStringStreamEditor()); - - Files.writeString(testFile, expectedString); - - InputStream inputStream = new FileInputStream(testFile.toFile()); - - - try (inputStream) { - storage.convertAndLoadInto(actualCompiler, formatter, inputStream); - } - - assertEquals(expectedCompiler, actualCompiler); - } - - @Test - @UseTestFile - public void convertThenFormatAndLoadStringInto_IncorrectFormatter(Path testFile) throws IOException { - LoadableTestStorableCustomCompiler actualCompiler = new LoadableTestStorableCustomCompiler(); - ValueFormatter formatter = new TestIntegerValueFormatter(); - - CompilerStorage storage = new CompilerStorage() - .setTargetPath(testFile) - .setFileEditor(new TestStringStreamEditor()); - - InputStream inputStream = new FileInputStream(testFile.toFile()); - - - try (inputStream) { - assertThrows(StorageFormatMismatchException.class, () -> storage.convertAndLoadInto(actualCompiler, formatter, inputStream)); - } - } - - @Test - @UseTestFile - public void convertThenFormatAndLoadStringInto_FileWriteError(Path testFile) throws IOException { - LoadableTestStorableCustomCompiler expectedCompiler = new LoadableTestStorableCustomCompiler(); - LoadableTestStorableCustomCompiler actualCompiler = new LoadableTestStorableCustomCompiler(); - String expectedString = expectedCompiler.getStorageRepresentation().toString(); - ValueFormatter formatter = new TestStringValueFormatter(); - - CompilerStorage storage = new CompilerStorage() - .setTargetPath(testFile) - .setFileEditor(new TestStringErrorStreamEditor()); - - Files.writeString(testFile, expectedString); - - InputStream inputStream = new FileInputStream(testFile.toFile()); - - - try (inputStream) { - LoadFailureException exception = assertThrows( - LoadFailureException.class, - () -> storage.convertAndLoadInto(actualCompiler, formatter, inputStream) - ); - assertInstanceOf(ExampleException.class, exception.getCause()); - } - } - - @Test - @UseTestFile - public void convertThenFormatAndLoadStringInto_FormatterError(Path testFile) throws IOException { - LoadableTestStorableCustomCompiler expectedCompiler = new LoadableTestStorableCustomCompiler(); - LoadableTestStorableCustomCompiler actualCompiler = new LoadableTestStorableCustomCompiler(); - String expectedString = expectedCompiler.getStorageRepresentation().toString(); - ValueFormatter formatter = new TestStringErrorValueFormatter(); - - CompilerStorage storage = new CompilerStorage() - .setTargetPath(testFile) - .setFileEditor(new TestStringStreamEditor()); - - Files.writeString(testFile, expectedString); - - InputStream inputStream = new FileInputStream(testFile.toFile()); - - - try (inputStream) { - FormatParseException exception = assertThrows( - FormatParseException.class, - () -> storage.convertAndLoadInto(actualCompiler, formatter, inputStream) - ); - assertInstanceOf(ExampleException.class, exception.getCause()); - } - } - - @Test - @UseTestFile - public void storeNullToStream(Path testFile) throws IOException { - StorableCustomCompiler compiler = null; - CompilerStorage storage = new CompilerStorage() - .setTargetPath(testFile) - .setFileEditor(new TestStringStreamEditor()) - .setFormatter(new TestStringValueFormatter()); - - OutputStream outputStream = new FileOutputStream(testFile.toFile()); - - - assertThrows(NullStorageObjectException.class, () -> { - try (outputStream) { - storage.store(compiler, outputStream); - } - }); - } - - @Test - @UseTestFile - public void storeToStream(Path testFile) throws IOException { - StorableCustomCompiler compiler = new TestStorableCustomCompiler(); - ValueFormatter formatter = new ValueToStringFormatter(); - String expectedString = formatter.format(compiler.getStorageRepresentation()); - CompilerStorage storage = new CompilerStorage() - .setTargetPath(testFile) - .setFileEditor(new TestStringStreamEditor()) - .setFormatter(formatter); - - OutputStream outputStream = new FileOutputStream(testFile.toFile()); - - - try (outputStream) { - storage.store(compiler, outputStream); - } - - - String actualString = Files.readString(testFile); - assertEquals(expectedString, actualString); - } - - @Test - @UseTestFile - public void storeToStream_IncorrectFormatter(Path testFile) throws IOException { - StorableCustomCompiler compiler = new TestStorableCustomCompiler(); - CompilerStorage storage = new CompilerStorage() - .setTargetPath(testFile) - .setFileEditor(new TestStringStreamEditor()) - .setFormatter(new TestIntegerValueFormatter()); - - OutputStream outputStream = new FileOutputStream(testFile.toFile()); - - - try (outputStream) { - assertThrows(StorageFormatMismatchException.class, () -> storage.store(compiler, outputStream)); - } - } - - @Test - @UseTestFile - public void storeToStream_FileWriteError(Path testFile) throws IOException { - StorableCustomCompiler compiler = new TestStorableCustomCompiler(); - CompilerStorage storage = new CompilerStorage() - .setTargetPath(testFile) - .setFileEditor(new TestStringErrorStreamEditor()) - .setFormatter(new TestStringValueFormatter()); - - OutputStream outputStream = new FileOutputStream(testFile.toFile()); - - - try (outputStream) { - StoreFailureException exception = assertThrows( - StoreFailureException.class, - () -> storage.store(compiler, outputStream) - ); - assertInstanceOf(ExampleException.class, exception.getCause()); - } - } - - @Test - @UseTestFile - public void storeToStream_FormatterError(Path testFile) throws IOException { - StorableCustomCompiler compiler = new TestStorableCustomCompiler(); - CompilerStorage storage = new CompilerStorage() - .setTargetPath(testFile) - .setFileEditor(new TestStringStreamEditor()) - .setFormatter(new TestStringErrorValueFormatter()); - - OutputStream outputStream = new FileOutputStream(testFile.toFile()); - - - try (outputStream) { - FormattingException exception = assertThrows( - FormattingException.class, - () -> storage.store(compiler, outputStream) - ); - assertInstanceOf(ExampleException.class, exception.getCause()); - } - } - - @Test - @UseTestFile - public void loadFromInputStream(Path testFile) throws IOException { - StorableCustomCompiler expectedCompiler = new TestStorableCustomCompiler(); - ValueFormatter formatter = new ValueToStringFormatter(); - String expectedString = formatter.format(expectedCompiler.getStorageRepresentation()); - CompilerStorage storage = new CompilerStorage() - .setTargetPath(testFile) - .setFileEditor(new TestStringStreamEditor()) - .setFormatter(formatter); - - Files.writeString(testFile, expectedString); - - InputStream inputStream = new FileInputStream(testFile.toFile()); - - - StorableCustomCompiler actualcompiler = storage.load(inputStream); - - - assertEquals(expectedCompiler, actualcompiler); - } - - @Test - @UseTestFile - public void loadFromInputStream_IncorrectFormatter(Path testFile) throws IOException { - CompilerStorage storage = new CompilerStorage() - .setTargetPath(testFile) - .setFileEditor(new TestStringStreamEditor()) - .setFormatter(new TestIntegerValueFormatter()); - - InputStream inputStream = new FileInputStream(testFile.toFile()); - - - try (inputStream) { - assertThrows(StorageFormatMismatchException.class, () -> storage.load(inputStream)); - } - } - - @Test - @UseTestFile - public void loadFromInputStream_FileWriteError(Path testFile) throws IOException { - StorableCustomCompiler expectedCompiler = new TestStorableCustomCompiler(); - String testString = expectedCompiler.getStorageRepresentation().toString(); - CompilerStorage storage = new CompilerStorage() - .setTargetPath(testFile) - .setFileEditor(new TestStringErrorStreamEditor()) - .setFormatter(new TestStringValueFormatter()); - - Files.writeString(testFile, testString); - - InputStream inputStream = new FileInputStream(testFile.toFile()); - - - try (inputStream) { - LoadFailureException exception = assertThrows( - LoadFailureException.class, - () -> storage.load(inputStream) - ); - assertInstanceOf(ExampleException.class, exception.getCause()); - } - } - - @Test - @UseTestFile - public void loadFromInputStream_FormatterError(Path testFile) throws IOException { - StorableCustomCompiler expectedCompiler = new TestStorableCustomCompiler(); - String testString = expectedCompiler.getStorageRepresentation().toString(); - CompilerStorage storage = new CompilerStorage() - .setTargetPath(testFile) - .setFileEditor(new TestStringStreamEditor()) - .setFormatter(new TestStringErrorValueFormatter()); - - Files.writeString(testFile, testString); - - InputStream inputStream = new FileInputStream(testFile.toFile()); - - - try (inputStream) { - FormatParseException exception = assertThrows( - FormatParseException.class, - () -> storage.load(inputStream) - ); - assertInstanceOf(ExampleException.class, exception.getCause()); - } - } - - @Test - @UseTestFile - public void storeStorableOfNull(Path testFile) throws IOException { - StorableCustomCompiler compiler = null; - CompilerStorage storage = new CompilerStorage() - .setTargetPath(testFile) - .setFileEditor(new TestStringStreamEditor()) - .setFormatter(new TestStringValueFormatter()); - - - assertThrows(NullStorageObjectException.class, () -> storage.store(compiler)); - } - - @Test - @UseTestFile - public void storeStorableOfString(Path testFile) throws IOException { - StorableCustomCompiler compiler = new TestStorableCustomCompiler(); - ValueFormatter formatter = new ValueToStringFormatter(); - String expectedString = formatter.format(compiler.getStorageRepresentation()); - CompilerStorage storage = new CompilerStorage() - .setTargetPath(testFile) - .setFileEditor(new TestStringStreamEditor()) - .setFormatter(formatter); - - - storage.store(compiler); - String actualString = Files.readString(testFile); - - - assertEquals(expectedString, actualString); - } - - @Test - @UseTestFile - public void storeStorableOfString_IncorrectFormatter(Path testFile) throws IOException { - StorableCustomCompiler compiler = new TestStorableCustomCompiler(); - CompilerStorage storage = new CompilerStorage() - .setTargetPath(testFile) - .setFileEditor(new TestStringStreamEditor()) - .setFormatter(new TestIntegerValueFormatter()); - - - assertThrows(StorageFormatMismatchException.class, () -> storage.store(compiler)); - } - - @Test - @UseTestFile - public void storeStorableOfString_FileWriteError(Path testFile) throws IOException { - StorableCustomCompiler compiler = new TestStorableCustomCompiler(); - CompilerStorage storage = new CompilerStorage() - .setTargetPath(testFile) - .setFileEditor(new TestStringErrorStreamEditor()) - .setFormatter(new TestStringValueFormatter()); - - - StoreFailureException exception = assertThrows( - StoreFailureException.class, - () -> storage.store(compiler) - ); - assertInstanceOf(ExampleException.class, exception.getCause()); - } - - @Test - @UseTestFile - public void storeStorableOfString_FormatterError(Path testFile) throws IOException { - StorableCustomCompiler compiler = new TestStorableCustomCompiler(); - CompilerStorage storage = new CompilerStorage() - .setTargetPath(testFile) - .setFileEditor(new TestStringStreamEditor()) - .setFormatter(new TestStringErrorValueFormatter()); - - - FormattingException exception = assertThrows( - FormattingException.class, - () -> storage.store(compiler) - ); - assertInstanceOf(ExampleException.class, exception.getCause()); - } - - @Test - @UseTestFile - public void storeStorableOfNullAtFilepath(Path testFile) throws IOException { - StorableCustomCompiler compiler = null; - CompilerStorage storage = new CompilerStorage() - .setFileEditor(new TestStringStreamEditor()) - .setFormatter(new TestStringValueFormatter()); - - - assertThrows(NullStorageObjectException.class, () -> storage.store(compiler, testFile.toString())); - } - - @Test - @UseTestFile - public void storeStorableOfStringAtFilepath(Path testFile) throws IOException { - StorableCustomCompiler compiler = new TestStorableCustomCompiler(); - ValueFormatter formatter = new ValueToStringFormatter(); - String expectedString = formatter.format(compiler.getStorageRepresentation()); - CompilerStorage storage = new CompilerStorage() - .setFileEditor(new TestStringStreamEditor()) - .setFormatter(formatter); - - - storage.store(compiler, testFile.toString()); - String actualString = Files.readString(testFile); - - - assertEquals(expectedString, actualString); - } - - @Test - @UseTestFile - public void storeStorableOfStringAtFilepath_IncorrectFormatter(Path testFile) throws IOException { - StorableCustomCompiler compiler = new TestStorableCustomCompiler(); - CompilerStorage storage = new CompilerStorage() - .setFileEditor(new TestStringStreamEditor()) - .setFormatter(new TestIntegerValueFormatter()); - - - assertThrows(StorageFormatMismatchException.class, () -> storage.store(compiler, testFile.toString())); - } - - @Test - @UseTestFile - public void storeStorableOfStringAtFilepath_FileWriteError(Path testFile) throws IOException { - StorableCustomCompiler compiler = new TestStorableCustomCompiler(); - CompilerStorage storage = new CompilerStorage() - .setFileEditor(new TestStringErrorStreamEditor()) - .setFormatter(new TestStringValueFormatter()); - - - StoreFailureException exception = assertThrows( - StoreFailureException.class, - () -> storage.store(compiler, testFile.toString()) - ); - assertInstanceOf(ExampleException.class, exception.getCause()); - } - - @Test - @UseTestFile - public void storeStorableOfStringAtFilepath_FormatterError(Path testFile) throws IOException { - StorableCustomCompiler compiler = new TestStorableCustomCompiler(); - CompilerStorage storage = new CompilerStorage() - .setFileEditor(new TestStringStreamEditor()) - .setFormatter(new TestStringErrorValueFormatter()); - - - FormattingException exception = assertThrows( - FormattingException.class, - () -> storage.store(compiler, testFile.toString()) - ); - assertInstanceOf(ExampleException.class, exception.getCause()); - } - - @Test - @UseTestFile - public void storecompilerOfNull(Path testFile) throws IOException { - StorableCustomCompiler compiler = null; - CompilerStorage storage = new CompilerStorage() - .setTargetPath(testFile) - .setFileEditor(new TestStringStreamEditor()) - .setFormatter(new TestStringValueFormatter()); - - - assertThrows(NullStorageObjectException.class, () -> storage.store(compiler)); - } - - @Test - @UseTestFile - public void storecompilerOfString(Path testFile) throws IOException { - StorableCustomCompiler compiler = new TestStorableCustomCompiler(); - ValueFormatter formatter = new ValueToStringFormatter(); - String expectedString = formatter.format(compiler.getStorageRepresentation()); - CompilerStorage storage = new CompilerStorage() - .setTargetPath(testFile) - .setFileEditor(new TestStringStreamEditor()) - .setFormatter(formatter); - - - storage.store(compiler); - String actualString = Files.readString(testFile); - - - assertEquals(expectedString, actualString); - } - - @Test - @UseTestFile - public void storecompilerOfString_IncorrectFormatter(Path testFile) throws IOException { - StorableCustomCompiler compiler = new TestStorableCustomCompiler(); - CompilerStorage storage = new CompilerStorage() - .setTargetPath(testFile) - .setFileEditor(new TestStringStreamEditor()) - .setFormatter(new TestIntegerValueFormatter()); - - - assertThrows(StorageFormatMismatchException.class, () -> storage.store(compiler)); - } - - @Test - @UseTestFile - public void storecompilerOfString_FileWriteError(Path testFile) throws IOException { - StorableCustomCompiler compiler = new TestStorableCustomCompiler(); - CompilerStorage storage = new CompilerStorage() - .setTargetPath(testFile) - .setFileEditor(new TestStringErrorStreamEditor()) - .setFormatter(new TestStringValueFormatter()); - - - StoreFailureException exception = assertThrows( - StoreFailureException.class, - () -> storage.store(compiler) - ); - assertInstanceOf(ExampleException.class, exception.getCause()); - } - - @Test - @UseTestFile - public void storecompilerOfString_FormatterError(Path testFile) throws IOException { - StorableCustomCompiler compiler = new TestStorableCustomCompiler(); - CompilerStorage storage = new CompilerStorage() - .setTargetPath(testFile) - .setFileEditor(new TestStringStreamEditor()) - .setFormatter(new TestStringErrorValueFormatter()); - - - FormattingException exception = assertThrows( - FormattingException.class, - () -> storage.store(compiler) - ); - assertInstanceOf(ExampleException.class, exception.getCause()); - } - - @Test - @UseTestFile - void LoadStringInto(Path testFile) throws IOException { - LoadableTestStorableCustomCompiler expectedCompiler = new LoadableTestStorableCustomCompiler(); - LoadableTestStorableCustomCompiler actualCompiler = new LoadableTestStorableCustomCompiler(); - ValueFormatter formatter = new ValueToStringFormatter(); - String expectedString = formatter.format(expectedCompiler.getStorageRepresentation()); - CompilerStorage storage = new CompilerStorage() - .setTargetPath(testFile) - .setFormatter(formatter) - .setFileEditor(new TestStringStreamEditor()); - - Files.writeString(testFile, expectedString); - - - storage.loadInto(actualCompiler); - - - assertEquals(expectedCompiler, actualCompiler); - } - - @Test - @UseTestFile - public void LoadStringInto_IncorrectFormatter(Path testFile) throws IOException { - LoadableTestStorableCustomCompiler actualCompiler = new LoadableTestStorableCustomCompiler(); - CompilerStorage storage = new CompilerStorage() - .setTargetPath(testFile) - .setFormatter(new TestStringValueFormatter()) - .setFileEditor(new TestIntegerStreamEditor()); - - - assertThrows(StorageFormatMismatchException.class, () -> storage.loadInto(actualCompiler)); - } - - @Test - @UseTestFile - public void LoadStringInto_FileWriteError(Path testFile) throws IOException { - LoadableTestStorableCustomCompiler expectedCompiler = new LoadableTestStorableCustomCompiler(); - LoadableTestStorableCustomCompiler actualCompiler = new LoadableTestStorableCustomCompiler(); - String expectedString = expectedCompiler.getStorageRepresentation().toString(); - CompilerStorage storage = new CompilerStorage() - .setTargetPath(testFile) - .setFormatter(new TestStringValueFormatter()) - .setFileEditor(new TestStringErrorStreamEditor()); - - Files.writeString(testFile, expectedString); - - - LoadFailureException exception = assertThrows( - LoadFailureException.class, - () -> storage.loadInto(actualCompiler) - ); - assertInstanceOf(ExampleException.class, exception.getCause()); - } - - @Test - @UseTestFile - public void LoadStringInto_FormatterError(Path testFile) throws IOException { - LoadableTestStorableCustomCompiler expectedCompiler = new LoadableTestStorableCustomCompiler(); - LoadableTestStorableCustomCompiler actualCompiler = new LoadableTestStorableCustomCompiler(); - String expectedString = expectedCompiler.getStorageRepresentation().toString(); - CompilerStorage storage = new CompilerStorage() - .setTargetPath(testFile) - .setFormatter(new TestStringErrorValueFormatter()) - .setFileEditor(new TestStringStreamEditor()); - - Files.writeString(testFile, expectedString); - - - FormatParseException exception = assertThrows( - FormatParseException.class, - () -> storage.loadInto(actualCompiler) - ); - assertInstanceOf(ExampleException.class, exception.getCause()); - } - - @Test - @UseTestFile - public void loadFromTargetPath(Path testFile) throws IOException { - StorableCustomCompiler expectedCompiler = new TestStorableCustomCompiler(); - ValueFormatter formatter = new ValueToStringFormatter(); - String expectedString = formatter.format(expectedCompiler.getStorageRepresentation()); - CompilerStorage storage = new CompilerStorage() - .setTargetPath(testFile) - .setFileEditor(new TestStringStreamEditor()) - .setFormatter(formatter); - - Files.writeString(testFile, expectedString); - - - StorableCustomCompiler actualcompiler = storage.load(); - - - assertEquals(expectedCompiler, actualcompiler); - } - - @Test - @UseTestFile - public void loadFromTargetPath_IncorrectFormatter(Path testFile) throws IOException { - CompilerStorage storage = new CompilerStorage() - .setTargetPath(testFile) - .setFileEditor(new TestStringStreamEditor()) - .setFormatter(new TestIntegerValueFormatter()); - - - assertThrows(StorageFormatMismatchException.class, () -> storage.load()); - } - - @Test - @UseTestFile - public void loadFromTargetPath_FileWriteError(Path testFile) throws IOException { - StorableCustomCompiler expectedCompiler = new TestStorableCustomCompiler(); - String testString = expectedCompiler.getStorageRepresentation().toString(); - CompilerStorage storage = new CompilerStorage() - .setTargetPath(testFile) - .setFileEditor(new TestStringErrorStreamEditor()) - .setFormatter(new TestStringValueFormatter()); - - Files.writeString(testFile, testString); - - - LoadFailureException exception = assertThrows( - LoadFailureException.class, - () -> storage.load() - ); - assertInstanceOf(ExampleException.class, exception.getCause()); - } - - @Test - @UseTestFile - public void loadFromTargetPath_FormatterError(Path testFile) throws IOException { - StorableCustomCompiler expectedCompiler = new TestStorableCustomCompiler(); - String testString = expectedCompiler.getStorageRepresentation().toString(); - CompilerStorage storage = new CompilerStorage() - .setTargetPath(testFile) - .setFileEditor(new TestStringStreamEditor()) - .setFormatter(new TestStringErrorValueFormatter()); - - Files.writeString(testFile, testString); - - - FormatParseException exception = assertThrows( - FormatParseException.class, - () -> storage.load() - ); - assertInstanceOf(ExampleException.class, exception.getCause()); - } - -} diff --git a/src/test/java/component_construction/storable/StorableCustomCompilerTests.java b/src/test/java/component_construction/storable/StorableCustomCompilerTests.java deleted file mode 100644 index 12664a6..0000000 --- a/src/test/java/component_construction/storable/StorableCustomCompilerTests.java +++ /dev/null @@ -1,5 +0,0 @@ -package component_construction.storable; - -public class StorableCustomCompilerTests { - // TODO -} diff --git a/src/test/java/component_construction/storable/builders/StorableCustomCompilerBuilderTests.java b/src/test/java/component_construction/storable/builders/StorableCustomCompilerBuilderTests.java deleted file mode 100644 index 90e3e70..0000000 --- a/src/test/java/component_construction/storable/builders/StorableCustomCompilerBuilderTests.java +++ /dev/null @@ -1,217 +0,0 @@ -package component_construction.storable.builders; - -import static org.junit.jupiter.api.Assertions.*; -import org.junit.jupiter.api.Test; - -import component_construction.ParameterError; -import component_construction.storable.exceptions.NonStorableComponentException; -import grammars.basic_identifier.BasicIdentifierGrammar; -import grammars.basic_identifier.convertors.XToYToXSemantic; -import lexical_analysis.DynamicTokenRegex; -import test_aids.storage_entities.custom_components.factories.*; - -public class StorableCustomCompilerBuilderTests { - - @Test - public void getSelf() { - StorableCustomCompilerBuilder builder = new StorableCustomCompilerBuilder(); - - - assertEquals(builder, builder.getThis()); - } - - @Test - public void basicCompilerBuilder() { - StorableCustomCompilerBuilder builder = new StorableCustomCompilerBuilder(); - builder.setComponents( - new TestStorableCustomLexicalAnalyserFactory(), - new TestStorableCustomSyntaxAnalyserFactory(), - new TestStorableCustomCodeGeneratorFactory(), - BasicIdentifierGrammar.produce(), - XToYToXSemantic.produce(), - new String[] {" "}, - new String[] {"+", "=", ";"}, - new String[] {}, - new DynamicTokenRegex[] { - new DynamicTokenRegex("[A-Za-z]+", "identifier"), - new DynamicTokenRegex("[0-9]+(\\.[0-9]+)?", "number") //TODO: Using [0-9]+(\\.[0-9]+)? for all tests would be better - } - ); - - - assertDoesNotThrow(() -> builder.createCompiler()); - } - - @Test - public void nullComponentInputs() { - StorableCustomCompilerBuilder builder1 = new StorableCustomCompilerBuilder(); - StorableCustomCompilerBuilder builder2 = new StorableCustomCompilerBuilder(); - StorableCustomCompilerBuilder builder3 = new StorableCustomCompilerBuilder(); - StorableCustomCompilerBuilder builder4 = new StorableCustomCompilerBuilder(); - StorableCustomCompilerBuilder builder5 = new StorableCustomCompilerBuilder(); - - builder1.setComponents( - null, - new TestStorableCustomSyntaxAnalyserFactory(), - new TestStorableCustomCodeGeneratorFactory(), - BasicIdentifierGrammar.produce(), - XToYToXSemantic.produce(), - new String[] {" "}, - new String[] {"+", "=", ";"}, - new String[] {}, - new DynamicTokenRegex[] { - new DynamicTokenRegex("[A-Za-z]+", "identifier"), - new DynamicTokenRegex("[0-9]+(\\.[0-9]+)?", "number") - } - ); - builder2.setComponents( - new TestStorableCustomLexicalAnalyserFactory(), - null, - new TestStorableCustomCodeGeneratorFactory(), - BasicIdentifierGrammar.produce(), - XToYToXSemantic.produce(), - new String[] {" "}, - new String[] {"+", "=", ";"}, - new String[] {}, - new DynamicTokenRegex[] { - new DynamicTokenRegex("[A-Za-z]+", "identifier"), - new DynamicTokenRegex("[0-9]+(\\.[0-9]+)?", "number") - } - ); - builder3.setComponents( - new TestStorableCustomLexicalAnalyserFactory(), - new TestStorableCustomSyntaxAnalyserFactory(), - null, - BasicIdentifierGrammar.produce(), - XToYToXSemantic.produce(), - new String[] {" "}, - new String[] {"+", "=", ";"}, - new String[] {}, - new DynamicTokenRegex[] { - new DynamicTokenRegex("[A-Za-z]+", "identifier"), - new DynamicTokenRegex("[0-9]+(\\.[0-9]+)?", "number") - } - ); - builder4.setComponents( - new TestStorableCustomLexicalAnalyserFactory(), - new TestStorableCustomSyntaxAnalyserFactory(), - new TestStorableCustomCodeGeneratorFactory(), - null, - XToYToXSemantic.produce(), - new String[] {" "}, - new String[] {"+", "=", ";"}, - new String[] {}, - new DynamicTokenRegex[] { - new DynamicTokenRegex("[A-Za-z]+", "identifier"), - new DynamicTokenRegex("[0-9]+(\\.[0-9]+)?", "number") - } - ); - builder5.setComponents( - new TestStorableCustomLexicalAnalyserFactory(), - new TestStorableCustomSyntaxAnalyserFactory(), - new TestStorableCustomCodeGeneratorFactory(), - BasicIdentifierGrammar.produce(), - null, - new String[] {" "}, - new String[] {"+", "=", ";"}, - new String[] {}, - new DynamicTokenRegex[] { - new DynamicTokenRegex("[A-Za-z]+", "identifier"), - new DynamicTokenRegex("[0-9]+(\\.[0-9]+)?", "number") - } - ); - - - assertThrows(ParameterError.class, () -> builder1.createCompiler()); - assertThrows(ParameterError.class, () -> builder2.createCompiler()); - assertThrows(ParameterError.class, () -> builder3.createCompiler()); - assertThrows(ParameterError.class, () -> builder4.createCompiler()); - assertThrows(ParameterError.class, () -> builder5.createCompiler()); - } - - @Test - public void nullLexicalInputs() { - StorableCustomCompilerBuilder builder = new StorableCustomCompilerBuilder(); - builder.setComponents( - new TestStorableCustomLexicalAnalyserFactory(), - new TestStorableCustomSyntaxAnalyserFactory(), - new TestStorableCustomCodeGeneratorFactory(), - BasicIdentifierGrammar.produce(), - XToYToXSemantic.produce(), - null, - null, - null, - null - ); - - - assertDoesNotThrow(() -> builder.createCompiler()); - } - - @Test - public void setcomponents_nonStorableLexicalAnalyser() { - StorableCustomCompilerBuilder builder = new StorableCustomCompilerBuilder(); - builder.setComponents( - new TestCustomLexicalAnalyserFactory(), - new TestStorableCustomSyntaxAnalyserFactory(), - new TestStorableCustomCodeGeneratorFactory(), - BasicIdentifierGrammar.produce(), - XToYToXSemantic.produce(), - new String[] {" "}, - new String[] {"+", "=", ";"}, - new String[] {}, - new DynamicTokenRegex[] { - new DynamicTokenRegex("[A-Za-z]+", "identifier"), - new DynamicTokenRegex("[0-9]+(\\.[0-9]+)?", "number") - } - ); - - - assertThrows(NonStorableComponentException.class, () -> builder.createCompiler()); - } - - @Test - public void setcomponents_nonStorableSyntaxAnalyser() { - StorableCustomCompilerBuilder builder = new StorableCustomCompilerBuilder(); - builder.setComponents( - new TestStorableCustomLexicalAnalyserFactory(), - new TestCustomSyntaxAnalyserFactory(), - new TestStorableCustomCodeGeneratorFactory(), - BasicIdentifierGrammar.produce(), - XToYToXSemantic.produce(), - new String[] {" "}, - new String[] {"+", "=", ";"}, - new String[] {}, - new DynamicTokenRegex[] { - new DynamicTokenRegex("[A-Za-z]+", "identifier"), - new DynamicTokenRegex("[0-9]+(\\.[0-9]+)?", "number") - } - ); - - - assertThrows(NonStorableComponentException.class, () -> builder.createCompiler()); - } - - @Test - public void setcomponents_nonStorableCodeGenerator() { - StorableCustomCompilerBuilder builder = new StorableCustomCompilerBuilder(); - builder.setComponents( - new TestStorableCustomLexicalAnalyserFactory(), - new TestStorableCustomSyntaxAnalyserFactory(), - new TestCustomCodeGeneratorFactory(), - BasicIdentifierGrammar.produce(), - XToYToXSemantic.produce(), - new String[] {" "}, - new String[] {"+", "=", ";"}, - new String[] {}, - new DynamicTokenRegex[] { - new DynamicTokenRegex("[A-Za-z]+", "identifier"), - new DynamicTokenRegex("[0-9]+(\\.[0-9]+)?", "number") - } - ); - - - assertThrows(NonStorableComponentException.class, () -> builder.createCompiler()); - } - -} diff --git a/src/test/java/component_construction/storable/dynamic_loading/LoadableByTests.java b/src/test/java/component_construction/storable/dynamic_loading/LoadableByTests.java deleted file mode 100644 index 07b9de8..0000000 --- a/src/test/java/component_construction/storable/dynamic_loading/LoadableByTests.java +++ /dev/null @@ -1,63 +0,0 @@ -package component_construction.storable.dynamic_loading; - -import static org.junit.jupiter.api.Assertions.*; -import org.junit.jupiter.api.Test; - -import component_construction.storable.exceptions.IncorrectlyFormattedException; -import test_aids.storage_entities.loadableby_entities.*; - -public class LoadableByTests { - - @Test - @SuppressWarnings("unchecked") - public void getTargetLoader() { - Class>> loadableBy = (Class>>)(Class)LoadableObject.class; - Class> actualLoader = LoadableBy.getTargetLoader(loadableBy); - - assertEquals(StandardLoader.class, actualLoader); - } - - @Test - @SuppressWarnings("unchecked") - public void getTargetLoader_genericLoader() { - Class>> loadableBy = (Class>>)(Class)GenericallyLoadableObject.class; - - assertThrows(IncorrectlyFormattedException.class, () -> LoadableBy.getTargetLoader(loadableBy)); - } - - @Test - @SuppressWarnings("unchecked") - public void getTargetLoader_wildcardLoader() { - Class>> loadableBy = (Class>>)(Class)WildcardLoadableObject.class; - - assertThrows(IncorrectlyFormattedException.class, () -> LoadableBy.getTargetLoader(loadableBy)); - } - - @Test - @SuppressWarnings("unchecked") - public void getTargetLoader_additionalInterface() { - Class>> loadableBy = (Class>>)(Class)TestLoadableObject.class; - Class> actualLoader = LoadableBy.getTargetLoader(loadableBy); - - assertEquals(StandardLoader.class, actualLoader); - } - - @Test - @SuppressWarnings("unchecked") - public void getTargetLoader_additionalGenericInterface() { - Class>>> loadableBy = (Class>>>)(Class)GenericTestLoadableObject.class; - Class>> actualLoader = LoadableBy.getTargetLoader(loadableBy); - - assertEquals(StandardLoader.class, actualLoader); - } - - @Test - @SuppressWarnings("unchecked") - public void getTargetLoader_additionalConcretisedGenericInterface() { - Class>>> loadableBy = (Class>>>)(Class)ConcretisedGenericTestLoadableObject.class; - Class>> actualLoader = LoadableBy.getTargetLoader(loadableBy); - - assertEquals(StandardLoader.class, actualLoader); - } - -} diff --git a/src/test/java/component_construction/storable/dynamic_loading/LoaderTests.java b/src/test/java/component_construction/storable/dynamic_loading/LoaderTests.java deleted file mode 100644 index fca3c0e..0000000 --- a/src/test/java/component_construction/storable/dynamic_loading/LoaderTests.java +++ /dev/null @@ -1,27 +0,0 @@ -package component_construction.storable.dynamic_loading; - -import static org.junit.jupiter.api.Assertions.*; -import org.junit.jupiter.api.Test; - -import component_construction.storable.exceptions.MissingEmptyConstructorException; -import test_aids.storage_entities.*; - -public class LoaderTests { - - @Test - @SuppressWarnings("unchecked") - public void construct() { - Class> loaderClass = (Class>)(Class)TestObjectLoader.class; - - assertDoesNotThrow(() -> Loader.construct(loaderClass)); - } - - @Test - @SuppressWarnings("unchecked") - public void construct_IncorrectlyFormedLoader() { - Class> loaderClass = (Class>)(Class)IncorrectlyFormedLoader.class; - - assertThrows(MissingEmptyConstructorException.class, () -> Loader.construct(loaderClass)); - } - -} diff --git a/src/test/java/component_construction/storable/dynamic_loading/ReflectiveClassConstructorTests.java b/src/test/java/component_construction/storable/dynamic_loading/ReflectiveClassConstructorTests.java deleted file mode 100644 index d0c7ad8..0000000 --- a/src/test/java/component_construction/storable/dynamic_loading/ReflectiveClassConstructorTests.java +++ /dev/null @@ -1,598 +0,0 @@ -package component_construction.storable.dynamic_loading; - -import static org.junit.jupiter.api.Assertions.*; -import org.junit.jupiter.api.Test; - -import test_aids.storage_entities.*; -import test_aids.storage_entities.TestDynamicObject.*; - -public class ReflectiveClassConstructorTests { - - protected String TestDynamicObjectNamespace = TestDynamicObject.class.getPackageName(); - protected String nonExistantTestDynamicObjectPath = TestDynamicObjectNamespace + ".NonExistantTestDynamicObject"; - protected String nonExistantStaticInnerTestDynamicObjectPath = TestDynamicObjectNamespace + ".NonExistantTestDynamicObject$StaticInnerTestDynamicObject"; - protected String nonExistantInnerTestDynamicObjectPath = TestDynamicObjectNamespace + ".NonExistantTestDynamicObject$InnerTestDynamicObject"; - - @Test - public void construct_noParameters_class() throws ClassNotFoundException { - TestDynamicObject actualObject = new ReflectiveClassConstructor() - .construct( - TestDynamicObject.class.getName(), - TestDynamicObject.class - ); - TestDynamicObject expectedObject = new TestDynamicObject(); - - assertEquals(expectedObject, actualObject); - } - - @Test - public void construct_noParameters_staticInnerClass() throws ClassNotFoundException { - StaticInnerTestDynamicObject actualObject = new ReflectiveClassConstructor() - .construct( - StaticInnerTestDynamicObject.class.getName(), - StaticInnerTestDynamicObject.class - ); - StaticInnerTestDynamicObject expectedObject = new StaticInnerTestDynamicObject(); - - assertEquals(expectedObject, actualObject); - } - - @Test - public void construct_noParameters_innerClass() throws ClassNotFoundException { - TestDynamicObject parentObject = new TestDynamicObject(); - - InnerTestDynamicObject actualObject = new ReflectiveClassConstructor() - .construct( - InnerTestDynamicObject.class.getName(), - InnerTestDynamicObject.class, - new Class[] {parentObject.getClass()}, - new Object[] {parentObject} - ); - InnerTestDynamicObject expectedObject = parentObject.new InnerTestDynamicObject(); - - assertEquals(expectedObject, actualObject); - } - - @Test - public void construct_noParameters_nonExistantClass() throws ClassNotFoundException { - assertThrows(ClassNotFoundException.class, () -> - new ReflectiveClassConstructor() - .construct( - nonExistantTestDynamicObjectPath, - TestDynamicObject.class - ) - ); - } - - @Test - public void construct_noParameters_nonExistantStaticInnerClass() throws ClassNotFoundException { - assertThrows(ClassNotFoundException.class, () -> - new ReflectiveClassConstructor() - .construct( - nonExistantStaticInnerTestDynamicObjectPath, - TestDynamicObject.class - ) - ); - } - - @Test - public void construct_noParameters_nonExistantInnerClass() throws ClassNotFoundException { - assertThrows(ClassNotFoundException.class, () -> - new ReflectiveClassConstructor() - .construct( - nonExistantInnerTestDynamicObjectPath, - TestDynamicObject.class - ) - ); - } - - @Test - public void construct_oneParameter_class_intParam() throws ClassNotFoundException { - TestDynamicObject expectedObject = new TestDynamicObject(); - expectedObject.a = 1; - - TestDynamicObject actualObject = new ReflectiveClassConstructor() - .construct( - TestDynamicObject.class.getName(), - TestDynamicObject.class, - new Class[] {int.class}, - new Object[] {expectedObject.a} - ); - - assertEquals(expectedObject, actualObject); - } - - @Test - public void construct_oneParameter_staticInnerClass_intParam() throws ClassNotFoundException { - StaticInnerTestDynamicObject expectedObject = new StaticInnerTestDynamicObject(); - expectedObject.e = 1; - - StaticInnerTestDynamicObject actualObject = new ReflectiveClassConstructor() - .construct( - StaticInnerTestDynamicObject.class.getName(), - StaticInnerTestDynamicObject.class, - new Class[] {int.class}, - new Object[] {expectedObject.e} - ); - - assertEquals(expectedObject, actualObject); - } - - @Test - public void construct_oneParameter_innerClass_intParam() throws ClassNotFoundException { - TestDynamicObject parentObject = new TestDynamicObject(); - InnerTestDynamicObject expectedObject = parentObject.new InnerTestDynamicObject(); - expectedObject.c = 1; - - InnerTestDynamicObject actualObject = new ReflectiveClassConstructor() - .construct( - InnerTestDynamicObject.class.getName(), - InnerTestDynamicObject.class, - new Class[] { - parentObject.getClass(), - int.class - }, - new Object[] { - parentObject, - expectedObject.c - } - ); - - assertEquals(expectedObject, actualObject); - } - - @Test - public void construct_oneParameter_class_stringParam() throws ClassNotFoundException { - TestDynamicObject expectedObject = new TestDynamicObject(); - expectedObject.b = "Test"; - - TestDynamicObject actualObject = new ReflectiveClassConstructor() - .construct( - TestDynamicObject.class.getName(), - TestDynamicObject.class, - new Class[] {String.class}, - new Object[] {expectedObject.b} - ); - - assertEquals(expectedObject, actualObject); - } - - @Test - public void construct_oneParameter_staticInnerClass_stringParam() throws ClassNotFoundException { - StaticInnerTestDynamicObject expectedObject = new StaticInnerTestDynamicObject(); - expectedObject.f = "Test"; - - StaticInnerTestDynamicObject actualObject = new ReflectiveClassConstructor() - .construct( - StaticInnerTestDynamicObject.class.getName(), - StaticInnerTestDynamicObject.class, - new Class[] {String.class}, - new Object[] {expectedObject.f} - ); - - assertEquals(expectedObject, actualObject); - } - - @Test - public void construct_oneParameter_innerClass_stringParam() throws ClassNotFoundException { - TestDynamicObject parentObject = new TestDynamicObject(); - InnerTestDynamicObject expectedObject = parentObject.new InnerTestDynamicObject(); - expectedObject.d = "Test"; - - InnerTestDynamicObject actualObject = new ReflectiveClassConstructor() - .construct( - InnerTestDynamicObject.class.getName(), - InnerTestDynamicObject.class, - new Class[] { - parentObject.getClass(), - String.class - }, - new Object[] { - parentObject, - expectedObject.d - } - ); - - assertEquals(expectedObject, actualObject); - } - - @Test - public void construct_oneParameter_class_falseBooleanType() throws ClassNotFoundException { - TestDynamicObject expectedObject = new TestDynamicObject(); - expectedObject.a = 1; - - assertThrows(IllegalArgumentException.class, () -> - new ReflectiveClassConstructor() - .construct( - TestDynamicObject.class.getName(), - TestDynamicObject.class, - new Class[] {boolean.class}, - new Object[] {expectedObject.a} - ) - ); - } - - @Test - public void construct_oneParameter_staticInnerClass_falseBooleanType() throws ClassNotFoundException { - StaticInnerTestDynamicObject expectedObject = new StaticInnerTestDynamicObject(); - expectedObject.e = 1; - - assertThrows(IllegalArgumentException.class, () -> - new ReflectiveClassConstructor() - .construct( - StaticInnerTestDynamicObject.class.getName(), - StaticInnerTestDynamicObject.class, - new Class[] {boolean.class}, - new Object[] {expectedObject.e} - ) - ); - } - - @Test - public void construct_oneParameter_innerClass_falseBooleanType() throws ClassNotFoundException { - TestDynamicObject parentObject = new TestDynamicObject(); - InnerTestDynamicObject expectedObject = parentObject.new InnerTestDynamicObject(); - expectedObject.c = 1; - - assertThrows(IllegalArgumentException.class, () -> - new ReflectiveClassConstructor() - .construct( - InnerTestDynamicObject.class.getName(), - InnerTestDynamicObject.class, - new Class[] { - parentObject.getClass(), - boolean.class - }, - new Object[] { - parentObject, - expectedObject.c - } - ) - ); - } - - @Test - public void construct_oneParameter_class_falseBooleanParam() throws ClassNotFoundException { - TestDynamicObject expectedObject = new TestDynamicObject(); - expectedObject.a = 1; - - assertThrows(IllegalArgumentException.class, () -> - new ReflectiveClassConstructor() - .construct( - TestDynamicObject.class.getName(), - TestDynamicObject.class, - new Class[] {int.class}, - new Object[] {false} - ) - ); - } - - @Test - public void construct_oneParameter_staticInnerClass_falseBooleanParam() throws ClassNotFoundException { - StaticInnerTestDynamicObject expectedObject = new StaticInnerTestDynamicObject(); - expectedObject.e = 1; - - assertThrows(IllegalArgumentException.class, () -> - new ReflectiveClassConstructor() - .construct( - StaticInnerTestDynamicObject.class.getName(), - StaticInnerTestDynamicObject.class, - new Class[] {int.class}, - new Object[] {false} - ) - ); - } - - @Test - public void construct_oneParameter_innerClass_falseBooleanParam() throws ClassNotFoundException { - TestDynamicObject parentObject = new TestDynamicObject(); - InnerTestDynamicObject expectedObject = parentObject.new InnerTestDynamicObject(); - expectedObject.c = 1; - - assertThrows(IllegalArgumentException.class, () -> - new ReflectiveClassConstructor() - .construct( - InnerTestDynamicObject.class.getName(), - InnerTestDynamicObject.class, - new Class[] { - parentObject.getClass(), - int.class - }, - new Object[] { - parentObject, - false - } - ) - ); - } - - @Test - public void construct_oneParameter_nonExistantClass() throws ClassNotFoundException { - assertThrows(ClassNotFoundException.class, () -> - new ReflectiveClassConstructor() - .construct( - nonExistantTestDynamicObjectPath, - TestDynamicObject.class, - new Class[] {int.class}, - new Object[] {1} - ) - ); - } - - @Test - public void construct_oneParameter_nonExistantStaticInnerClass() throws ClassNotFoundException { - assertThrows(ClassNotFoundException.class, () -> - new ReflectiveClassConstructor() - .construct( - nonExistantStaticInnerTestDynamicObjectPath, - TestDynamicObject.class, - new Class[] {int.class}, - new Object[] {1} - ) - ); - } - - @Test - public void construct_oneParameter_nonExistantInnerClass() throws ClassNotFoundException { - assertThrows(ClassNotFoundException.class, () -> - new ReflectiveClassConstructor() - .construct( - nonExistantInnerTestDynamicObjectPath, - TestDynamicObject.class, - new Class[] {int.class}, - new Object[] {1} - ) - ); - } - - @Test - public void construct_manyParameters_class_correctParams() throws ClassNotFoundException { - TestDynamicObject expectedObject = new TestDynamicObject(); - expectedObject.a = 1; - expectedObject.b = "Test"; - - TestDynamicObject actualObject = new ReflectiveClassConstructor() - .construct( - TestDynamicObject.class.getName(), - TestDynamicObject.class, - new Class[] {int.class, String.class}, - new Object[] {expectedObject.a, expectedObject.b} - ); - - assertEquals(expectedObject, actualObject); - } - - @Test - public void construct_manyParameters_staticInnerClass_correctParams() throws ClassNotFoundException { - StaticInnerTestDynamicObject expectedObject = new StaticInnerTestDynamicObject(); - expectedObject.e = 1; - expectedObject.f = "Test"; - - StaticInnerTestDynamicObject actualObject = new ReflectiveClassConstructor() - .construct( - StaticInnerTestDynamicObject.class.getName(), - StaticInnerTestDynamicObject.class, - new Class[] {int.class, String.class}, - new Object[] {expectedObject.e, expectedObject.f} - ); - - assertEquals(expectedObject, actualObject); - } - - @Test - public void construct_manyParameters_innerClass_correctParams() throws ClassNotFoundException { - TestDynamicObject parentObject = new TestDynamicObject(); - InnerTestDynamicObject expectedObject = parentObject.new InnerTestDynamicObject(); - expectedObject.c = 1; - expectedObject.d = "Test"; - - InnerTestDynamicObject actualObject = new ReflectiveClassConstructor() - .construct( - InnerTestDynamicObject.class.getName(), - InnerTestDynamicObject.class, - new Class[] { - parentObject.getClass(), - int.class, - String.class - }, - new Object[] { - parentObject, - expectedObject.c, - expectedObject.d - } - ); - - assertEquals(expectedObject, actualObject); - } - - @Test - public void construct_manyParameters_class_falseBooleanType() throws ClassNotFoundException { - TestDynamicObject expectedObject = new TestDynamicObject(); - expectedObject.a = 1; - expectedObject.b = "Test"; - - assertThrows(IllegalArgumentException.class, () -> - new ReflectiveClassConstructor() - .construct( - TestDynamicObject.class.getName(), - TestDynamicObject.class, - new Class[] {boolean.class, String.class}, - new Object[] {expectedObject.a, expectedObject.b} - ) - ); - } - - @Test - public void construct_manyParameters_staticInnerClass_falseBooleanType() throws ClassNotFoundException { - StaticInnerTestDynamicObject expectedObject = new StaticInnerTestDynamicObject(); - expectedObject.e = 1; - expectedObject.f = "Test"; - - assertThrows(IllegalArgumentException.class, () -> - new ReflectiveClassConstructor() - .construct( - StaticInnerTestDynamicObject.class.getName(), - StaticInnerTestDynamicObject.class, - new Class[] {boolean.class, String.class}, - new Object[] {expectedObject.e, expectedObject.f} - ) - ); - } - - @Test - public void construct_manyParameters_innerClass_falseBooleanType() throws ClassNotFoundException { - TestDynamicObject parentObject = new TestDynamicObject(); - InnerTestDynamicObject expectedObject = parentObject.new InnerTestDynamicObject(); - expectedObject.c = 1; - expectedObject.d = "Test"; - - assertThrows(IllegalArgumentException.class, () -> - new ReflectiveClassConstructor() - .construct( - InnerTestDynamicObject.class.getName(), - InnerTestDynamicObject.class, - new Class[] { - parentObject.getClass(), - boolean.class, - String.class - }, - new Object[] { - parentObject, - expectedObject.c, - expectedObject.d - } - ) - ); - } - - @Test - public void construct_manyParameters_class_falseBooleanParam() throws ClassNotFoundException { - TestDynamicObject expectedObject = new TestDynamicObject(); - expectedObject.a = 1; - expectedObject.b = "Test"; - - assertThrows(IllegalArgumentException.class, () -> - new ReflectiveClassConstructor() - .construct( - TestDynamicObject.class.getName(), - TestDynamicObject.class, - new Class[] {int.class, String.class}, - new Object[] {false, expectedObject.b} - ) - ); - } - - @Test - public void construct_manyParameters_staticInnerClass_falseBooleanParam() throws ClassNotFoundException { - StaticInnerTestDynamicObject expectedObject = new StaticInnerTestDynamicObject(); - expectedObject.e = 1; - expectedObject.f = "Test"; - - assertThrows(IllegalArgumentException.class, () -> - new ReflectiveClassConstructor() - .construct( - StaticInnerTestDynamicObject.class.getName(), - StaticInnerTestDynamicObject.class, - new Class[] {int.class, String.class}, - new Object[] {false, expectedObject.f} - ) - ); - } - - @Test - public void construct_manyParameters_innerClass_falseBooleanParam() throws ClassNotFoundException { - TestDynamicObject parentObject = new TestDynamicObject(); - InnerTestDynamicObject expectedObject = parentObject.new InnerTestDynamicObject(); - expectedObject.c = 1; - expectedObject.d = "Test"; - - assertThrows(IllegalArgumentException.class, () -> - new ReflectiveClassConstructor() - .construct( - InnerTestDynamicObject.class.getName(), - InnerTestDynamicObject.class, - new Class[] { - parentObject.getClass(), - int.class, - String.class - }, - new Object[] { - parentObject, - false, - expectedObject.d - } - ) - ); - } - - @Test - public void construct_manyParameters_nonExistantClass() throws ClassNotFoundException { - assertThrows(ClassNotFoundException.class, () -> - new ReflectiveClassConstructor() - .construct( - nonExistantTestDynamicObjectPath, - TestDynamicObject.class, - new Class[] {int.class, String.class}, - new Object[] {1, "Test"} - ) - ); - } - - @Test - public void construct_manyParameters_nonExistantStaticInnerClass() throws ClassNotFoundException { - assertThrows(ClassNotFoundException.class, () -> - new ReflectiveClassConstructor() - .construct( - nonExistantStaticInnerTestDynamicObjectPath, - TestDynamicObject.class, - new Class[] {int.class, String.class}, - new Object[] {1, "Test"} - ) - ); - } - - @Test - public void construct_manyParameters_nonExistantInnerClass() throws ClassNotFoundException { - assertThrows(ClassNotFoundException.class, () -> - new ReflectiveClassConstructor() - .construct( - nonExistantInnerTestDynamicObjectPath, - TestDynamicObject.class, - new Class[] {int.class, String.class}, - new Object[] {1, "Test"} - ) - ); - } - - @Test - public void construct_subclassAsTargetType() throws ClassNotFoundException { - TestDynamicObjectSubclass expectedObject = new TestDynamicObjectSubclass( - 1, - "Test", - true - ); - - TestDynamicObject actualObject = new ReflectiveClassConstructor() - .construct( - TestDynamicObjectSubclass.class.getName(), - TestDynamicObject.class, - new Class[] { int.class, String.class, boolean.class }, - new Object[] { expectedObject.a, expectedObject.b, expectedObject.c } - ); - - assertEquals((TestDynamicObject)expectedObject, actualObject); - } - - @Test - public void construct_superclassAsTargetType() throws ClassNotFoundException { - assertThrows(ClassCastException.class, () -> - new ReflectiveClassConstructor() - .construct( - TestDynamicObject.class.getName(), - TestDynamicObjectSubclass.class, - new Class[] { int.class, String.class }, - new Object[] { 1, "Test" } - ) - ); - } -} diff --git a/src/test/java/component_construction/storable/factories/StorableCustomCompilerFactoryTests.java b/src/test/java/component_construction/storable/factories/StorableCustomCompilerFactoryTests.java deleted file mode 100644 index 8368ab5..0000000 --- a/src/test/java/component_construction/storable/factories/StorableCustomCompilerFactoryTests.java +++ /dev/null @@ -1,464 +0,0 @@ -package component_construction.storable.factories; - -import static org.junit.jupiter.api.Assertions.*; -import java.util.*; -import org.junit.jupiter.api.Test; - -import code_generation.CodeGenerator; -import component_construction.storable.exceptions.*; -import lexical_analysis.LexicalAnalyser; -import storage.storage_values.*; -import syntax_analysis.SyntaxAnalyser; -import test_aids.storage_entities.custom_components.*; -import test_aids.storage_entities.custom_components.loadable.LoadableStorableCustomLexicalAnalyser; -import test_aids.storage_entities.custom_components.loadableBy.LoadableByStorableCustomLexicalAnalyser; - -public class StorableCustomCompilerFactoryTests { - - protected record TypedComponent(String name, ListStorageValue description, Factory factory) {} - - protected static final TypedComponent lexicalComponent = new TypedComponent<>( - "TestLexicalAnalyser", - new ListStorageValue( - new StringStorageValue("TestLexicalAnalyser") - ), - (description) -> { - assertEquals( - new ListStorageValue( - new StringStorageValue("TestLexicalAnalyser") - ), - description - ); - - return new TestStorableCustomLexicalAnalyser(); - } - ); - - protected static final TypedComponent syntaxComponent = new TypedComponent<>( - "TestSyntaxAnalyser", - new ListStorageValue( - new StringStorageValue("TestSyntaxAnalyser") - ), - (description) -> { - assertEquals( - new ListStorageValue( - new StringStorageValue("TestSyntaxAnalyser") - ), - description - ); - - return new TestStorableCustomSyntaxAnalyser(); - } - ); - - protected static final TypedComponent codeGeneratorComponent = new TypedComponent<>( - "TestCodeGenerator", - new ListStorageValue( - new StringStorageValue("TestCodeGenerator") - ), - (description) -> { - assertEquals( - new ListStorageValue( - new StringStorageValue("TestCodeGenerator") - ), - description - ); - - return new TestStorableCustomCodeGenerator(); - } - ); - - @Test - public void produce() { - StorableCustomCompilerFactory factory = new StorableCustomCompilerFactory() - .addLexicalAnalyserFactory( - lexicalComponent.name(), - lexicalComponent.factory() - ) - .addSyntaxAnalyserFactory( - syntaxComponent.name(), - syntaxComponent.factory() - ) - .addCodeGeneratorFactory( - codeGeneratorComponent.name(), - codeGeneratorComponent.factory() - ); - - assertDoesNotThrow(() -> factory.produce( - new MapStorageValue(Map.of( - "lexicalAnalyser", new ListStorageValue( - new StringStorageValue(lexicalComponent.name()), - lexicalComponent.description() - ), - "syntaxAnalyser", new ListStorageValue( - new StringStorageValue(syntaxComponent.name()), - syntaxComponent.description() - ), - "codeGenerator", new ListStorageValue( - new StringStorageValue(codeGeneratorComponent.name()), - codeGeneratorComponent.description() - ) - )) - )); - } - - @Test - public void produce_existingNamedClassComponents() { - StorableCustomCompilerFactory factory = new StorableCustomCompilerFactory() - .addLexicalAnalyserFactory( - "TestCustomLexicalAnalyser", - lexicalComponent.factory() - ) - .addSyntaxAnalyserFactory( - "TestCustomSyntaxAnalyser", - syntaxComponent.factory() - ) - .addCodeGeneratorFactory( - "TestCustomCodeGenerator", - codeGeneratorComponent.factory() - ); - - assertDoesNotThrow(() -> factory.produce( - new MapStorageValue(Map.of( - "lexicalAnalyser", new ListStorageValue( - new StringStorageValue("TestCustomLexicalAnalyser"), - lexicalComponent.description() - ), - "syntaxAnalyser", new ListStorageValue( - new StringStorageValue("TestCustomSyntaxAnalyser"), - syntaxComponent.description() - ), - "codeGenerator", new ListStorageValue( - new StringStorageValue("TestCustomCodeGenerator"), - codeGeneratorComponent.description() - ) - )) - )); - } - - @Test - public void produce_LoadableByLexicalAnalyser() { - StorableCustomCompilerFactory factory = new StorableCustomCompilerFactory() - .addSyntaxAnalyserFactory( - syntaxComponent.name(), - syntaxComponent.factory() - ) - .addCodeGeneratorFactory( - codeGeneratorComponent.name(), - codeGeneratorComponent.factory() - ); - - factory.produce( - new MapStorageValue(Map.of( - "lexicalAnalyser", new ListStorageValue( - new StringStorageValue(LoadableByStorableCustomLexicalAnalyser.class.getName()), - lexicalComponent.description() - ), - "syntaxAnalyser", new ListStorageValue( - new StringStorageValue(syntaxComponent.name()), - syntaxComponent.description() - ), - "codeGenerator", new ListStorageValue( - new StringStorageValue(codeGeneratorComponent.name()), - codeGeneratorComponent.description() - ) - )) - ); - } - - @Test - public void produce_LoadableLexicalAnalyser() { - StorableCustomCompilerFactory factory = new StorableCustomCompilerFactory() - .addSyntaxAnalyserFactory( - syntaxComponent.name(), - syntaxComponent.factory() - ) - .addCodeGeneratorFactory( - codeGeneratorComponent.name(), - codeGeneratorComponent.factory() - ); - - factory.produce( - new MapStorageValue(Map.of( - "lexicalAnalyser", new ListStorageValue( - new StringStorageValue(LoadableStorableCustomLexicalAnalyser.class.getName()), - lexicalComponent.description() - ), - "syntaxAnalyser", new ListStorageValue( - new StringStorageValue(syntaxComponent.name()), - syntaxComponent.description() - ), - "codeGenerator", new ListStorageValue( - new StringStorageValue(codeGeneratorComponent.name()), - codeGeneratorComponent.description() - ) - )) - ); - } - - @Test - public void produce_ConstructableLexicalAnalyser() { - StorableCustomCompilerFactory factory = new StorableCustomCompilerFactory() - .addSyntaxAnalyserFactory( - syntaxComponent.name(), - syntaxComponent.factory() - ) - .addCodeGeneratorFactory( - codeGeneratorComponent.name(), - codeGeneratorComponent.factory() - ); - - factory.produce( - new MapStorageValue(Map.of( - "lexicalAnalyser", new ListStorageValue( - new StringStorageValue(ConstructableStorableLexicalAnalyser.class.getName()), - new ListStorageValue(List.of()) - ), - "syntaxAnalyser", new ListStorageValue( - new StringStorageValue(syntaxComponent.name()), - syntaxComponent.description() - ), - "codeGenerator", new ListStorageValue( - new StringStorageValue(codeGeneratorComponent.name()), - codeGeneratorComponent.description() - ) - )) - ); - } - - @Test - public void produce_incorrectFormat_noMap() { - StorableCustomCompilerFactory factory = new StorableCustomCompilerFactory() - .addSyntaxAnalyserFactory( - syntaxComponent.name(), - syntaxComponent.factory() - ) - .addCodeGeneratorFactory( - codeGeneratorComponent.name(), - codeGeneratorComponent.factory() - ); - - assertThrows(IncorrectLoadValueFormat.class, () -> factory.produce( - new ListStorageValue(List.of( - new ListStorageValue( - new StringStorageValue("lexicalAnalyser"), - new ListStorageValue( - new StringStorageValue(lexicalComponent.name()), - new ListStorageValue(List.of()) - ) - ), - new ListStorageValue( - new StringStorageValue("syntaxAnalyser"), - new ListStorageValue( - new StringStorageValue(syntaxComponent.name()), - syntaxComponent.description() - ) - ), - new ListStorageValue( - new StringStorageValue("codeGenerator"), - new ListStorageValue( - new StringStorageValue(codeGeneratorComponent.name()), - codeGeneratorComponent.description() - ) - ) - )) - )); - } - - @Test - public void produce_incorrectFormat_missingKey() { - StorableCustomCompilerFactory factory = new StorableCustomCompilerFactory() - .addLexicalAnalyserFactory( - lexicalComponent.name(), - lexicalComponent.factory() - ) - .addSyntaxAnalyserFactory( - syntaxComponent.name(), - syntaxComponent.factory() - ) - .addCodeGeneratorFactory( - codeGeneratorComponent.name(), - codeGeneratorComponent.factory() - ); - - assertThrows(MissingKeyException.class, () -> factory.produce( - new MapStorageValue(Map.of( - "syntaxAnalyser", new ListStorageValue( - new StringStorageValue(syntaxComponent.name()), - syntaxComponent.description() - ), - "codeGenerator", new ListStorageValue( - new StringStorageValue(codeGeneratorComponent.name()), - codeGeneratorComponent.description() - ) - )) - )); - } - - @Test - public void produce_incorrectFormat_multipleMissingKeys() { - StorableCustomCompilerFactory factory = new StorableCustomCompilerFactory() - .addLexicalAnalyserFactory( - lexicalComponent.name(), - lexicalComponent.factory() - ) - .addSyntaxAnalyserFactory( - syntaxComponent.name(), - syntaxComponent.factory() - ) - .addCodeGeneratorFactory( - codeGeneratorComponent.name(), - codeGeneratorComponent.factory() - ); - - assertThrows(MissingKeyException.class, () -> factory.produce( - new MapStorageValue(Map.of( - "syntaxAnalyser", new ListStorageValue( - new StringStorageValue(syntaxComponent.name()), - syntaxComponent.description() - ) - )) - )); - } - - @Test - public void produce_incorrectFormat_emptyMap() { - StorableCustomCompilerFactory factory = new StorableCustomCompilerFactory() - .addLexicalAnalyserFactory( - lexicalComponent.name(), - lexicalComponent.factory() - ) - .addSyntaxAnalyserFactory( - syntaxComponent.name(), - syntaxComponent.factory() - ) - .addCodeGeneratorFactory( - codeGeneratorComponent.name(), - codeGeneratorComponent.factory() - ); - - assertThrows(MissingKeyException.class, () -> factory.produce( - new MapStorageValue(Map.of()) - )); - } - - @Test - public void produce_incorrectFormat_nonListComponentDescription() { - StorableCustomCompilerFactory factory = new StorableCustomCompilerFactory() - .addSyntaxAnalyserFactory( - syntaxComponent.name(), - syntaxComponent.factory() - ) - .addCodeGeneratorFactory( - codeGeneratorComponent.name(), - codeGeneratorComponent.factory() - ); - - assertThrows(IncorrectLoadValueFormat.class, () -> factory.produce( - new MapStorageValue(Map.of( - "lexicalAnalyser", new MapStorageValue(Map.of( - lexicalComponent.name(), - lexicalComponent.description() - )), - "syntaxAnalyser", new ListStorageValue( - new StringStorageValue(syntaxComponent.name()), - syntaxComponent.description() - ), - "codeGenerator", new ListStorageValue( - new StringStorageValue(codeGeneratorComponent.name()), - codeGeneratorComponent.description() - ) - )) - )); - } - - @Test - public void produce_nonExistentComponentClass() { - StorableCustomCompilerFactory factory = new StorableCustomCompilerFactory() - .addSyntaxAnalyserFactory( - syntaxComponent.name(), - syntaxComponent.factory() - ) - .addCodeGeneratorFactory( - codeGeneratorComponent.name(), - codeGeneratorComponent.factory() - ); - - assertThrows(NonExistentComponentException.class, () -> factory.produce( - new MapStorageValue(Map.of( - "lexicalAnalyser", new ListStorageValue( - new StringStorageValue("NonExistantClass"), - new ListStorageValue(List.of()) - ), - "syntaxAnalyser", new ListStorageValue( - new StringStorageValue(syntaxComponent.name()), - syntaxComponent.description() - ), - "codeGenerator", new ListStorageValue( - new StringStorageValue(codeGeneratorComponent.name()), - codeGeneratorComponent.description() - ) - )) - )); - } - - @Test - public void produce_nonComponentClass() { - StorableCustomCompilerFactory factory = new StorableCustomCompilerFactory() - .addSyntaxAnalyserFactory( - syntaxComponent.name(), - syntaxComponent.factory() - ) - .addCodeGeneratorFactory( - codeGeneratorComponent.name(), - codeGeneratorComponent.factory() - ); - - assertThrows(ComponentCastException.class, () -> factory.produce( - new MapStorageValue(Map.of( - "lexicalAnalyser", new ListStorageValue( - new StringStorageValue(TestCustomFalseLexicalAnalyser.class.getName()), - new ListStorageValue(List.of()) - ), - "syntaxAnalyser", new ListStorageValue( - new StringStorageValue(syntaxComponent.name()), - syntaxComponent.description() - ), - "codeGenerator", new ListStorageValue( - new StringStorageValue(codeGeneratorComponent.name()), - codeGeneratorComponent.description() - ) - )) - )); - } - - @Test - public void produce_componentMissingCorrectConstructor() { - StorableCustomCompilerFactory factory = new StorableCustomCompilerFactory() - .addSyntaxAnalyserFactory( - syntaxComponent.name(), - syntaxComponent.factory() - ) - .addCodeGeneratorFactory( - codeGeneratorComponent.name(), - codeGeneratorComponent.factory() - ); - - assertThrows(ReflectiveLoadFailure.class, () -> factory.produce( - new MapStorageValue(Map.of( - "lexicalAnalyser", new ListStorageValue( - new StringStorageValue(NonConstructableLexicalAnalyser.class.getName()), - new ListStorageValue(List.of()) - ), - "syntaxAnalyser", new ListStorageValue( - new StringStorageValue(syntaxComponent.name()), - syntaxComponent.description() - ), - "codeGenerator", new ListStorageValue( - new StringStorageValue(codeGeneratorComponent.name()), - codeGeneratorComponent.description() - ) - )) - )); - } -} diff --git a/src/test/java/storage/StorageTests.java b/src/test/java/storage/StorageTests.java deleted file mode 100644 index 00c9b1c..0000000 --- a/src/test/java/storage/StorageTests.java +++ /dev/null @@ -1,1465 +0,0 @@ -package storage; - -import static org.junit.jupiter.api.Assertions.*; -import java.io.*; -import java.nio.file.*; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.*; - -import storage.exceptions.*; -import storage.external_interfaces.Storable; -import storage.storage_values.*; -import storage.value_formatters.*; -import test_aids.exceptions.ExampleException; -import test_aids.test_extensions.test_files.*; -import test_aids.test_storage.*; - -@ExtendWith(UseTestFileExtension.class) -public class StorageTests { - - @Test - public void setTargetPath() { - Path expectedPath = Path.of("./testPath"); - Storage storage = new Storage(); - - - storage.setTargetPath(expectedPath); - Path actualPath = storage.getTargetFilepath(); - - - assertEquals(expectedPath, actualPath); - } - - @Test - public void setAbsoluteTargetPath() { - Path expectedPath = Path.of("testPath"); - Storage storage = new Storage(); - - - storage.setAbsoluteTargetPath(expectedPath.toString()); - Path actualPath = storage.getTargetFilepath(); - - - assertEquals(expectedPath, actualPath); - } - - @Test - public void setRelativeTargetPath() { - String fileName = "testPath.txt"; - Storage storage = new Storage(); - - - storage.setRelativeTargetPath(fileName); - Path actualPath = storage.getTargetFilepath(); - - - Path expectedPath = Path.of("./" + fileName); - assertEquals(expectedPath, actualPath); - } - - @Test - @UseTestFile - public void storeNull(Path testFile) throws IOException { - StorageValue storageValue = null; - Storage storage = new Storage() - .setTargetPath(testFile) - .setFileEditor(new TestStringStreamEditor()) - .setFormatter(new TestStringValueFormatter()); - - - assertThrows(NullStorageObjectException.class, () -> storage.store(storageValue)); - } - - @Test - @UseTestFile - public void storeString(Path testFile) throws IOException { - String expectedString = "testString"; - StorageValue storageValue = new TestStorageValue(expectedString); - Storage storage = new Storage() - .setTargetPath(testFile) - .setFileEditor(new TestStringStreamEditor()) - .setFormatter(new TestStringValueFormatter()); - - - storage.store(storageValue); - String actualString = Files.readString(testFile); - - - assertEquals(expectedString, actualString); - } - - @Test - @UseTestFile - public void storeInteger(Path testFile) throws IOException { - int expectedInt = 10; - StorageValue storageValue = new TestStorageValue(expectedInt); - Storage storage = new Storage() - .setTargetPath(testFile) - .setFileEditor(new TestStringStreamEditor()) - .setFormatter(new TestStringValueFormatter()); - - - storage.store(storageValue); - int actualString = Integer.parseInt(Files.readString(testFile)); - - - assertEquals(expectedInt, actualString); - } - - @Test - @UseTestFile - public void storeString_IncorrectFormatter(Path testFile) throws IOException { - String expectedString = "testString"; - StorageValue storageValue = new TestStorageValue(expectedString); - Storage storage = new Storage() - .setTargetPath(testFile) - .setFileEditor(new TestStringStreamEditor()) - .setFormatter(new TestIntegerValueFormatter()); - - - assertThrows(StorageFormatMismatchException.class, () -> storage.store(storageValue)); - } - - @Test - @UseTestFile - public void storeString_FileWriteError(Path testFile) throws IOException { - String expectedString = "testString"; - StorageValue storageValue = new TestStorageValue(expectedString); - Storage storage = new Storage() - .setTargetPath(testFile) - .setFileEditor(new TestStringErrorStreamEditor()) - .setFormatter(new TestStringValueFormatter()); - - - StoreFailureException exception = assertThrows( - StoreFailureException.class, - () -> storage.store(storageValue) - ); - assertInstanceOf(ExampleException.class, exception.getCause()); - } - - @Test - @UseTestFile - public void storeString_FormatterError(Path testFile) throws IOException { - String expectedString = "testString"; - StorageValue storageValue = new TestStorageValue(expectedString); - Storage storage = new Storage() - .setTargetPath(testFile) - .setFileEditor(new TestStringStreamEditor()) - .setFormatter(new TestStringErrorValueFormatter()); - - - FormattingException exception = assertThrows( - FormattingException.class, - () -> storage.store(storageValue) - ); - assertInstanceOf(ExampleException.class, exception.getCause()); - } - - @Test - @UseTestFile - public void loadString(Path testFile) throws IOException { - String testString = "testString"; - Storage storage = new Storage() - .setTargetPath(testFile) - .setFileEditor(new TestStringStreamEditor()) - .setFormatter(new TestStringValueFormatter()); - - Files.writeString(testFile, testString); - - - StorageValue actualStorageValue = storage.load(); - - - StorageValue expectedStorageValue = new TestStorageValue(testString); - assertEquals(expectedStorageValue, actualStorageValue); - } - - @Test - @UseTestFile - public void loadInteger(Path testFile) throws IOException { - int testInteger = 10; - Storage storage = new Storage() - .setTargetPath(testFile) - .setFileEditor(new TestIntegerStreamEditor()) - .setFormatter(new TestIntegerValueFormatter()); - - Files.writeString(testFile, Integer.toString(testInteger)); - - - StorageValue actualStorageValue = storage.load(); - - - StorageValue expectedStorageValue = new TestStorageValue(testInteger); - assertEquals(expectedStorageValue, actualStorageValue); - } - - @Test - @UseTestFile - public void loadEmptyString(Path testFile) throws IOException { - Storage storage = new Storage() - .setTargetPath(testFile) - .setFileEditor(new TestStringStreamEditor()) - .setFormatter(new TestStringValueFormatter()); - - StorageValue actualStorageValue = storage.load(); - - - StorageValue expectedStorageValue = new TestStorageValue(""); - assertEquals(expectedStorageValue, actualStorageValue); - } - - @Test - @UseTestFile - public void loadEmptyInteger(Path testFile) throws IOException { - Storage storage = new Storage() - .setTargetPath(testFile) - .setFileEditor(new TestIntegerStreamEditor()) - .setFormatter(new TestIntegerValueFormatter()); - - - LoadFailureException exception = assertThrows( - LoadFailureException.class, - () -> storage.load() - ); - assertInstanceOf(NumberFormatException.class, exception.getCause()); - } - - @Test - @UseTestFile - public void loadString_IncorrectFormatter(Path testFile) throws IOException { - String testString = "testString"; - Storage storage = new Storage() - .setTargetPath(testFile) - .setFileEditor(new TestStringStreamEditor()) - .setFormatter(new TestIntegerValueFormatter()); - - Files.writeString(testFile, testString); - - - assertThrows(StorageFormatMismatchException.class, () -> storage.load()); - } - - @Test - @UseTestFile - public void loadString_FileWriteError(Path testFile) throws IOException { - String testString = "testString"; - Storage storage = new Storage() - .setTargetPath(testFile) - .setFileEditor(new TestStringErrorStreamEditor()) - .setFormatter(new TestStringValueFormatter()); - - Files.writeString(testFile, testString); - - - LoadFailureException exception = assertThrows( - LoadFailureException.class, - () -> storage.load() - ); - assertInstanceOf(ExampleException.class, exception.getCause()); - } - - @Test - @UseTestFile - public void loadString_FormatterError(Path testFile) throws IOException { - String testString = "testString"; - Storage storage = new Storage() - .setTargetPath(testFile) - .setFileEditor(new TestStringStreamEditor()) - .setFormatter(new TestStringErrorValueFormatter()); - - Files.writeString(testFile, testString); - - - FormatParseException exception = assertThrows( - FormatParseException.class, - () -> storage.load() - ); - assertInstanceOf(ExampleException.class, exception.getCause()); - } - - @Test - @UseTestFile - void convertAndStoreNull(Path testFile) throws IOException { - Storable storable = null; - ValueFormatter formatter = new TestStringValueFormatter(); - Storage storage = new Storage() - .setTargetPath(testFile) - .setFileEditor(new TestStringStreamEditor()); - - OutputStream outputStream = new FileOutputStream(testFile.toFile()); - - - assertThrows(NullStorageObjectException.class, () -> { - try (outputStream) { - storage.convertAndStore(storable, formatter, outputStream); - } - }); - } - - @Test - @UseTestFile - void convertAndStoreString(Path testFile) throws IOException { - String expectedString = "testString"; - - Storable storable = new TestStorable(expectedString); - ValueFormatter formatter = new TestStringValueFormatter(); - Storage storage = new Storage() - .setTargetPath(testFile) - .setFileEditor(new TestStringStreamEditor()); - - OutputStream outputStream = new FileOutputStream(testFile.toFile()); - - - try (outputStream) { - storage.convertAndStore(storable, formatter, outputStream); - } - - - String actualString = Files.readString(testFile); - assertEquals(expectedString, actualString); - } - - @Test - @UseTestFile - void convertAndStoreInteger(Path testFile) throws IOException { - int expectedInteger = 10; - - Storable storable = new TestStorable(expectedInteger); - ValueFormatter formatter = new TestIntegerValueFormatter(); - Storage storage = new Storage() - .setTargetPath(testFile) - .setFileEditor(new TestIntegerStreamEditor()); - - OutputStream outputStream = new FileOutputStream(testFile.toFile()); - - - try (outputStream) { - storage.convertAndStore(storable, formatter, outputStream); - } - - - int actualInteger = Integer.parseInt(Files.readString(testFile)); - assertEquals(expectedInteger, actualInteger); - } - - @Test - @UseTestFile - public void convertAndStoreString_IncorrectFormatter(Path testFile) throws IOException { - String expectedString = "testString"; - - Storable storable = new TestStorable(expectedString); - ValueFormatter formatter = new TestIntegerValueFormatter(); - Storage storage = new Storage() - .setTargetPath(testFile) - .setFileEditor(new TestStringStreamEditor()); - - OutputStream outputStream = new FileOutputStream(testFile.toFile()); - - try (outputStream) { - assertThrows(StorageFormatMismatchException.class, () -> storage.convertAndStore(storable, formatter, outputStream)); - } - } - - @Test - @UseTestFile - public void convertAndStoreString_FileWriteError(Path testFile) throws IOException { - String expectedString = "testString"; - - Storable storable = new TestStorable(expectedString); - ValueFormatter formatter = new TestStringValueFormatter(); - Storage storage = new Storage() - .setTargetPath(testFile) - .setFileEditor(new TestStringErrorStreamEditor()); - - OutputStream outputStream = new FileOutputStream(testFile.toFile()); - - try (outputStream) { - StoreFailureException exception = assertThrows( - StoreFailureException.class, - () -> storage.convertAndStore(storable, formatter, outputStream) - ); - assertInstanceOf(ExampleException.class, exception.getCause()); - } - } - - @Test - @UseTestFile - public void convertAndStoreString_FormatterError(Path testFile) throws IOException { - String expectedString = "testString"; - - Storable storable = new TestStorable(expectedString); - ValueFormatter formatter = new TestStringErrorValueFormatter(); - Storage storage = new Storage() - .setTargetPath(testFile) - .setFileEditor(new TestStringStreamEditor()); - - OutputStream outputStream = new FileOutputStream(testFile.toFile()); - - try (outputStream) { - FormattingException exception = assertThrows( - FormattingException.class, - () -> storage.convertAndStore(storable, formatter, outputStream) - ); - assertInstanceOf(ExampleException.class, exception.getCause()); - } - } - - @Test - @UseTestFile - void convertAndLoadStringInto(Path testFile) throws IOException { - String expectedString = "testString"; - - TestLoadable loadable = new TestLoadable(); - Storage storage = new Storage() - .setTargetPath(testFile) - .setFormatter(new TestStringValueFormatter()) - .setFileEditor(new TestStringStreamEditor()); - - Files.writeString(testFile, expectedString); - - InputStream inputStream = new FileInputStream(testFile.toFile()); - - - try (inputStream) { - storage.convertAndLoadInto(loadable, inputStream); - } - - - assertEquals(expectedString, loadable.getValue()); - } - - @Test - @UseTestFile - void convertAndLoadIntegerInto(Path testFile) throws IOException { - int expectedInteger= 10; - - TestLoadable loadable = new TestLoadable(); - Storage storage = new Storage() - .setTargetPath(testFile) - .setFormatter(new TestIntegerValueFormatter()) - .setFileEditor(new TestIntegerStreamEditor()); - - Files.writeString(testFile, Integer.toString(expectedInteger)); - - InputStream inputStream = new FileInputStream(testFile.toFile()); - - - try (inputStream) { - storage.convertAndLoadInto(loadable, inputStream); - } - - - assertEquals(expectedInteger, loadable.getValue()); - } - - @Test - @UseTestFile - public void convertAndLoadStringInto_IncorrectFormatter(Path testFile) throws IOException { - String expectedString = "testString"; - - TestLoadable loadable = new TestLoadable(); - Storage storage = new Storage() - .setTargetPath(testFile) - .setFormatter(new TestIntegerValueFormatter()) - .setFileEditor(new TestStringStreamEditor()); - - Files.writeString(testFile, expectedString); - - InputStream inputStream = new FileInputStream(testFile.toFile()); - - - try (inputStream) { - assertThrows(StorageFormatMismatchException.class, () -> storage.convertAndLoadInto(loadable, inputStream)); - } - } - - @Test - @UseTestFile - public void convertAndLoadStringInto_FileWriteError(Path testFile) throws IOException { - String expectedString = "testString"; - - TestLoadable loadable = new TestLoadable(); - Storage storage = new Storage() - .setTargetPath(testFile) - .setFormatter(new TestStringValueFormatter()) - .setFileEditor(new TestStringErrorStreamEditor()); - - Files.writeString(testFile, expectedString); - - InputStream inputStream = new FileInputStream(testFile.toFile()); - - - try (inputStream) { - LoadFailureException exception = assertThrows( - LoadFailureException.class, - () -> storage.convertAndLoadInto(loadable, inputStream) - ); - assertInstanceOf(ExampleException.class, exception.getCause()); - } - } - - @Test - @UseTestFile - public void convertAndLoadStringInto_FormatterError(Path testFile) throws IOException { - String expectedString = "testString"; - - TestLoadable loadable = new TestLoadable(); - Storage storage = new Storage() - .setTargetPath(testFile) - .setFormatter(new TestStringErrorValueFormatter()) - .setFileEditor(new TestStringStreamEditor()); - - Files.writeString(testFile, expectedString); - - InputStream inputStream = new FileInputStream(testFile.toFile()); - - - try (inputStream) { - FormatParseException exception = assertThrows( - FormatParseException.class, - () -> storage.convertAndLoadInto(loadable, inputStream) - ); - assertInstanceOf(ExampleException.class, exception.getCause()); - } - } - - @Test - @UseTestFile - void convertThenFormatAndLoadStringInto(Path testFile) throws IOException { - String expectedString = "testString"; - - TestLoadable loadable = new TestLoadable(); - ValueFormatter formatter = new TestStringValueFormatter(); - - Storage storage = new Storage() - .setTargetPath(testFile) - .setFileEditor(new TestStringStreamEditor()); - - Files.writeString(testFile, expectedString); - - InputStream inputStream = new FileInputStream(testFile.toFile()); - - - try (inputStream) { - storage.convertAndLoadInto(loadable, formatter, inputStream); - } - - assertEquals(expectedString, loadable.getValue()); - } - - @Test - @UseTestFile - void convertThenFormatAndLoadIntegerInto(Path testFile) throws IOException { - int expectedInteger = 10; - - TestLoadable loadable = new TestLoadable(); - ValueFormatter formatter = new TestIntegerValueFormatter(); - - Storage storage = new Storage() - .setTargetPath(testFile) - .setFileEditor(new TestIntegerStreamEditor()); - - Files.writeString(testFile, Integer.toString(expectedInteger)); - - InputStream inputStream = new FileInputStream(testFile.toFile()); - - - try (inputStream) { - storage.convertAndLoadInto(loadable, formatter, inputStream); - } - - assertEquals(expectedInteger, loadable.getValue()); - } - - @Test - @UseTestFile - public void convertThenFormatAndLoadStringInto_IncorrectFormatter(Path testFile) throws IOException { - String expectedString = "testString"; - - TestLoadable loadable = new TestLoadable(); - ValueFormatter formatter = new TestIntegerValueFormatter(); - - Storage storage = new Storage() - .setTargetPath(testFile) - .setFileEditor(new TestStringStreamEditor()); - - Files.writeString(testFile, expectedString); - - InputStream inputStream = new FileInputStream(testFile.toFile()); - - - try (inputStream) { - assertThrows(StorageFormatMismatchException.class, () -> storage.convertAndLoadInto(loadable, formatter, inputStream)); - } - } - - @Test - @UseTestFile - public void convertThenFormatAndLoadStringInto_FileWriteError(Path testFile) throws IOException { - String expectedString = "testString"; - - TestLoadable loadable = new TestLoadable(); - ValueFormatter formatter = new TestStringValueFormatter(); - - Storage storage = new Storage() - .setTargetPath(testFile) - .setFileEditor(new TestStringErrorStreamEditor()); - - Files.writeString(testFile, expectedString); - - InputStream inputStream = new FileInputStream(testFile.toFile()); - - - try (inputStream) { - LoadFailureException exception = assertThrows( - LoadFailureException.class, - () -> storage.convertAndLoadInto(loadable, formatter, inputStream) - ); - assertInstanceOf(ExampleException.class, exception.getCause()); - } - } - - @Test - @UseTestFile - public void convertThenFormatAndLoadStringInto_FormatterError(Path testFile) throws IOException { - String expectedString = "testString"; - - TestLoadable loadable = new TestLoadable(); - ValueFormatter formatter = new TestStringErrorValueFormatter(); - - Storage storage = new Storage() - .setTargetPath(testFile) - .setFileEditor(new TestStringStreamEditor()); - - Files.writeString(testFile, expectedString); - - InputStream inputStream = new FileInputStream(testFile.toFile()); - - - try (inputStream) { - FormatParseException exception = assertThrows( - FormatParseException.class, - () -> storage.convertAndLoadInto(loadable, formatter, inputStream) - ); - assertInstanceOf(ExampleException.class, exception.getCause()); - } - } - - @Test - @UseTestFile - public void storeNullToStream(Path testFile) throws IOException { - Storable storable = null; - Storage storage = new Storage() - .setTargetPath(testFile) - .setFileEditor(new TestStringStreamEditor()) - .setFormatter(new TestStringValueFormatter()); - - OutputStream outputStream = new FileOutputStream(testFile.toFile()); - - - assertThrows(NullStorageObjectException.class, () -> { - try (outputStream) { - storage.store(storable, outputStream); - } - }); - } - - @Test - @UseTestFile - public void storeStringToStream(Path testFile) throws IOException { - String expectedString = "testString"; - Storable storable = new TestStorable(expectedString); - Storage storage = new Storage() - .setTargetPath(testFile) - .setFileEditor(new TestStringStreamEditor()) - .setFormatter(new TestStringValueFormatter()); - - OutputStream outputStream = new FileOutputStream(testFile.toFile()); - - - try (outputStream) { - storage.store(storable, outputStream); - } - - - String actualString = Files.readString(testFile); - assertEquals(expectedString, actualString); - } - - @Test - @UseTestFile - public void storeIntegerToStream(Path testFile) throws IOException { - int expectedInteger = 10; - Storable storable = new TestStorable(expectedInteger); - Storage storage = new Storage() - .setTargetPath(testFile) - .setFileEditor(new TestIntegerStreamEditor()) - .setFormatter(new TestIntegerValueFormatter()); - - OutputStream outputStream = new FileOutputStream(testFile.toFile()); - - - try (outputStream) { - storage.store(storable, outputStream); - } - - - int actualInteger = Integer.parseInt(Files.readString(testFile)); - assertEquals(expectedInteger, actualInteger); - } - - @Test - @UseTestFile - public void storeStringToStream_IncorrectFormatter(Path testFile) throws IOException { - String expectedString = "testString"; - Storable storable = new TestStorable(expectedString); - Storage storage = new Storage() - .setTargetPath(testFile) - .setFileEditor(new TestStringStreamEditor()) - .setFormatter(new TestIntegerValueFormatter()); - - OutputStream outputStream = new FileOutputStream(testFile.toFile()); - - - try (outputStream) { - assertThrows(StorageFormatMismatchException.class, () -> storage.store(storable, outputStream)); - } - } - - @Test - @UseTestFile - public void storeStringToStream_FileWriteError(Path testFile) throws IOException { - String expectedString = "testString"; - Storable storable = new TestStorable(expectedString); - Storage storage = new Storage() - .setTargetPath(testFile) - .setFileEditor(new TestStringErrorStreamEditor()) - .setFormatter(new TestStringValueFormatter()); - - OutputStream outputStream = new FileOutputStream(testFile.toFile()); - - - try (outputStream) { - StoreFailureException exception = assertThrows( - StoreFailureException.class, - () -> storage.store(storable, outputStream) - ); - assertInstanceOf(ExampleException.class, exception.getCause()); - } - } - - @Test - @UseTestFile - public void storeStringToStream_FormatterError(Path testFile) throws IOException { - String expectedString = "testString"; - Storable storable = new TestStorable(expectedString); - Storage storage = new Storage() - .setTargetPath(testFile) - .setFileEditor(new TestStringStreamEditor()) - .setFormatter(new TestStringErrorValueFormatter()); - - OutputStream outputStream = new FileOutputStream(testFile.toFile()); - - - try (outputStream) { - FormattingException exception = assertThrows( - FormattingException.class, - () -> storage.store(storable, outputStream) - ); - assertInstanceOf(ExampleException.class, exception.getCause()); - } - } - - @Test - @UseTestFile - public void loadStringFromInputStream(Path testFile) throws IOException { - String testString = "testString"; - Storage storage = new Storage() - .setTargetPath(testFile) - .setFileEditor(new TestStringStreamEditor()) - .setFormatter(new TestStringValueFormatter()); - - Files.writeString(testFile, testString); - - InputStream inputStream = new FileInputStream(testFile.toFile()); - - - StorageValue actualStorageValue = storage.load(inputStream); - - - StorageValue expectedStorageValue = new TestStorageValue(testString); - assertEquals(expectedStorageValue, actualStorageValue); - } - - @Test - @UseTestFile - public void loadIntegerFromInputStream(Path testFile) throws IOException { - int testInteger = 10; - Storage storage = new Storage() - .setTargetPath(testFile) - .setFileEditor(new TestIntegerStreamEditor()) - .setFormatter(new TestIntegerValueFormatter()); - - Files.writeString(testFile, Integer.toString(testInteger)); - - InputStream inputStream = new FileInputStream(testFile.toFile()); - - - StorageValue actualStorageValue = storage.load(inputStream); - - - StorageValue expectedStorageValue = new TestStorageValue(testInteger); - assertEquals(expectedStorageValue, actualStorageValue); - } - - @Test - @UseTestFile - public void loadStringFromInputStream_IncorrectFormatter(Path testFile) throws IOException { - String testString = "testString"; - Storage storage = new Storage() - .setTargetPath(testFile) - .setFileEditor(new TestStringStreamEditor()) - .setFormatter(new TestIntegerValueFormatter()); - - Files.writeString(testFile, testString); - - InputStream inputStream = new FileInputStream(testFile.toFile()); - - - try (inputStream) { - assertThrows(StorageFormatMismatchException.class, () -> storage.load(inputStream)); - } - } - - @Test - @UseTestFile - public void loadStringFromInputStream_FileWriteError(Path testFile) throws IOException { - String testString = "testString"; - Storage storage = new Storage() - .setTargetPath(testFile) - .setFileEditor(new TestStringErrorStreamEditor()) - .setFormatter(new TestStringValueFormatter()); - - Files.writeString(testFile, testString); - - InputStream inputStream = new FileInputStream(testFile.toFile()); - - - try (inputStream) { - LoadFailureException exception = assertThrows( - LoadFailureException.class, - () -> storage.load(inputStream) - ); - assertInstanceOf(ExampleException.class, exception.getCause()); - } - } - - @Test - @UseTestFile - public void loadStringFromInputStream_FormatterError(Path testFile) throws IOException { - String testString = "testString"; - Storage storage = new Storage() - .setTargetPath(testFile) - .setFileEditor(new TestStringStreamEditor()) - .setFormatter(new TestStringErrorValueFormatter()); - - Files.writeString(testFile, testString); - - InputStream inputStream = new FileInputStream(testFile.toFile()); - - - try (inputStream) { - FormatParseException exception = assertThrows( - FormatParseException.class, - () -> storage.load(inputStream) - ); - assertInstanceOf(ExampleException.class, exception.getCause()); - } - } - - @Test - @UseTestFile - public void loadWithTypeString(Path testFile) throws IOException { - String testString = "testString"; - Storage storage = new Storage() - .setTargetPath(testFile) - .setFileEditor(new TestStringStreamEditor()) - .setFormatter(new TestStringValueFormatter()); - - Files.writeString(testFile, testString); - - InputStream inputStream = new FileInputStream(testFile.toFile()); - - - StorageValue actualStorageValue = storage.loadWithType(inputStream); - - - StorageValue expectedStorageValue = new TestStorageValue(testString); - assertEquals(expectedStorageValue, actualStorageValue); - } - - @Test - @UseTestFile - public void loadWithTypeInteger(Path testFile) throws IOException { - int testInteger = 10; - Storage storage = new Storage() - .setTargetPath(testFile) - .setFileEditor(new TestIntegerStreamEditor()) - .setFormatter(new TestIntegerValueFormatter()); - - Files.writeString(testFile, Integer.toString(testInteger)); - - InputStream inputStream = new FileInputStream(testFile.toFile()); - - - StorageValue actualStorageValue = storage.loadWithType(inputStream); - - - StorageValue expectedStorageValue = new TestStorageValue(testInteger); - assertEquals(expectedStorageValue, actualStorageValue); - } - - @Test - @UseTestFile - public void loadWithTypeString_IncorrectFormatter(Path testFile) throws IOException { - String testString = "testString"; - Storage storage = new Storage() - .setTargetPath(testFile) - .setFileEditor(new TestStringStreamEditor()) - .setFormatter(new TestIntegerValueFormatter()); - - Files.writeString(testFile, testString); - - InputStream inputStream = new FileInputStream(testFile.toFile()); - - - try (inputStream) { - assertThrows(StorageFormatMismatchException.class, () -> storage.loadWithType(inputStream)); - } - } - - @Test - @UseTestFile - public void loadWithTypeString_FileWriteError(Path testFile) throws IOException { - String testString = "testString"; - Storage storage = new Storage() - .setTargetPath(testFile) - .setFileEditor(new TestStringErrorStreamEditor()) - .setFormatter(new TestStringValueFormatter()); - - Files.writeString(testFile, testString); - - InputStream inputStream = new FileInputStream(testFile.toFile()); - - - try (inputStream) { - LoadFailureException exception = assertThrows( - LoadFailureException.class, - () -> storage.loadWithType(inputStream) - ); - assertInstanceOf(ExampleException.class, exception.getCause()); - } - } - - @Test - @UseTestFile - public void loadWithTypeString_FormatterError(Path testFile) throws IOException { - String testString = "testString"; - Storage storage = new Storage() - .setTargetPath(testFile) - .setFileEditor(new TestStringStreamEditor()) - .setFormatter(new TestStringErrorValueFormatter()); - - Files.writeString(testFile, testString); - - InputStream inputStream = new FileInputStream(testFile.toFile()); - - - try (inputStream) { - FormatParseException exception = assertThrows( - FormatParseException.class, - () -> storage.loadWithType(inputStream) - ); - assertInstanceOf(ExampleException.class, exception.getCause()); - } - } - - @Test - @UseTestFile - public void storeStorableOfNull(Path testFile) throws IOException { - Storable storable = null; - Storage storage = new Storage() - .setTargetPath(testFile) - .setFileEditor(new TestStringStreamEditor()) - .setFormatter(new TestStringValueFormatter()); - - - assertThrows(NullStorageObjectException.class, () -> storage.store(storable)); - } - - @Test - @UseTestFile - public void storeStorableOfString(Path testFile) throws IOException { - String expectedString = "testString"; - Storable storable = new TestStorable(expectedString); - Storage storage = new Storage() - .setTargetPath(testFile) - .setFileEditor(new TestStringStreamEditor()) - .setFormatter(new TestStringValueFormatter()); - - - storage.store(storable); - String actualString = Files.readString(testFile); - - - assertEquals(expectedString, actualString); - } - - @Test - @UseTestFile - public void storeStorableOfInteger(Path testFile) throws IOException { - int expectedInteger = 10; - Storable storable = new TestStorable(expectedInteger); - Storage storage = new Storage() - .setTargetPath(testFile) - .setFileEditor(new TestIntegerStreamEditor()) - .setFormatter(new TestIntegerValueFormatter()); - - - storage.store(storable); - int actualInteger = Integer.parseInt(Files.readString(testFile)); - - - assertEquals(expectedInteger, actualInteger); - } - - @Test - @UseTestFile - public void storeStorableOfString_IncorrectFormatter(Path testFile) throws IOException { - String expectedString = "testString"; - Storable storable = new TestStorable(expectedString); - Storage storage = new Storage() - .setTargetPath(testFile) - .setFileEditor(new TestStringStreamEditor()) - .setFormatter(new TestIntegerValueFormatter()); - - - assertThrows(StorageFormatMismatchException.class, () -> storage.store(storable)); - } - - @Test - @UseTestFile - public void storeStorableOfString_FileWriteError(Path testFile) throws IOException { - String expectedString = "testString"; - Storable storable = new TestStorable(expectedString); - Storage storage = new Storage() - .setTargetPath(testFile) - .setFileEditor(new TestStringErrorStreamEditor()) - .setFormatter(new TestStringValueFormatter()); - - - StoreFailureException exception = assertThrows( - StoreFailureException.class, - () -> storage.store(storable) - ); - assertInstanceOf(ExampleException.class, exception.getCause()); - } - - @Test - @UseTestFile - public void storeStorableOfString_FormatterError(Path testFile) throws IOException { - String expectedString = "testString"; - Storable storable = new TestStorable(expectedString); - Storage storage = new Storage() - .setTargetPath(testFile) - .setFileEditor(new TestStringStreamEditor()) - .setFormatter(new TestStringErrorValueFormatter()); - - - FormattingException exception = assertThrows( - FormattingException.class, - () -> storage.store(storable) - ); - assertInstanceOf(ExampleException.class, exception.getCause()); - } - - @Test - @UseTestFile - public void storeStorableOfNullAtFilepath(Path testFile) throws IOException { - Storable storable = null; - Storage storage = new Storage() - .setFileEditor(new TestStringStreamEditor()) - .setFormatter(new TestStringValueFormatter()); - - - assertThrows(NullStorageObjectException.class, () -> storage.store(storable, testFile.toString())); - } - - @Test - @UseTestFile - public void storeStorableOfStringAtFilepath(Path testFile) throws IOException { - String expectedString = "testString"; - Storable storable = new TestStorable(expectedString); - Storage storage = new Storage() - .setFileEditor(new TestStringStreamEditor()) - .setFormatter(new TestStringValueFormatter()); - - - storage.store(storable, testFile.toString()); - String actualString = Files.readString(testFile); - - - assertEquals(expectedString, actualString); - } - - @Test - @UseTestFile - public void storeStorableOfIntegerAtFilepath(Path testFile) throws IOException { - int expectedInteger = 10; - Storable storable = new TestStorable(expectedInteger); - Storage storage = new Storage() - .setFileEditor(new TestIntegerStreamEditor()) - .setFormatter(new TestIntegerValueFormatter()); - - - storage.store(storable, testFile.toString()); - int actualInteger = Integer.parseInt(Files.readString(testFile)); - - - assertEquals(expectedInteger, actualInteger); - } - - @Test - @UseTestFile - public void storeStorableOfStringAtFilepath_IncorrectFormatter(Path testFile) throws IOException { - String expectedString = "testString"; - Storable storable = new TestStorable(expectedString); - Storage storage = new Storage() - .setFileEditor(new TestStringStreamEditor()) - .setFormatter(new TestIntegerValueFormatter()); - - - assertThrows(StorageFormatMismatchException.class, () -> storage.store(storable, testFile.toString())); - } - - @Test - @UseTestFile - public void storeStorableOfStringAtFilepath_FileWriteError(Path testFile) throws IOException { - String expectedString = "testString"; - Storable storable = new TestStorable(expectedString); - Storage storage = new Storage() - .setFileEditor(new TestStringErrorStreamEditor()) - .setFormatter(new TestStringValueFormatter()); - - - StoreFailureException exception = assertThrows( - StoreFailureException.class, - () -> storage.store(storable, testFile.toString()) - ); - assertInstanceOf(ExampleException.class, exception.getCause()); - } - - @Test - @UseTestFile - public void storeStorableOfStringAtFilepath_FormatterError(Path testFile) throws IOException { - String expectedString = "testString"; - Storable storable = new TestStorable(expectedString); - Storage storage = new Storage() - .setFileEditor(new TestStringStreamEditor()) - .setFormatter(new TestStringErrorValueFormatter()); - - - FormattingException exception = assertThrows( - FormattingException.class, - () -> storage.store(storable, testFile.toString()) - ); - assertInstanceOf(ExampleException.class, exception.getCause()); - } - - @Test - @UseTestFile - public void storeStorageValueOfNull(Path testFile) throws IOException { - StorageValue storageValue = null; - Storage storage = new Storage() - .setTargetPath(testFile) - .setFileEditor(new TestStringStreamEditor()) - .setFormatter(new TestStringValueFormatter()); - - - assertThrows(NullStorageObjectException.class, () -> storage.store(storageValue)); - } - - @Test - @UseTestFile - public void storeStorageValueOfString(Path testFile) throws IOException { - String expectedString = "testString"; - StorageValue storageValue = new TestStorageValue(expectedString); - Storage storage = new Storage() - .setTargetPath(testFile) - .setFileEditor(new TestStringStreamEditor()) - .setFormatter(new TestStringValueFormatter()); - - - storage.store(storageValue); - String actualString = Files.readString(testFile); - - - assertEquals(expectedString, actualString); - } - - @Test - @UseTestFile - public void storeStorageValueOfInteger(Path testFile) throws IOException { - int expectedInteger = 10; - StorageValue storageValue = new TestStorageValue(expectedInteger); - Storage storage = new Storage() - .setTargetPath(testFile) - .setFileEditor(new TestIntegerStreamEditor()) - .setFormatter(new TestIntegerValueFormatter()); - - - storage.store(storageValue); - int actualInteger = Integer.parseInt(Files.readString(testFile)); - - - assertEquals(expectedInteger, actualInteger); - } - - @Test - @UseTestFile - public void storeStorageValueOfString_IncorrectFormatter(Path testFile) throws IOException { - String expectedString = "testString"; - StorageValue storageValue = new TestStorageValue(expectedString); - Storage storage = new Storage() - .setTargetPath(testFile) - .setFileEditor(new TestStringStreamEditor()) - .setFormatter(new TestIntegerValueFormatter()); - - - assertThrows(StorageFormatMismatchException.class, () -> storage.store(storageValue)); - } - - @Test - @UseTestFile - public void storeStorageValueOfString_FileWriteError(Path testFile) throws IOException { - String expectedString = "testString"; - StorageValue storageValue = new TestStorageValue(expectedString); - Storage storage = new Storage() - .setTargetPath(testFile) - .setFileEditor(new TestStringErrorStreamEditor()) - .setFormatter(new TestStringValueFormatter()); - - - StoreFailureException exception = assertThrows( - StoreFailureException.class, - () -> storage.store(storageValue) - ); - assertInstanceOf(ExampleException.class, exception.getCause()); - } - - @Test - @UseTestFile - public void storeStorageValueOfString_FormatterError(Path testFile) throws IOException { - String expectedString = "testString"; - StorageValue storageValue = new TestStorageValue(expectedString); - Storage storage = new Storage() - .setTargetPath(testFile) - .setFileEditor(new TestStringStreamEditor()) - .setFormatter(new TestStringErrorValueFormatter()); - - - FormattingException exception = assertThrows( - FormattingException.class, - () -> storage.store(storageValue) - ); - assertInstanceOf(ExampleException.class, exception.getCause()); - } - - @Test - @UseTestFile - void LoadStringInto(Path testFile) throws IOException { - String expectedString = "testString"; - TestLoadable loadable = new TestLoadable(); - Storage storage = new Storage() - .setTargetPath(testFile) - .setFormatter(new TestStringValueFormatter()) - .setFileEditor(new TestStringStreamEditor()); - - Files.writeString(testFile, expectedString); - - - storage.loadInto(loadable); - - - assertEquals(expectedString, loadable.getValue()); - } - - @Test - @UseTestFile - void LoadIntegerInto(Path testFile) throws IOException { - int expectedInteger = 10; - TestLoadable loadable = new TestLoadable(); - Storage storage = new Storage() - .setTargetPath(testFile) - .setFormatter(new TestIntegerValueFormatter()) - .setFileEditor(new TestIntegerStreamEditor()); - - Files.writeString(testFile, Integer.toString(expectedInteger)); - - - storage.loadInto(loadable); - - - assertEquals(expectedInteger, loadable.getValue()); - } - - @Test - @UseTestFile - public void LoadStringInto_IncorrectFormatter(Path testFile) throws IOException { - String expectedString = "testString"; - TestLoadable loadable = new TestLoadable(); - Storage storage = new Storage() - .setTargetPath(testFile) - .setFormatter(new TestStringValueFormatter()) - .setFileEditor(new TestIntegerStreamEditor()); - - Files.writeString(testFile, expectedString); - - - assertThrows(StorageFormatMismatchException.class, () -> storage.loadInto(loadable)); - } - - @Test - @UseTestFile - public void LoadStringInto_FileWriteError(Path testFile) throws IOException { - String expectedString = "testString"; - TestLoadable loadable = new TestLoadable(); - Storage storage = new Storage() - .setTargetPath(testFile) - .setFormatter(new TestStringValueFormatter()) - .setFileEditor(new TestStringErrorStreamEditor()); - - Files.writeString(testFile, expectedString); - - - LoadFailureException exception = assertThrows( - LoadFailureException.class, - () -> storage.loadInto(loadable) - ); - assertInstanceOf(ExampleException.class, exception.getCause()); - } - - @Test - @UseTestFile - public void LoadStringInto_FormatterError(Path testFile) throws IOException { - String expectedString = "testString"; - TestLoadable loadable = new TestLoadable(); - Storage storage = new Storage() - .setTargetPath(testFile) - .setFormatter(new TestStringErrorValueFormatter()) - .setFileEditor(new TestStringStreamEditor()); - - Files.writeString(testFile, expectedString); - - - FormatParseException exception = assertThrows( - FormatParseException.class, - () -> storage.loadInto(loadable) - ); - assertInstanceOf(ExampleException.class, exception.getCause()); - } - - @Test - @UseTestFile - public void loadStringFromTargetPath(Path testFile) throws IOException { - String testString = "testString"; - Storage storage = new Storage() - .setTargetPath(testFile) - .setFileEditor(new TestStringStreamEditor()) - .setFormatter(new TestStringValueFormatter()); - - Files.writeString(testFile, testString); - - - StorageValue actualStorageValue = storage.load(); - - - StorageValue expectedStorageValue = new TestStorageValue(testString); - assertEquals(expectedStorageValue, actualStorageValue); - } - - @Test - @UseTestFile - public void loadIntegerFromTargetPath(Path testFile) throws IOException { - int testInteger = 10; - Storage storage = new Storage() - .setTargetPath(testFile) - .setFileEditor(new TestIntegerStreamEditor()) - .setFormatter(new TestIntegerValueFormatter()); - - Files.writeString(testFile, Integer.toString(testInteger)); - - - StorageValue actualStorageValue = storage.load(); - - - StorageValue expectedStorageValue = new TestStorageValue(testInteger); - assertEquals(expectedStorageValue, actualStorageValue); - } - - @Test - @UseTestFile - public void loadStringFromTargetPath_IncorrectFormatter(Path testFile) throws IOException { - String testString = "testString"; - Storage storage = new Storage() - .setTargetPath(testFile) - .setFileEditor(new TestStringStreamEditor()) - .setFormatter(new TestIntegerValueFormatter()); - - Files.writeString(testFile, testString); - - - assertThrows(StorageFormatMismatchException.class, () -> storage.load()); - } - - @Test - @UseTestFile - public void loadStringFromTargetPath_FileWriteError(Path testFile) throws IOException { - String testString = "testString"; - Storage storage = new Storage() - .setTargetPath(testFile) - .setFileEditor(new TestStringErrorStreamEditor()) - .setFormatter(new TestStringValueFormatter()); - - Files.writeString(testFile, testString); - - - LoadFailureException exception = assertThrows( - LoadFailureException.class, - () -> storage.load() - ); - assertInstanceOf(ExampleException.class, exception.getCause()); - } - - @Test - @UseTestFile - public void loadStringFromTargetPath_FormatterError(Path testFile) throws IOException { - String testString = "testString"; - Storage storage = new Storage() - .setTargetPath(testFile) - .setFileEditor(new TestStringStreamEditor()) - .setFormatter(new TestStringErrorValueFormatter()); - - Files.writeString(testFile, testString); - - - FormatParseException exception = assertThrows( - FormatParseException.class, - () -> storage.load() - ); - assertInstanceOf(ExampleException.class, exception.getCause()); - } - - // TODO: Implement and test LoadableBy -} diff --git a/src/test/java/storage/storage_values/StorageValueTests.java b/src/test/java/storage/storage_values/StorageValueTests.java deleted file mode 100644 index 522e879..0000000 --- a/src/test/java/storage/storage_values/StorageValueTests.java +++ /dev/null @@ -1,54 +0,0 @@ -package storage.storage_values; - -import static org.junit.jupiter.api.Assertions.*; -import org.junit.jupiter.api.Test; - -public class StorageValueTests { - - @Test - public void nonEquality() { - String strValue = "0"; - Integer intValue = Integer.parseInt(strValue); - - StringStorageValue strStorage = new StringStorageValue(strValue); - IntegerStorageValue intStorage = new IntegerStorageValue(intValue); - - assertNotEquals(strStorage, intStorage); - } - - @Test - public void equality() { - String strValue = "0"; - Integer intValue = Integer.parseInt(strValue); - - StringStorageValue strStorage1 = new StringStorageValue(strValue); - IntegerStorageValue intStorage1 = new IntegerStorageValue(intValue); - - StringStorageValue strStorage2 = new StringStorageValue(strValue); - IntegerStorageValue intStorage2 = new IntegerStorageValue(intValue); - - assertEquals(strStorage1, strStorage2); - assertEquals(intStorage1, intStorage2); - } - - @Test - public void nullNonEquality() { - String strValue = null; - Integer intValue = null; - - StringStorageValue strStorage = new StringStorageValue(strValue); - IntegerStorageValue intStorage = new IntegerStorageValue(intValue); - - assertNotEquals(strStorage, intStorage); - } - - @Test - public void nullEquality() { - String strValue = null; - - StringStorageValue strStorage1 = new StringStorageValue(strValue); - StringStorageValue strStorage2 = new StringStorageValue(strValue); - - assertEquals(strStorage1, strStorage2); - } -} diff --git a/src/test/java/storage/value_formatters/ValueToStringFormatterTests.java b/src/test/java/storage/value_formatters/ValueToStringFormatterTests.java deleted file mode 100644 index 2aabfc3..0000000 --- a/src/test/java/storage/value_formatters/ValueToStringFormatterTests.java +++ /dev/null @@ -1,718 +0,0 @@ -package storage.value_formatters; -import static org.junit.jupiter.api.Assertions.*; - -import java.util.*; -import org.junit.jupiter.api.Test; - -import helper_objects.*; -import storage.storage_value_adapters.UnsupportedValueException; -import storage.storage_values.*; - -public class ValueToStringFormatterTests { - - //NOTE: No exceptions for incorrectly formatted data were made. This will be left to more sophisticated ValueFormatters - - //#region parsing - - @Test - public void parseFormattedString() { - String str = "Java"; - String formattedString = "\"" + str + "\""; - ValueFormatter valueFormatter = new ValueToStringFormatter(); - - StorageValue actualValue = valueFormatter.parse(formattedString); - - StringStorageValue expectedValue = new StringStorageValue(str); - assertEquals(expectedValue, actualValue); - } - - @Test - public void parseUnformattedString() { - String str = "Java"; - ValueFormatter valueFormatter = new ValueToStringFormatter(); - - assertThrows(UnsupportedValueException.class, () -> valueFormatter.parse(str)); - } - - @Test - public void parseFormattedInteger() { - Integer integer = 10; - String formattedString = Integer.toString(integer); - ValueFormatter valueFormatter = new ValueToStringFormatter(); - - StorageValue actualValue = valueFormatter.parse(formattedString); - - IntegerStorageValue expectedValue = new IntegerStorageValue(10); - assertEquals(expectedValue, actualValue); - } - - @Test - public void parseFormattedEmptyMap() { - String formattedString1 = "{}"; - String formattedString2 = "{\n}"; - ValueFormatter valueFormatter = new ValueToStringFormatter(); - - StorageValue actualValue1 = valueFormatter.parse(formattedString1); - StorageValue actualValue2 = valueFormatter.parse(formattedString2); - - MapStorageValue expectedValue = new MapStorageValue(Map.of()); - assertEquals(expectedValue, actualValue1); - assertEquals(expectedValue, actualValue2); - } - - @Test - public void parseFormattedSimpleMap() { - Tuple testString = new NotEmptyTuple<>("testStringKey", "testString"); - Tuple testInt = new NotEmptyTuple<>("testIntKey", 30); - String formattedString1 = "{\n" + - " \"" + testString.value1() + "\":\"" + testString.value2() + "\",\n" + - " \"" + testInt.value1() + "\":" + testInt.value2() + "\n" + - "}"; - ValueFormatter valueFormatter = new ValueToStringFormatter(); - - StorageValue actualValue1 = valueFormatter.parse(formattedString1); - - MapStorageValue expectedValue = new MapStorageValue(Map.ofEntries( - Map.entry(testString.value1(), new StringStorageValue(testString.value2())), - Map.entry(testInt.value1(), new IntegerStorageValue(testInt.value2())) - )); - assertEquals(expectedValue, actualValue1); - } - - @Test - public void parseNestedMap() { - Tuple testString1 = new NotEmptyTuple<>("testStringKey1", "testString1"); - Tuple testString2 = new NotEmptyTuple<>("testStringKey2", "testString2"); - Tuple testInt = new NotEmptyTuple<>("testIntKey", 30); - String formattedString1 = "{\n" + - " \"innerMap\":{\n" + - " \"" + testString1.value1() + "\":\"" + testString1.value2() + "\",\n" + - " \"" + testInt.value1() + "\":" + testInt.value2() + "\n" + - " },\n" + - " \"" + testString2.value1() + "\":\"" + testString2.value2() + "\"\n" + - "}"; - ValueFormatter valueFormatter = new ValueToStringFormatter(); - - StorageValue actualValue1 = valueFormatter.parse(formattedString1); - - MapStorageValue expectedValue = new MapStorageValue(Map.ofEntries( - Map.entry("innerMap", new MapStorageValue(Map.ofEntries( - Map.entry(testString1.value1(), new StringStorageValue(testString1.value2())), - Map.entry(testInt.value1(), new IntegerStorageValue(testInt.value2())) - ))), - Map.entry(testString2.value1(), new StringStorageValue(testString2.value2())) - )); - assertEquals(expectedValue, actualValue1); - } - - @Test - public void parseFormattedEmptyList() { - String formattedString1 = "[]"; - String formattedString2 = "[\n]"; - ValueFormatter valueFormatter = new ValueToStringFormatter(); - - StorageValue actualValue1 = valueFormatter.parse(formattedString1); - StorageValue actualValue2 = valueFormatter.parse(formattedString2); - - ListStorageValue expectedValue = new ListStorageValue(List.of()); - assertEquals(expectedValue, actualValue1); - assertEquals(expectedValue, actualValue2); - } - - @Test - public void parseFormattedSimpleList() { - String testString1 = "testString1"; - String testString2 = "testString2"; - Integer testInt = 30; - String formattedString1 = "[\n" + - " \"" + testString1 + "\",\n" + - " \"" + testString2 + "\",\n" + - " " + testInt + "\n" + - "]"; - ValueFormatter valueFormatter = new ValueToStringFormatter(); - - StorageValue actualValue1 = valueFormatter.parse(formattedString1); - - ListStorageValue expectedValue = new ListStorageValue(List.of( - new StringStorageValue(testString1), - new StringStorageValue(testString2), - new IntegerStorageValue(testInt) - )); - assertEquals(expectedValue, actualValue1); - } - - @Test - public void parseFormattedNestedList() { - String testString1 = "testString1"; - String testString2 = "testString2"; - Integer testInt = 30; - String formattedString1 = "[\n" + - " [\n" + - " \"" + testString1 + "\",\n" + - " \"" + testString2 + "\"\n" + - " ],\n" + - " " + testInt + "\n" + - "]"; - ValueFormatter valueFormatter = new ValueToStringFormatter(); - - StorageValue actualValue1 = valueFormatter.parse(formattedString1); - - ListStorageValue expectedValue = new ListStorageValue(List.of( - new ListStorageValue(List.of( - new StringStorageValue(testString1), - new StringStorageValue(testString2) - )), - new IntegerStorageValue(testInt) - )); - assertEquals(expectedValue, actualValue1); - } - - @Test - public void parseFormattedNestedMapAndList() { - Tuple> testList = new NotEmptyTuple<>( - "testListKey1", - List.of( - "testString1", - "testString2" - ) - ); - Tuple testInt = new NotEmptyTuple<>("testIntKey", 30); - String formattedString1 = "{\n" + - " \"" + testList.value1() + "\":[\n" + - " \"" + testList.value2().get(0) + "\",\n" + - " \"" + testList.value2().get(1)+ "\",\n" + - " ],\n" + - " \"" + testInt.value1() + "\":" + testInt.value2() + "\n" + - "}"; - ValueFormatter valueFormatter = new ValueToStringFormatter(); - - StorageValue actualValue1 = valueFormatter.parse(formattedString1); - - MapStorageValue expectedValue = new MapStorageValue(Map.ofEntries( - Map.entry(testList.value1(), new ListStorageValue(List.of( - new StringStorageValue(testList.value2().get(0)), - new StringStorageValue(testList.value2().get(1)) - ))), - Map.entry(testInt.value1(), new IntegerStorageValue(testInt.value2())) - )); - assertEquals(expectedValue, actualValue1); - } - - @Test - public void parseFormattedNestedListAndMap() { - Tuple testString1 = new NotEmptyTuple<>("testStringKey1", "testString1"); - Tuple testInt1 = new NotEmptyTuple<>("testStringKey2", 50); - Integer testInt2 = 30; - String formattedString1 = "[\n" + - " {\n" + - " \"" + testString1.value1() + "\":\"" + testString1.value2() + "\",\n" + - " \"" + testInt1.value1() + "\":" + testInt1.value2() + "\n" + - " },\n" + - " " + testInt2 + "\n" + - "]"; - ValueFormatter valueFormatter = new ValueToStringFormatter(); - - StorageValue actualValue1 = valueFormatter.parse(formattedString1); - - ListStorageValue expectedValue = new ListStorageValue(List.of( - new MapStorageValue(Map.ofEntries( - Map.entry(testString1.value1(), new StringStorageValue(testString1.value2())), - Map.entry(testInt1.value1(), new IntegerStorageValue(testInt1.value2())) - )), - new IntegerStorageValue(testInt2) - )); - assertEquals(expectedValue, actualValue1); - } - - @Test - public void parseFormattedComplexObjectCombination() { - String formattedString = "{\n" + - " \"key1\":[" + - " \"string1\"," + - " [" + - " 0," + - " \"string2\"" + - " ]" + - " ]," + - " \"key2\":[" + - " \"string3\"," + - " [" + - " 1," + - " \"string4\"" + - " ]" + - " ]," + - " \"key3\":[" + - " \"string5\"," + - " [" + - " 0," + - " \"\"" + - " ]" + - " ]" + - "}"; - ValueFormatter valueFormatter = new ValueToStringFormatter(); - - StorageValue actualValue1 = valueFormatter.parse(formattedString); - - MapStorageValue expectedValue = new MapStorageValue(Map.ofEntries( - Map.entry("key1", new ListStorageValue(List.of( - new StringStorageValue("string1"), - new ListStorageValue(List.of( - new IntegerStorageValue(0), - new StringStorageValue("string2") - )) - ))), - Map.entry("key2", new ListStorageValue(List.of( - new StringStorageValue("string3"), - new ListStorageValue(List.of( - new IntegerStorageValue(1), - new StringStorageValue("string4") - )) - ))), - Map.entry("key3", new ListStorageValue(List.of( - new StringStorageValue("string5"), - new ListStorageValue(List.of( - new IntegerStorageValue(0), - new StringStorageValue("") - )) - ))) - )); - assertEquals(expectedValue, actualValue1); - } - - //#endregion - - //#region formatting - - @Test - public void formatString() { - String str = "Java"; - StringStorageValue stringValue = new StringStorageValue(str); - ValueFormatter valueFormatter = new ValueToStringFormatter(); - - String actualValue = valueFormatter.format(stringValue); - - String expectedValue = "\"" + str + "\""; - assertEquals(expectedValue, actualValue); - } - - @Test - public void formatInteger() { - Integer integer = 10; - IntegerStorageValue integerValue = new IntegerStorageValue(10); - ValueFormatter valueFormatter = new ValueToStringFormatter(); - - String actualValue = valueFormatter.format(integerValue); - - String expectedValue = Integer.toString(integer); - assertEquals(expectedValue, actualValue); - } - - @Test - public void formatEmptyMap() { - MapStorageValue mapValue = new MapStorageValue(Map.of()); - ValueFormatter valueFormatter = new ValueToStringFormatter(); - - String actualValue = valueFormatter.format(mapValue); - - String expectedValue = "{}"; - assertEquals(expectedValue, actualValue); - } - - @Test - public void formatSimpleMap() { - Tuple testString = new NotEmptyTuple<>("testStringKey", "testString"); - Tuple testInt = new NotEmptyTuple<>("testIntKey", 30); - MapStorageValue mapValue = new MapStorageValue(Map.ofEntries( - Map.entry(testString.value1(), new StringStorageValue(testString.value2())), - Map.entry(testInt.value1(), new IntegerStorageValue(testInt.value2())) - )); - ValueFormatter valueFormatter = new ValueToStringFormatter(); - - String actualValue = valueFormatter.format(mapValue); - - assertTrue(List.of( - "{\n" + - " \"" + testString.value1() + "\":\"" + testString.value2() + "\",\n" + - " \"" + testInt.value1() + "\":" + testInt.value2() + "\n" + - "}", - - "{\n" + - " \"" + testInt.value1() + "\":" + testInt.value2() + ",\n" + - " \"" + testString.value1() + "\":\"" + testString.value2() + "\"\n" + - "}" - ) - .contains(actualValue) - ); - } - - @Test - public void formatNestedMap() { - Tuple testString1 = new NotEmptyTuple<>("testStringKey1", "testString1"); - Tuple testString2 = new NotEmptyTuple<>("testStringKey2", "testString2"); - Tuple testInt = new NotEmptyTuple<>("testIntKey", 30); - MapStorageValue mapValue = new MapStorageValue(Map.ofEntries( - Map.entry("innerMap", new MapStorageValue(Map.ofEntries( - Map.entry(testString1.value1(), new StringStorageValue(testString1.value2())), - Map.entry(testInt.value1(), new IntegerStorageValue(testInt.value2())) - ))), - Map.entry(testString2.value1(), new StringStorageValue(testString2.value2())) - )); - ValueFormatter valueFormatter = new ValueToStringFormatter(); - - String actualValue = valueFormatter.format(mapValue); - - assertTrue(List.of( - "{\n" + - " \"innerMap\":{\n" + - " \"" + testString1.value1() + "\":\"" + testString1.value2() + "\",\n" + - " \"" + testInt.value1() + "\":" + testInt.value2() + "\n" + - " },\n" + - " \"" + testString2.value1() + "\":\"" + testString2.value2() + "\"\n" + - "}", - - "{\n" + - " \"innerMap\":{\n" + - " \"" + testInt.value1() + "\":" + testInt.value2() + ",\n" + - " \"" + testString1.value1() + "\":\"" + testString1.value2() + "\"\n" + - " },\n" + - " \"" + testString2.value1() + "\":\"" + testString2.value2() + "\"\n" + - "}", - - "{\n" + - " \"" + testString2.value1() + "\":\"" + testString2.value2() + "\",\n" + - " \"innerMap\":{\n" + - " \"" + testString1.value1() + "\":\"" + testString1.value2() + "\",\n" + - " \"" + testInt.value1() + "\":" + testInt.value2() + "\n" + - " }\n" + - "}", - - "{\n" + - " \"" + testString2.value1() + "\":\"" + testString2.value2() + "\",\n" + - " \"innerMap\":{\n" + - " \"" + testInt.value1() + "\":" + testInt.value2() + ",\n" + - " \"" + testString1.value1() + "\":\"" + testString1.value2() + "\"\n" + - " }\n" + - "}" - ) - .contains(actualValue) - ); - } - - @Test - public void formatEmptyList() { - ListStorageValue mapValue = new ListStorageValue(List.of()); - ValueFormatter valueFormatter = new ValueToStringFormatter(); - - String actualValue = valueFormatter.format(mapValue); - - String expectedValue = "[]"; - assertEquals(expectedValue, actualValue); - } - - @Test - public void formatSimpleList() { - String testString1 = "testString1"; - String testString2 = "testString2"; - Integer testInt = 30; - ListStorageValue listValue = new ListStorageValue(List.of( - new StringStorageValue(testString1), - new StringStorageValue(testString2), - new IntegerStorageValue(testInt) - )); - ValueFormatter valueFormatter = new ValueToStringFormatter(); - - String actualValue = valueFormatter.format(listValue); - - String expectedValue = "[\n" + - " \"" + testString1 + "\",\n" + - " \"" + testString2 + "\",\n" + - " " + testInt + "\n" + - "]"; - assertEquals(expectedValue, actualValue); - } - - @Test - public void formatNestedList() { - String testString1 = "testString1"; - String testString2 = "testString2"; - Integer testInt = 30; - ListStorageValue listValue = new ListStorageValue(List.of( - new ListStorageValue(List.of( - new StringStorageValue(testString1), - new StringStorageValue(testString2) - )), - new IntegerStorageValue(testInt) - )); - ValueFormatter valueFormatter = new ValueToStringFormatter(); - - String actualValue = valueFormatter.format(listValue); - - String expectedValue = "[\n" + - " [\n" + - " \"" + testString1 + "\",\n" + - " \"" + testString2 + "\"\n" + - " ],\n" + - " " + testInt + "\n" + - "]"; - assertEquals(expectedValue, actualValue); - } - - @Test - public void formatNestedMapAndList() { - Tuple> testList = new NotEmptyTuple<>( - "testListKey", - List.of( - "testString1", - "testString2" - ) - ); - Tuple testInt = new NotEmptyTuple<>("testIntKey", 30); - MapStorageValue mapValue = new MapStorageValue(Map.ofEntries( - Map.entry(testList.value1(), new ListStorageValue(List.of( - new StringStorageValue(testList.value2().get(0)), - new StringStorageValue(testList.value2().get(1)) - ))), - Map.entry(testInt.value1(), new IntegerStorageValue(testInt.value2())) - )); - ValueFormatter valueFormatter = new ValueToStringFormatter(); - - String actualValue = valueFormatter.format(mapValue); - - assertTrue(List.of( - "{\n" + - " \"" + testList.value1() + "\":[\n" + - " \"" + testList.value2().get(0) + "\",\n" + - " \"" + testList.value2().get(1)+ "\"\n" + - " ],\n" + - " \"" + testInt.value1() + "\":" + testInt.value2() + "\n" + - "}", - - "{\n" + - " \"" + testInt.value1() + "\":" + testInt.value2() + ",\n" + - " \"" + testList.value1() + "\":[\n" + - " \"" + testList.value2().get(0) + "\",\n" + - " \"" + testList.value2().get(1)+ "\"\n" + - " ]\n" + - "}" - ) - .contains(actualValue) - ); - } - - @Test - public void formatNestedListAndMap() { - Tuple testString1 = new NotEmptyTuple<>("testStringKey1", "testString1"); - Tuple testInt1 = new NotEmptyTuple<>("testStringKey2", 50); - Integer testInt2 = 30; - ListStorageValue listValue = new ListStorageValue(List.of( - new MapStorageValue(Map.ofEntries( - Map.entry(testString1.value1(), new StringStorageValue(testString1.value2())), - Map.entry(testInt1.value1(), new IntegerStorageValue(testInt1.value2())) - )), - new IntegerStorageValue(testInt2) - )); - ValueFormatter valueFormatter = new ValueToStringFormatter(); - - String actualValue = valueFormatter.format(listValue); - - assertTrue(List.of( - "[\n" + - " {\n" + - " \"" + testString1.value1() + "\":\"" + testString1.value2() + "\",\n" + - " \"" + testInt1.value1() + "\":" + testInt1.value2() + "\n" + - " },\n" + - " " + testInt2 + "\n" + - "]", - - "[\n" + - " {\n" + - " \"" + testInt1.value1() + "\":" + testInt1.value2() + ",\n" + - " \"" + testString1.value1() + "\":\"" + testString1.value2() + "\"\n" + - " },\n" + - " " + testInt2 + "\n" + - "]" - ) - .contains(actualValue) - ); - } - - @Test - public void formatComplexObjectCombination() { - MapStorageValue mapValue = new MapStorageValue(Map.ofEntries( - Map.entry("key1", new ListStorageValue(List.of( - new StringStorageValue("string1"), - new ListStorageValue(List.of( - new IntegerStorageValue(0), - new StringStorageValue("string2") - )) - ))), - Map.entry("key2", new ListStorageValue(List.of( - new StringStorageValue("string3"), - new ListStorageValue(List.of( - new IntegerStorageValue(1), - new StringStorageValue("string4") - )) - ))), - Map.entry("key3", new ListStorageValue(List.of( - new StringStorageValue("string5"), - new ListStorageValue(List.of( - new IntegerStorageValue(0), - new StringStorageValue("") - )) - ))) - )); - ValueFormatter valueFormatter = new ValueToStringFormatter(); - - String actualValue = valueFormatter.format(mapValue); - - assertTrue(List.of( - "{\n" + - " \"key1\":[\n" + - " \"string1\",\n" + - " [\n" + - " 0,\n" + - " \"string2\"\n" + - " ]\n" + - " ],\n" + - " \"key2\":[\n" + - " \"string3\",\n" + - " [\n" + - " 1,\n" + - " \"string4\"\n" + - " ]\n" + - " ],\n" + - " \"key3\":[\n" + - " \"string5\",\n" + - " [\n" + - " 0,\n" + - " \"\"\n" + - " ]\n" + - " ]\n" + - "}", - - "{\n" + - " \"key2\":[\n" + - " \"string3\",\n" + - " [\n" + - " 1,\n" + - " \"string4\"\n" + - " ]\n" + - " ],\n" + - " \"key1\":[\n" + - " \"string1\",\n" + - " [\n" + - " 0,\n" + - " \"string2\"\n" + - " ]\n" + - " ],\n" + - " \"key3\":[\n" + - " \"string5\",\n" + - " [\n" + - " 0,\n" + - " \"\"\n" + - " ]\n" + - " ]\n" + - "}", - - "{\n" + - " \"key3\":[\n" + - " \"string5\",\n" + - " [\n" + - " 0,\n" + - " \"\"\n" + - " ]\n" + - " ],\n" + - " \"key1\":[\n" + - " \"string1\",\n" + - " [\n" + - " 0,\n" + - " \"string2\"\n" + - " ]\n" + - " ],\n" + - " \"key2\":[\n" + - " \"string3\",\n" + - " [\n" + - " 1,\n" + - " \"string4\"\n" + - " ]\n" + - " ]\n" + - "}", - - "{\n" + - " \"key1\":[\n" + - " \"string1\",\n" + - " [\n" + - " 0,\n" + - " \"string2\"\n" + - " ]\n" + - " ],\n" + - " \"key3\":[\n" + - " \"string5\",\n" + - " [\n" + - " 0,\n" + - " \"\"\n" + - " ]\n" + - " ],\n" + - " \"key2\":[\n" + - " \"string3\",\n" + - " [\n" + - " 1,\n" + - " \"string4\"\n" + - " ]\n" + - " ]\n" + - "}", - - "{\n" + - " \"key2\":[\n" + - " \"string3\",\n" + - " [\n" + - " 1,\n" + - " \"string4\"\n" + - " ]\n" + - " ],\n" + - " \"key3\":[\n" + - " \"string5\",\n" + - " [\n" + - " 0,\n" + - " \"\"\n" + - " ]\n" + - " ],\n" + - " \"key1\":[\n" + - " \"string1\",\n" + - " [\n" + - " 0,\n" + - " \"string2\"\n" + - " ]\n" + - " ]\n" + - "}", - - "{\n" + - " \"key3\":[\n" + - " \"string5\",\n" + - " [\n" + - " 0,\n" + - " \"\"\n" + - " ]\n" + - " ],\n" + - " \"key2\":[\n" + - " \"string3\",\n" + - " [\n" + - " 1,\n" + - " \"string4\"\n" + - " ]\n" + - " ],\n" + - " \"key1\":[\n" + - " \"string1\",\n" + - " [\n" + - " 0,\n" + - " \"string2\"\n" + - " ]\n" + - " ]\n" + - "}" - ) - .contains(actualValue) - ); - } - - //#endregion -} diff --git a/src/test/java/syntax_analysis/CLR1ParserTests.java b/src/test/java/syntax_analysis/CLR1ParserTests.java index 1d9f101..1a5ffcb 100644 --- a/src/test/java/syntax_analysis/CLR1ParserTests.java +++ b/src/test/java/syntax_analysis/CLR1ParserTests.java @@ -7,7 +7,6 @@ import grammar_objects.*; import syntax_analysis.grammar_structure_creation.*; import syntax_analysis.parsing.*; -import syntax_analysis.parsing.parsers.CLR1Parser; import test_aids.*; import test_aids.test_grammars.BasicCLR1TestGrammar; import test_aids.test_grammars.BasicIdentifierTestGrammar; diff --git a/src/test/java/syntax_analysis/LR0ParserTests.java b/src/test/java/syntax_analysis/LR0ParserTests.java index 95c067e..c9504c7 100644 --- a/src/test/java/syntax_analysis/LR0ParserTests.java +++ b/src/test/java/syntax_analysis/LR0ParserTests.java @@ -7,7 +7,6 @@ import grammar_objects.*; import syntax_analysis.grammar_structure_creation.*; import syntax_analysis.parsing.*; -import syntax_analysis.parsing.parsers.LR0Parser; import test_aids.*; import test_aids.test_grammars.BasicIdentifierTestGrammar; import test_aids.test_grammars.SelfReferentialTestGrammar; diff --git a/src/test/java/syntax_analysis/SLR1ParserTests.java b/src/test/java/syntax_analysis/SLR1ParserTests.java index c89e4b0..326106f 100644 --- a/src/test/java/syntax_analysis/SLR1ParserTests.java +++ b/src/test/java/syntax_analysis/SLR1ParserTests.java @@ -7,7 +7,6 @@ import grammar_objects.*; import syntax_analysis.grammar_structure_creation.*; import syntax_analysis.parsing.*; -import syntax_analysis.parsing.parsers.SLR1Parser; import test_aids.*; import test_aids.test_grammars.BasicIdentifierTestGrammar; import test_aids.test_grammars.BasicSLR1TestGrammar; diff --git a/src/test/java/test_aids/exceptions/ExampleException.java b/src/test/java/test_aids/exceptions/ExampleException.java deleted file mode 100644 index 74ec301..0000000 --- a/src/test/java/test_aids/exceptions/ExampleException.java +++ /dev/null @@ -1,8 +0,0 @@ -package test_aids.exceptions; - -public class ExampleException extends RuntimeException { - - public ExampleException() { - super("Example exception"); - } -} diff --git a/src/test/java/test_aids/storage_entities/IncorrectlyFormedLoader.java b/src/test/java/test_aids/storage_entities/IncorrectlyFormedLoader.java deleted file mode 100644 index f5450e3..0000000 --- a/src/test/java/test_aids/storage_entities/IncorrectlyFormedLoader.java +++ /dev/null @@ -1,17 +0,0 @@ -package test_aids.storage_entities; - -import component_construction.storable.dynamic_loading.Loader; -import storage.storage_values.StorageValue; - -public class IncorrectlyFormedLoader implements Loader { - - private IncorrectlyFormedLoader() { - // Exists only to prevent empty constructor call - } - - @Override - public Boolean produce(StorageValue loadValue) { - return true; - } - -} diff --git a/src/test/java/test_aids/storage_entities/TestDynamicObject.java b/src/test/java/test_aids/storage_entities/TestDynamicObject.java deleted file mode 100644 index dc3223c..0000000 --- a/src/test/java/test_aids/storage_entities/TestDynamicObject.java +++ /dev/null @@ -1,97 +0,0 @@ -package test_aids.storage_entities; - -public class TestDynamicObject { - public int a; - public String b; - - public TestDynamicObject() {} - - public TestDynamicObject(int a) { - this.a = a; - } - - public TestDynamicObject(String b) { - this.b = b; - } - - public TestDynamicObject(int a, String b) { - this.a = a; - this.b = b; - } - - @Override - public boolean equals(Object obj) { - if (!(obj instanceof TestDynamicObject)) return false; - - TestDynamicObject other = (TestDynamicObject)obj; - - if (this.a != other.a) return false; - if (this.b != other.b) return false; - - return true; - } - - public class InnerTestDynamicObject { - public int c; - public String d; - - public InnerTestDynamicObject() {} - - public InnerTestDynamicObject(int c) { - this.c = c; - } - - public InnerTestDynamicObject(String d) { - this.d = d; - } - - public InnerTestDynamicObject(int c, String d) { - this.c = c; - this.d = d; - } - - @Override - public boolean equals(Object obj) { - if (!(obj instanceof InnerTestDynamicObject)) return false; - - InnerTestDynamicObject other = (InnerTestDynamicObject)obj; - - if (this.c != other.c) return false; - if (this.d != other.d) return false; - - return true; - } - } - - public static class StaticInnerTestDynamicObject { - public int e; - public String f; - - public StaticInnerTestDynamicObject() {} - - public StaticInnerTestDynamicObject(int e) { - this.e = e; - } - - public StaticInnerTestDynamicObject(String f) { - this.f = f; - } - - public StaticInnerTestDynamicObject(int e, String f) { - this.e = e; - this.f = f; - } - - @Override - public boolean equals(Object obj) { - if (!(obj instanceof StaticInnerTestDynamicObject)) return false; - - StaticInnerTestDynamicObject other = (StaticInnerTestDynamicObject)obj; - - if (this.e != other.e) return false; - if (this.f != other.f) return false; - - return true; - } - } -} diff --git a/src/test/java/test_aids/storage_entities/TestDynamicObjectSubclass.java b/src/test/java/test_aids/storage_entities/TestDynamicObjectSubclass.java deleted file mode 100644 index 4bb66a3..0000000 --- a/src/test/java/test_aids/storage_entities/TestDynamicObjectSubclass.java +++ /dev/null @@ -1,24 +0,0 @@ -package test_aids.storage_entities; - -public class TestDynamicObjectSubclass extends TestDynamicObject { - public boolean c; - - public TestDynamicObjectSubclass(int a, String b, boolean c) { - this.a = a; - this.b = b; - this.c = c; - } - - @Override - public boolean equals(Object obj) { - if (!(obj instanceof TestDynamicObjectSubclass)) return false; - - TestDynamicObjectSubclass other = (TestDynamicObjectSubclass)obj; - - if (this.a != other.a) return false; - if (this.b != other.b) return false; - if (this.c != other.c) return false; - - return true; - } -} diff --git a/src/test/java/test_aids/storage_entities/TestObject.java b/src/test/java/test_aids/storage_entities/TestObject.java deleted file mode 100644 index 5c58b7e..0000000 --- a/src/test/java/test_aids/storage_entities/TestObject.java +++ /dev/null @@ -1,3 +0,0 @@ -package test_aids.storage_entities; - -public record TestObject(int a) {} diff --git a/src/test/java/test_aids/storage_entities/TestObjectLoader.java b/src/test/java/test_aids/storage_entities/TestObjectLoader.java deleted file mode 100644 index f2846fd..0000000 --- a/src/test/java/test_aids/storage_entities/TestObjectLoader.java +++ /dev/null @@ -1,13 +0,0 @@ -package test_aids.storage_entities; - -import component_construction.storable.dynamic_loading.Loader; -import storage.storage_values.StorageValue; - -public class TestObjectLoader implements Loader { - - @Override - public TestObject produce(StorageValue loadValue) { - return new TestObject((int)loadValue.getValue()); - } - -} diff --git a/src/test/java/test_aids/storage_entities/custom_components/ConstructableStorableLexicalAnalyser.java b/src/test/java/test_aids/storage_entities/custom_components/ConstructableStorableLexicalAnalyser.java deleted file mode 100644 index 2ac6237..0000000 --- a/src/test/java/test_aids/storage_entities/custom_components/ConstructableStorableLexicalAnalyser.java +++ /dev/null @@ -1,34 +0,0 @@ -package test_aids.storage_entities.custom_components; - -import grammar_objects.Token; -import lexical_analysis.LexicalAnalyser; -import storage.external_interfaces.Storable; -import storage.storage_values.*; - -public class ConstructableStorableLexicalAnalyser implements LexicalAnalyser, Storable { - - public StorageValue loadedData = new NullStorageValue(); - - public ConstructableStorableLexicalAnalyser(StorageValue data) { - loadedData = data; - } - - @Override - public Token[] analyse(String sentence) { - throw new UnsupportedOperationException("Unimplemented method 'analyse'"); - } - - @Override - public StorageValue getStorageRepresentation() { - return loadedData; - } - - @Override - public boolean equals(Object obj) { - if (!(obj instanceof ConstructableStorableLexicalAnalyser)) return false; - - ConstructableStorableLexicalAnalyser other = (ConstructableStorableLexicalAnalyser)obj; - return this.loadedData.equals(other.loadedData); - } - -} diff --git a/src/test/java/test_aids/storage_entities/custom_components/NonConstructableLexicalAnalyser.java b/src/test/java/test_aids/storage_entities/custom_components/NonConstructableLexicalAnalyser.java deleted file mode 100644 index 1af1991..0000000 --- a/src/test/java/test_aids/storage_entities/custom_components/NonConstructableLexicalAnalyser.java +++ /dev/null @@ -1,28 +0,0 @@ -package test_aids.storage_entities.custom_components; - -import grammar_objects.Token; -import lexical_analysis.LexicalAnalyser; -import storage.storage_values.*; - -public class NonConstructableLexicalAnalyser implements LexicalAnalyser { - - public StorageValue loadedData = new NullStorageValue(); - - public NonConstructableLexicalAnalyser() {} - - public NonConstructableLexicalAnalyser(int a, String b) {} - - @Override - public Token[] analyse(String sentence) { - throw new UnsupportedOperationException("Unimplemented method 'analyse'"); - } - - @Override - public boolean equals(Object obj) { - if (!(obj instanceof NonConstructableLexicalAnalyser)) return false; - - NonConstructableLexicalAnalyser other = (NonConstructableLexicalAnalyser)obj; - return this.loadedData.equals(other.loadedData); - } - -} diff --git a/src/test/java/test_aids/storage_entities/custom_components/TestCustomCodeGenerator.java b/src/test/java/test_aids/storage_entities/custom_components/TestCustomCodeGenerator.java deleted file mode 100644 index 71c7d8b..0000000 --- a/src/test/java/test_aids/storage_entities/custom_components/TestCustomCodeGenerator.java +++ /dev/null @@ -1,13 +0,0 @@ -package test_aids.storage_entities.custom_components; - -import code_generation.CodeGenerator; -import syntax_analysis.parsing.ParseState; - -public class TestCustomCodeGenerator implements CodeGenerator { - - @Override - public String generate(ParseState parseRoot) { - throw new UnsupportedOperationException("Unimplemented method 'generate'"); - } - -} diff --git a/src/test/java/test_aids/storage_entities/custom_components/TestCustomFalseLexicalAnalyser.java b/src/test/java/test_aids/storage_entities/custom_components/TestCustomFalseLexicalAnalyser.java deleted file mode 100644 index 03c6bea..0000000 --- a/src/test/java/test_aids/storage_entities/custom_components/TestCustomFalseLexicalAnalyser.java +++ /dev/null @@ -1,14 +0,0 @@ -package test_aids.storage_entities.custom_components; - -import grammar_objects.Token; - -/** - * Identical class to {@code TestCustomLexicalAnalyser} but does not implement {@code LexicalAnalyser} - */ -public class TestCustomFalseLexicalAnalyser { - - public Token[] analyse(String sentence) { - throw new UnsupportedOperationException("Unimplemented method 'analyse'"); - } - -} diff --git a/src/test/java/test_aids/storage_entities/custom_components/TestCustomLexicalAnalyser.java b/src/test/java/test_aids/storage_entities/custom_components/TestCustomLexicalAnalyser.java deleted file mode 100644 index 43c1319..0000000 --- a/src/test/java/test_aids/storage_entities/custom_components/TestCustomLexicalAnalyser.java +++ /dev/null @@ -1,13 +0,0 @@ -package test_aids.storage_entities.custom_components; - -import grammar_objects.Token; -import lexical_analysis.LexicalAnalyser; - -public class TestCustomLexicalAnalyser implements LexicalAnalyser { - - @Override - public Token[] analyse(String sentence) { - throw new UnsupportedOperationException("Unimplemented method 'analyse'"); - } - -} diff --git a/src/test/java/test_aids/storage_entities/custom_components/TestCustomSyntaxAnalyser.java b/src/test/java/test_aids/storage_entities/custom_components/TestCustomSyntaxAnalyser.java deleted file mode 100644 index 14a14a3..0000000 --- a/src/test/java/test_aids/storage_entities/custom_components/TestCustomSyntaxAnalyser.java +++ /dev/null @@ -1,14 +0,0 @@ -package test_aids.storage_entities.custom_components; - -import grammar_objects.Token; -import syntax_analysis.SyntaxAnalyser; -import syntax_analysis.parsing.*; - -public class TestCustomSyntaxAnalyser implements SyntaxAnalyser { - - @Override - public ParseState analyse(Token[] inputTokens) throws ParseFailedException { - throw new UnsupportedOperationException("Unimplemented method 'analyse'"); - } - -} diff --git a/src/test/java/test_aids/storage_entities/custom_components/TestStorableCustomCodeGenerator.java b/src/test/java/test_aids/storage_entities/custom_components/TestStorableCustomCodeGenerator.java deleted file mode 100644 index 78e1963..0000000 --- a/src/test/java/test_aids/storage_entities/custom_components/TestStorableCustomCodeGenerator.java +++ /dev/null @@ -1,26 +0,0 @@ -package test_aids.storage_entities.custom_components; - -import code_generation.CodeGenerator; -import storage.external_interfaces.Storable; -import storage.storage_values.*; -import syntax_analysis.parsing.ParseState; - -public class TestStorableCustomCodeGenerator implements CodeGenerator, Storable { - - @Override - public String generate(ParseState parseRoot) { - throw new UnsupportedOperationException("Unimplemented method 'generate'"); - } - - @Override - public StorageValue getStorageRepresentation() { - return new StringStorageValue("TestStorableCustomCodeGenerator description"); - } - - @Override - public boolean equals(Object obj) { - if (!(obj instanceof TestStorableCustomCodeGenerator)) return false; - return true; - } - -} diff --git a/src/test/java/test_aids/storage_entities/custom_components/TestStorableCustomCompiler.java b/src/test/java/test_aids/storage_entities/custom_components/TestStorableCustomCompiler.java deleted file mode 100644 index d528957..0000000 --- a/src/test/java/test_aids/storage_entities/custom_components/TestStorableCustomCompiler.java +++ /dev/null @@ -1,16 +0,0 @@ -package test_aids.storage_entities.custom_components; - -import component_construction.storable.StorableCustomCompiler; -import test_aids.storage_entities.custom_components.loadable.*; - -public class TestStorableCustomCompiler extends StorableCustomCompiler { - - public TestStorableCustomCompiler() { - super( - new LoadableStorableCustomLexicalAnalyser(), - new LoadableStorableCustomSyntaxAnalyser(), - new LoadableStorableCustomCodeGenerator() - ); - } - -} diff --git a/src/test/java/test_aids/storage_entities/custom_components/TestStorableCustomLexicalAnalyser.java b/src/test/java/test_aids/storage_entities/custom_components/TestStorableCustomLexicalAnalyser.java deleted file mode 100644 index b8a1055..0000000 --- a/src/test/java/test_aids/storage_entities/custom_components/TestStorableCustomLexicalAnalyser.java +++ /dev/null @@ -1,26 +0,0 @@ -package test_aids.storage_entities.custom_components; - -import grammar_objects.Token; -import lexical_analysis.LexicalAnalyser; -import storage.external_interfaces.Storable; -import storage.storage_values.*; - -public class TestStorableCustomLexicalAnalyser implements LexicalAnalyser, Storable { - - @Override - public Token[] analyse(String sentence) { - throw new UnsupportedOperationException("Unimplemented method 'analyse'"); - } - - @Override - public StorageValue getStorageRepresentation() { - return new StringStorageValue("TestStorableCustomLexicalAnalyser description"); - } - - @Override - public boolean equals(Object obj) { - if (!(obj instanceof TestStorableCustomCodeGenerator)) return false; - return true; - } - -} diff --git a/src/test/java/test_aids/storage_entities/custom_components/TestStorableCustomSyntaxAnalyser.java b/src/test/java/test_aids/storage_entities/custom_components/TestStorableCustomSyntaxAnalyser.java deleted file mode 100644 index 2fef464..0000000 --- a/src/test/java/test_aids/storage_entities/custom_components/TestStorableCustomSyntaxAnalyser.java +++ /dev/null @@ -1,27 +0,0 @@ -package test_aids.storage_entities.custom_components; - -import grammar_objects.Token; -import storage.external_interfaces.Storable; -import storage.storage_values.*; -import syntax_analysis.SyntaxAnalyser; -import syntax_analysis.parsing.*; - -public class TestStorableCustomSyntaxAnalyser implements SyntaxAnalyser, Storable { - - @Override - public ParseState analyse(Token[] inputTokens) throws ParseFailedException { - throw new UnsupportedOperationException("Unimplemented method 'analyse'"); - } - - @Override - public StorageValue getStorageRepresentation() { - return new StringStorageValue("TestStorableCustomSyntaxAnalyser description"); - } - - @Override - public boolean equals(Object obj) { - if (!(obj instanceof TestStorableCustomCodeGenerator)) return false; - return true; - } - -} diff --git a/src/test/java/test_aids/storage_entities/custom_components/factories/TestCustomCodeGeneratorFactory.java b/src/test/java/test_aids/storage_entities/custom_components/factories/TestCustomCodeGeneratorFactory.java deleted file mode 100644 index d20edeb..0000000 --- a/src/test/java/test_aids/storage_entities/custom_components/factories/TestCustomCodeGeneratorFactory.java +++ /dev/null @@ -1,15 +0,0 @@ -package test_aids.storage_entities.custom_components.factories; - -import code_generation.CodeGenerator; -import component_construction.factories.code_generation.CodeGeneratorFactory; -import grammar_objects.RuleConvertor; -import test_aids.storage_entities.custom_components.*; - -public class TestCustomCodeGeneratorFactory implements CodeGeneratorFactory { - - @Override - public CodeGenerator produceGenerator(RuleConvertor ruleConvertor) { - return new TestCustomCodeGenerator(); - } - -} diff --git a/src/test/java/test_aids/storage_entities/custom_components/factories/TestCustomLexicalAnalyserFactory.java b/src/test/java/test_aids/storage_entities/custom_components/factories/TestCustomLexicalAnalyserFactory.java deleted file mode 100644 index 637f0f1..0000000 --- a/src/test/java/test_aids/storage_entities/custom_components/factories/TestCustomLexicalAnalyserFactory.java +++ /dev/null @@ -1,20 +0,0 @@ -package test_aids.storage_entities.custom_components.factories; - -import component_construction.factories.lexical_analysis.LexicalAnalyserFactory; -import lexical_analysis.DynamicTokenRegex; -import lexical_analysis.LexicalAnalyser; -import test_aids.storage_entities.custom_components.*; - -public class TestCustomLexicalAnalyserFactory implements LexicalAnalyserFactory { - - @Override - public LexicalAnalyser produceAnalyser( - String[] whitespaceDelimiters, - String[] stronglyReservedWords, - String[] weaklyReservedWords, - DynamicTokenRegex[] dynamicTokenRegex - ) { - return new TestCustomLexicalAnalyser(); - } - -} diff --git a/src/test/java/test_aids/storage_entities/custom_components/factories/TestCustomSyntaxAnalyserFactory.java b/src/test/java/test_aids/storage_entities/custom_components/factories/TestCustomSyntaxAnalyserFactory.java deleted file mode 100644 index a58e6f6..0000000 --- a/src/test/java/test_aids/storage_entities/custom_components/factories/TestCustomSyntaxAnalyserFactory.java +++ /dev/null @@ -1,15 +0,0 @@ -package test_aids.storage_entities.custom_components.factories; - -import component_construction.factories.syntax_analysis.SyntaxAnalyserFactory; -import grammar_objects.GrammarParts; -import syntax_analysis.SyntaxAnalyser; -import test_aids.storage_entities.custom_components.*; - -public class TestCustomSyntaxAnalyserFactory implements SyntaxAnalyserFactory { - - @Override - public SyntaxAnalyser produceAnalyser(GrammarParts parts) { - return new TestCustomSyntaxAnalyser(); - } - -} diff --git a/src/test/java/test_aids/storage_entities/custom_components/factories/TestStorableCustomCodeGeneratorFactory.java b/src/test/java/test_aids/storage_entities/custom_components/factories/TestStorableCustomCodeGeneratorFactory.java deleted file mode 100644 index abbe686..0000000 --- a/src/test/java/test_aids/storage_entities/custom_components/factories/TestStorableCustomCodeGeneratorFactory.java +++ /dev/null @@ -1,15 +0,0 @@ -package test_aids.storage_entities.custom_components.factories; - -import code_generation.CodeGenerator; -import component_construction.factories.code_generation.CodeGeneratorFactory; -import grammar_objects.RuleConvertor; -import test_aids.storage_entities.custom_components.TestStorableCustomCodeGenerator; - -public class TestStorableCustomCodeGeneratorFactory implements CodeGeneratorFactory { - - @Override - public CodeGenerator produceGenerator(RuleConvertor ruleConvertor) { - return new TestStorableCustomCodeGenerator(); - } - -} diff --git a/src/test/java/test_aids/storage_entities/custom_components/factories/TestStorableCustomLexicalAnalyserFactory.java b/src/test/java/test_aids/storage_entities/custom_components/factories/TestStorableCustomLexicalAnalyserFactory.java deleted file mode 100644 index e81ffb7..0000000 --- a/src/test/java/test_aids/storage_entities/custom_components/factories/TestStorableCustomLexicalAnalyserFactory.java +++ /dev/null @@ -1,20 +0,0 @@ -package test_aids.storage_entities.custom_components.factories; - -import component_construction.factories.lexical_analysis.LexicalAnalyserFactory; -import lexical_analysis.DynamicTokenRegex; -import lexical_analysis.LexicalAnalyser; -import test_aids.storage_entities.custom_components.TestStorableCustomLexicalAnalyser; - -public class TestStorableCustomLexicalAnalyserFactory implements LexicalAnalyserFactory { - - @Override - public LexicalAnalyser produceAnalyser( - String[] whitespaceDelimiters, - String[] stronglyReservedWords, - String[] weaklyReservedWords, - DynamicTokenRegex[] dynamicTokenRegex - ) { - return new TestStorableCustomLexicalAnalyser(); - } - -} diff --git a/src/test/java/test_aids/storage_entities/custom_components/factories/TestStorableCustomSyntaxAnalyserFactory.java b/src/test/java/test_aids/storage_entities/custom_components/factories/TestStorableCustomSyntaxAnalyserFactory.java deleted file mode 100644 index a942411..0000000 --- a/src/test/java/test_aids/storage_entities/custom_components/factories/TestStorableCustomSyntaxAnalyserFactory.java +++ /dev/null @@ -1,15 +0,0 @@ -package test_aids.storage_entities.custom_components.factories; - -import component_construction.factories.syntax_analysis.SyntaxAnalyserFactory; -import grammar_objects.GrammarParts; -import syntax_analysis.SyntaxAnalyser; -import test_aids.storage_entities.custom_components.TestStorableCustomSyntaxAnalyser; - -public class TestStorableCustomSyntaxAnalyserFactory implements SyntaxAnalyserFactory { - - @Override - public SyntaxAnalyser produceAnalyser(GrammarParts parts) { - return new TestStorableCustomSyntaxAnalyser(); - } - -} diff --git a/src/test/java/test_aids/storage_entities/custom_components/loadable/LoadableStorableCustomCodeGenerator.java b/src/test/java/test_aids/storage_entities/custom_components/loadable/LoadableStorableCustomCodeGenerator.java deleted file mode 100644 index 1d15bcf..0000000 --- a/src/test/java/test_aids/storage_entities/custom_components/loadable/LoadableStorableCustomCodeGenerator.java +++ /dev/null @@ -1,36 +0,0 @@ -package test_aids.storage_entities.custom_components.loadable; - -import code_generation.CodeGenerator; -import component_construction.storable.dynamic_loading.ReflectivelyLoadable; -import storage.external_interfaces.*; -import storage.storage_values.*; -import syntax_analysis.parsing.ParseState; - -public class LoadableStorableCustomCodeGenerator implements CodeGenerator, ReflectivelyLoadable, Storable { - - public StorageValue loadedData = new NullStorageValue(); - - @Override - public String generate(ParseState parseRoot) { - throw new UnsupportedOperationException("Unimplemented method 'generate'"); - } - - @Override - public void load(StorageValue data) { - loadedData = data; - } - - @Override - public StorageValue getStorageRepresentation() { - return loadedData; - } - - @Override - public boolean equals(Object obj) { - if (!(obj instanceof LoadableStorableCustomCodeGenerator)) return false; - - LoadableStorableCustomCodeGenerator other = (LoadableStorableCustomCodeGenerator)obj; - return this.loadedData.equals(other.loadedData); - } - -} diff --git a/src/test/java/test_aids/storage_entities/custom_components/loadable/LoadableStorableCustomLexicalAnalyser.java b/src/test/java/test_aids/storage_entities/custom_components/loadable/LoadableStorableCustomLexicalAnalyser.java deleted file mode 100644 index 4a89fd4..0000000 --- a/src/test/java/test_aids/storage_entities/custom_components/loadable/LoadableStorableCustomLexicalAnalyser.java +++ /dev/null @@ -1,36 +0,0 @@ -package test_aids.storage_entities.custom_components.loadable; - -import component_construction.storable.dynamic_loading.ReflectivelyLoadable; -import grammar_objects.Token; -import lexical_analysis.LexicalAnalyser; -import storage.external_interfaces.Storable; -import storage.storage_values.*; - -public class LoadableStorableCustomLexicalAnalyser implements LexicalAnalyser, ReflectivelyLoadable, Storable { - - public StorageValue loadedData = new NullStorageValue(); - - @Override - public Token[] analyse(String sentence) { - throw new UnsupportedOperationException("Unimplemented method 'analyse'"); - } - - @Override - public void load(StorageValue data) { - loadedData = data; - } - - @Override - public StorageValue getStorageRepresentation() { - return loadedData; - } - - @Override - public boolean equals(Object obj) { - if (!(obj instanceof LoadableStorableCustomLexicalAnalyser)) return false; - - LoadableStorableCustomLexicalAnalyser other = (LoadableStorableCustomLexicalAnalyser)obj; - return this.loadedData.equals(other.loadedData); - } - -} diff --git a/src/test/java/test_aids/storage_entities/custom_components/loadable/LoadableStorableCustomSyntaxAnalyser.java b/src/test/java/test_aids/storage_entities/custom_components/loadable/LoadableStorableCustomSyntaxAnalyser.java deleted file mode 100644 index 68eb5a2..0000000 --- a/src/test/java/test_aids/storage_entities/custom_components/loadable/LoadableStorableCustomSyntaxAnalyser.java +++ /dev/null @@ -1,37 +0,0 @@ -package test_aids.storage_entities.custom_components.loadable; - -import component_construction.storable.dynamic_loading.ReflectivelyLoadable; -import grammar_objects.Token; -import storage.external_interfaces.*; -import storage.storage_values.*; -import syntax_analysis.SyntaxAnalyser; -import syntax_analysis.parsing.*; - -public class LoadableStorableCustomSyntaxAnalyser implements SyntaxAnalyser, ReflectivelyLoadable, Storable { - - public StorageValue loadedData = new NullStorageValue(); - - @Override - public ParseState analyse(Token[] inputTokens) throws ParseFailedException { - throw new UnsupportedOperationException("Unimplemented method 'analyse'"); - } - - @Override - public void load(StorageValue data) { - loadedData = data; - } - - @Override - public StorageValue getStorageRepresentation() { - return loadedData; - } - - @Override - public boolean equals(Object obj) { - if (!(obj instanceof LoadableStorableCustomSyntaxAnalyser)) return false; - - LoadableStorableCustomSyntaxAnalyser other = (LoadableStorableCustomSyntaxAnalyser)obj; - return this.loadedData.equals(other.loadedData); - } - -} diff --git a/src/test/java/test_aids/storage_entities/custom_components/loadable/LoadableTestStorableCustomCompiler.java b/src/test/java/test_aids/storage_entities/custom_components/loadable/LoadableTestStorableCustomCompiler.java deleted file mode 100644 index 82a61ef..0000000 --- a/src/test/java/test_aids/storage_entities/custom_components/loadable/LoadableTestStorableCustomCompiler.java +++ /dev/null @@ -1,36 +0,0 @@ -package test_aids.storage_entities.custom_components.loadable; - -import java.util.Map; - -import component_construction.storable.StorableCustomCompiler; -import storage.external_interfaces.Loadable; -import storage.storage_values.*; - -public class LoadableTestStorableCustomCompiler extends StorableCustomCompiler implements Loadable { - - public LoadableTestStorableCustomCompiler() { - super( - new LoadableStorableCustomLexicalAnalyser(), - new LoadableStorableCustomSyntaxAnalyser(), - new LoadableStorableCustomCodeGenerator() - ); - } - - @Override - public void load(StorageValue data) { - Map> description = ((MapStorageValue)data).getValue(); - - StorageValue lexicalAnalyserDescription = ((ListStorageValue)description.get("lexicalAnalyser")).getValue().get(1); - StorageValue syntaxAnalyserDescription = ((ListStorageValue)description.get("lexicalAnalyser")).getValue().get(1); - StorageValue codeGeneratorDescription = ((ListStorageValue)description.get("lexicalAnalyser")).getValue().get(1); - - lexicalAnalyser = new LoadableStorableCustomLexicalAnalyser(); - syntaxAnalyser = new LoadableStorableCustomSyntaxAnalyser(); - codeGenerator = new LoadableStorableCustomCodeGenerator(); - - ((LoadableStorableCustomLexicalAnalyser)lexicalAnalyser).load(lexicalAnalyserDescription); - ((LoadableStorableCustomSyntaxAnalyser)syntaxAnalyser).load(syntaxAnalyserDescription); - ((LoadableStorableCustomCodeGenerator)codeGenerator).load(codeGeneratorDescription); - } - -} diff --git a/src/test/java/test_aids/storage_entities/custom_components/loadableBy/LoadableByCustomLexicalAnalyserLoader.java b/src/test/java/test_aids/storage_entities/custom_components/loadableBy/LoadableByCustomLexicalAnalyserLoader.java deleted file mode 100644 index f0feff2..0000000 --- a/src/test/java/test_aids/storage_entities/custom_components/loadableBy/LoadableByCustomLexicalAnalyserLoader.java +++ /dev/null @@ -1,16 +0,0 @@ -package test_aids.storage_entities.custom_components.loadableBy; - -import component_construction.storable.dynamic_loading.Loader; -import storage.storage_values.StorageValue; - -public class LoadableByCustomLexicalAnalyserLoader implements Loader { - - @Override - public LoadableByStorableCustomLexicalAnalyser produce(StorageValue loadValue) { - LoadableByStorableCustomLexicalAnalyser lex = new LoadableByStorableCustomLexicalAnalyser(); - lex.loadInternals(loadValue); - - return lex; - } - -} diff --git a/src/test/java/test_aids/storage_entities/custom_components/loadableBy/LoadableByStorableCustomLexicalAnalyser.java b/src/test/java/test_aids/storage_entities/custom_components/loadableBy/LoadableByStorableCustomLexicalAnalyser.java deleted file mode 100644 index 4029e49..0000000 --- a/src/test/java/test_aids/storage_entities/custom_components/loadableBy/LoadableByStorableCustomLexicalAnalyser.java +++ /dev/null @@ -1,35 +0,0 @@ -package test_aids.storage_entities.custom_components.loadableBy; - -import component_construction.storable.dynamic_loading.LoadableBy; -import grammar_objects.Token; -import lexical_analysis.LexicalAnalyser; -import storage.external_interfaces.Storable; -import storage.storage_values.*; - -public class LoadableByStorableCustomLexicalAnalyser implements LexicalAnalyser, LoadableBy, Storable { - - public StorageValue loadedData = new NullStorageValue(); - - @Override - public Token[] analyse(String sentence) { - throw new UnsupportedOperationException("Unimplemented method 'analyse'"); - } - - public void loadInternals(StorageValue data) { - loadedData = data; - } - - @Override - public StorageValue getStorageRepresentation() { - return loadedData; - } - - @Override - public boolean equals(Object obj) { - if (!(obj instanceof LoadableByStorableCustomLexicalAnalyser)) return false; - - LoadableByStorableCustomLexicalAnalyser other = (LoadableByStorableCustomLexicalAnalyser)obj; - return this.loadedData.equals(other.loadedData); - } - -} diff --git a/src/test/java/test_aids/storage_entities/loadableby_entities/ConcretisedGenericTestLoadableObject.java b/src/test/java/test_aids/storage_entities/loadableby_entities/ConcretisedGenericTestLoadableObject.java deleted file mode 100644 index 2c0256e..0000000 --- a/src/test/java/test_aids/storage_entities/loadableby_entities/ConcretisedGenericTestLoadableObject.java +++ /dev/null @@ -1,5 +0,0 @@ -package test_aids.storage_entities.loadableby_entities; - -import component_construction.storable.dynamic_loading.LoadableBy; - -public class ConcretisedGenericTestLoadableObject extends StandardLoader implements GenercicTestInterface, LoadableBy {} \ No newline at end of file diff --git a/src/test/java/test_aids/storage_entities/loadableby_entities/GenercicTestInterface.java b/src/test/java/test_aids/storage_entities/loadableby_entities/GenercicTestInterface.java deleted file mode 100644 index a10a6a5..0000000 --- a/src/test/java/test_aids/storage_entities/loadableby_entities/GenercicTestInterface.java +++ /dev/null @@ -1,8 +0,0 @@ -package test_aids.storage_entities.loadableby_entities; - -/** - * GenercicTestInterface - */ -public interface GenercicTestInterface { - -} diff --git a/src/test/java/test_aids/storage_entities/loadableby_entities/GenericLoader.java b/src/test/java/test_aids/storage_entities/loadableby_entities/GenericLoader.java deleted file mode 100644 index ecad6e0..0000000 --- a/src/test/java/test_aids/storage_entities/loadableby_entities/GenericLoader.java +++ /dev/null @@ -1,18 +0,0 @@ -package test_aids.storage_entities.loadableby_entities; - -import component_construction.storable.dynamic_loading.Loader; -import storage.storage_values.StorageValue; - -public class GenericLoader implements Loader { - - private GenericLoader() { - // Exists only to prevent empty constructor call - } - - @Override - @SuppressWarnings("unchecked") - public T produce(StorageValue loadValue) { - return (T)new GenericallyLoadableObject((int)loadValue.getValue()); - } - -} diff --git a/src/test/java/test_aids/storage_entities/loadableby_entities/GenericTestInterface.java b/src/test/java/test_aids/storage_entities/loadableby_entities/GenericTestInterface.java deleted file mode 100644 index 2e33787..0000000 --- a/src/test/java/test_aids/storage_entities/loadableby_entities/GenericTestInterface.java +++ /dev/null @@ -1,3 +0,0 @@ -package test_aids.storage_entities.loadableby_entities; - -public interface GenericTestInterface {} diff --git a/src/test/java/test_aids/storage_entities/loadableby_entities/GenericTestLoadableObject.java b/src/test/java/test_aids/storage_entities/loadableby_entities/GenericTestLoadableObject.java deleted file mode 100644 index cbc0066..0000000 --- a/src/test/java/test_aids/storage_entities/loadableby_entities/GenericTestLoadableObject.java +++ /dev/null @@ -1,5 +0,0 @@ -package test_aids.storage_entities.loadableby_entities; - -import component_construction.storable.dynamic_loading.LoadableBy; - -public class GenericTestLoadableObject extends StandardLoader implements GenercicTestInterface, LoadableBy {} \ No newline at end of file diff --git a/src/test/java/test_aids/storage_entities/loadableby_entities/GenericallyLoadableObject.java b/src/test/java/test_aids/storage_entities/loadableby_entities/GenericallyLoadableObject.java deleted file mode 100644 index e0f5144..0000000 --- a/src/test/java/test_aids/storage_entities/loadableby_entities/GenericallyLoadableObject.java +++ /dev/null @@ -1,6 +0,0 @@ -package test_aids.storage_entities.loadableby_entities; - -import component_construction.storable.dynamic_loading.LoadableBy; - -public record GenericallyLoadableObject(int a) implements LoadableBy> {} - diff --git a/src/test/java/test_aids/storage_entities/loadableby_entities/LoadableObject.java b/src/test/java/test_aids/storage_entities/loadableby_entities/LoadableObject.java deleted file mode 100644 index 0bc390f..0000000 --- a/src/test/java/test_aids/storage_entities/loadableby_entities/LoadableObject.java +++ /dev/null @@ -1,6 +0,0 @@ -package test_aids.storage_entities.loadableby_entities; - -import component_construction.storable.dynamic_loading.LoadableBy; - -public record LoadableObject(int a) implements LoadableBy {} - diff --git a/src/test/java/test_aids/storage_entities/loadableby_entities/StandardLoader.java b/src/test/java/test_aids/storage_entities/loadableby_entities/StandardLoader.java deleted file mode 100644 index 9e6d86c..0000000 --- a/src/test/java/test_aids/storage_entities/loadableby_entities/StandardLoader.java +++ /dev/null @@ -1,13 +0,0 @@ -package test_aids.storage_entities.loadableby_entities; - -import component_construction.storable.dynamic_loading.Loader; -import storage.storage_values.StorageValue; - -public class StandardLoader implements Loader { - - @Override - public LoadableObject produce(StorageValue loadValue) { - return new LoadableObject((int)loadValue.getValue()); - } - -} diff --git a/src/test/java/test_aids/storage_entities/loadableby_entities/TestInterface.java b/src/test/java/test_aids/storage_entities/loadableby_entities/TestInterface.java deleted file mode 100644 index c16c9ae..0000000 --- a/src/test/java/test_aids/storage_entities/loadableby_entities/TestInterface.java +++ /dev/null @@ -1,3 +0,0 @@ -package test_aids.storage_entities.loadableby_entities; - -public interface TestInterface {} diff --git a/src/test/java/test_aids/storage_entities/loadableby_entities/TestLoadableObject.java b/src/test/java/test_aids/storage_entities/loadableby_entities/TestLoadableObject.java deleted file mode 100644 index 09e60b5..0000000 --- a/src/test/java/test_aids/storage_entities/loadableby_entities/TestLoadableObject.java +++ /dev/null @@ -1,5 +0,0 @@ -package test_aids.storage_entities.loadableby_entities; - -import component_construction.storable.dynamic_loading.LoadableBy; - -public class TestLoadableObject extends StandardLoader implements TestInterface, LoadableBy {} \ No newline at end of file diff --git a/src/test/java/test_aids/storage_entities/loadableby_entities/WildcardLoadableObject.java b/src/test/java/test_aids/storage_entities/loadableby_entities/WildcardLoadableObject.java deleted file mode 100644 index 1f87236..0000000 --- a/src/test/java/test_aids/storage_entities/loadableby_entities/WildcardLoadableObject.java +++ /dev/null @@ -1,6 +0,0 @@ -package test_aids.storage_entities.loadableby_entities; - -import component_construction.storable.dynamic_loading.*; - -public record WildcardLoadableObject(int a) implements LoadableBy> {} - diff --git a/src/test/java/test_aids/test_extensions/test_files/UseTestFile.java b/src/test/java/test_aids/test_extensions/test_files/UseTestFile.java deleted file mode 100644 index 79b7d89..0000000 --- a/src/test/java/test_aids/test_extensions/test_files/UseTestFile.java +++ /dev/null @@ -1,7 +0,0 @@ -package test_aids.test_extensions.test_files; - -import java.lang.annotation.*; - -@Target(ElementType.METHOD) -@Retention(RetentionPolicy.RUNTIME) -public @interface UseTestFile {} \ No newline at end of file diff --git a/src/test/java/test_aids/test_extensions/test_files/UseTestFileExtension.java b/src/test/java/test_aids/test_extensions/test_files/UseTestFileExtension.java deleted file mode 100644 index c55007f..0000000 --- a/src/test/java/test_aids/test_extensions/test_files/UseTestFileExtension.java +++ /dev/null @@ -1,67 +0,0 @@ -package test_aids.test_extensions.test_files; - -import java.io.*; -import java.nio.file.*; -import java.util.Comparator; - -import org.junit.jupiter.api.extension.*; -import org.junit.jupiter.api.extension.ExtensionContext.Namespace; -import org.junit.jupiter.api.extension.ExtensionContext.Store.CloseableResource; - -public class UseTestFileExtension implements ParameterResolver { - - private static final Namespace STORAGE_NAMESPACE = Namespace.create(UseTestFileExtension.class); - - @Override - public boolean supportsParameter(ParameterContext pc, ExtensionContext ec) { - return ec - .getTestMethod() - .get() - .isAnnotationPresent(UseTestFile.class); - } - - @Override - public Object resolveParameter(ParameterContext pc, ExtensionContext ec) { - try { - ManagedDirectory managedDir = ec - .getStore(STORAGE_NAMESPACE) - .getOrComputeIfAbsent( - "managedDir", - key -> new ManagedDirectory(), - ManagedDirectory.class - ); - - return managedDir.createFile("testFile-" + System.nanoTime()); - } catch (IOException e) { - throw new UncheckedIOException(e); - } - } - - protected static class ManagedDirectory implements CloseableResource { - - private final Path dir; - - public ManagedDirectory() { - try { - this.dir = Files.createTempDirectory("tests-"); - } catch (IOException e) { - throw new UncheckedIOException(e); - } - } - - public Path createFile(String filename) throws IOException { - return Files.createFile(dir.resolve(filename)); - } - - @Override - public void close() throws Throwable { - if (!Files.exists(dir)) return; - - try (var stream = Files.walk(dir)) { - stream - .sorted(Comparator.reverseOrder()) - .forEach(p -> p.toFile().delete()); - } - } - } -} \ No newline at end of file diff --git a/src/test/java/test_aids/test_storage/TestIntegerStreamEditor.java b/src/test/java/test_aids/test_storage/TestIntegerStreamEditor.java deleted file mode 100644 index d4f369b..0000000 --- a/src/test/java/test_aids/test_storage/TestIntegerStreamEditor.java +++ /dev/null @@ -1,23 +0,0 @@ -package test_aids.test_storage; - -import java.io.*; -import java.nio.charset.StandardCharsets; -import storage.file_editors.StreamEditor; - -public class TestIntegerStreamEditor implements StreamEditor { - - @Override - public Integer readFrom(InputStream stream) throws IOException { - try (stream) { - return Integer.parseInt(new String(stream.readAllBytes(), StandardCharsets.UTF_8)); - } - } - - @Override - public void addTo(OutputStream stream, Integer contents) throws IOException { - try (stream) { - stream.write(contents.toString().getBytes(StandardCharsets.UTF_8)); - } - } - -} \ No newline at end of file diff --git a/src/test/java/test_aids/test_storage/TestIntegerValueFormatter.java b/src/test/java/test_aids/test_storage/TestIntegerValueFormatter.java deleted file mode 100644 index 5690cec..0000000 --- a/src/test/java/test_aids/test_storage/TestIntegerValueFormatter.java +++ /dev/null @@ -1,19 +0,0 @@ -package test_aids.test_storage; - -import storage.storage_value_adapters.UnsupportedValueException; -import storage.storage_values.StorageValue; -import storage.value_formatters.ValueFormatter; - -public class TestIntegerValueFormatter implements ValueFormatter { - - @Override - public Integer format(StorageValue value) throws UnsupportedValueException { - return Integer.parseInt(value.getValue().toString()); - } - - @Override - public StorageValue parse(Integer formattedData) throws UnsupportedValueException { - return new TestStorageValue(formattedData); - } - -} \ No newline at end of file diff --git a/src/test/java/test_aids/test_storage/TestLoadable.java b/src/test/java/test_aids/test_storage/TestLoadable.java deleted file mode 100644 index 9021331..0000000 --- a/src/test/java/test_aids/test_storage/TestLoadable.java +++ /dev/null @@ -1,18 +0,0 @@ -package test_aids.test_storage; - -import storage.external_interfaces.Loadable; -import storage.storage_values.StorageValue; - -public class TestLoadable implements Loadable { - private Object value = null; - - public Object getValue() { - return value; - } - - @Override - public void load(StorageValue data) { - value = data.getValue(); - } - -} diff --git a/src/test/java/test_aids/test_storage/TestStorable.java b/src/test/java/test_aids/test_storage/TestStorable.java deleted file mode 100644 index 367b56e..0000000 --- a/src/test/java/test_aids/test_storage/TestStorable.java +++ /dev/null @@ -1,17 +0,0 @@ -package test_aids.test_storage; - -import storage.external_interfaces.Storable; - -public class TestStorable implements Storable { - private Object value; - - public TestStorable(Object value) { - this.value = value; - } - - @Override - public TestStorageValue getStorageRepresentation() { - return new TestStorageValue(value); - } - -} diff --git a/src/test/java/test_aids/test_storage/TestStorageValue.java b/src/test/java/test_aids/test_storage/TestStorageValue.java deleted file mode 100644 index 0562b46..0000000 --- a/src/test/java/test_aids/test_storage/TestStorageValue.java +++ /dev/null @@ -1,16 +0,0 @@ -package test_aids.test_storage; - -import storage.storage_values.StorageValue; - -public class TestStorageValue extends StorageValue { - - public TestStorageValue(Object value) { - super(value); - } - - @Override - public String toString() { - return value.toString(); - } - -} diff --git a/src/test/java/test_aids/test_storage/TestStringErrorStreamEditor.java b/src/test/java/test_aids/test_storage/TestStringErrorStreamEditor.java deleted file mode 100644 index 2680bd0..0000000 --- a/src/test/java/test_aids/test_storage/TestStringErrorStreamEditor.java +++ /dev/null @@ -1,19 +0,0 @@ -package test_aids.test_storage; - -import java.io.*; -import storage.file_editors.StreamEditor; -import test_aids.exceptions.ExampleException; - -public class TestStringErrorStreamEditor implements StreamEditor { - - @Override - public String readFrom(InputStream stream) throws IOException { - throw new ExampleException(); - } - - @Override - public void addTo(OutputStream stream, String contents) throws IOException { - throw new ExampleException(); - } - -} \ No newline at end of file diff --git a/src/test/java/test_aids/test_storage/TestStringErrorValueFormatter.java b/src/test/java/test_aids/test_storage/TestStringErrorValueFormatter.java deleted file mode 100644 index b8609e1..0000000 --- a/src/test/java/test_aids/test_storage/TestStringErrorValueFormatter.java +++ /dev/null @@ -1,20 +0,0 @@ -package test_aids.test_storage; - -import storage.storage_value_adapters.UnsupportedValueException; -import storage.storage_values.StorageValue; -import storage.value_formatters.ValueFormatter; -import test_aids.exceptions.ExampleException; - -public class TestStringErrorValueFormatter implements ValueFormatter { - - @Override - public String format(StorageValue value) throws UnsupportedValueException { - throw new ExampleException(); - } - - @Override - public StorageValue parse(String formattedData) throws UnsupportedValueException { - throw new ExampleException(); - } - -} \ No newline at end of file diff --git a/src/test/java/test_aids/test_storage/TestStringStreamEditor.java b/src/test/java/test_aids/test_storage/TestStringStreamEditor.java deleted file mode 100644 index 29fdb62..0000000 --- a/src/test/java/test_aids/test_storage/TestStringStreamEditor.java +++ /dev/null @@ -1,23 +0,0 @@ -package test_aids.test_storage; - -import java.io.*; -import java.nio.charset.StandardCharsets; -import storage.file_editors.StreamEditor; - -public class TestStringStreamEditor implements StreamEditor { - - @Override - public String readFrom(InputStream stream) throws IOException { - try (stream) { - return new String(stream.readAllBytes(), StandardCharsets.UTF_8); - } - } - - @Override - public void addTo(OutputStream stream, String contents) throws IOException { - try (stream) { - stream.write(contents.getBytes(StandardCharsets.UTF_8)); - } - } - -} \ No newline at end of file diff --git a/src/test/java/test_aids/test_storage/TestStringValueFormatter.java b/src/test/java/test_aids/test_storage/TestStringValueFormatter.java deleted file mode 100644 index 4c97d38..0000000 --- a/src/test/java/test_aids/test_storage/TestStringValueFormatter.java +++ /dev/null @@ -1,19 +0,0 @@ -package test_aids.test_storage; - -import storage.storage_value_adapters.UnsupportedValueException; -import storage.storage_values.StorageValue; -import storage.value_formatters.ValueFormatter; - -public class TestStringValueFormatter implements ValueFormatter { - - @Override - public String format(StorageValue value) throws UnsupportedValueException { - return value.getValue().toString(); - } - - @Override - public StorageValue parse(String formattedData) throws UnsupportedValueException { - return new TestStorageValue(formattedData); - } - -}