Package java1.util.regex

Examples of java1.util.regex.Pattern$Bound


   *
   * @throws Exception if something goes wrong
   */
  @Test
  public void testBothHaveBounds() throws Exception {
    Bound bound0 = new Bound(1, 2, 4, 3, "source1");
    RunnableSource source0 = new BoundSource(bound0, true);

    Bound bound1 = new Bound(5, 6, 8, 7, "source2");
    RunnableSource source1 = new BoundSource(bound1, true);

    EntityMerger merger = new EntityMerger(ConflictResolutionMethod.LatestSource, 1,
        BoundRemovedAction.Ignore);
   
    SinkEntityInspector merged = RunTaskUtilities.run(merger, source0, source1);
    List<EntityContainer> mergedList = createList(merged.getProcessedEntities());
    Assert.assertEquals(3, mergedList.size());
    Assert.assertEquals(EntityType.Bound, mergedList.get(0).getEntity().getType());
   
    // Check the bound
    Bound bound01 = (Bound) mergedList.get(0).getEntity();
    Assert.assertEquals(bound0.union(bound1), bound01);

    for (int i = 1; i < mergedList.size(); i++) {
      Assert.assertEquals(EntityType.Node, mergedList.get(i).getEntity().getType());
    }
View Full Code Here


   */
  @Test
  public void testOneSourceEmpty() throws Exception {
    RunnableSource source0 = new EmptyReader();

    Bound bound1 = new Bound(5, 6, 8, 7, "source2");
    RunnableSource source1 = new BoundSource(bound1, true);
   
    EntityMerger merger = new EntityMerger(ConflictResolutionMethod.LatestSource, 1,
        BoundRemovedAction.Ignore);
   
View Full Code Here

          new SchemaVersionValidator(loginCredentials, preferences)
                  .validateVersion(ApidbVersionConstants.SCHEMA_MIGRATIONS);
         
          entityDao = new AllEntityDao(dbCtx.getJdbcTemplate());
         
          sink.process(new BoundContainer(new Bound("Osmosis " + OsmosisConstants.VERSION)));
          reader = entityDao.getCurrent();
          try {
            while (reader.hasNext()) {
              sink.process(reader.next());
            }
View Full Code Here

          new SchemaVersionValidator(loginCredentials, preferences)
                  .validateVersion(ApidbVersionConstants.SCHEMA_MIGRATIONS);
         
          entityDao = new AllEntityDao(dbCtx.getJdbcTemplate());

          sink.process(new BoundContainer(new Bound("Osmosis " + OsmosisConstants.VERSION)));
          reader = new EntitySnapshotReader(entityDao.getHistory(), snapshotInstant);
          try {
            while (reader.hasNext()) {
              sink.process(reader.next());
            }
View Full Code Here

    }
    origin = attributes.getValue(ATTRIBUTE_NAME_ORIGIN);
    if (origin == null || origin.equals("")) {
      throw new OsmosisRuntimeException("Origin attribute of bound element is empty or missing.");
    }
    bound = new Bound(right, left, top, bottom, origin);
  }
View Full Code Here

            double rightf = block.getBbox().getRight() * multiplier;
            double leftf = block.getBbox().getLeft() * multiplier;
            double topf = block.getBbox().getTop() * multiplier;
            double bottomf = block.getBbox().getBottom() * multiplier;

            Bound bounds = new Bound(rightf, leftf, topf, bottomf, source);
            sink.process(new BoundContainer(bounds));
        }
    }
View Full Code Here

            SAXParser parser = createParser();
            InputStream inputStream =
              getInputStream(myBaseUrl + "/map?bbox=" + myLeft + "," + myBottom + "," + myRight + "," + myTop);

            // First send the Bound down the pipeline
            mySink.process(new BoundContainer(new Bound(myRight, myLeft, myTop, myBottom, myBaseUrl)));

            try {
                parser.parse(inputStream, new OsmHandler(mySink, true));
            } finally {
                inputStream.close();
View Full Code Here

  /**
   * Test processing a single Bound entity.
   */
  @Test
  public final void testProcess1() {
    testOsmWriter.process(new BoundContainer(new Bound("source")));
    // Nothing to assert; just expect no exception
  }
View Full Code Here

  /**
   * Test processing a repeated Bound entity.
   */
  @Test(expected = OsmosisRuntimeException.class)
  public final void testProcess2() {
    testOsmWriter.process(new BoundContainer(new Bound("source")));
    testOsmWriter.process(new BoundContainer(new Bound("source2")));
    fail("Expected to throw an exception.");
  }
View Full Code Here

    testOsmWriter.process(new NodeContainer(
        new Node(
            new CommonEntityData(1234, 0, new Date(), new OsmUser(12, "OsmosisTest"), 0,
                new ArrayList<Tag>()),
            20, 20)));
    testOsmWriter.process(new BoundContainer(new Bound("source")));
    fail("Expected to throw an exception.");
  }
View Full Code Here

TOP

Related Classes of java1.util.regex.Pattern$Bound

Copyright © 2018 www.massapicom. 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.