Search in sources :

Example 11 with DetectArgumentState

use of com.synopsys.integration.detect.configuration.help.DetectArgumentState in project synopsys-detect by blackducksoftware.

the class ArgumentStateParserTests method helpParsesStartValue.

@Test
public void helpParsesStartValue() {
    String[] args = new String[] { "-h", "value", "--property", "--property", "--property" };
    DetectArgumentState state = parser.parseArgs(args);
    Assertions.assertTrue(state.isHelp());
    Assertions.assertEquals("value", state.getParsedValue());
}
Also used : DetectArgumentState(com.synopsys.integration.detect.configuration.help.DetectArgumentState) Test(org.junit.jupiter.api.Test)

Example 12 with DetectArgumentState

use of com.synopsys.integration.detect.configuration.help.DetectArgumentState in project synopsys-detect by blackducksoftware.

the class ArgumentStateParserTests method helpParsesEndValue.

@Test
public void helpParsesEndValue() {
    String[] args = new String[] { "--property", "--property", "-h", "value" };
    DetectArgumentState state = parser.parseArgs(args);
    Assertions.assertTrue(state.isHelp());
    Assertions.assertEquals("value", state.getParsedValue());
}
Also used : DetectArgumentState(com.synopsys.integration.detect.configuration.help.DetectArgumentState) Test(org.junit.jupiter.api.Test)

Example 13 with DetectArgumentState

use of com.synopsys.integration.detect.configuration.help.DetectArgumentState in project synopsys-detect by blackducksoftware.

the class DiagnosticDecisionTest method commandLineDecision.

@Test
void commandLineDecision() {
    PropertyConfiguration propertyConfiguration = createPropertyConfiguration(false, false);
    DetectArgumentState detectArgumentState = createDetectArgumentState(true, false);
    DiagnosticDecision diagnosticDecision = DiagnosticDecision.decide(detectArgumentState, propertyConfiguration);
    Assertions.assertTrue(diagnosticDecision.shouldCreateDiagnosticSystem());
    Assertions.assertFalse(diagnosticDecision.isExtended());
}
Also used : DetectArgumentState(com.synopsys.integration.detect.configuration.help.DetectArgumentState) PropertyConfiguration(com.synopsys.integration.configuration.config.PropertyConfiguration) Test(org.junit.jupiter.api.Test)

Example 14 with DetectArgumentState

use of com.synopsys.integration.detect.configuration.help.DetectArgumentState in project synopsys-detect by blackducksoftware.

the class DiagnosticDecisionTest method noDiagnostic.

@Test
void noDiagnostic() {
    PropertyConfiguration propertyConfiguration = createPropertyConfiguration(false, false);
    DetectArgumentState detectArgumentState = createDetectArgumentState(false, false);
    DiagnosticDecision diagnosticDecision = DiagnosticDecision.decide(detectArgumentState, propertyConfiguration);
    Assertions.assertFalse(diagnosticDecision.shouldCreateDiagnosticSystem());
    Assertions.assertFalse(diagnosticDecision.isExtended());
}
Also used : DetectArgumentState(com.synopsys.integration.detect.configuration.help.DetectArgumentState) PropertyConfiguration(com.synopsys.integration.configuration.config.PropertyConfiguration) Test(org.junit.jupiter.api.Test)

Aggregations

DetectArgumentState (com.synopsys.integration.detect.configuration.help.DetectArgumentState)14 Test (org.junit.jupiter.api.Test)13 PropertyConfiguration (com.synopsys.integration.configuration.config.PropertyConfiguration)5 AirGapType (com.synopsys.integration.detect.workflow.airgap.AirGapType)3 AirGapTypeDecider (com.synopsys.integration.detect.workflow.airgap.AirGapTypeDecider)3 PropertySource (com.synopsys.integration.configuration.source.PropertySource)1 SpringConfigurationPropertySource (com.synopsys.integration.configuration.source.SpringConfigurationPropertySource)1 DetectArgumentStateParser (com.synopsys.integration.detect.configuration.help.DetectArgumentStateParser)1 DetectBoot (com.synopsys.integration.detect.lifecycle.boot.DetectBoot)1 DetectBootFactory (com.synopsys.integration.detect.lifecycle.boot.DetectBootFactory)1 DetectBootResult (com.synopsys.integration.detect.lifecycle.boot.DetectBootResult)1 ArrayList (java.util.ArrayList)1