*** Settings ***
Documentation    Integration smoke tests for domain-specific analyzers
Resource         ${CURDIR}/common.resource
Suite Setup      Setup Test Environment
Suite Teardown   Cleanup Test Environment

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

*** Test Cases ***
Analyze Python Source
    [Documentation]    PythonAnalyzer extracts Module, Class, and Function triples
    ${result}=    Run Process    ${PYTHON}    ${HELPER}    analyze-python    timeout=120s    on_timeout=kill
    Log    ${result.stdout}
    Log    ${result.stderr}
    Should Be Equal As Integers    ${result.rc}    0
    Should Contain    ${result.stdout}    analyze-python-ok

Analyze Markdown Document
    [Documentation]    MarkdownAnalyzer extracts Document and Section triples
    ${result}=    Run Process    ${PYTHON}    ${HELPER}    analyze-markdown    timeout=120s    on_timeout=kill
    Log    ${result.stdout}
    Log    ${result.stderr}
    Should Be Equal As Integers    ${result.rc}    0
    Should Contain    ${result.stdout}    analyze-markdown-ok

Analyze PostgreSQL DDL
    [Documentation]    PostgreSQLAnalyzer extracts Table and Column triples
    ${result}=    Run Process    ${PYTHON}    ${HELPER}    analyze-postgresql    timeout=120s    on_timeout=kill
    Log    ${result.stdout}
    Log    ${result.stderr}
    Should Be Equal As Integers    ${result.rc}    0
    Should Contain    ${result.stdout}    analyze-postgresql-ok

Analyze Docker Compose YAML
    [Documentation]    DockerComposeAnalyzer extracts Service and DeploymentUnit triples
    ${result}=    Run Process    ${PYTHON}    ${HELPER}    analyze-docker-compose    timeout=120s    on_timeout=kill
    Log    ${result.stdout}
    Log    ${result.stderr}
    Should Be Equal As Integers    ${result.rc}    0
    Should Contain    ${result.stdout}    analyze-docker-compose-ok

Verify Analyzer Protocol Conformance
    [Documentation]    All four analyzers satisfy AnalyzerProtocol
    ${result}=    Run Process    ${PYTHON}    ${HELPER}    protocol-check    timeout=120s    on_timeout=kill
    Log    ${result.stdout}
    Log    ${result.stderr}
    Should Be Equal As Integers    ${result.rc}    0
    Should Contain    ${result.stdout}    protocol-check-ok

Verify Analyzer Registry Lookup
    [Documentation]    AnalyzerRegistry registers all four analyzers and resolves by extension
    ${result}=    Run Process    ${PYTHON}    ${HELPER}    registry-check    timeout=120s    on_timeout=kill
    Log    ${result.stdout}
    Log    ${result.stderr}
    Should Be Equal As Integers    ${result.rc}    0
    Should Contain    ${result.stdout}    registry-check-ok
