diff --git a/LARAI/build.gradle b/LARAI/build.gradle index 49442f7a2..e2fe0b7c7 100644 --- a/LARAI/build.gradle +++ b/LARAI/build.gradle @@ -27,10 +27,9 @@ dependencies { // Testing dependencies testImplementation 'org.junit.jupiter:junit-jupiter:5.10.0' - testImplementation 'org.mockito:mockito-core:5.5.0' - testImplementation 'org.mockito:mockito-junit-jupiter:5.5.0' + testImplementation 'org.mockito:mockito-core:5.23.0' + testImplementation 'org.mockito:mockito-junit-jupiter:5.23.0' testImplementation 'org.assertj:assertj-core:3.24.2' - testImplementation 'org.mockito:mockito-inline:5.2.0' // For static mocking testRuntimeOnly 'org.junit.platform:junit-platform-launcher:1.10.0' } diff --git a/Lara-JS/code/generate-ts-joinpoints.test.ts b/Lara-JS/code/generate-ts-joinpoints.test.ts new file mode 100644 index 000000000..9976c1152 --- /dev/null +++ b/Lara-JS/code/generate-ts-joinpoints.test.ts @@ -0,0 +1,31 @@ +import fs from "fs"; +import os from "os"; +import path from "path"; +import { generateEnums } from "../scripts/generate-ts-joinpoints.ts"; + +describe("generateEnums", () => { + it("preserves the enum values from the language specification", () => { + const outputDirectory = fs.mkdtempSync( + path.join(os.tmpdir(), "lara-build-interfaces-"), + ); + const outputPath = path.join(outputDirectory, "Joinpoints.ts"); + + try { + const outputFile = fs.openSync(outputPath, "w"); + try { + generateEnums( + [{ name: "StorageClass", entries: ["NONE", "PRIVATE_EXTERN", "STATIC"] }], + outputFile, + ); + } finally { + fs.closeSync(outputFile); + } + + const output = fs.readFileSync(outputPath, "utf8"); + expect(output).toContain(' STATIC: "STATIC",'); + expect(output).toContain(' PRIVATE_EXTERN: "PRIVATE_EXTERN",'); + } finally { + fs.rmSync(outputDirectory, { recursive: true, force: true }); + } + }); +}); diff --git a/Lara-JS/scripts/generate-ts-joinpoints.ts b/Lara-JS/scripts/generate-ts-joinpoints.ts index 9d6dbe111..e65555c3f 100644 --- a/Lara-JS/scripts/generate-ts-joinpoints.ts +++ b/Lara-JS/scripts/generate-ts-joinpoints.ts @@ -207,7 +207,7 @@ function generateEnum(e: ConvertedEnum, outputFile: number) { */\n`); fs.writeSync(outputFile, `export const ${e.name} = {\n`); e.entries.forEach((entry) => { - fs.writeSync(outputFile, ` ${entry}: "${entry.toLowerCase()}",\n`); + fs.writeSync(outputFile, ` ${entry}: "${entry}",\n`); }); fs.writeSync(outputFile, `} as const;\n`); fs.writeSync( diff --git a/LaraUtils/build.gradle b/LaraUtils/build.gradle index 6fc158ab3..fefa47eba 100644 --- a/LaraUtils/build.gradle +++ b/LaraUtils/build.gradle @@ -23,10 +23,9 @@ dependencies { // Testing dependencies testImplementation 'org.junit.jupiter:junit-jupiter:5.10.0' - testImplementation 'org.mockito:mockito-core:5.5.0' - testImplementation 'org.mockito:mockito-junit-jupiter:5.5.0' + testImplementation 'org.mockito:mockito-core:5.23.0' + testImplementation 'org.mockito:mockito-junit-jupiter:5.23.0' testImplementation 'org.assertj:assertj-core:3.24.2' - testImplementation 'org.mockito:mockito-inline:5.2.0' // For static mocking testRuntimeOnly 'org.junit.platform:junit-platform-launcher:1.10.0' } diff --git a/LaraUtils/test/pt/up/fe/specs/lara/LaraSystemToolsTest.java b/LaraUtils/test/pt/up/fe/specs/lara/LaraSystemToolsTest.java index b637071dd..80f81ca4f 100644 --- a/LaraUtils/test/pt/up/fe/specs/lara/LaraSystemToolsTest.java +++ b/LaraUtils/test/pt/up/fe/specs/lara/LaraSystemToolsTest.java @@ -126,7 +126,7 @@ void testRunCommand_withNullTimeout_handlesGracefully() { // Given String command = "echo hello"; boolean printToConsole = false; - long timeoutNanos = 2000000000; // 2 seconds + Long timeoutNanos = null; // When ProcessOutputAsString result = LaraSystemTools.runCommand(command, workingDirectory, printToConsole, timeoutNanos); diff --git a/WeaverGen2/build.gradle b/WeaverGen2/build.gradle index da8a5e189..a8503051e 100644 --- a/WeaverGen2/build.gradle +++ b/WeaverGen2/build.gradle @@ -25,10 +25,9 @@ dependencies { // Testing dependencies testImplementation 'org.junit.jupiter:junit-jupiter:5.10.0' - testImplementation 'org.mockito:mockito-core:5.5.0' - testImplementation 'org.mockito:mockito-junit-jupiter:5.5.0' + testImplementation 'org.mockito:mockito-core:5.23.0' + testImplementation 'org.mockito:mockito-junit-jupiter:5.23.0' testImplementation 'org.assertj:assertj-core:3.24.2' - testImplementation 'org.mockito:mockito-inline:5.2.0' // For static mocking testImplementation 'org.junit-pioneer:junit-pioneer:2.3.0' // For test retries testImplementation 'com.github.stefanbirkner:system-lambda:1.2.1' testImplementation 'com.google.guava:guava:33.4.0-jre' diff --git a/WeaverInterface/build.gradle b/WeaverInterface/build.gradle index 5dd2b2351..33ff66062 100644 --- a/WeaverInterface/build.gradle +++ b/WeaverInterface/build.gradle @@ -66,10 +66,9 @@ dependencies { // Testing dependencies testImplementation 'org.junit.jupiter:junit-jupiter:5.10.0' - testImplementation 'org.mockito:mockito-core:5.5.0' - testImplementation 'org.mockito:mockito-junit-jupiter:5.5.0' + testImplementation 'org.mockito:mockito-core:5.23.0' + testImplementation 'org.mockito:mockito-junit-jupiter:5.23.0' testImplementation 'org.assertj:assertj-core:3.24.2' - testImplementation 'org.mockito:mockito-inline:5.2.0' // For static mocking testImplementation 'org.junit-pioneer:junit-pioneer:2.3.0' // For test retries testImplementation 'com.github.stefanbirkner:system-lambda:1.2.1' testRuntimeOnly 'org.junit.platform:junit-platform-launcher:1.10.0'