chg xslt, add test class

This commit is contained in:
Andreas Czerniak 2021-05-03 16:10:41 +02:00
parent 103024d23e
commit 2baa038d0e
2 changed files with 20 additions and 46 deletions

View File

@ -1,26 +1,19 @@
package eu.dnetlib.dhp.transformation.xslt;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertThat;
import static org.mockito.Mockito.*;
import java.util.List;
import org.hamcrest.CoreMatchers;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.ArgumentCaptor;
import org.mockito.Mock;
import org.mockito.junit.MockitoJUnitRunner;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.junit.jupiter.MockitoExtension;
@RunWith(MockitoJUnitRunner.class)
@ExtendWith(MockitoExtension.class)
public class PersonCleanerTest {
private PersonCleaner personCleaner;
@Before
@BeforeEach
public void setup() {
this.personCleaner = new PersonCleaner();
}
@ -80,35 +73,4 @@ public class PersonCleanerTest {
// TODO: assert scenario
}
@Test
public void shouldGetName() {
QName actualValue = personCleaner.getName();
// TODO: assert scenario
}
@Test
public void shouldGetResultType() {
SequenceType actualValue = personCleaner.getResultType();
// TODO: assert scenario
}
@Test
public void shouldGetArgumentTypes() {
SequenceType[] actualValue = personCleaner.getArgumentTypes();
// TODO: assert scenario
}
@Test
public void shouldCall() {
// TODO: initialize args
XdmValue[] xdmValues;
XdmValue actualValue = personCleaner.call(xdmValues);
// TODO: assert scenario
}
}

View File

@ -15,7 +15,7 @@
exclude-result-prefixes="xsl vocabulary dateCleaner">
<xsl:param name="varOfficialName" />
<xsl:param name="varDsType" />
<!-- deprecated , marked to remove <xsl:param name="varDsType" /> -->
<xsl:param name="varDataSourceId" />
<xsl:param name="varFP7" select = "'corda_______::'"/>
@ -68,6 +68,12 @@
<xsl:call-template name="validRecord" />
</xsl:template>
<xsl:template name="terminate">
<xsl:message terminate="yes">
record is not compliant, transformation is interrupted.
</xsl:message>
</xsl:template>
<xsl:template name="validRecord">
<record>
<xsl:apply-templates select="//*[local-name() = 'header']" />
@ -276,6 +282,9 @@
<xsl:value-of select="$varEmbargoEndDate"/>
</oaf:embargoenddate>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="terminate"/>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
@ -301,6 +310,9 @@
</dr:CobjCategory>
-->
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="terminate"/>
</xsl:otherwise>
</xsl:choose>
<!-- review status -->