Skip to content

Commit

Permalink
#13: fixed #13
Browse files Browse the repository at this point in the history
  • Loading branch information
FlorianZipser committed Mar 29, 2017
1 parent bfed0ac commit 8cce3da
Show file tree
Hide file tree
Showing 7 changed files with 16,113 additions and 9,691 deletions.
14 changes: 11 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.corpus-tools</groupId>
Expand All @@ -22,10 +23,17 @@
<connection>scm:git:git://github.com/korpling/pepperModules-MergingModule.git</connection>
<developerConnection>scm:git:git@github.com:korpling/pepperModules-MergingModule.git</developerConnection>
<url>https://github.com/korpling/pepperModules-MergingModule</url>
<tag>HEAD</tag>
</scm>
<tag>HEAD</tag>
</scm>
<inceptionYear>2014</inceptionYear>
<organization>
<name>Humboldt-Universität zu Berlin</name>
</organization>
<dependencies>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.7.5</version>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,16 @@ public boolean isReadyToStart() {

@Override
public SelfTestDesc getSelfTestDesc() {
getProperties().setPropertyValue(MergerProperties.PROP_FIRST_AS_BASE, true);
getProperties().setPropertyValue(MergerProperties.PROP_COPY_NODES, true);
final URI baseInputCorpus = getResources().appendSegment("selfTests").appendSegment("in");
final URI morphCorpus = baseInputCorpus.appendSegment("morph");
final URI rstCorpus = baseInputCorpus.appendSegment("rst");
final URI syntaxCorpus = baseInputCorpus.appendSegment("syntax");
final URI expectedCorpus = getResources().appendSegment("selfTests").appendSegment("expected");

return SelfTestDesc.create().withInputCorpusPath(morphCorpus).withInputCorpusPath(rstCorpus)
.withInputCorpusPath(syntaxCorpus).withExpectedCorpusPath(expectedCorpus).build();
return SelfTestDesc.create().withInputCorpusPath(rstCorpus).withInputCorpusPath(syntaxCorpus)
.withInputCorpusPath(morphCorpus).withExpectedCorpusPath(expectedCorpus).build();
}

/**
Expand Down
9,657 changes: 5,971 additions & 3,686 deletions src/main/resources/selfTests/expected/pcc3/maz-00001.salt
100755 → 100644

Large diffs are not rendered by default.

7,275 changes: 4,597 additions & 2,678 deletions src/main/resources/selfTests/expected/pcc3/maz-00002.salt
100755 → 100644

Large diffs are not rendered by default.

8,764 changes: 5,496 additions & 3,268 deletions src/main/resources/selfTests/expected/pcc3/maz-1423.salt
100755 → 100644

Large diffs are not rendered by default.

67 changes: 33 additions & 34 deletions src/main/resources/selfTests/expected/saltProject.salt
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,35 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<saltCommon:SaltProject xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:sCorpusStructure="sCorpusStructure" xmlns:saltCommon="saltCommon" xmlns:saltCore="saltCore">
<sCorpusGraphs>
<labels xsi:type="saltCore:SElementId" namespace="graph" name="id" value="T::corpusGraph1"/>
<labels xsi:type="saltCore:SFeature" namespace="salt" name="SNAME" value="T::pcc3_graph"/>
<nodes xsi:type="sCorpusStructure:SCorpus">
<labels xsi:type="saltCore:SFeature" namespace="salt" name="SNAME" value="T::pcc3"/>
<labels xsi:type="saltCore:SElementId" namespace="graph" name="id" value="T::salt:/pcc3"/>
</nodes>
<nodes xsi:type="sCorpusStructure:SDocument">
<labels xsi:type="saltCore:SFeature" namespace="salt" name="SNAME" value="T::maz-00001"/>
<labels xsi:type="saltCore:SElementId" namespace="graph" name="id" value="T::salt:/pcc3/maz-00001"/>
</nodes>
<nodes xsi:type="sCorpusStructure:SDocument">
<labels xsi:type="saltCore:SFeature" namespace="salt" name="SNAME" value="T::maz-00002"/>
<labels xsi:type="saltCore:SElementId" namespace="graph" name="id" value="T::salt:/pcc3/maz-00002"/>
</nodes>
<nodes xsi:type="sCorpusStructure:SDocument">
<labels xsi:type="saltCore:SFeature" namespace="salt" name="SNAME" value="T::maz-1423"/>
<labels xsi:type="saltCore:SElementId" namespace="graph" name="id" value="T::salt:/pcc3/maz-1423"/>
</nodes>
<edges xsi:type="sCorpusStructure:SCorpusDocumentRelation" source="//@sCorpusGraphs.0/@nodes.0" target="//@sCorpusGraphs.0/@nodes.1">
<labels xsi:type="saltCore:SFeature" namespace="salt" name="SNAME" value="T::corpDocRel1"/>
<labels xsi:type="saltCore:SElementId" namespace="graph" name="id" value="T::salt:/corpDocRel1"/>
</edges>
<edges xsi:type="sCorpusStructure:SCorpusDocumentRelation" source="//@sCorpusGraphs.0/@nodes.0" target="//@sCorpusGraphs.0/@nodes.2">
<labels xsi:type="saltCore:SFeature" namespace="salt" name="SNAME" value="T::corpDocRel2"/>
<labels xsi:type="saltCore:SElementId" namespace="graph" name="id" value="T::salt:/corpDocRel2"/>
</edges>
<edges xsi:type="sCorpusStructure:SCorpusDocumentRelation" source="//@sCorpusGraphs.0/@nodes.0" target="//@sCorpusGraphs.0/@nodes.3">
<labels xsi:type="saltCore:SFeature" namespace="salt" name="SNAME" value="T::corpDocRel3"/>
<labels xsi:type="saltCore:SElementId" namespace="graph" name="id" value="T::salt:/corpDocRel3"/>
</edges>
</sCorpusGraphs>
<?xml version='1.0' encoding='UTF-8'?>
<saltCommon:SaltProject xmlns:sCorpusStructure="sCorpusStructure" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:saltCore="saltCore" xmlns:saltCommon="saltCommon" xmi:version="2.0">
<sCorpusGraphs>
<labels xsi:type="saltCore:SFeature" namespace="salt" name="SNAME" value="T::pcc3"/>
<nodes xsi:type="sCorpusStructure:SCorpus">
<labels xsi:type="saltCore:SElementId" namespace="salt" name="id" value="T::salt:/pcc3"/>
<labels xsi:type="saltCore:SFeature" namespace="salt" name="SNAME" value="T::pcc3"/>
</nodes>
<nodes xsi:type="sCorpusStructure:SDocument">
<labels xsi:type="saltCore:SElementId" namespace="salt" name="id" value="T::salt:/pcc3/maz-00001"/>
<labels xsi:type="saltCore:SFeature" namespace="salt" name="SNAME" value="T::maz-00001"/>
</nodes>
<nodes xsi:type="sCorpusStructure:SDocument">
<labels xsi:type="saltCore:SElementId" namespace="salt" name="id" value="T::salt:/pcc3/maz-00002"/>
<labels xsi:type="saltCore:SFeature" namespace="salt" name="SNAME" value="T::maz-00002"/>
</nodes>
<nodes xsi:type="sCorpusStructure:SDocument">
<labels xsi:type="saltCore:SElementId" namespace="salt" name="id" value="T::salt:/pcc3/maz-1423"/>
<labels xsi:type="saltCore:SFeature" namespace="salt" name="SNAME" value="T::maz-1423"/>
</nodes>
<edges xsi:type="sCorpusStructure:SCorpusDocumentRelation" source="//@nodes.0" target="//@nodes.1">
<labels xsi:type="saltCore:SElementId" namespace="salt" name="id" value="T::salt:/corpDocRel1"/>
<labels xsi:type="saltCore:SFeature" namespace="salt" name="SNAME" value="T::corpDocRel1"/>
</edges>
<edges xsi:type="sCorpusStructure:SCorpusDocumentRelation" source="//@nodes.0" target="//@nodes.2">
<labels xsi:type="saltCore:SElementId" namespace="salt" name="id" value="T::salt:/corpDocRel2"/>
<labels xsi:type="saltCore:SFeature" namespace="salt" name="SNAME" value="T::corpDocRel2"/>
</edges>
<edges xsi:type="sCorpusStructure:SCorpusDocumentRelation" source="//@nodes.0" target="//@nodes.3">
<labels xsi:type="saltCore:SElementId" namespace="salt" name="id" value="T::salt:/corpDocRel3"/>
<labels xsi:type="saltCore:SFeature" namespace="salt" name="SNAME" value="T::corpDocRel3"/>
</edges>
</sCorpusGraphs>
</saltCommon:SaltProject>
Original file line number Diff line number Diff line change
Expand Up @@ -19,38 +19,19 @@

import static org.junit.Assert.assertEquals;

import java.io.File;

import org.corpus_tools.pepper.testFramework.PepperManipulatorTest;
import org.corpus_tools.peppermodules.mergingModules.Merger;
import org.corpus_tools.salt.SaltFactory;
import org.corpus_tools.salt.common.SCorpus;
import org.corpus_tools.salt.common.SCorpusGraph;
import org.corpus_tools.salt.common.SDocument;
import org.eclipse.emf.common.util.URI;
import org.junit.Before;
import org.junit.Test;

/**
*
* @author Florian Zipser
*
*/
public class MergerTest extends PepperManipulatorTest {

private Merger fixture = null;

public Merger getFixture() {
return fixture;
}

public void setFixture(Merger fixture) {
this.fixture = fixture;
super.setResourcesURI(URI.createFileURI(new File(".").getAbsolutePath()));
}

@Before
public void setUp() {
public void beforeEach() {
setFixture(new Merger());
getFixture().setSaltProject(SaltFactory.createSaltProject());
}
Expand Down

0 comments on commit 8cce3da

Please sign in to comment.