Make test classes name consitence by adding 'Support' or 'Dummy' at start of util or dummy type of test classes
Issue-ID: POLICY-1263
Change-Id: Ia90e0ea73af16f6cde37692e98f1c4afc408dd2b
Signed-off-by: Parshad Patel <pars.patel@samsung.com>
import org.onap.policy.apex.model.basicmodel.concepts.AxReferenceKey;
import org.onap.policy.apex.model.basicmodel.concepts.AxValidationResult;
-public class KeyUseTest {
+public class AxKeyUseTest {
@Test
public void test() {
@Entity
@Table(name = "TestEntity")
-public class TestEntity extends AxConcept {
+public class DummyEntity extends AxConcept {
private static final long serialVersionUID = -2962570563281067894L;
@EmbeddedId()
private double doubleValue;
- public TestEntity() {
+ public DummyEntity() {
this.key = new AxReferenceKey();
this.doubleValue = 0;
}
- public TestEntity(Double doubleValue) {
+ public DummyEntity(Double doubleValue) {
this.key = new AxReferenceKey();
this.doubleValue = doubleValue;
}
- public TestEntity(AxReferenceKey key, Double doubleValue) {
+ public DummyEntity(AxReferenceKey key, Double doubleValue) {
this.key = key;
this.doubleValue = doubleValue;
}
@Override
public AxConcept copyTo(AxConcept target) {
- final Object copyObject = ((target == null) ? new TestEntity() : target);
- if (copyObject instanceof TestEntity) {
- final TestEntity copy = ((TestEntity) copyObject);
+ final Object copyObject = ((target == null) ? new DummyEntity() : target);
+ if (copyObject instanceof DummyEntity) {
+ final DummyEntity copy = ((DummyEntity) copyObject);
if (this.checkSetKey()) {
copy.setKey(new AxReferenceKey(key));
} else {
if (getClass() != obj.getClass()) {
return false;
}
- TestEntity other = (TestEntity) obj;
+ DummyEntity other = (DummyEntity) obj;
if (key == null) {
if (other.key != null) {
return false;
if (this == otherObj) {
return 0;
}
- TestEntity other = (TestEntity) otherObj;
+ DummyEntity other = (DummyEntity) otherObj;
if (key == null) {
if (other.key != null) {
return 1;
import org.onap.policy.apex.model.basicmodel.concepts.AxArtifactKey;
import org.onap.policy.apex.model.basicmodel.concepts.AxKeyInfo;
import org.onap.policy.apex.model.basicmodel.concepts.AxReferenceKey;
-import org.onap.policy.apex.model.basicmodel.concepts.TestEntity;
+import org.onap.policy.apex.model.basicmodel.concepts.DummyEntity;
/**
* JUnit test class.
final AxArtifactKey owner4Key = new AxArtifactKey("Owner4", "0.0.1");
final AxArtifactKey owner5Key = new AxArtifactKey("Owner5", "0.0.1");
- apexDao.create(new TestEntity(new AxReferenceKey(owner0Key, "Entity0"), 100.0));
- apexDao.create(new TestEntity(new AxReferenceKey(owner0Key, "Entity1"), 101.0));
- apexDao.create(new TestEntity(new AxReferenceKey(owner0Key, "Entity2"), 102.0));
- apexDao.create(new TestEntity(new AxReferenceKey(owner0Key, "Entity3"), 103.0));
- apexDao.create(new TestEntity(new AxReferenceKey(owner0Key, "Entity4"), 104.0));
- apexDao.create(new TestEntity(new AxReferenceKey(owner1Key, "Entity5"), 105.0));
- apexDao.create(new TestEntity(new AxReferenceKey(owner1Key, "Entity6"), 106.0));
- apexDao.create(new TestEntity(new AxReferenceKey(owner1Key, "Entity7"), 107.0));
- apexDao.create(new TestEntity(new AxReferenceKey(owner2Key, "Entity8"), 108.0));
- apexDao.create(new TestEntity(new AxReferenceKey(owner2Key, "Entity9"), 109.0));
- apexDao.create(new TestEntity(new AxReferenceKey(owner3Key, "EntityA"), 110.0));
- apexDao.create(new TestEntity(new AxReferenceKey(owner4Key, "EntityB"), 111.0));
- apexDao.create(new TestEntity(new AxReferenceKey(owner5Key, "EntityC"), 112.0));
- apexDao.create(new TestEntity(new AxReferenceKey(owner5Key, "EntityD"), 113.0));
- apexDao.create(new TestEntity(new AxReferenceKey(owner5Key, "EntityE"), 114.0));
- apexDao.create(new TestEntity(new AxReferenceKey(owner5Key, "EntityF"), 115.0));
-
- TreeSet<TestEntity> testEntitySetOut = new TreeSet<TestEntity>(apexDao.getAll(TestEntity.class));
+ apexDao.create(new DummyEntity(new AxReferenceKey(owner0Key, "Entity0"), 100.0));
+ apexDao.create(new DummyEntity(new AxReferenceKey(owner0Key, "Entity1"), 101.0));
+ apexDao.create(new DummyEntity(new AxReferenceKey(owner0Key, "Entity2"), 102.0));
+ apexDao.create(new DummyEntity(new AxReferenceKey(owner0Key, "Entity3"), 103.0));
+ apexDao.create(new DummyEntity(new AxReferenceKey(owner0Key, "Entity4"), 104.0));
+ apexDao.create(new DummyEntity(new AxReferenceKey(owner1Key, "Entity5"), 105.0));
+ apexDao.create(new DummyEntity(new AxReferenceKey(owner1Key, "Entity6"), 106.0));
+ apexDao.create(new DummyEntity(new AxReferenceKey(owner1Key, "Entity7"), 107.0));
+ apexDao.create(new DummyEntity(new AxReferenceKey(owner2Key, "Entity8"), 108.0));
+ apexDao.create(new DummyEntity(new AxReferenceKey(owner2Key, "Entity9"), 109.0));
+ apexDao.create(new DummyEntity(new AxReferenceKey(owner3Key, "EntityA"), 110.0));
+ apexDao.create(new DummyEntity(new AxReferenceKey(owner4Key, "EntityB"), 111.0));
+ apexDao.create(new DummyEntity(new AxReferenceKey(owner5Key, "EntityC"), 112.0));
+ apexDao.create(new DummyEntity(new AxReferenceKey(owner5Key, "EntityD"), 113.0));
+ apexDao.create(new DummyEntity(new AxReferenceKey(owner5Key, "EntityE"), 114.0));
+ apexDao.create(new DummyEntity(new AxReferenceKey(owner5Key, "EntityF"), 115.0));
+
+ TreeSet<DummyEntity> testEntitySetOut = new TreeSet<DummyEntity>(apexDao.getAll(DummyEntity.class));
assertEquals(16, testEntitySetOut.size());
- testEntitySetOut = new TreeSet<TestEntity>(apexDao.getAll(TestEntity.class, owner0Key));
+ testEntitySetOut = new TreeSet<DummyEntity>(apexDao.getAll(DummyEntity.class, owner0Key));
assertEquals(5, testEntitySetOut.size());
- testEntitySetOut = new TreeSet<TestEntity>(apexDao.getAll(TestEntity.class, owner1Key));
+ testEntitySetOut = new TreeSet<DummyEntity>(apexDao.getAll(DummyEntity.class, owner1Key));
assertEquals(3, testEntitySetOut.size());
- testEntitySetOut = new TreeSet<TestEntity>(apexDao.getAll(TestEntity.class, owner2Key));
+ testEntitySetOut = new TreeSet<DummyEntity>(apexDao.getAll(DummyEntity.class, owner2Key));
assertEquals(2, testEntitySetOut.size());
- testEntitySetOut = new TreeSet<TestEntity>(apexDao.getAll(TestEntity.class, owner3Key));
+ testEntitySetOut = new TreeSet<DummyEntity>(apexDao.getAll(DummyEntity.class, owner3Key));
assertEquals(1, testEntitySetOut.size());
- testEntitySetOut = new TreeSet<TestEntity>(apexDao.getAll(TestEntity.class, owner4Key));
+ testEntitySetOut = new TreeSet<DummyEntity>(apexDao.getAll(DummyEntity.class, owner4Key));
assertEquals(1, testEntitySetOut.size());
- testEntitySetOut = new TreeSet<TestEntity>(apexDao.getAll(TestEntity.class, owner5Key));
+ testEntitySetOut = new TreeSet<DummyEntity>(apexDao.getAll(DummyEntity.class, owner5Key));
assertEquals(4, testEntitySetOut.size());
- assertNotNull(apexDao.get(TestEntity.class, new AxReferenceKey(owner0Key, "Entity0")));
- assertNotNull(apexDao.getArtifact(TestEntity.class, new AxReferenceKey(owner0Key, "Entity0")));
- assertNull(apexDao.get(TestEntity.class, new AxReferenceKey(owner0Key, "Entity1000")));
- assertNull(apexDao.getArtifact(TestEntity.class, new AxReferenceKey(owner0Key, "Entity1000")));
- apexDao.delete(TestEntity.class, new AxReferenceKey(owner0Key, "Entity0"));
+ assertNotNull(apexDao.get(DummyEntity.class, new AxReferenceKey(owner0Key, "Entity0")));
+ assertNotNull(apexDao.getArtifact(DummyEntity.class, new AxReferenceKey(owner0Key, "Entity0")));
+ assertNull(apexDao.get(DummyEntity.class, new AxReferenceKey(owner0Key, "Entity1000")));
+ assertNull(apexDao.getArtifact(DummyEntity.class, new AxReferenceKey(owner0Key, "Entity1000")));
+ apexDao.delete(DummyEntity.class, new AxReferenceKey(owner0Key, "Entity0"));
final Set<AxReferenceKey> rKeySetIn = new TreeSet<AxReferenceKey>();
rKeySetIn.add(new AxReferenceKey(owner4Key, "EntityB"));
rKeySetIn.add(new AxReferenceKey(owner5Key, "EntityD"));
- final int deletedRCount = apexDao.deleteByReferenceKey(TestEntity.class, rKeySetIn);
+ final int deletedRCount = apexDao.deleteByReferenceKey(DummyEntity.class, rKeySetIn);
assertEquals(2, deletedRCount);
- apexDao.update(new TestEntity(new AxReferenceKey(owner5Key, "EntityF"), 120.0));
+ apexDao.update(new DummyEntity(new AxReferenceKey(owner5Key, "EntityF"), 120.0));
}
}
import org.junit.Test;
import org.onap.policy.apex.model.basicmodel.handling.ApexModelException;
-public class ExceptionsTest {
+public class ApexModelExceptionTest {
@Test
public void test() {
import org.onap.policy.apex.model.basicmodel.concepts.AxModel;
import org.onap.policy.apex.model.basicmodel.handling.ApexModelFileWriter;
-public class ModelFileWriterTest {
+public class ApexModelFileWriterTest {
@Test
public void testModelFileWriter() throws IOException, ApexException {
File jsonTempFile = new File(tempDir.getAbsolutePath() + "/aaa/ApexFileWriterTest.json");
File xmlTempFile = new File(tempDir.getAbsolutePath() + "/ccc/ApexFileWriterTest.xml");
- AxModel model = new TestApexBasicModelCreator().getModel();
+ AxModel model = new DummyApexBasicModelCreator().getModel();
modelFileWriter.apexModelWriteJsonFile(model, AxModel.class, jsonTempFile.getAbsolutePath());
modelFileWriter.apexModelWriteXmlFile(model, AxModel.class, xmlTempFile.getAbsolutePath());
import org.onap.policy.apex.model.basicmodel.handling.ApexModelReader;
import org.onap.policy.apex.model.basicmodel.handling.ApexModelWriter;
-public class ModelReaderTest {
+public class ApexModelReaderTest {
@Test
public void testModelReader() throws IOException, ApexException {
- AxModel model = new TestApexBasicModelCreator().getModel();
- AxModel invalidModel = new TestApexBasicModelCreator().getInvalidModel();
+ AxModel model = new DummyApexBasicModelCreator().getModel();
+ AxModel invalidModel = new DummyApexBasicModelCreator().getInvalidModel();
ApexModelWriter<AxModel> modelWriter = new ApexModelWriter<AxModel>(AxModel.class);
modelWriter.setValidateFlag(true);
import org.onap.policy.apex.model.basicmodel.concepts.AxModel;
import org.onap.policy.apex.model.basicmodel.handling.ApexModelSaver;
-public class ModelSaverTest {
+public class ApexModelSaverTest {
@Test
public void testModelSaver() throws IOException, ApexException {
- AxModel model = new TestApexBasicModelCreator().getModel();
+ AxModel model = new DummyApexBasicModelCreator().getModel();
Path tempPath = Files.createTempDirectory("ApexTest");
import org.onap.policy.apex.model.basicmodel.concepts.AxModel;
import org.onap.policy.apex.model.basicmodel.handling.ApexModelStringWriter;
-public class ModelStringWriterTest {
+public class ApexModelStringWriterTest {
@Test
public void testModelStringWriter() throws IOException, ApexException {
- AxModel basicModel = new TestApexBasicModelCreator().getModel();
+ AxModel basicModel = new DummyApexBasicModelCreator().getModel();
assertNotNull(basicModel);
AxKeyInfo intKeyInfo = basicModel.getKeyInformation().get("IntegerKIKey");
import org.onap.policy.apex.model.basicmodel.concepts.AxModel;
import org.onap.policy.apex.model.basicmodel.handling.ApexModelWriter;
-public class ModelWriterTest {
+public class ApexModelWriterTest {
@Test
public void testModelWriter() throws IOException, ApexException {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
- AxModel model = new TestApexBasicModelCreator().getModel();
+ AxModel model = new DummyApexBasicModelCreator().getModel();
modelWriter.write(model, baos);
modelWriter.setJsonOutput(true);
import org.junit.Test;
-public class SchemaGeneratorTest {
+public class ApexSchemaGeneratorTest {
@Test
public void test() throws IOException {
import org.onap.policy.apex.model.basicmodel.concepts.AxModel;
import org.onap.policy.apex.model.basicmodel.test.TestApexModelCreator;
-public class TestApexBasicModelCreator implements TestApexModelCreator<AxModel> {
+public class DummyApexBasicModelCreator implements TestApexModelCreator<AxModel> {
@Override
public AxModel getModel() {
* Get the model with its references.
* @return the model with its references
*/
- public final AxModelWithReferences getModelWithReferences() {
+ public final DummyAxModelWithReferences getModelWithReferences() {
AxModel model = getModel();
- AxModelWithReferences modelWithReferences = new AxModelWithReferences(model.getKey());
+ DummyAxModelWithReferences modelWithReferences = new DummyAxModelWithReferences(model.getKey());
modelWithReferences.setKeyInformation(model.getKeyInformation());
modelWithReferences.setReferenceKeyList();
import org.onap.policy.apex.model.basicmodel.concepts.AxModel;
import org.onap.policy.apex.model.basicmodel.concepts.AxReferenceKey;
-public class AxModelWithReferences extends AxModel {
+public class DummyAxModelWithReferences extends AxModel {
private static final long serialVersionUID = -8194956638511120008L;
private List<AxKey> extrakeyList = new ArrayList<>();
- public AxModelWithReferences(final AxArtifactKey key) {
+ public DummyAxModelWithReferences(final AxArtifactKey key) {
super(key);
}
import org.onap.policy.apex.model.basicmodel.service.ModelService;
import org.onap.policy.apex.model.basicmodel.test.TestApexModel;
-public class ApexBasicModelConceptsTest {
+public class SupportApexBasicModelConceptsTester {
TestApexModel<AxModel> testApexModel;
@Before
public void setup() throws Exception {
- testApexModel = new TestApexModel<AxModel>(AxModel.class, new TestApexBasicModelCreator());
+ testApexModel = new TestApexModel<AxModel>(AxModel.class, new DummyApexBasicModelCreator());
}
@Test
@Test
public void testModelConceptsWithReferences() {
- final AxModelWithReferences mwr = new TestApexBasicModelCreator().getModelWithReferences();
+ final DummyAxModelWithReferences mwr = new DummyApexBasicModelCreator().getModelWithReferences();
assertNotNull(mwr);
mwr.getKeyInformation().getKeyInfoMap().clear();
mwr.getKeyInformation().generateKeyInfo(mwr);
import org.onap.policy.apex.model.basicmodel.dao.DaoParameters;
import org.onap.policy.apex.model.basicmodel.test.TestApexModel;
-public class ApexBasicModelTest {
+public class SupportApexBasicModelTester {
private Connection connection;
TestApexModel<AxModel> testApexModel;
Class.forName("org.apache.derby.jdbc.EmbeddedDriver").newInstance();
connection = DriverManager.getConnection("jdbc:derby:memory:apex_test;create=true");
- testApexModel = new TestApexModel<AxModel>(AxModel.class, new TestApexBasicModelCreator());
+ testApexModel = new TestApexModel<AxModel>(AxModel.class, new DummyApexBasicModelCreator());
}
@After
import org.onap.policy.apex.model.basicmodel.concepts.AxModel;
import org.onap.policy.apex.model.basicmodel.test.TestApexModel;
-public class BasicModelTest {
+public class SupportBasicModelTester {
@Test
public void testNormalModelCreator() throws ApexException {
final TestApexModel<AxModel> testApexModel = new TestApexModel<AxModel>(AxModel.class,
- new TestApexBasicModelCreator());
+ new DummyApexBasicModelCreator());
testApexModel.testApexModelValid();
try {
@Test
public void testModelCreator0() throws ApexException {
final TestApexModel<AxModel> testApexModel = new TestApexModel<AxModel>(AxModel.class,
- new TestApexTestModelCreator0());
+ new TestApexModelCreator0Test());
testApexModel.testApexModelValid();
try {
@Test
public void testModelCreator1() throws ApexException {
final TestApexModel<AxModel> testApexModel = new TestApexModel<AxModel>(AxModel.class,
- new TestApexTestModelCreator1());
+ new TestApexModelCreator1Test());
try {
testApexModel.testApexModelValid();
@Test
public void testModelCreator2() throws ApexException {
final TestApexModel<AxModel> testApexModel = new TestApexModel<AxModel>(AxModel.class,
- new TestApexTestModelCreator2());
+ new TestApexModelCreator2Test());
testApexModel.testApexModelValid();
testApexModel.testApexModelVaidateObservation();
@Test
public void testModelCreator1XmlJson() throws ApexException {
final TestApexModel<AxModel> testApexModel = new TestApexModel<AxModel>(AxModel.class,
- new TestApexTestModelCreator1());
+ new TestApexModelCreator1Test());
try {
testApexModel.testApexModelWriteReadJson();
import org.onap.policy.apex.model.basicmodel.handling.ApexModelFileWriter;
import org.onap.policy.apex.model.basicmodel.handling.ApexModelReader;
-public class ConceptGetterTest {
+public class SupportConceptGetterTester {
@Test
public void testConceptGetter() throws IOException, ApexException {
- AxModel basicModel = new TestApexBasicModelCreator().getModel();
+ AxModel basicModel = new DummyApexBasicModelCreator().getModel();
assertNotNull(basicModel);
AxKeyInfo intKI01 = new AxKeyInfo(new AxArtifactKey("IntegerKIKey01", "0.0.1"), UUID.randomUUID(),
import org.onap.policy.apex.model.basicmodel.concepts.AxModel;
import org.onap.policy.apex.model.basicmodel.test.TestApexModelCreator;
-public class TestApexTestModelCreator0 implements TestApexModelCreator<AxModel> {
+public class TestApexModelCreator0Test implements TestApexModelCreator<AxModel> {
@Override
public AxModel getModel() {
import org.onap.policy.apex.model.basicmodel.concepts.AxModel;
import org.onap.policy.apex.model.basicmodel.test.TestApexModelCreator;
-public class TestApexTestModelCreator1 implements TestApexModelCreator<AxModel> {
+public class TestApexModelCreator1Test implements TestApexModelCreator<AxModel> {
@Override
public AxModel getModel() {
import org.onap.policy.apex.model.basicmodel.concepts.AxModel;
import org.onap.policy.apex.model.basicmodel.test.TestApexModelCreator;
-public class TestApexTestModelCreator2 implements TestApexModelCreator<AxModel> {
+public class TestApexModelCreator2Test implements TestApexModelCreator<AxModel> {
@Override
public AxModel getModel() {
import org.junit.Test;
import org.onap.policy.apex.model.basicmodel.concepts.AxKeyInformation;
-import org.onap.policy.apex.model.basicmodel.handling.TestApexBasicModelCreator;
+import org.onap.policy.apex.model.basicmodel.handling.DummyApexBasicModelCreator;
public class ModelServiceTest {
}
ModelService.registerModel(AxKeyInformation.class,
- new TestApexBasicModelCreator().getModel().getKeyInformation());
+ new DummyApexBasicModelCreator().getModel().getKeyInformation());
assertTrue(ModelService.existsModel(AxKeyInformation.class));
assertNotNull(ModelService.getModel(AxKeyInformation.class));
}
ModelService.registerModel(AxKeyInformation.class,
- new TestApexBasicModelCreator().getModel().getKeyInformation());
+ new DummyApexBasicModelCreator().getModel().getKeyInformation());
assertTrue(ModelService.existsModel(AxKeyInformation.class));
assertNotNull(ModelService.getModel(AxKeyInformation.class));
<class>org.onap.policy.apex.model.basicmodel.concepts.AxKeyInfo</class>
<class>org.onap.policy.apex.model.basicmodel.concepts.AxKeyInformation</class>
<class>org.onap.policy.apex.model.basicmodel.concepts.AxModel</class>
- <class>org.onap.policy.apex.model.basicmodel.concepts.TestEntity</class>
+ <class>org.onap.policy.apex.model.basicmodel.concepts.DummyEntity</class>
<properties>
<property name="javax.persistence.jdbc.url" value="jdbc:derby:memory:apex_test" />