Package align.task

Source Code of align.task.SimpleTaskTest

package align.task;

import static loomchild.util.testing.Utils.assertListEquals;

import java.util.List;

import junit.framework.TestCase;
import align.aligner.Aligner;
import align.aligner.AlignerMock;
import align.aligner.AlignmentImpossibleException;
import align.data.Alignment;
import align.splitter.Splitter;
import align.splitter.SplitterMock;

public class SimpleTaskTest extends TestCase {
 
  public void testUseDifferentSplitters() throws AlignmentImpossibleException {
    Splitter sourceSplitter = new SplitterMock(1);
    Splitter targetSplitter = new SplitterMock(2);
    Aligner aligner = new AlignerMock();   
    SimpleTask task =
      new SimpleTask(sourceSplitter, targetSplitter, aligner);
    List<Alignment> alignmentList = task.run("abcd", "efgh");
    assertEquals(1, alignmentList.size());
    Alignment alignment = alignmentList.get(0);
    assertListEquals(new String[]{"a", "b", "c", "d",},
        alignment.getSourceSegmentList());
    assertListEquals(new String[]{"ef", "gh",},
        alignment.getTargetSegmentList());
  }
 
}
TOP

Related Classes of align.task.SimpleTaskTest

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.