org.opengis.test.Assert.assertNotSame()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(11.0k)|赞(0)|评价(0)|浏览(169)

本文整理了Java中org.opengis.test.Assert.assertNotSame()方法的一些代码示例,展示了Assert.assertNotSame()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Assert.assertNotSame()方法的具体详情如下:
包路径:org.opengis.test.Assert
类名称:Assert
方法名:assertNotSame

Assert.assertNotSame介绍

暂无

代码示例

代码示例来源:origin: opengeospatial/geoapi

/**
 * Validates the given "pass through" operation.
 *
 * @param  object  the object to validate, or {@code null}.
 */
public void validate(final PassThroughOperation object) {
  if (object == null) {
    return;
  }
  validateCoordinateOperation(object);
  final MathTransform transform = object.getMathTransform();
  mandatory("PassThroughOperation: shall have a MathTransform.", transform);
  final CoordinateOperation operation = object.getOperation();
  mandatory("PassThroughOperation: getOperation() is mandatory.", operation);
  assertNotSame("PassThroughOperation: getOperation() can't be this.", object, operation);
  dispatch(operation);
  final int[] index = object.getModifiedCoordinates();
  mandatory("PassThroughOperation: modified coordinates are mandatory.", index);
  if (operation == null || index == null) {
    return;
  }
  final int sourceDimension = transform.getSourceDimensions();
  for (int i : index) {
    assertBetween("PassThroughOperation: invalid modified ordinate index.", 0, sourceDimension-1, i);
  }
}

代码示例来源:origin: org.opengis/geoapi-conformance

assertNotSame("PassThroughOperation: getOperation() can't be this.", object, operation);
dispatch(operation);

代码示例来源:origin: apache/sis

/**
 * Tests {@link Quantities#castOrCopy(Quantity)}.
 */
@Test
public void testCastOrCopy() {
  Quantity<Length> q = Quantities.create(5, Units.KILOMETRE);
  assertSame(q, Quantities.castOrCopy(q));
  q = new Quantity<Length>() {
    @Override public Number           getValue()                         {return 8;}
    @Override public Unit<Length>     getUnit ()                         {return Units.CENTIMETRE;}
    @Override public Quantity<Length> add     (Quantity<Length> ignored) {return null;}
    @Override public Quantity<Length> subtract(Quantity<Length> ignored) {return null;}
    @Override public Quantity<?>      multiply(Quantity<?>      ignored) {return null;}
    @Override public Quantity<?>      divide  (Quantity<?>      ignored) {return null;}
    @Override public Quantity<Length> multiply(Number           ignored) {return null;}
    @Override public Quantity<Length> divide  (Number           ignored) {return null;}
    @Override public Quantity<?>      inverse ()                         {return null;}
    @Override public Quantity<Length> to      (Unit<Length>     ignored) {return null;}
    @Override public <T extends Quantity<T>> Quantity<T> asType(Class<T> ignored) {return null;}
  };
  final Length c = Quantities.castOrCopy(q);
  assertNotSame(q, c);
  assertEquals("value", 8, c.getValue().doubleValue(), STRICT);
  assertSame  ("unit", Units.CENTIMETRE, c.getUnit());
}

代码示例来源:origin: opengeospatial/geoapi

targetPosition = transform.transform(sourcePosition, targetPosition);
assertNotNull("MathTransform.transform(DirectPosition, …) shall not return null.", targetPosition);
assertNotSame("MathTransform.transform(DirectPosition, …) shall not overwrite " +
    "the source position.", sourcePosition, targetPosition);
assertEquals("MathTransform.transform(DirectPosition) must return a position having " +

代码示例来源:origin: apache/sis

assertNotSame("Expected a new Reader instance.", in, in2);
assertEquals("Number of characters read.", expected.length, in.read(actual));
assertArrayEquals("First sentence.", expected, actual);

代码示例来源:origin: apache/sis

/**
 * Tests the {@link StorageConnector#getStorageAs(Class)} method for the {@link ChannelDataInput} type.
 * The initial value should not be an instance of {@link ChannelImageInputStream} in order to avoid initializing
 * the Image I/O classes. However after a call to {@code getStorageAt(ChannelImageInputStream.class)}, the type
 * should have been promoted.
 *
 * @throws DataStoreException if an error occurred while using the storage connector.
 * @throws IOException if an error occurred while reading the test file.
 */
@Test
public void testGetAsChannelDataInput() throws DataStoreException, IOException {
  final StorageConnector connection = create(true);
  final ChannelDataInput input = connection.getStorageAs(ChannelDataInput.class);
  assertFalse(input instanceof ChannelImageInputStream);
  assertEquals(MAGIC_NUMBER, input.buffer.getInt());
  /*
   * Get as an image input stream and ensure that the cached value has been replaced.
   */
  final DataInput stream = connection.getStorageAs(DataInput.class);
  assertInstanceOf("Needs the SIS implementation", ChannelImageInputStream.class, stream);
  assertNotSame("Expected a new instance.", input, stream);
  assertSame("Shall share the channel.", input.channel, ((ChannelDataInput) stream).channel);
  assertSame("Shall share the buffer.",  input.buffer,  ((ChannelDataInput) stream).buffer);
  assertSame("Cached valud shall have been replaced.", stream, connection.getStorageAs(ChannelDataInput.class));
  connection.closeAllExcept(null);
}

代码示例来源:origin: apache/sis

/**
 * Tests {@link FrenchProfile#toAFNOR(Object)} with {@link Constraints},
 * {@link LegalConstraints} and  {@link SecurityConstraints} objects.
 */
@Test
public void testConstraintsToAFNOR() {
  Constraints std, fra;
  std = new DefaultConstraints("Some constraints.");
  fra = (Constraints) FrenchProfile.toAFNOR(std);
  assertNotSame("Expected a copy.", std, fra);
  assertSame   ("Already an AFNOR instance.", fra, FrenchProfile.toAFNOR(fra));
  assertEquals ("Some constraints.", getSingleton(fra.getUseLimitations()).toString());
  std = new DefaultLegalConstraints("Some legal constraints.");
  fra = (LegalConstraints) FrenchProfile.toAFNOR(std);
  assertNotSame("Expected a copy.", std, fra);
  assertSame   ("Already an AFNOR instance.", fra, FrenchProfile.toAFNOR(fra));
  assertEquals ("Some legal constraints.", getSingleton(fra.getUseLimitations()).toString());
  std = new DefaultSecurityConstraints("Some security constraints.");
  fra = (SecurityConstraints) FrenchProfile.toAFNOR(std);
  assertNotSame("Expected a copy.", std, fra);
  assertSame   ("Already an AFNOR instance.", fra, FrenchProfile.toAFNOR(fra));
  assertEquals ("Some security constraints.", getSingleton(fra.getUseLimitations()).toString());
}

代码示例来源:origin: apache/sis

assertNotSame    ("converse",           category, converse);
assertSame       ("converse.converse",  category, converse.converse);
assertSame       ("converted",          converse, category.converted());
assertSame       ("measurementRange",   converse.range,      converse.getMeasurementRange().get());
assertSame       ("transferFunction",   category.toConverse, category.getTransferFunction().get());
assertNotSame    ("transferFunction",   converse.toConverse, converse.getTransferFunction().get());
assertTrue       ("transferFunction",                        converse.getTransferFunction().get().isIdentity());
assertFalse      ("toConverse.isIdentity",                   category.toConverse.isIdentity());

代码示例来源:origin: apache/sis

assertNotSame(dimension,  converted);
assertSame   (dimension,  dimension.forConvertedValues(false));
assertSame   (dimension,  converted.forConvertedValues(false));

代码示例来源:origin: opengeospatial/geoapi

for (final LocalName name : parsedNames) {
  assertNotNull("ScopedName: getParsedNames() can not contain null element.", name);
  assertNotSame("ScopedName: the enclosing scoped name can not be in any parsed name.", object, name);
  assertEquals("ScopedName: inconsistent value of isGlobal().", global, name.scope().isGlobal());
  global = false;         // Only the first name may be global.

代码示例来源:origin: org.opengis/geoapi-conformance

for (final LocalName name : parsedNames) {
  assertNotNull("ScopedName: getParsedNames() can not contain null element.", name);
  assertNotSame("ScopedName: the enclosing scoped name can not be in any parsed name.", object, name);
  assertEquals("ScopedName: inconsistent value of isGlobal().", global, name.scope().isGlobal());
  global = false; // Only the first name may be global.

代码示例来源:origin: apache/sis

assertNotSame("converse",           category, converse);
assertSame   ("converse.converse",  category, converse.converse);
assertSame   ("converted",          converse, category.converted());

代码示例来源:origin: apache/sis

assertNotSame(vec, compressed = vec.compress(0));
assertInstanceOf("vector.compress(0)", ArrayVector.class, compressed);
assertEquals("elementType", Byte.class, compressed.getElementType());
assertNotSame(vec, compressed = vec.compress(0));
assertInstanceOf("vector.compress(0)", ArrayVector.class, compressed);
assertEquals("elementType", Byte.class, compressed.getElementType());
assertNotSame(vec, compressed = vec.compress(0));
assertInstanceOf("vector.compress(0)", ArrayVector.class, compressed);
assertEquals("elementType", Short.class, compressed.getElementType());
assertNotSame(vec, compressed = vec.compress(0));
assertInstanceOf("vector.compress(0)", ArrayVector.class, compressed);
assertEquals("elementType", Short.class, compressed.getElementType());
assertNotSame(vec, compressed = vec.compress(0));
assertInstanceOf("vector.compress(0)", PackedVector.class, compressed);
assertContentEquals(vec, compressed);
assertNotSame(vec, compressed = vec.compress(0));
assertInstanceOf("vector.compress(0)", ArrayVector.class, compressed);
assertEquals("elementType", Byte.class, compressed.getElementType());
assertNotSame(vec, compressed = vec.compress(0));
assertInstanceOf("vector.compress(0)", PackedVector.class, compressed);
assertContentEquals(vec, compressed);
assertNotSame(vec, compressed = vec.compress(0));

代码示例来源:origin: apache/sis

/**
 * Tests the {@link StorageConnector#getStorageAs(Class)} method for the {@link InputStream} type.
 * The {@code InputStream} was specified as a URL.
 *
 * @throws DataStoreException if an error occurred while using the storage connector.
 * @throws IOException if an error occurred while reading the test file.
 */
@Test
@DependsOnMethod("testGetAsImageInputStream")
public void testGetAsInputStream() throws DataStoreException, IOException {
  final StorageConnector connection = create(false);
  final InputStream in = connection.getStorageAs(InputStream.class);
  assertNotSame(connection.getStorage(), in);
  assertSame("Expected cached value.", in, connection.getStorageAs(InputStream.class));
  assertInstanceOf("Expected Channel backend.", InputStreamAdapter.class, in);
  final ImageInputStream input = ((InputStreamAdapter) in).input;
  assertInstanceOf("Expected Channel backend.", ChannelImageInputStream.class, input);
  assertSame(input, connection.getStorageAs(DataInput.class));
  assertSame(input, connection.getStorageAs(ImageInputStream.class));
  final ReadableByteChannel channel = ((ChannelImageInputStream) input).channel;
  assertTrue(channel.isOpen());
  connection.closeAllExcept(null);
  assertFalse(channel.isOpen());
}

代码示例来源:origin: org.opengis/geoapi-conformance

for (final SingleOperation single : operations) {
  assertNotNull("ConcatenatedOperation: getOperations() can't contain null element.", single);
  assertNotSame("ConcatenatedOperation: can't contain itself as a single element.", single, object);
  dispatch(single);
  if (first == null) {

代码示例来源:origin: opengeospatial/geoapi

for (final CoordinateOperation single : operations) {
  assertNotNull("ConcatenatedOperation: getOperations() can't contain null element.", single);
  assertNotSame("ConcatenatedOperation: can't contain itself as a single element.", single, object);
  dispatch(single);
  if (first == null) {

相关文章