Skip to content

Commit

Permalink
Util package refactor (#31)
Browse files Browse the repository at this point in the history
* refactor util package structure

* revert pom dep scope
  • Loading branch information
bischoffz authored Feb 4, 2024
1 parent 66897f9 commit 97d1dde
Show file tree
Hide file tree
Showing 53 changed files with 115 additions and 116 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package gov.hhs.aspr.ms.taskit.core;

import util.errors.ContractError;
import gov.hhs.aspr.ms.util.errors.ContractError;

public enum CoreTranslationError implements ContractError {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

import org.apache.commons.math3.util.Pair;

import util.errors.ContractException;
import gov.hhs.aspr.ms.util.errors.ContractException;

/**
* The TranslatorController serves as the master of cerimonies for translating
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
import java.util.Set;
import java.util.stream.Collectors;

import util.errors.ContractException;
import util.graph.Graph;
import util.graph.GraphDepthEvaluator;
import util.graph.Graphs;
import util.graph.MutableGraph;
import gov.hhs.aspr.ms.util.errors.ContractException;
import gov.hhs.aspr.ms.util.graph.Graph;
import gov.hhs.aspr.ms.util.graph.GraphDepthEvaluator;
import gov.hhs.aspr.ms.util.graph.Graphs;
import gov.hhs.aspr.ms.util.graph.MutableGraph;

/**
* Main Translator Class Initializes all {@link TranslationSpec}s and maintains
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import java.util.Objects;

import util.errors.ContractException;
import gov.hhs.aspr.ms.util.errors.ContractException;

/**
* Core implementation of the {@link BaseTranslationSpec} that must be
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import java.util.Set;
import java.util.function.Consumer;

import util.errors.ContractException;
import gov.hhs.aspr.ms.util.errors.ContractException;

/**
* The Translator class serves as a wrapper around one or more
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package gov.hhs.aspr.ms.taskit.core;

import util.errors.ContractException;
import gov.hhs.aspr.ms.util.errors.ContractException;

/**
* Context that is used by {@link Translator}s
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import org.junit.jupiter.api.Test;

import util.annotations.UnitTestMethod;
import gov.hhs.aspr.ms.util.annotations.UnitTestMethod;

public class AT_CoreTranslationError {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@
import gov.hhs.aspr.ms.taskit.core.testsupport.testobject.TestAppObject;
import gov.hhs.aspr.ms.taskit.core.testsupport.testobject.TestObjectTranslator;
import gov.hhs.aspr.ms.taskit.core.testsupport.testobject.input.TestInputObject;
import util.annotations.UnitTestForCoverage;
import util.annotations.UnitTestMethod;
import util.errors.ContractException;
import util.resourcehelper.TestResourceHelper;
import gov.hhs.aspr.ms.util.annotations.UnitTestForCoverage;
import gov.hhs.aspr.ms.util.annotations.UnitTestMethod;
import gov.hhs.aspr.ms.util.errors.ContractException;
import gov.hhs.aspr.ms.util.resourcehelper.TestResourceHelper;

public class AT_TranslationController {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@
import gov.hhs.aspr.ms.taskit.core.testsupport.testobject.input.TestInputChildObject;
import gov.hhs.aspr.ms.taskit.core.testsupport.testobject.input.TestInputObject;
import gov.hhs.aspr.ms.taskit.core.testsupport.testobject.translationSpecs.TestObjectTranslationSpec;
import util.annotations.UnitTestForCoverage;
import util.annotations.UnitTestMethod;
import util.errors.ContractException;
import util.graph.MutableGraph;
import gov.hhs.aspr.ms.util.annotations.UnitTestForCoverage;
import gov.hhs.aspr.ms.util.annotations.UnitTestMethod;
import gov.hhs.aspr.ms.util.errors.ContractException;
import gov.hhs.aspr.ms.util.graph.MutableGraph;

public class AT_TranslationEngine {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
import gov.hhs.aspr.ms.taskit.core.testsupport.testobject.input.TestInputChildObject;
import gov.hhs.aspr.ms.taskit.core.testsupport.testobject.input.TestInputObject;
import gov.hhs.aspr.ms.taskit.core.testsupport.testobject.translationSpecs.TestObjectTranslationSpec;
import util.annotations.UnitTestConstructor;
import util.annotations.UnitTestMethod;
import util.errors.ContractException;
import gov.hhs.aspr.ms.util.annotations.UnitTestConstructor;
import gov.hhs.aspr.ms.util.annotations.UnitTestMethod;
import gov.hhs.aspr.ms.util.errors.ContractException;

public class AT_TranslationSpec {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@

import gov.hhs.aspr.ms.taskit.core.testsupport.testcomplexobject.TestComplexObjectTranslatorId;
import gov.hhs.aspr.ms.taskit.core.testsupport.testobject.TestObjectTranslatorId;
import util.annotations.UnitTestMethod;
import util.errors.ContractException;
import gov.hhs.aspr.ms.util.annotations.UnitTestMethod;
import gov.hhs.aspr.ms.util.errors.ContractException;

public class AT_Translator {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
import org.junit.jupiter.api.Test;

import gov.hhs.aspr.ms.taskit.core.testsupport.TestTranslationEngine;
import util.annotations.UnitTestConstructor;
import util.annotations.UnitTestMethod;
import util.errors.ContractException;
import gov.hhs.aspr.ms.util.annotations.UnitTestConstructor;
import gov.hhs.aspr.ms.util.annotations.UnitTestMethod;
import gov.hhs.aspr.ms.util.errors.ContractException;

public class AT_TranslatorContext {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import gov.hhs.aspr.ms.taskit.core.testsupport.testobject.TestObjectTranslator;
import gov.hhs.aspr.ms.taskit.core.testsupport.testobject.TestObjectWrapper;
import gov.hhs.aspr.ms.taskit.core.testsupport.testobject.translationSpecs.TestObjectTranslationSpec;
import util.errors.ContractException;
import gov.hhs.aspr.ms.util.errors.ContractException;

public final class TranslationEngineTestHelper {
private TranslationEngineTestHelper() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
import gov.hhs.aspr.ms.taskit.core.testsupport.testobject.TestAppObject;
import gov.hhs.aspr.ms.taskit.core.testsupport.testobject.input.TestInputObject;
import gov.hhs.aspr.ms.taskit.core.testsupport.testobject.translationSpecs.TestObjectTranslationSpec;
import util.annotations.UnitTestMethod;
import util.resourcehelper.TestResourceHelper;
import gov.hhs.aspr.ms.util.annotations.UnitTestMethod;
import gov.hhs.aspr.ms.util.resourcehelper.TestResourceHelper;

public class AT_TestTranslationEngine {
Path basePath = TestResourceHelper.getResourceDir(this.getClass());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
import gov.hhs.aspr.ms.taskit.core.testsupport.testobject.TestAppObject;
import gov.hhs.aspr.ms.taskit.core.testsupport.testobject.input.TestInputObject;
import gov.hhs.aspr.ms.taskit.core.testsupport.testobject.translationSpecs.TestObjectTranslationSpec;
import util.annotations.UnitTestConstructor;
import util.annotations.UnitTestMethod;
import gov.hhs.aspr.ms.util.annotations.UnitTestConstructor;
import gov.hhs.aspr.ms.util.annotations.UnitTestMethod;

public class AT_TestTranslationSpec {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import gov.hhs.aspr.ms.taskit.core.testsupport.testobject.TestAppObject;
import gov.hhs.aspr.ms.taskit.core.testsupport.testobject.input.TestInputChildObject;
import gov.hhs.aspr.ms.taskit.core.testsupport.testobject.input.TestInputObject;
import util.random.RandomGeneratorProvider;
import gov.hhs.aspr.ms.util.random.RandomGeneratorProvider;

public class TestObjectUtil {
static org.apache.commons.math3.random.RandomGenerator randomGenerator = RandomGeneratorProvider
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
import org.junit.jupiter.api.Test;

import gov.hhs.aspr.ms.taskit.core.testsupport.TestObjectUtil;
import util.annotations.UnitTestConstructor;
import util.annotations.UnitTestMethod;
import gov.hhs.aspr.ms.util.annotations.UnitTestConstructor;
import gov.hhs.aspr.ms.util.annotations.UnitTestMethod;

public class AT_TestComplexAppObject {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

import gov.hhs.aspr.ms.taskit.core.Translator;
import gov.hhs.aspr.ms.taskit.core.TranslatorId;
import util.annotations.UnitTestMethod;
import gov.hhs.aspr.ms.util.annotations.UnitTestMethod;

public class AT_TestComplexTranslator {

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

import org.junit.jupiter.api.Test;

import util.annotations.UnitTestField;
import gov.hhs.aspr.ms.util.annotations.UnitTestField;

public class AT_TestComplexTranslatorId {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
import org.junit.jupiter.api.Test;

import gov.hhs.aspr.ms.taskit.core.testsupport.TestObjectUtil;
import util.annotations.UnitTestConstructor;
import util.annotations.UnitTestMethod;
import gov.hhs.aspr.ms.util.annotations.UnitTestConstructor;
import gov.hhs.aspr.ms.util.annotations.UnitTestMethod;

public class AT_TestComplexInputObject {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
import gov.hhs.aspr.ms.taskit.core.testsupport.testcomplexobject.TestComplexAppObject;
import gov.hhs.aspr.ms.taskit.core.testsupport.testcomplexobject.input.TestComplexInputObject;
import gov.hhs.aspr.ms.taskit.core.testsupport.testobject.translationSpecs.TestObjectTranslationSpec;
import util.annotations.UnitTestConstructor;
import util.annotations.UnitTestForCoverage;
import util.annotations.UnitTestMethod;
import gov.hhs.aspr.ms.util.annotations.UnitTestConstructor;
import gov.hhs.aspr.ms.util.annotations.UnitTestForCoverage;
import gov.hhs.aspr.ms.util.annotations.UnitTestMethod;

public class AT_TestComplexObjectTranslationSpec {

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

import org.junit.jupiter.api.Test;

import util.annotations.UnitTestConstructor;
import gov.hhs.aspr.ms.util.annotations.UnitTestConstructor;

public class AT_TestAppChildObject {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

import gov.hhs.aspr.ms.taskit.core.testsupport.TestObjectUtil;
import gov.hhs.aspr.ms.taskit.core.testsupport.testcomplexobject.TestComplexAppObject;
import util.annotations.UnitTestConstructor;
import util.annotations.UnitTestMethod;
import gov.hhs.aspr.ms.util.annotations.UnitTestConstructor;
import gov.hhs.aspr.ms.util.annotations.UnitTestMethod;

public class AT_TestAppObject {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import gov.hhs.aspr.ms.taskit.core.Translator;
import gov.hhs.aspr.ms.taskit.core.TranslatorId;
import gov.hhs.aspr.ms.taskit.core.testsupport.testcomplexobject.TestComplexObjectTranslatorId;
import util.annotations.UnitTestMethod;
import gov.hhs.aspr.ms.util.annotations.UnitTestMethod;

public class AT_TestObjectTranslator {

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

import org.junit.jupiter.api.Test;

import util.annotations.UnitTestField;
import gov.hhs.aspr.ms.util.annotations.UnitTestField;

public class AT_TestObjectTranslatorId {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@

import gov.hhs.aspr.ms.taskit.core.testsupport.TestObjectUtil;
import gov.hhs.aspr.ms.taskit.core.testsupport.testobject.input.TestInputObject;
import util.annotations.UnitTestConstructor;
import util.annotations.UnitTestMethod;
import gov.hhs.aspr.ms.util.annotations.UnitTestConstructor;
import gov.hhs.aspr.ms.util.annotations.UnitTestMethod;

public class AT_TestObjectWrapper {

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

import org.junit.jupiter.api.Test;

import util.annotations.UnitTestConstructor;
import gov.hhs.aspr.ms.util.annotations.UnitTestConstructor;

public class AT_TestInputChildObject {
@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

import gov.hhs.aspr.ms.taskit.core.testsupport.TestObjectUtil;
import gov.hhs.aspr.ms.taskit.core.testsupport.testcomplexobject.input.TestComplexInputObject;
import util.annotations.UnitTestConstructor;
import util.annotations.UnitTestMethod;
import gov.hhs.aspr.ms.util.annotations.UnitTestConstructor;
import gov.hhs.aspr.ms.util.annotations.UnitTestMethod;

public class AT_TestInputObject {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
import gov.hhs.aspr.ms.taskit.core.testsupport.testcomplexobject.translationSpecs.TestComplexObjectTranslationSpec;
import gov.hhs.aspr.ms.taskit.core.testsupport.testobject.TestAppObject;
import gov.hhs.aspr.ms.taskit.core.testsupport.testobject.input.TestInputObject;
import util.annotations.UnitTestConstructor;
import util.annotations.UnitTestForCoverage;
import util.annotations.UnitTestMethod;
import gov.hhs.aspr.ms.util.annotations.UnitTestConstructor;
import gov.hhs.aspr.ms.util.annotations.UnitTestForCoverage;
import gov.hhs.aspr.ms.util.annotations.UnitTestMethod;

public class AT_TestObjectTranslationSpec {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@ public final class UnitTestReport {
public static void main(final String[] args) {

System.out.println("Missing Tests Report:");
util.meta.unittestcoverage.reports.MissingTestsReport.run(args);
gov.hhs.aspr.ms.util.meta.unittestcoverage.reports.MissingTestsReport.run(args);
System.out.print("\n\n\n");

System.out.println("MetaInfo Report:");
util.meta.unittestcoverage.reports.MetaInfoReport.run(args);
gov.hhs.aspr.ms.util.meta.unittestcoverage.reports.MetaInfoReport.run(args);
System.out.print("\n\n\n");

System.out.println("Incomplete Tests Report:");
util.meta.unittestcoverage.reports.IncompleteClassReport.run(args);
gov.hhs.aspr.ms.util.meta.unittestcoverage.reports.IncompleteClassReport.run(args);
System.out.print("\n\n\n");

System.out.println("Status Report:");
util.meta.unittestcoverage.reports.StatusReport.run(args);
gov.hhs.aspr.ms.util.meta.unittestcoverage.reports.StatusReport.run(args);
System.out.print("\n\n\n");
}

Expand Down
1 change: 0 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>${gson.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>gov.hhs.aspr.ms</groupId>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package gov.hhs.aspr.ms.taskit.protobuf;

import util.errors.ContractError;
import gov.hhs.aspr.ms.util.errors.ContractError;

public enum ProtobufCoreTranslationError implements ContractError {
INVALID_INPUT_CLASS("The input class is neither a Protobuf Message, nor a Protobuf Enum"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
import gov.hhs.aspr.ms.taskit.core.TranslationSpec;
import gov.hhs.aspr.ms.taskit.core.Translator;
import gov.hhs.aspr.ms.taskit.protobuf.translationSpecs.AnyTranslationSpec;
import util.errors.ContractException;
import gov.hhs.aspr.ms.util.errors.ContractException;

/**
* Protobuf TranslationEngine that allows for conversion between POJOs and
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import gov.hhs.aspr.ms.taskit.core.testsupport.testobject.TestObjectWrapper;
import gov.hhs.aspr.ms.taskit.protobuf.testsupport.testcomplexobject.translationSpecs.TestProtobufComplexObjectTranslationSpec;
import gov.hhs.aspr.ms.taskit.protobuf.testsupport.testobject.translationSpecs.TestProtobufObjectTranslationSpec;
import util.errors.ContractException;
import gov.hhs.aspr.ms.util.errors.ContractException;

public final class ProtobufTranslationEngineTestHelper {
private ProtobufTranslationEngineTestHelper() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import org.junit.jupiter.api.Test;

import util.annotations.UnitTestMethod;
import gov.hhs.aspr.ms.util.annotations.UnitTestMethod;

public class AT_ProtobufCoreTranslationError {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@
import gov.hhs.aspr.ms.taskit.protobuf.testsupport.testobject.input.TestInputEnum;
import gov.hhs.aspr.ms.taskit.protobuf.testsupport.testobject.input.TestInputObject;
import gov.hhs.aspr.ms.taskit.protobuf.testsupport.testobject.translationSpecs.TestProtobufObjectTranslationSpec;
import util.annotations.UnitTestForCoverage;
import util.annotations.UnitTestMethod;
import util.errors.ContractException;
import util.resourcehelper.TestResourceHelper;
import gov.hhs.aspr.ms.util.annotations.UnitTestForCoverage;
import gov.hhs.aspr.ms.util.annotations.UnitTestMethod;
import gov.hhs.aspr.ms.util.errors.ContractException;
import gov.hhs.aspr.ms.util.resourcehelper.TestResourceHelper;

public class AT_ProtobufTranslationEngine {
Path basePath = TestResourceHelper.getResourceDir(this.getClass());
Expand Down
Loading

0 comments on commit 97d1dde

Please sign in to comment.