Placing Tool Test Cases - codemetropolis/CodeMetropolis GitHub Wiki


Test ID: PLA-001

Test name: Run Placing Tool with valid input file

Precondition: Input XML file with Mapping tool has been generated.

Steps:

  • Open a command line.
  • Run Placing Tool with a valid input, for example: java -jar codemetropolis-toolchain-placing-1.3.jar -i Modules\Mapping_output.xml

Expected Result:

  • The Placing tool will be successfully executed with the following messages:
    -- Placing: Reading input file...
    -- Placing: Reading input file done.
    -- Placing: Calculating building sizes and positions...
    -- Placing: Calculating building sizes and positions done.
    -- Placing: Generating input for rendering...
    -- Placing: Generating input for rendering done.
  • The output XML will successfully generated with the default placingToRendering.xml.

Test ID: PLA-002

Test name: Run Placing Tool with invalid input file

Precondition: Input XML file with Mapping tool has been generated.

Steps:

  • Open a command line.
  • Run Placing Tool with an invalid input file, for example: java -jar codemetropolis-toolchain-placing-1.3.jar -i g:\Modules\Mapping_output.xml

Expected Result: Placing tool will display an error message: Error: The given input XML does not exits.


Test ID: PLA-003

Test name: Run Placing Tool with valid input and with help

Precondition: Input XML file with Mapping tool has been generated.

Steps:

  • Open a command line.
  • Run Placing Tool with a valid input and with -h parameter, for example: java -jar codemetropolis-toolchain-placing-1.3.jar -i Modules\Mapping_output.xml -h

Expected Result:

  • CodeMetropolis Toolchain Placing (c) University of Szeged, Department of Software Engineering
  • Usage: java -jar placing.jar -i <inputFile> [-o <outputFile>] [-m]

Test ID: PLA-004

Test name: Run Placing Tool with valid input and with valid output

Precondition: Input XML file with Mapping tool has been generated.

Steps:

  • Open a command line.
  • Run Placing Tool with a valid input and with valid -o parameter, for example: java -jar codemetropolis-toolchain-placing-1.3.jar -i Modules\Mapping_output.xml -o Modules\Placing_output.xml

Expected Result:

  • The Placing tool will be successfully executed with the following messages:
    -- Placing: Reading input file...
    -- Placing: Reading input file done.
    -- Placing: Calculating building sizes and positions...
    -- Placing: Calculating building sizes and positions done.
    -- Placing: Generating input for rendering...
    -- Placing: Generating input for rendering done.
  • The output XML will be generated to the given path with the given name.

Test ID: PLA-005

Test name: Run Placing Tool with valid input file, and with invalid output

Precondition: Input XML file with Mapping tool has been generated.

Steps:

  • Open a command line.
  • Run Placing Tool with a valid input and with invalid -o parameter, for example: java -jar codemetropolis-toolchain-placing-1.3.jar -i Modules\Mapping_output.xml -o g:\Modules\Placing_output.xml

Expected Result:

  • The Placing tool will display an error message: Error: An error has occurred while writing the output file. For more information please check the log file.

Test ID: PLA-006

Test name: Run Placing Tool with valid input and with valid layout value.

Precondition: Input XML file with Mapping tool has been generated.

Steps:

  • Open a command line.
  • Run Placing Tool with a valid input and with valid layout value, for example: java -jar codemetropolis-toolchain-placing-1.3.jar -i Modules\Mapping_output.xml -l TETRIS

Expected Result:

  • The Placing tool will be successfully executed with the following messages: -- Placing: Reading input file...
    -- Placing: Reading input file done.
    -- Placing: Calculating building sizes and positions...
    -- Placing: Calculating building sizes and positions done.
    -- Placing: Generating input for rendering...
    -- Placing: Generating input for rendering done.
  • Output will be the default, placingToRendering.xml.

Test ID: PLA-007

Test name: Run Placing Tool with valid input and with invalid layout value.

Precondition: Input XML file with Mapping tool has been generated.

Steps:

  • Open a command line.
  • Run Placing Tool with a valid input and with invalid layout value, for example: java -jar codemetropolis-toolchain-placing-1.3.jar -i Modules\Mapping_output.xml -l teszt

Expected Result:

  • The Placing tool will display an error message: Error: Wrong layout parameter!

Test ID: PLA-008

Test name: Run Placing Tool with valid input and with valid map value.

Precondition: Input XML file with Mapping tool has been generated.

Steps:

  • Open a command line.
  • Run Placing Tool with a valid input and with valid -m value, for example: java -jar codemetropolis-toolchain-placing-1.3.jar -i Modules\Mapping_output.xml -m

Expected Result:

  • The Placing tool will be successfully executed with the following messages: -- Placing: Reading input file...
    -- Placing: Reading input file done.
    -- Placing: Calculating building sizes and positions...
    -- Placing: Calculating building sizes and positions done.
    -- Placing: Generating input for rendering...
    -- Placing: Generating input for rendering done.
  • A popup window will appear with the graphically represented code sturcture, like a map.
  • Output will be the default, placingToRendering.xml.

Test ID: PLA-009

Test name: Run Placing Tool with valid input and with invalid map value.

Precondition: Input XML file with Mapping tool has been generated.

Steps:

  • Open a command line.
  • Run Placing Tool with a valid input and with invalid map value, for example: java -jar codemetropolis-toolchain-placing-1.3.jar -i Modules\Mapping_output.xml -m true

Expected Result:

  • The tool will display an error message:
    -- Error: Incorrect command line arguments.
    -- Usage: java -jar placing.jar -i <inputFile> [-o <outputFile>] [-m]

Test ID: PLA-010

Test name: Run Placing Tool with empty input value.

Precondition: Input XML file with Mapping tool has been generated.

Steps:

  • Open a command line.
  • Run Placing Tool with an empty input, for example: java -jar codemetropolis-toolchain-placing-1.3.jar -i

Expected Result:

  • The tool will display an error message:
    -- Error: Incorrect command line arguments.
    -- Usage: java -jar placing.jar -i <inputFile> [-o <outputFile>] [-m]

Test ID: PLA-011

Test name: Run Placing Tool with valid input and with empty output.

Precondition: Input XML file with Mapping tool has been generated.

Steps:

  • Open a command line.
  • Run Placing Tool with a valid input and with empty output, for example: java -jar codemetropolis-toolchain-placing-1.3.jar -i Modules\Mapping_output.xml -o

Expected Result:

  • The tool will display an error message:
    -- Error: Incorrect command line arguments.
    -- Usage: java -jar placing.jar -i <inputFile> [-o <outputFile>] [-m]

Test ID: PLA-012

Test name: Run Placing Tool with valid input and with empty layout.

Precondition: Input XML file with Mapping tool has been generated.

Steps:

  • Open a command line.
  • Run Placing Tool with a valid input and with empty layout, for example: java -jar codemetropolis-toolchain-placing-1.3.jar -i Modules\Mapping_output.xml -l

Expected Result:

  • The tool will display an error message:
    -- Error: Incorrect command line arguments.
    -- Usage: java -jar Placing.jar -i <graphFile> -m <PlacingFile> [-o <outputFile>]
⚠️ **GitHub.com Fallback** ⚠️