当前位置: 首页>>代码示例>>Java>>正文


Java Assert.equals方法代码示例

本文整理汇总了Java中com.vividsolutions.jts.util.Assert.equals方法的典型用法代码示例。如果您正苦于以下问题:Java Assert.equals方法的具体用法?Java Assert.equals怎么用?Java Assert.equals使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.vividsolutions.jts.util.Assert的用法示例。


在下文中一共展示了Assert.equals方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: runCheck

import com.vividsolutions.jts.util.Assert; //导入方法依赖的package包/类
@Test
public void runCheck() throws Exception {
	TransitSchedule s = ScheduleToolsTest.initSchedule();
	Network n = NetworkToolsTest.initNetwork();

	PlausibilityCheck check = new PlausibilityCheck(s, n, null);
	check.setDirectionChangeThreshold("bus", Math.PI * 95 / 180);
	check.setTtRange(0);
	check.runCheck();

	Map<PlausibilityWarning.Type, Set<PlausibilityWarning>> warnings = check.getWarnings();
	Assert.equals(0, warnings.get(PlausibilityWarning.Type.ArtificialLinkWarning).size());
	Assert.equals(0, warnings.get(PlausibilityWarning.Type.LoopWarning).size());
	Assert.equals(4, warnings.get(PlausibilityWarning.Type.DirectionChangeWarning).size());
	Assert.equals(0, warnings.get(PlausibilityWarning.Type.TravelTimeWarning).size());
}
 
开发者ID:matsim-org,项目名称:pt2matsim,代码行数:17,代码来源:PlausibilityCheckTest.java

示例2: cleanRing

import com.vividsolutions.jts.util.Assert; //导入方法依赖的package包/类
/**
 * @param vertices the vertices of a linear ring, which may or may not be
 * flattened (i.e. vertices collinear)
 * @return the coordinates with unnecessary (collinear) vertices
 * removed
 */
private Coordinate[] cleanRing(Coordinate[] original) {
    Assert.equals(original[0], original[original.length - 1]);
    ArrayList cleanedRing = new ArrayList();
    Coordinate previousDistinctCoordinate = null;
    for (int i = 0; i <= original.length - 2; i++) {
        Coordinate currentCoordinate = original[i];
        Coordinate nextCoordinate = original[i + 1];
        if (currentCoordinate.equals(nextCoordinate)) {
            continue;
        }
        if (previousDistinctCoordinate != null
                && this.isBetween(previousDistinctCoordinate, currentCoordinate, nextCoordinate)) {
            continue;
        }
        cleanedRing.add(currentCoordinate);
        previousDistinctCoordinate = currentCoordinate;
    }
    cleanedRing.add(original[original.length - 1]);
    Coordinate[] cleanedRingCoordinates = new Coordinate[cleanedRing.size()];
    return (Coordinate[]) cleanedRing.toArray(cleanedRingCoordinates);
}
 
开发者ID:gegy1000,项目名称:Earth,代码行数:28,代码来源:ConvexHull.java

示例3: cleanRing

import com.vividsolutions.jts.util.Assert; //导入方法依赖的package包/类
/**
 * @param vertices the vertices of a linear ring, which may or may not be
 *                 flattened (i.e. vertices collinear)
 * @return the coordinates with unnecessary (collinear) vertices
 * removed
 */
private Coordinate[] cleanRing(Coordinate[] original) {
    Assert.equals(original[0], original[original.length - 1]);
    ArrayList cleanedRing = new ArrayList();
    Coordinate previousDistinctCoordinate = null;
    for (int i = 0; i <= original.length - 2; i++) {
        Coordinate currentCoordinate = original[i];
        Coordinate nextCoordinate = original[i + 1];
        if (currentCoordinate.equals(nextCoordinate)) {
            continue;
        }
        if (previousDistinctCoordinate != null
                && isBetween(previousDistinctCoordinate, currentCoordinate, nextCoordinate)) {
            continue;
        }
        cleanedRing.add(currentCoordinate);
        previousDistinctCoordinate = currentCoordinate;
    }
    cleanedRing.add(original[original.length - 1]);
    Coordinate[] cleanedRingCoordinates = new Coordinate[cleanedRing.size()];
    return (Coordinate[]) cleanedRing.toArray(cleanedRingCoordinates);
}
 
开发者ID:Semantive,项目名称:jts,代码行数:28,代码来源:ConvexHull.java

示例4: cleanRing

import com.vividsolutions.jts.util.Assert; //导入方法依赖的package包/类
/**
 *@param  vertices  the vertices of a linear ring, which may or may not be
 *      flattened (i.e. vertices collinear)
 *@return           the coordinates with unnecessary (collinear) vertices
 *      removed
 */
private Coordinate[] cleanRing(Coordinate[] original) {
  Assert.equals(original[0], original[original.length - 1]);
  ArrayList cleanedRing = new ArrayList();
  Coordinate previousDistinctCoordinate = null;
  for (int i = 0; i <= original.length - 2; i++) {
    Coordinate currentCoordinate = original[i];
    Coordinate nextCoordinate = original[i+1];
    if (currentCoordinate.equals(nextCoordinate)) {
      continue;
    }
    if (previousDistinctCoordinate != null
        && isBetween(previousDistinctCoordinate, currentCoordinate, nextCoordinate)) {
      continue;
    }
    cleanedRing.add(currentCoordinate);
    previousDistinctCoordinate = currentCoordinate;
  }
  cleanedRing.add(original[original.length - 1]);
  Coordinate[] cleanedRingCoordinates = new Coordinate[cleanedRing.size()];
  return (Coordinate[]) cleanedRing.toArray(cleanedRingCoordinates);
}
 
开发者ID:GitHubDroid,项目名称:geodroid_master_update,代码行数:28,代码来源:ConvexHull.java

示例5: testGetPossibleConnectionsOneWayImport

import com.vividsolutions.jts.util.Assert; //导入方法依赖的package包/类
@Test
public void testGetPossibleConnectionsOneWayImport() {

    List<RouteType> expectedRouteTypes = new ArrayList<>();
    expectedRouteTypes.add(BARGE);
    expectedRouteTypes.add(TRUCK);
    expectedRouteTypes.add(TRUCK);

    Route expectedRoute = getExpectedRoute(expectedRouteTypes);

    when(connectionMock.getRouteType()).thenReturn(BARGE);

    MainRunStrategy mainRunStrategy = mock(MainRunStrategy.class);
    when(mainRunAdvisorMock.advice(ONEWAY, IMPORT)).thenReturn(mainRunStrategy);
    when(mainRunStrategy.getRoute(connectionMock, destination, TWENTY_LIGHT)).thenReturn(expectedRoute);

    RouteInformation information = new RouteInformation(destination, ONEWAY, containerType, IMPORT,
            RouteCombo.WATERWAY);

    // run test
    List<Route> routes = sut.getAvailableSeaportConnectionRoutes(seaport, information);

    Assert.equals(1, routes.size());
    Assert.equals(3, routes.get(0).getData().getParts().size());
    Assert.equals(BARGE, routes.get(0).getData().getParts().get(0).getRouteType());
    Assert.equals(TRUCK, routes.get(0).getData().getParts().get(1).getRouteType());
    Assert.equals(TRUCK, routes.get(0).getData().getParts().get(2).getRouteType());
}
 
开发者ID:Contargo,项目名称:iris,代码行数:29,代码来源:SeaportConnectionRoutesServiceImplUnitTest.java

示例6: addTableNotPartitioned

import com.vividsolutions.jts.util.Assert; //导入方法依赖的package包/类
@Test
public void addTableNotPartitioned() throws InterruptedException, StageException {
  String schema = "db";
  String table1Name = "table1";
  String table2Name = "table2";
  String offsetCol = null;
  final String partitionSize = null;
  int maxActivePartitions = 0;
  int threadNumber = 0;
  int numThreads = 1;

  TableContext table1 = createTableContext(schema, table1Name, offsetCol, partitionSize, maxActivePartitions, true);

  MultithreadedTableProvider provider = createTableProvider(numThreads, table1, BatchTableStrategy.PROCESS_ALL_AVAILABLE_ROWS_FROM_TABLE);

  TableRuntimeContext tableRuntimeContext = provider.nextTable(threadNumber);
  Assert.equals(table1Name, tableRuntimeContext.getSourceTableContext().getTableName());
  provider.releaseOwnedTable(tableRuntimeContext, threadNumber);

  tableRuntimeContext = provider.nextTable(threadNumber);
  Assert.equals(table1Name, tableRuntimeContext.getSourceTableContext().getTableName());
  provider.releaseOwnedTable(tableRuntimeContext, threadNumber);

  TableContext table2 = createTableContext(schema, table2Name, offsetCol, partitionSize, maxActivePartitions, true);
  Map<String, TableContext> tableContextMap = new HashMap<>();

  tableContextMap.put(table1.getQualifiedName(), table1);
  tableContextMap.put(table2.getQualifiedName(), table2);
  Queue<String> sortedTableOrder = new LinkedList<>();
  sortedTableOrder.add(table1.getQualifiedName());
  sortedTableOrder.add(table2.getQualifiedName());

  //Set added table lists
  provider.setTableContextMap(tableContextMap, sortedTableOrder);

  tableRuntimeContext = provider.nextTable(threadNumber);

  Assert.equals(table1Name, tableRuntimeContext.getSourceTableContext().getTableName());
  provider.releaseOwnedTable(tableRuntimeContext, threadNumber);

  tableRuntimeContext = provider.nextTable(threadNumber);
  Assert.equals(table2Name, tableRuntimeContext.getSourceTableContext().getTableName());
  provider.releaseOwnedTable(tableRuntimeContext, threadNumber);
}
 
开发者ID:streamsets,项目名称:datacollector,代码行数:45,代码来源:TestMultithreadedTableProvider.java

示例7: removeTableNotPartitioned

import com.vividsolutions.jts.util.Assert; //导入方法依赖的package包/类
@Test
public void removeTableNotPartitioned() throws InterruptedException, StageException {
  String schema = "db";
  String table1Name = "table1";
  String table2Name = "table2";
  String offsetCol = null;
  final String partitionSize = null;
  int maxActivePartitions = 0;
  int threadNumber = 0;
  int numThreads = 1;

  TableContext table1 = createTableContext(schema, table1Name, offsetCol, partitionSize, maxActivePartitions, true);
  TableContext table2 = createTableContext(schema, table2Name, offsetCol, partitionSize, maxActivePartitions, true);
  Map<String, TableContext> tableContextMap = new HashMap<>();

  tableContextMap.put(table1.getQualifiedName(), table1);
  tableContextMap.put(table2.getQualifiedName(), table2);
  Queue<String> sortedTableOrder = new LinkedList<>();
  sortedTableOrder.add(table1.getQualifiedName());
  sortedTableOrder.add(table2.getQualifiedName());

  Map threadNumToMaxTableSlots = new HashMap<>();

  BatchTableStrategy batchTableStrategy = BatchTableStrategy.PROCESS_ALL_AVAILABLE_ROWS_FROM_TABLE;
  MultithreadedTableProvider provider = new MultithreadedTableProvider(
      tableContextMap,
      sortedTableOrder,
      threadNumToMaxTableSlots,
      numThreads,
      batchTableStrategy
  );

  TableRuntimeContext tableRuntimeContext = provider.nextTable(threadNumber);
  Assert.equals(table1Name, tableRuntimeContext.getSourceTableContext().getTableName());
  provider.releaseOwnedTable(tableRuntimeContext, threadNumber);

  tableRuntimeContext = provider.nextTable(threadNumber);
  Assert.equals(table2Name, tableRuntimeContext.getSourceTableContext().getTableName());
  provider.releaseOwnedTable(tableRuntimeContext, threadNumber);

  tableContextMap.remove(table2.getQualifiedName());
  sortedTableOrder.remove(table2.getQualifiedName());
  //Set removed table lists
  provider.setTableContextMap(tableContextMap, sortedTableOrder);

  tableRuntimeContext = provider.nextTable(threadNumber);

  Assert.equals(table1Name, tableRuntimeContext.getSourceTableContext().getTableName());
  provider.releaseOwnedTable(tableRuntimeContext, threadNumber);

  tableRuntimeContext = provider.nextTable(threadNumber);
  Assert.equals(table1Name, tableRuntimeContext.getSourceTableContext().getTableName());
  provider.releaseOwnedTable(tableRuntimeContext, threadNumber);
}
 
开发者ID:streamsets,项目名称:datacollector,代码行数:55,代码来源:TestMultithreadedTableProvider.java

示例8: insertAfter

import com.vividsolutions.jts.util.Assert; //导入方法依赖的package包/类
/**
 * Insert an edge with the same origin after this one.
 * Assumes that the inserted edge is in the correct
 * position around the ring.
 *
 * @param e the edge to insert (with same origin)
 */
private void insertAfter(HalfEdge e) {
    Assert.equals(orig, e.orig());
    HalfEdge save = oNext();
    sym.setNext(e);
    e.sym().setNext(save);
}
 
开发者ID:Semantive,项目名称:jts,代码行数:14,代码来源:HalfEdge.java


注:本文中的com.vividsolutions.jts.util.Assert.equals方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。