*** Settings ***
Documentation    Smoke tests for UKO Analyzer Plugin Framework
Resource         ${CURDIR}/common.resource
Suite Setup      Setup Test Environment
Suite Teardown   Cleanup Test Environment

*** Variables ***
${HELPER}    ${CURDIR}/helper_uko_analyzers.py

*** Test Cases ***
AnalyzerProtocol Compliance For PythonAnalyzer
    [Documentation]    Verify PythonAnalyzer satisfies AnalyzerProtocol
    ${result}=    Run Process    ${PYTHON}    ${HELPER}    python-protocol    cwd=${WORKSPACE}
    Log    ${result.stdout}
    Log    ${result.stderr}
    Should Be Equal As Integers    ${result.rc}    0
    Should Contain    ${result.stdout}    uko-python-protocol-ok

AnalyzerProtocol Compliance For MarkdownAnalyzer
    [Documentation]    Verify MarkdownAnalyzer satisfies AnalyzerProtocol
    ${result}=    Run Process    ${PYTHON}    ${HELPER}    markdown-protocol    cwd=${WORKSPACE}
    Log    ${result.stdout}
    Log    ${result.stderr}
    Should Be Equal As Integers    ${result.rc}    0
    Should Contain    ${result.stdout}    uko-markdown-protocol-ok

AnalyzerRegistry Registration And Lookup
    [Documentation]    Verify registry registers and looks up analyzers
    ${result}=    Run Process    ${PYTHON}    ${HELPER}    registry    cwd=${WORKSPACE}
    Log    ${result.stdout}
    Log    ${result.stderr}
    Should Be Equal As Integers    ${result.rc}    0
    Should Contain    ${result.stdout}    uko-registry-ok

PythonAnalyzer Produces Triples
    [Documentation]    Verify PythonAnalyzer produces valid UKO triples from Python source
    ${result}=    Run Process    ${PYTHON}    ${HELPER}    python-analyze    cwd=${WORKSPACE}
    Log    ${result.stdout}
    Log    ${result.stderr}
    Should Be Equal As Integers    ${result.rc}    0
    Should Contain    ${result.stdout}    uko-python-analyze-ok

MarkdownAnalyzer Produces Triples
    [Documentation]    Verify MarkdownAnalyzer produces valid UKO triples from Markdown
    ${result}=    Run Process    ${PYTHON}    ${HELPER}    markdown-analyze    cwd=${WORKSPACE}
    Log    ${result.stdout}
    Log    ${result.stderr}
    Should Be Equal As Integers    ${result.rc}    0
    Should Contain    ${result.stdout}    uko-markdown-analyze-ok

UKOTriple Construction
    [Documentation]    Verify UKOTriple model construction and validation
    ${result}=    Run Process    ${PYTHON}    ${HELPER}    triple-model    cwd=${WORKSPACE}
    Log    ${result.stdout}
    Log    ${result.stderr}
    Should Be Equal As Integers    ${result.rc}    0
    Should Contain    ${result.stdout}    uko-triple-model-ok

Malformed Input Handling
    [Documentation]    Verify graceful handling of malformed inputs
    ${result}=    Run Process    ${PYTHON}    ${HELPER}    malformed    cwd=${WORKSPACE}
    Log    ${result.stdout}
    Log    ${result.stderr}
    Should Be Equal As Integers    ${result.rc}    0
    Should Contain    ${result.stdout}    uko-malformed-ok
