From 0d8936bcb0fdd6fda5d48c7f9ab3f47c7d9b244f Mon Sep 17 00:00:00 2001 From: FlightControl Date: Wed, 7 Dec 2016 14:55:35 +0100 Subject: [PATCH] Test Case documentation --- ...R - One coalition InitCleanUp API test.lua | 4 --- .../AIBALANCER - Spawned AI.lua | 33 ++++++++++++++++++ .../AIBALANCER - Spawned AI.miz} | Bin 3 files changed, 33 insertions(+), 4 deletions(-) delete mode 100644 Moose Test Missions/AI Balancer/AIBALANCER - One coalition InitCleanUp API test/AIBALANCER - One coalition InitCleanUp API test.lua create mode 100644 Moose Test Missions/AI Balancer/AIBALANCER - Spawned AI/AIBALANCER - Spawned AI.lua rename Moose Test Missions/AI Balancer/{AIBALANCER - One coalition InitCleanUp API test/AIBALANCER - One coalition InitCleanUp API test.miz => AIBALANCER - Spawned AI/AIBALANCER - Spawned AI.miz} (100%) diff --git a/Moose Test Missions/AI Balancer/AIBALANCER - One coalition InitCleanUp API test/AIBALANCER - One coalition InitCleanUp API test.lua b/Moose Test Missions/AI Balancer/AIBALANCER - One coalition InitCleanUp API test/AIBALANCER - One coalition InitCleanUp API test.lua deleted file mode 100644 index bd1265a5d..000000000 --- a/Moose Test Missions/AI Balancer/AIBALANCER - One coalition InitCleanUp API test/AIBALANCER - One coalition InitCleanUp API test.lua +++ /dev/null @@ -1,4 +0,0 @@ - -local RU_PlanesClientSet = SET_CLIENT:New():FilterCountries( "RUSSIA" ):FilterCategories( "plane" ):FilterStart() -local RU_PlanesSpawn = SPAWN:New( "AI RU" ):InitCleanUp( 20 ) -local RU_AIBalancer = AIBALANCER:New( RU_PlanesClientSet, RU_PlanesSpawn ) diff --git a/Moose Test Missions/AI Balancer/AIBALANCER - Spawned AI/AIBALANCER - Spawned AI.lua b/Moose Test Missions/AI Balancer/AIBALANCER - Spawned AI/AIBALANCER - Spawned AI.lua new file mode 100644 index 000000000..e9692de61 --- /dev/null +++ b/Moose Test Missions/AI Balancer/AIBALANCER - Spawned AI/AIBALANCER - Spawned AI.lua @@ -0,0 +1,33 @@ +--- AI Spawning and Decomissioning +-- +-- === +-- +-- Name: Spawned AI +-- Author: FlightControl +-- Date Created: 7 December 2016 +-- +-- # Situation: +-- +-- For the red coalition, 2 client slots are foreseen. +-- We test the AI spawning frequency, validating the number of spawned AI, +-- matching the amount of players that not have joined the mission. +-- When players join, AI should fly to the nearest home base. +-- +-- # Test cases: +-- +-- 1. If no player is logging into the red slots, 2 red AI planes should be alive. +-- 2. If a player joins one red slot, one red AI plane should return to the nearest home base. +-- 3. If two players join the red slots, no AI plane should be spawned, and all airborne AI planes should return to the nearest home base. +-- +-- @module TEST.AIBALANCER.T001 + +-- Define the SET of CLIENTs from the red coalition. This SET is filled during startup. +local RU_PlanesClientSet = SET_CLIENT:New():FilterCountries( "RUSSIA" ):FilterCategories( "plane" ):FilterStart() + +-- Define the SPAWN object for the red AI plane template. +-- We use InitCleanUp to check every 20 seconds, if there are no planes blocked at the airbase, waithing for take-off. +-- If a blocked plane exists, this red plane will be ReSpawned. +local RU_PlanesSpawn = SPAWN:New( "AI RU" ):InitCleanUp( 20 ) + +-- Start the AIBALANCER, using the SET of red CLIENTs, and the SPAWN object as a parameter. +local RU_AIBalancer = AIBALANCER:New( RU_PlanesClientSet, RU_PlanesSpawn ) diff --git a/Moose Test Missions/AI Balancer/AIBALANCER - One coalition InitCleanUp API test/AIBALANCER - One coalition InitCleanUp API test.miz b/Moose Test Missions/AI Balancer/AIBALANCER - Spawned AI/AIBALANCER - Spawned AI.miz similarity index 100% rename from Moose Test Missions/AI Balancer/AIBALANCER - One coalition InitCleanUp API test/AIBALANCER - One coalition InitCleanUp API test.miz rename to Moose Test Missions/AI Balancer/AIBALANCER - Spawned AI/AIBALANCER - Spawned AI.miz