Skip to content

Commit

Permalink
Spellcheck (#62)
Browse files Browse the repository at this point in the history
* spellcheck

* spellcheck
  • Loading branch information
bischoffz authored Jun 5, 2024
1 parent e52c9e5 commit bd99dee
Show file tree
Hide file tree
Showing 17 changed files with 87 additions and 87 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public enum CoreTranslationError implements ContractError {
NO_TRANSLATION_ENGINES("There are no translation engines added to this controller."),
NULL_CLASS_REF("Null Class Ref"),
NULL_DEPENDENCY("Null dependency"),
NULL_INIT_CONSUMER("Null Initilizer Consumer"),
NULL_INIT_CONSUMER("Null Initializer Consumer"),
NULL_OBJECT_FOR_TRANSLATION("The object to be translated was null"),
NULL_PATH("Null Path"),
NULL_TRANSLATION_ENGINE("Null Translation Engine"),
Expand All @@ -34,7 +34,7 @@ public enum CoreTranslationError implements ContractError {
"Translators were added to the builder but were not initialized. Make sure to call super.initTranslators() during your custom engine build method"),
UNKNOWN_CLASSREF("No object has been read in with the specified classRef"),
UNKNOWN_OBJECT("Object is not Translatable by this TranslationSpec"),
UNKNWON_TRANSLATION_ENGINE_TYPE("Translation Engine Type was not set"),
UNKNOWN_TRANSLATION_ENGINE_TYPE("Translation Engine Type was not set"),
UNKNOWN_TRANSLATION_SPEC("No translation spec was provided for the given class"),
UNSUPPORTED_VERSION("The given version is not supported");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import gov.hhs.aspr.ms.util.errors.ContractException;

/**
* The TranslatorController serves as the master of cerimonies for translating
* The TranslatorController serves as the master of ceremonies for translating
* between two types of objects. Additionally, it has the ability to distribute
* Input/Output files for reading and writing.
*/
Expand Down Expand Up @@ -137,7 +137,7 @@ public Builder addInputFilePath(Path filePath, Class<?> classRef, TranslationEng
}

/**
* Adds the given classRef markerInterace mapping.
* Adds the given classRef markerInterface mapping.
* <p>
* explicitly used when calling {@link TranslationController#writeOutput} with a
* class for which a classRef ScenarioId pair does not exist and/or the need to
Expand Down Expand Up @@ -404,7 +404,7 @@ <M extends U, U> void writeOutput(Path path, M object, Optional<Class<U>> superC
* Searches the list of read in objects and returns the first Object found of
* the given classRef
*
* @param <T> the type of the obect to get
* @param <T> the type of the object to get
* @throws ContractException
* <ul>
* <li>{@linkplain CoreTranslationError#UNKNOWN_CLASSREF}
Expand All @@ -425,7 +425,7 @@ public <T> T getFirstObject(Class<T> classRef) {
* Searches the list of read in objects and returns all Objects found with the
* given classRef
*
* @param <T> the type of the obect to get
* @param <T> the type of the object to get
*/
public <T> List<T> getObjects(Class<T> classRef) {
List<T> objects = new ArrayList<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ protected final <I, A> void _addTranslationSpec(TranslationSpec<I, A> translatio
* <li>{@linkplain CoreTranslationError#NULL_TRANSLATOR}
* if translator is null</li>
* <li>{@linkplain CoreTranslationError#DUPLICATE_TRANSLATOR}
* if translator has alaready been added</li>
* if translator has already been added</li>
* </ul>
*/
public abstract Builder addTranslator(Translator translator);
Expand All @@ -196,7 +196,7 @@ protected final void _addTranslator(Translator translator) {
}

/**
* Adds the given classRef markerInterace mapping.
* Adds the given classRef markerInterface mapping.
* <p>
* explicitly used when calling {@link TranslationController#writeOutput} with a
* class for which a classRef ScenarioId pair does not exist and/or the need to
Expand Down Expand Up @@ -380,7 +380,7 @@ void checkForCyclicGraph(MutableGraph<TranslatorId, Object> mutableGraph) {

private void validateTranslationEngineType() {
if (this.data.translationEngineType == TranslationEngineType.UNKNOWN) {
throw new ContractException(CoreTranslationError.UNKNWON_TRANSLATION_ENGINE_TYPE);
throw new ContractException(CoreTranslationError.UNKNOWN_TRANSLATION_ENGINE_TYPE);
}
}

Expand All @@ -401,7 +401,7 @@ Map<Class<?>, Class<?>> getChildParentClassMap() {
/**
* returns the {@link TranslationEngineType} of this TranslationEngine
*
* guarenteed to NOT be {@link TranslationEngineType#UNKNOWN}
* guaranteed to NOT be {@link TranslationEngineType#UNKNOWN}
*/
public TranslationEngineType getTranslationEngineType() {
return this.data.translationEngineType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,14 @@ public boolean isInitialized() {
* Input Class and if so, calls the related method
* </p>
* <p>
* It then checks if the the object class is assinable from either the App or
* It then checks if the the object class is assignable from either the App or
* Input Class and if so, calls the related method
* </p>
* <p>
* If no match can be found, an exception is thrown
* </p>
*
* @param <T> the expected return type after translation/coversion
* @param <T> the expected return type after translation/conversion
* @throws ContractException {@linkplain CoreTranslationError#UNKNOWN_OBJECT} if
* no match can be found between the passed in object
* and the given appClass and InputClass
Expand Down Expand Up @@ -102,7 +102,7 @@ public boolean equals(Object obj) {
return false;
}

// if different intput class, not equal
// if different input class, not equal
if (getInputObjectClass() != other.getInputObjectClass()) {
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,9 @@ public Builder setInitializer(Consumer<TranslatorContext> initConsumer) {
* @throws ContractException
* <ul>
* <li>{@linkplain CoreTranslationError#NULL_DEPENDENCY}
* if the dependecy is null</li>
* if the dependency is null</li>
* <li>{@linkplain CoreTranslationError#DUPLICATE_DEPENDENCY}
* if the dependecy has already been added</li>
* if the dependency has already been added</li>
* </ul>
*/
public Builder addDependency(TranslatorId dependency) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/
public interface TranslatorId {
/**
* Implementationn consistent with equals()
* Implementation consistent with equals()
*/
@Override
public int hashCode();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public void testValidateTranslationEngine() {
@Test
@UnitTestForCoverage
/*
* purpose of this test is to show that if there isnt a valid TranslationEngine
* purpose of this test is to show that if there isn't a valid TranslationEngine
* class -> Translation Engine Type -> Translation Engine mapping, an exception
* is thrown
*/
Expand Down Expand Up @@ -196,7 +196,7 @@ public void testReadInput() {
@Test
@UnitTestForCoverage
public void testWriteOutput_Engine() {
String fileName = "badFilePath-testoutput.json";
String fileName = "badFilePath-testOutput.json";

ResourceHelper.createFile(filePath, fileName);
TestTranslationEngine engine = TestTranslationEngine.builder()
Expand Down Expand Up @@ -565,7 +565,7 @@ public void testAddParentChildClassRelationship() {
@Test
@UnitTestMethod(target = TranslationController.Builder.class, name = "addTranslationEngine", args = {
TranslationEngine.class })
public void testAddTransationEngine() {
public void testAddTranslationEngine() {
TestTranslationEngine translationEngine = TestTranslationEngine.builder()
.addTranslator(TestObjectTranslator.getTranslator())
.addTranslator(TestComplexObjectTranslator.getTranslator())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public void testValidateTranslationEngineType() {
engine.validateInit();
});

assertEquals(CoreTranslationError.UNKNWON_TRANSLATION_ENGINE_TYPE, contractException.getErrorType());
assertEquals(CoreTranslationError.UNKNOWN_TRANSLATION_ENGINE_TYPE, contractException.getErrorType());
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public void testConvert() {
assertEquals(expectedAppChildObject, TestObjectUtil.getChildAppFromApp(actualAppChildObject));

// precondition
// TranslationSpec not intialized
// TranslationSpec not initialized
ContractException contractException = assertThrows(ContractException.class, () -> {
TestObjectTranslationSpec testObjectTranslationSpec2 = new TestObjectTranslationSpec();
testObjectTranslationSpec2.convert(new TestAppObject());
Expand Down
24 changes: 12 additions & 12 deletions core/src/test/java/gov/hhs/aspr/ms/taskit/core/AT_Translator.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class AT_Translator {
@Test
@UnitTestMethod(target = Translator.class, name = "getInitializer", args = {})
public void testGetInitializer() {
Consumer<TranslatorContext> expectedInitializer = (translatorConext) -> {
Consumer<TranslatorContext> expectedInitializer = (translatorContext) -> {
};
Translator testTranslator = Translator.builder().setInitializer(expectedInitializer)
.setTranslatorId(new TranslatorId() {
Expand All @@ -35,7 +35,7 @@ public void testGetInitializer() {
public void testGetTranslatorId() {
TranslatorId expectedTranslatorId = new TranslatorId() {
};
Translator testTranslator = Translator.builder().setInitializer((translatorConext) -> {
Translator testTranslator = Translator.builder().setInitializer((translatorContext) -> {
}).setTranslatorId(expectedTranslatorId).build();

assertEquals(expectedTranslatorId, testTranslator.getTranslatorId());
Expand All @@ -46,7 +46,7 @@ public void testGetTranslatorId() {
public void testGetTranslatorDependencies() {
TranslatorId expectedTranslatorId = new TranslatorId() {
};
Translator testTranslator = Translator.builder().setInitializer((translatorConext) -> {
Translator testTranslator = Translator.builder().setInitializer((translatorContext) -> {
}).setTranslatorId(expectedTranslatorId).addDependency(TestObjectTranslatorId.TRANSLATOR_ID)
.addDependency(TestComplexObjectTranslatorId.TRANSLATOR_ID).build();

Expand All @@ -66,7 +66,7 @@ public void testHashCode() {
};
TranslatorId translatorIdB = new TranslatorId() {
};
Consumer<TranslatorContext> consumerA = (translatorConext) -> {
Consumer<TranslatorContext> consumerA = (translatorContext) -> {
};

Translator translatorA = Translator.builder().setInitializer(consumerA).setTranslatorId(translatorIdA).build();
Expand All @@ -91,7 +91,7 @@ public void testHashCode() {
// if same id, but different dependencies, not equal
assertNotEquals(translatorA.hashCode(), translatorC.hashCode());

// if same id and dependecies, equal
// if same id and dependencies, equal
assertEquals(translatorC.hashCode(), translatorD.hashCode());
}

Expand All @@ -102,7 +102,7 @@ public void testEquals() {
};
TranslatorId translatorIdB = new TranslatorId() {
};
Consumer<TranslatorContext> consumerA = (translatorConext) -> {
Consumer<TranslatorContext> consumerA = (translatorContext) -> {
};
Translator translatorA = Translator.builder().setInitializer(consumerA).setTranslatorId(translatorIdA).build();

Expand All @@ -129,7 +129,7 @@ public void testEquals() {
// if same id, but different dependencies, not equal
assertNotEquals(translatorA, translatorC);

// if same id and dependecies, equal
// if same id and dependencies, equal
assertEquals(translatorC, translatorD);

Translator.Data data = new Translator.Data();
Expand All @@ -149,7 +149,7 @@ public void testBuilder() {
public void testBuild() {
TranslatorId translatorIdA = new TranslatorId() {
};
Translator translatorA = Translator.builder().setInitializer((translatorConext) -> {
Translator translatorA = Translator.builder().setInitializer((translatorContext) -> {
}).setTranslatorId(translatorIdA).build();

assertNotNull(translatorA);
Expand All @@ -164,7 +164,7 @@ public void testBuild() {

// null translatorId
contractException = assertThrows(ContractException.class, () -> {
Translator.builder().setInitializer((translatorConext) -> {
Translator.builder().setInitializer((translatorContext) -> {
}).build();
});

Expand All @@ -176,7 +176,7 @@ public void testBuild() {
public void testSetTranslatorId() {
TranslatorId translatorIdA = new TranslatorId() {
};
Translator translatorA = Translator.builder().setInitializer((translatorConext) -> {
Translator translatorA = Translator.builder().setInitializer((translatorContext) -> {
}).setTranslatorId(translatorIdA).build();

assertEquals(translatorIdA, translatorA.getTranslatorId());
Expand All @@ -193,7 +193,7 @@ public void testSetTranslatorId() {
@Test
@UnitTestMethod(target = Translator.Builder.class, name = "setInitializer", args = { Consumer.class })
public void testSetInitializer() {
Consumer<TranslatorContext> expectedInitializer = (translatorConext) -> {
Consumer<TranslatorContext> expectedInitializer = (translatorContext) -> {
};
Translator testTranslator = Translator.builder().setInitializer(expectedInitializer)
.setTranslatorId(new TranslatorId() {
Expand All @@ -215,7 +215,7 @@ public void testSetInitializer() {
public void testAddDependency() {
TranslatorId expectedTranslatorId = new TranslatorId() {
};
Translator testTranslator = Translator.builder().setInitializer((translatorConext) -> {
Translator testTranslator = Translator.builder().setInitializer((translatorContext) -> {
}).setTranslatorId(expectedTranslatorId).addDependency(TestObjectTranslatorId.TRANSLATOR_ID)
.addDependency(TestComplexObjectTranslatorId.TRANSLATOR_ID).build();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@ public static List<TestInputObject> getListOfInputObjects(int num) {

public static TestAppObject getAppFromInput(TestInputObject inputObject) {
TestAppObject appObject = new TestAppObject();
TestComplexAppObject complextAppObject = getComplexAppFromComplexInput(inputObject.getTestComplexInputObject());
TestComplexAppObject complexAppObject = getComplexAppFromComplexInput(inputObject.getTestComplexInputObject());

appObject.setTestComplexAppObject(complextAppObject);
appObject.setTestComplexAppObject(complexAppObject);
appObject.setBool(inputObject.isBool());
appObject.setInteger(inputObject.getInteger());
appObject.setString(inputObject.getString());
Expand All @@ -93,9 +93,9 @@ public static TestAppObject getAppFromInput(TestInputObject inputObject) {

public static TestInputObject getInputFromApp(TestAppObject appObject) {
TestInputObject inputObject = new TestInputObject();
TestComplexInputObject complextInputObject = getComplexInputFromComplexApp(appObject.getTestComplexAppObject());
TestComplexInputObject complexInputObject = getComplexInputFromComplexApp(appObject.getTestComplexAppObject());

inputObject.setTestComplexInputObject(complextInputObject);
inputObject.setTestComplexInputObject(complexInputObject);
inputObject.setBool(appObject.isBool());
inputObject.setInteger(appObject.getInteger());
inputObject.setString(appObject.getString());
Expand Down Expand Up @@ -126,22 +126,22 @@ public static TestInputChildObject getChildInputFromInput(TestInputObject inputO
}

public static TestComplexAppObject getComplexAppFromComplexInput(TestComplexInputObject inputObject) {
TestComplexAppObject complextAppObject = new TestComplexAppObject();
TestComplexAppObject complexAppObject = new TestComplexAppObject();

complextAppObject.setNumEntities(inputObject.getNumEntities());
complextAppObject.setStartTime(inputObject.getStartTime());
complextAppObject.setTestString(inputObject.getTestString());
complexAppObject.setNumEntities(inputObject.getNumEntities());
complexAppObject.setStartTime(inputObject.getStartTime());
complexAppObject.setTestString(inputObject.getTestString());

return complextAppObject;
return complexAppObject;
}

public static TestComplexInputObject getComplexInputFromComplexApp(TestComplexAppObject appObject) {
TestComplexInputObject complextInputObject = new TestComplexInputObject();
TestComplexInputObject complexInputObject = new TestComplexInputObject();

complextInputObject.setNumEntities(appObject.getNumEntities());
complextInputObject.setStartTime(appObject.getStartTime());
complextInputObject.setTestString(appObject.getTestString());
complexInputObject.setNumEntities(appObject.getNumEntities());
complexInputObject.setStartTime(appObject.getStartTime());
complexInputObject.setTestString(appObject.getTestString());

return complextInputObject;
return complexInputObject;
}
}
Loading

0 comments on commit bd99dee

Please sign in to comment.