Adding check for 95% of classes being covered by junits (and supporting test coverage); Update filesystem s3 tests to reuse localstack docker container

This commit is contained in:
2022-08-12 18:55:58 -05:00
parent 52121cc4f3
commit 83c1bd8028
20 changed files with 639 additions and 33 deletions

View File

@ -22,6 +22,7 @@
package com.kingsrook.sampleapp;
import com.kingsrook.qqq.backend.core.exceptions.QException;
import com.kingsrook.qqq.backend.core.model.metadata.QInstance;
import com.kingsrook.qqq.frontend.picocli.QPicoCliImplementation;
@ -48,9 +49,7 @@ public class SampleCli
{
try
{
QInstance qInstance = SampleMetaDataProvider.defineInstance();
QPicoCliImplementation qPicoCliImplementation = new QPicoCliImplementation(qInstance);
int exitCode = qPicoCliImplementation.runCli("my-sample-cli", args);
int exitCode = runForExitCode(args);
System.exit(exitCode);
}
catch(Exception e)
@ -60,4 +59,17 @@ public class SampleCli
}
}
/*******************************************************************************
**
*******************************************************************************/
int runForExitCode(String[] args) throws QException
{
QInstance qInstance = SampleMetaDataProvider.defineInstance();
QPicoCliImplementation qPicoCliImplementation = new QPicoCliImplementation(qInstance);
int exitCode = qPicoCliImplementation.runCli("my-sample-cli", args);
return exitCode;
}
}

View File

@ -0,0 +1,46 @@
/*
* QQQ - Low-code Application Framework for Engineers.
* Copyright (C) 2021-2022. Kingsrook, LLC
* 651 N Broad St Ste 205 # 6917 | Middletown DE 19709 | United States
* contact@kingsrook.com
* https://github.com/Kingsrook/
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.kingsrook.sampleapp;
import com.kingsrook.qqq.backend.core.exceptions.QException;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
/*******************************************************************************
** Unit test for SampleCli
*******************************************************************************/
class SampleCliTest
{
/*******************************************************************************
**
*******************************************************************************/
@Test
void test() throws QException
{
int exitCode = new SampleCli().runForExitCode(new String[] { "--meta-data" });
assertEquals(0, exitCode);
}
}

View File

@ -2,14 +2,14 @@ package com.kingsrook.sampleapp;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.*;
/*******************************************************************************
** Unit test for com.kingsrook.sampleapp.SampleJavalinServer
** Unit test for SampleJavalinServer
*******************************************************************************/
class SampleJavalinServerTest
{
/*******************************************************************************
**
*******************************************************************************/