Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optionally restrict types when running the CTS #7798

Merged
merged 6 commits into from
Jul 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@


dependencies {
compileOnly project(':open-metadata-implementation:frameworks:audit-log-framework')
compileOnly project(':open-metadata-implementation:frameworks:open-connector-framework')
implementation project(':open-metadata-implementation:repository-services:repository-services-apis')
implementation 'org.slf4j:slf4j-api'
compileOnly 'com.fasterxml.jackson.core:jackson-annotations'
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,23 @@
@JsonIgnoreProperties(ignoreUnknown=true)
public enum OpenMetadataConformanceProfilePriority implements Serializable
{
/**
* This profile must be supported for the technology under test to be compliant.
*/
MANDATORY_PROFILE (0, "Mandatory Profile",
"This profile must be supported for the technology under test to be compliant."),

/**
* This profile must either be supported, or a conformant response is required to signal that the feature is not supported.
*/
OPTIONAL_PROFILE (1, "Optional Profile",
"This profile must either be supported, or a conformant response is required.");
"This profile must either be supported, or a conformant response is required to signal that the feature is not supported.");

private static final long serialVersionUID = 1L;

private int ordinal;
private String name;
private String description;
private final int ordinal;
private final String name;
private final String description;



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,41 @@
@JsonIgnoreProperties(ignoreUnknown=true)
public enum OpenMetadataConformanceStatus implements Serializable
{
/**
* There is not enough evidence to determine the conformance of the technology under test.
*/
UNKNOWN_STATUS (0, "Unknown status",
"There is not enough evidence to determine the conformance of the technology under test."),

/**
* The technology provides correctly functioning support for all features in this profile.
*/
CONFORMANT_FULL_SUPPORT (1, "Conformant with full support",
"The technology provides correctly functioning support for all features in this profile."),

/**
* The technology provides correctly functioning support for some of the features in this profile and responds appropriately for features it does not support.
*/
CONFORMANT_PARTIAL_SUPPORT (2, "Conformant with partial support",
"The technology provides correctly functioning support for some of the features in this profile and responds appropriately for features it does not support."),

/**
* The technology provides correctly functioning responses that indicate it has no support for the features in this profile.
*/
CONFORMANT_NO_SUPPORT (3, "Conformant with no support",
"The technology provides correctly functioning responses that indicate it has no support for the features in this profile."),

/**
* The technology is not functioning according to the open metadata specifications.
*/
NOT_CONFORMANT (4, "Not Conformant",
"The technology is not functioning according to the open metadata specifications.");
"The technology is not functioning according to the open metadata specifications.");

private static final long serialVersionUID = 1L;

private int ordinal;
private String name;
private String description;
private final int ordinal;
private final String name;
private final String description;


/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,47 @@
*/
public enum OpenMetadataConformanceTestEvidenceType implements Serializable
{
/**
* Unknown - No data available at this time.
*/
NO_DATA_AVAILABLE (0, "Unknown",
"No data available at this time."),
"No data available at this time."),

/**
* The test case condition is true.
*/
SUCCESSFUL_ASSERTION (0, "Successful assertion",
"The test case condition is true."),
"The test case condition is true."),

/**
* The test case condition is false.
*/
UNSUCCESSFUL_ASSERTION (1, "Unsuccessful assertion",
"The test case condition is false."),
"The test case condition is false."),

/**
* The test case has discovered a property.
*/
DISCOVERED_PROPERTY (2, "Discovered property",
"The test case has discovered a property."),
"The test case has discovered a property."),

/**
* The test case reports a correct response for a non-supported function.
*/
NOT_SUPPORTED_FUNCTION (3, "Not supported function",
"The test case reports a correct response for a non supported function."),
"The test case reports a correct response for a non-supported function."),

/**
* An exception occurred where it should not.
*/
UNEXPECTED_EXCEPTION (4, "Unexpected exception",
"An exception occurred where it should not.");
"An exception occurred where it should not.");

private static final long serialVersionUID = 1L;

private int ordinal;
private String name;
private String description;
private final int ordinal;
private final String name;
private final String description;


/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import org.odpi.openmetadata.conformance.ffdc.ConformanceSuiteErrorCode;
import org.odpi.openmetadata.conformance.ffdc.exception.ConformanceSuiteRuntimeException;
import org.odpi.openmetadata.conformance.ffdc.exception.InvalidParameterException;
import org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException;

import java.util.*;

Expand Down Expand Up @@ -195,18 +195,11 @@ synchronized void registerTestCase(OpenMetadataTestCase testCase)
relatedProperties.put("Existing TestCase", duplicateTestCase);
relatedProperties.put("New TestCase", testCase);

ConformanceSuiteErrorCode errorCode = ConformanceSuiteErrorCode.DUPLICATE_TEST_CASE;
String errorMessage = errorCode.getErrorMessageId()
+ errorCode.getFormattedErrorMessage(tutName,
tutType,
testCase.getTestCaseId());

throw new ConformanceSuiteRuntimeException(errorCode.getHTTPErrorCode(),
throw new ConformanceSuiteRuntimeException(ConformanceSuiteErrorCode.DUPLICATE_TEST_CASE.getMessageDefinition(tutName,
tutType,
testCase.getTestCaseId()),
this.getClass().getName(),
methodName,
errorMessage,
errorCode.getSystemAction(),
errorCode.getUserAction(),
relatedProperties);
}
}
Expand Down Expand Up @@ -591,15 +584,9 @@ synchronized OpenMetadataTestCaseResult getTestCaseResult(String testCaseId)
return testCase.getResult();
}

ConformanceSuiteErrorCode errorCode = ConformanceSuiteErrorCode.UNKNOWN_TEST_CASE_ID;
String errorMessage = errorCode.getErrorMessageId() + errorCode.getFormattedErrorMessage(testCaseId);

throw new InvalidParameterException(errorCode.getHTTPErrorCode(),
throw new InvalidParameterException(ConformanceSuiteErrorCode.UNKNOWN_TEST_CASE_ID.getMessageDefinition(testCaseId),
this.getClass().getName(),
methodName,
errorMessage,
errorCode.getSystemAction(),
errorCode.getUserAction(),
parameterName);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
package org.odpi.openmetadata.conformance.beans;

import org.odpi.openmetadata.conformance.ffdc.ConformanceSuiteErrorCode;
import org.odpi.openmetadata.conformance.ffdc.exception.InvalidParameterException;
import org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException;

import java.util.ArrayList;
import java.util.Date;
Expand All @@ -12,14 +12,13 @@
/**
* TechnologyUnderTestWorkPad is the class used to aggregate information about a technology (typically a metadata
* repository) that is being tested by the ODPi Egeria Conformance Suite.
*
* It is responsible for accumulating the results from the different test workbenches as they probe the REST API
* and validate the events being published by the technology under test (TUT).
*/
public class TechnologyUnderTestWorkPad
{
private OpenMetadataConformanceTestLabResults testLabResults = new OpenMetadataConformanceTestLabResults();
private List<OpenMetadataConformanceWorkbenchWorkPad> workbenchWorkPads;
private final OpenMetadataConformanceTestLabResults testLabResults = new OpenMetadataConformanceTestLabResults();
private final List<OpenMetadataConformanceWorkbenchWorkPad> workbenchWorkPads;


/**
Expand Down Expand Up @@ -105,16 +104,10 @@ public OpenMetadataConformanceProfileResults getProfileReport(String profileName
/*
* None of the workbenches know about this profile name.
*/
ConformanceSuiteErrorCode errorCode = ConformanceSuiteErrorCode.UNKNOWN_PROFILE_NAME;
String errorMessage = errorCode.getErrorMessageId() + errorCode.getFormattedErrorMessage(profileName);

throw new InvalidParameterException(errorCode.getHTTPErrorCode(),
this.getClass().getName(),
methodName,
errorMessage,
errorCode.getSystemAction(),
errorCode.getUserAction(),
parameterName);
throw new InvalidParameterException(ConformanceSuiteErrorCode.UNKNOWN_PROFILE_NAME.getMessageDefinition(profileName),
this.getClass().getName(),
methodName,
parameterName);
}


Expand Down Expand Up @@ -154,15 +147,9 @@ public OpenMetadataTestCaseResult getTestCaseReport(String testCaseId) throws
/*
* None of the workbenches know about this test case.
*/
ConformanceSuiteErrorCode errorCode = ConformanceSuiteErrorCode.UNKNOWN_TEST_CASE_ID;
String errorMessage = errorCode.getErrorMessageId() + errorCode.getFormattedErrorMessage(testCaseId);

throw new InvalidParameterException(errorCode.getHTTPErrorCode(),
throw new InvalidParameterException(ConformanceSuiteErrorCode.UNKNOWN_TEST_CASE_ID.getMessageDefinition(testCaseId),
this.getClass().getName(),
methodName,
errorMessage,
errorCode.getSystemAction(),
errorCode.getUserAction(),
parameterName);
}

Expand Down Expand Up @@ -230,15 +217,9 @@ public OpenMetadataConformanceWorkbenchResults getWorkbenchReport(String workb
}
}

ConformanceSuiteErrorCode errorCode = ConformanceSuiteErrorCode.UNKNOWN_WORKBENCH_ID;
String errorMessage = errorCode.getErrorMessageId() + errorCode.getFormattedErrorMessage(workbenchId);

throw new InvalidParameterException(errorCode.getHTTPErrorCode(),
throw new InvalidParameterException(ConformanceSuiteErrorCode.UNKNOWN_WORKBENCH_ID.getMessageDefinition(workbenchId),
this.getClass().getName(),
methodName,
errorMessage,
errorCode.getSystemAction(),
errorCode.getUserAction(),
parameterName);
}

Expand Down Expand Up @@ -268,16 +249,10 @@ public OpenMetadataConformanceWorkbenchStatus getWorkbenchStatus(String workbe
}
}

ConformanceSuiteErrorCode errorCode = ConformanceSuiteErrorCode.UNKNOWN_WORKBENCH_ID;
String errorMessage = errorCode.getErrorMessageId() + errorCode.getFormattedErrorMessage(workbenchId);

throw new InvalidParameterException(errorCode.getHTTPErrorCode(),
this.getClass().getName(),
methodName,
errorMessage,
errorCode.getSystemAction(),
errorCode.getUserAction(),
parameterName);
throw new InvalidParameterException(ConformanceSuiteErrorCode.UNKNOWN_WORKBENCH_ID.getMessageDefinition(workbenchId),
this.getClass().getName(),
methodName,
parameterName);
}


Expand Down
Loading
Loading