Package chunmap.model.relate.relateop

Source Code of chunmap.model.relate.relateop.Point_PointTest

/**
* Copyright (c) 2009-2011, chunquedong(YangJiandong)
*
* This file is part of ChunMap project
* Licensed under the GNU LESSER GENERAL PUBLIC LICENSE(Version >=3)
*
* History:
*     2010-05-05  Jed Young  Creation
*/
package chunmap.model.relate.relateop;

import static org.junit.Assert.*;

import org.junit.Test;

import chunmap.model.geom.GeoPoint;
import chunmap.model.relate.ComputeImFactory;
import chunmap.model.relate.IntersectionMatrix;
import chunmap.model.relate.ComputeIm;

/**
* @author chunquedong
*
*/
public class Point_PointTest {

  /**
   * {@link chunmap.model.relate.relateop.Point_Point#computeIM()} 的测试方法。
   */
  @Test
  public void testComputeIM() {
    GeoPoint p1 = new GeoPoint(1, 2);
    GeoPoint p2 = new GeoPoint(1, 0);

    ComputeIm r = new Point_Point(p1, p2);
    IntersectionMatrix rt = r.getIM();

    assertTrue(rt.match(IntersectionMatrix.DisjointPattern));
  }

  @Test
  public void testComputeIM2() {
    GeoPoint p1 = new GeoPoint(1, 2);
    GeoPoint p2 = new GeoPoint(1, 2);

    ComputeIm r = new Point_Point(p1, p2);
    IntersectionMatrix rt = r.getIM();

    assertFalse(rt.match(IntersectionMatrix.DisjointPattern));
  }

  @Test
  public void testComputeIM3() {
    GeoPoint p1 = new GeoPoint(1, 2);
    GeoPoint p2 = new GeoPoint(1, 0);

    IntersectionMatrix rt = ComputeImFactory.getInstance().getImComputer(p1, p2).getIM();

    assertTrue(rt.match(IntersectionMatrix.DisjointPattern));
  }

}
TOP

Related Classes of chunmap.model.relate.relateop.Point_PointTest

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.