org.apache.sis.test.Assert.assertFalse()方法的使用及代码示例

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

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

Assert.assertFalse介绍

暂无

代码示例

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

/**
 * Implementation of {@link #testEquals()} used also by {@link #testClone()}.
 */
static void testEquals(final AbstractAttribute<Integer> a1, final AbstractAttribute<Integer> a2) {
  assertTrue  ("equals",   a1.equals(a2));
  assertEquals("hashCode", a1.hashCode(), a2.hashCode());
  a2.setValue(1000);
  assertFalse("equals",   a1.equals(a2));
  assertFalse("hashCode", a1.hashCode() == a2.hashCode());
}

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

/**
 * Tests {@link CollectionsExt#identityEquals(Iterator, Iterator)}.
 */
@Test
public void testIdentityEquals() {
  final List<String> c1 = Arrays.asList("A", "B", "C");
  final List<String> c2 = Arrays.asList("A", "B");
  assertFalse(CollectionsExt.identityEquals(c1.iterator(), c2.iterator()));
  assertFalse(CollectionsExt.identityEquals(c2.iterator(), c1.iterator()));
  assertTrue(CollectionsExt.identityEquals(c1.iterator(), Arrays.asList("A", "B", "C").iterator()));
}

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

/**
 * Tests {@link Units#isPressure(Unit)}.
 */
@Test
public void testIsPressure() {
  assertFalse(isPressure(null));
  assertFalse(isPressure(METRE));
}

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

/**
 * Tests the {@code getAuthorityCodes(…)} method.
 *
 * @throws FactoryException if an error occurred while fetching the codes.
 */
@Test
public void testGetAuthorityCodes() throws FactoryException {
  final CRSAuthorityFactory factory = AuthorityFactories.ALL;
  final Collection<String> codes = factory.getAuthorityCodes(CoordinateReferenceSystem.class);
  assertFalse(codes.isEmpty());
  assertTrue(codes.contains("CRS:84"));
  assertTrue(codes.contains("AUTO:42001") || codes.contains("AUTO2:42001"));
}

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

/**
 * Tests attribute comparison.
 */
@Test
@DependsOnMethod("testValue")
@SuppressWarnings("ObjectEqualsNull")
public void testEquals() {
  final AbstractAttribute<Integer> a1 = population();
  final AbstractAttribute<Integer> a2 = population();
  assertFalse("equals(null)", a1.equals(null));
  testEquals(a1, a2);
}

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

/**
   * Tests the interfaces implemented by the transforms returned by {@link MathTransforms#translation(double...)}.
   */
  @Test
  public void testTranslation() {
    MathTransform tr = MathTransforms.translation(4);
    assertInstanceOf("1D", MathTransform1D.class, tr);
    assertFalse("isIdentity", tr.isIdentity());

    tr = MathTransforms.translation(4, 7);
    assertInstanceOf("2D", MathTransform2D.class, tr);
    assertFalse("isIdentity", tr.isIdentity());
  }
}

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

/**
 * Asserts that conversion of the given {@code source} value produces the given {@code target} value.
 * The conversion is not expected to be invertible. This method is used for testing rounding behavior.
 */
private static <S extends Number, T extends Number> void runConversion(
    final ObjectConverter<S,T> c, final S source, final T target, final S inverse)
    throws UnconvertibleObjectException
{
  assertFalse(source.equals(inverse));
  assertEquals("Forward conversion.", target,  c.apply(source));
  assertEquals("Inverse conversion.", inverse, c.inverse().apply(target));
}

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

/**
 * Tests attribute comparison.
 */
@Test
@DependsOnMethod("testValue")
@SuppressWarnings("ObjectEqualsNull")
public void testEquals() {
  final AbstractAttribute<Integer> a1 = population();
  final AbstractAttribute<Integer> a2 = population();
  assertFalse("equals(null)", a1.equals(null));
  SingletonAttributeTest.testEquals(a1, a2);
}

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

/**
 * Tests the {@link Range#contains(Comparable)} method.
 */
@Test
public void testContains() {
  final Range<Integer> range = new Range<>(Integer.class, 3, true, 5, true);
  assertTrue (range.contains(4));
  assertFalse(range.contains(6));
  assertFalse(range.contains(2));
  assertTrue (range.contains(3));
  assertTrue (range.contains(5));
}

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

/**
 * Tests the {@link Range#contains(Comparable)} method with an exclusive minimal value.
 */
@Test
public void testContainsNotInclusiveMinimum() {
  final Range<Integer> range = new Range<>(Integer.class, 2, false, 5, true);
  assertTrue (range.contains(4));
  assertFalse(range.contains(6));
  assertFalse(range.contains(2));
  assertTrue (range.contains(3));
  assertTrue (range.contains(5));
}

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

/**
 * Tests the {@link Range#contains(Comparable)} method with an exclusive maximal value.
 */
@Test
public void testContainsNotInclusiveMaximum() {
  final Range<Integer> range = new Range<>(Integer.class, 3, true, 6, false);
  assertTrue (range.contains(4));
  assertFalse(range.contains(6));
  assertFalse(range.contains(2));
  assertTrue (range.contains(3));
  assertTrue (range.contains(5));
}

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

/**
 * Tests {@link ArrayEnvelope#isEmpty()}.
 */
@Test
public void testIsEmpty() {
  ArrayEnvelope envelope = new ArrayEnvelope(new double[] {0, -356.683168});
  assertTrue(envelope.isEmpty());
  envelope.ordinates[0] = -360;
  assertFalse(envelope.isEmpty());
}

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

/**
 * Tests the {@link Range#union(Range)} method with disjoint ranges.
 */
@Test
@SuppressWarnings("UnnecessaryBoxing")
public void testDisjointUnion() {
  final Range<Character> range1 = new Range<>(Character.class, 'a', true, 'f', true);
  final Range<Character> range2 = new Range<>(Character.class, 'm', true, 'v', true);
  final Range<?> unionRange = range1.union(range2);
  assertFalse(unionRange.isEmpty());
  assertEquals(Character.valueOf('a'), unionRange.getMinValue());
  assertEquals(Character.valueOf('v'), unionRange.getMaxValue());
}

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

/**
 * Tests the {@link Range#contains(Range)} method without upper endpoint.
 */
@Test
public void testContainsRangeNoUpperEndpoint() {
  final Range<Integer> range  = new Range<>(Integer.class, -2500, true, null, true);
  final Range<Integer> inside = new Range<>(Integer.class,    17, true,  305, true);
  assertTrue(range.contains(inside));
  assertFalse(inside.contains(range));
}

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

/**
 * Tests the {@link Range#contains(Range)} method.
 */
@Test
public void testContainsRange() {
  final Range<Integer> range  = new Range<>(Integer.class, -10, true, 10, true);
  final Range<Integer> inside = new Range<>(Integer.class,  -5, true,  5, true);
  assertTrue(range.contains(inside));
  assertFalse(inside.contains(range));
}

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

/**
 * Tests the {@link Range#contains(Range)} method without lower endpoint.
 */
@Test
public void testContainsRangeNoLowerEndpoint() {
  final Range<Integer> range  = new Range<>(Integer.class,  null, true, 500, true);
  final Range<Integer> inside = new Range<>(Integer.class, -2500, true, 305, true);
  assertTrue (range.contains(inside));
  assertFalse(inside.contains(range));
}

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

/**
 * Tests the {@link Range#contains(Comparable)} method without upper endpoint.
 */
@Test
public void testContainsNoUpperEndpoint() {
  final Range<Integer> range = new Range<>(Integer.class, 3, true, null, true);
  assertFalse(range.contains(1));
  assertTrue (range.contains(3));
  assertTrue (range.contains(10000));
}

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

/**
 * Tests the {@link Range#contains(Comparable)} method without lower endpoint.
 */
@Test
public void testContainsNoLowerEndpoint() {
  final Range<Integer> range = new Range<>(Integer.class, null, true, 5, true);
  assertTrue (range.contains(-555));
  assertTrue (range.contains(5));
  assertFalse(range.contains(6));
}

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

/**
 * Tests {@link ConventionalUnit#isCompatible(Unit)}.
 */
@Test
public void testIsCompatible() {
  assertTrue (Units.KILOMETRE.isCompatible(Units.METRE));
  assertFalse(Units.KILOMETRE.isCompatible(Units.SECOND));
  assertTrue (Units.DEGREE   .isCompatible(Units.GRAD));
  assertTrue (Units.DEGREE   .isCompatible(Units.PPM));       // Because those units are dimensionless.
}

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

/**
 * Tests {@link DefaultFeatureType#equals(Object)}.
 */
@Test
@DependsOnMethod("testSimple")
public void testEquals() {
  final DefaultFeatureType city = city();
  assertTrue (city.equals(city()));
  assertFalse(city.equals(capital()));
}

相关文章