Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoberto E. Escobar2013-09-06 13:31:35 -0400
committerGerrit Code Review @ Eclipse.org2013-09-10 15:01:27 -0400
commit4c1d849b32ccd9cd670e6aeee746f60f30f1be25 (patch)
tree915ba4e1ae15ff1544ea77a193728f2a9450eaef /plugins/org.eclipse.osee.orcs.core.test
parent302e7e1e425b13d5b46297bf21225d2dbb3fc9c4 (diff)
downloadorg.eclipse.osee-4c1d849b32ccd9cd670e6aeee746f60f30f1be25.tar.gz
org.eclipse.osee-4c1d849b32ccd9cd670e6aeee746f60f30f1be25.tar.xz
org.eclipse.osee-4c1d849b32ccd9cd670e6aeee746f60f30f1be25.zip
refactor: Simplify LoadDataHandler
Diffstat (limited to 'plugins/org.eclipse.osee.orcs.core.test')
-rw-r--r--plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/ds/LoadDataHandlerDecoratorTest.java16
-rw-r--r--plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/loader/ArtifactBuilderImplTest.java12
2 files changed, 10 insertions, 18 deletions
diff --git a/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/ds/LoadDataHandlerDecoratorTest.java b/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/ds/LoadDataHandlerDecoratorTest.java
index 062894c2e1..0efd672abc 100644
--- a/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/ds/LoadDataHandlerDecoratorTest.java
+++ b/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/ds/LoadDataHandlerDecoratorTest.java
@@ -11,7 +11,6 @@
package org.eclipse.osee.orcs.core.ds;
import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.when;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.type.MatchLocation;
import org.junit.Before;
@@ -34,11 +33,7 @@ public class LoadDataHandlerDecoratorTest {
@Mock private RelationData relData;
@Mock private LoadDescription description;
@Mock private MatchLocation match;
-
-
- @Mock private OrcsDataHandler<ArtifactData> artDataHandler;
- @Mock private OrcsDataHandler<AttributeData> attrDataHandler;
- @Mock private OrcsDataHandler<RelationData> relDataHandler;
+
// @formatter:on
private LoadDataHandlerDecorator decorated;
@@ -49,9 +44,6 @@ public class LoadDataHandlerDecoratorTest {
decorated = new LoadDataHandlerDecorator(handler);
- when(handler.getArtifactDataHandler()).thenReturn(artDataHandler);
- when(handler.getAttributeDataHandler()).thenReturn(attrDataHandler);
- when(handler.getRelationDataHandler()).thenReturn(relDataHandler);
}
@Test
@@ -66,13 +58,13 @@ public class LoadDataHandlerDecoratorTest {
verify(handler).onData(attrData, match);
decorated.onData(artData);
- verify(artDataHandler).onData(artData);
+ verify(handler).onData(artData);
decorated.onData(attrData);
- verify(attrDataHandler).onData(attrData);
+ verify(handler).onData(attrData);
decorated.onData(relData);
- verify(relDataHandler).onData(relData);
+ verify(handler).onData(relData);
decorated.onLoadEnd();
verify(handler).onLoadEnd();
diff --git a/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/loader/ArtifactBuilderImplTest.java b/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/loader/ArtifactBuilderImplTest.java
index 67822b7894..37676fee4e 100644
--- a/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/loader/ArtifactBuilderImplTest.java
+++ b/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/loader/ArtifactBuilderImplTest.java
@@ -33,8 +33,8 @@ import org.eclipse.osee.orcs.core.ds.AttributeData;
import org.eclipse.osee.orcs.core.ds.RelationData;
import org.eclipse.osee.orcs.core.ds.VersionData;
import org.eclipse.osee.orcs.core.internal.ArtifactBuilder;
-import org.eclipse.osee.orcs.core.internal.artifact.ArtifactFactory;
import org.eclipse.osee.orcs.core.internal.artifact.Artifact;
+import org.eclipse.osee.orcs.core.internal.artifact.ArtifactFactory;
import org.eclipse.osee.orcs.core.internal.attribute.AttributeFactory;
import org.eclipse.osee.orcs.core.internal.proxy.ArtifactProxyFactory;
import org.eclipse.osee.orcs.core.internal.relation.RelationContainer;
@@ -82,8 +82,8 @@ public class ArtifactBuilderImplTest {
when(attributeData.getArtifactId()).thenReturn(45);
- builder.getArtifactDataHandler().onData(artifactData);
- builder.getAttributeDataHandler().onData(attributeData);
+ builder.onData(artifactData);
+ builder.onData(attributeData);
verify(attributeFactory).createAttribute(artifact, attributeData);
verify(logger, times(0)).warn("");
@@ -96,7 +96,7 @@ public class ArtifactBuilderImplTest {
when(attributeData.getArtifactId()).thenReturn(45);
- builder.getAttributeDataHandler().onData(attributeData);
+ builder.onData(attributeData);
verify(attributeFactory, times(0)).createAttribute(artifact, attributeData);
verify(logger).warn("Orphaned attribute detected - [%s]", attributeData);
@@ -110,7 +110,7 @@ public class ArtifactBuilderImplTest {
doSetup(datas, containers);
for (RelationData data : datas) {
- builder.getRelationDataHandler().onData(data);
+ builder.onData(data);
}
checkRelationCount(containers.get(1), RelationSide.SIDE_B, 9);
@@ -149,7 +149,7 @@ public class ArtifactBuilderImplTest {
RelationContainer container = containers.get(id);
when(artifact.getRelationContainer()).thenReturn(container);
- builder.getArtifactDataHandler().onData(artData);
+ builder.onData(artData);
}
}

Back to the top