Tabnine Logo
Assert.assertEquals
Code IndexAdd Tabnine to your IDE (free)

How to use
assertEquals
method
in
org.testng.Assert

Best Java code snippets using org.testng.Assert.assertEquals (Showing top 20 results out of 7,470)

Refine searchRefine arrow

  • Test.<init>
  • Assert.assertTrue
  • ImmutableList.of
  • List.size
  • List.get
  • Multimap.get
  • Assert.assertNotNull
origin: prestodb/presto

@Test
public void testGroupByNanArray()
{
  MaterializedResult actual = computeActual("SELECT a FROM (VALUES (ARRAY[nan(), 2e0, 3e0]), (ARRAY[nan(), 2e0, 3e0])) t(a) GROUP BY a");
  List<MaterializedRow> actualRows = actual.getMaterializedRows();
  assertEquals(actualRows.size(), 1);
  assertTrue(Double.isNaN(((List<Double>) actualRows.get(0).getField(0)).get(0)));
  assertEquals(((List<Double>) actualRows.get(0).getField(0)).get(1), 2.0);
  assertEquals(((List<Double>) actualRows.get(0).getField(0)).get(2), 3.0);
}
origin: prestodb/presto

@Test
public void testExampleSystemTable()
{
  assertQuery("SELECT name FROM sys.example", "SELECT 'test' AS name");
  MaterializedResult result = computeActual("SHOW SCHEMAS");
  assertTrue(result.getOnlyColumnAsSet().containsAll(ImmutableSet.of("sf100", "tiny", "sys")));
  result = computeActual("SHOW TABLES FROM sys");
  assertEquals(result.getOnlyColumnAsSet(), ImmutableSet.of("example"));
}
origin: spring-projects/spring-framework

@Test
@Transactional(propagation = Propagation.NOT_SUPPORTED)
void autowiringFromConfigClass() {
  assertNotNull(employee, "The employee should have been autowired.");
  assertEquals(employee.getName(), "John Smith");
  assertNotNull(pet, "The pet should have been autowired.");
  assertEquals(pet.getName(), "Fido");
}
origin: prestodb/presto

private static void assertColumnList(List<com.amazonaws.services.glue.model.Column> actual, List<Column> expected)
{
  if (expected == null) {
    assertNull(actual);
  }
  assertEquals(actual.size(), expected.size());
  for (int i = 0; i < expected.size(); i++) {
    assertColumn(actual.get(i), expected.get(i));
  }
}
origin: prestodb/presto

  @Test
  public void testSQLException()
  {
    config.setControlGateway("invalid:url");
    List<QueryPair> rewrittenQueries = rewriteQueries(parser, config, queryPairs);
    assertEquals(rewrittenQueries.size(), 0);
  }
}
origin: prestodb/presto

@Test
public void testScheduleLocal()
{
  Split split = new Split(CONNECTOR_ID, TestingTransactionHandle.create(), new TestSplitLocal());
  Set<Split> splits = ImmutableSet.of(split);
  Map.Entry<Node, Split> assignment = Iterables.getOnlyElement(nodeSelector.computeAssignments(splits, ImmutableList.copyOf(taskMap.values())).getAssignments().entries());
  assertEquals(assignment.getKey().getHostAndPort(), split.getAddresses().get(0));
  assertEquals(assignment.getValue(), split);
}
origin: swagger-api/swagger-core

@Test(description = "it should desserialize Long schema correctly")
public void deserializeLongSchema() throws IOException {
  final String jsonString = ResourceUtils.loadClassResource(getClass(), "specFiles/oas3_2.yaml");
  final OpenAPI swagger = Yaml.mapper().readValue(jsonString, OpenAPI.class);
  assertNotNull(swagger);
  Schema s = swagger.getPaths().get("/withIntegerEnum/{stage}").getGet().getParameters().get(0).getSchema();
  assertEquals(s.getEnum().get(0), 2147483647);
  assertEquals(s.getEnum().get(1), 3147483647L);
  assertEquals(s.getEnum().get(2), 31474836475505055L);
}
origin: swagger-api/swagger-core

@Test
public void getRepeatableAnnotationsArrayTest() {
  Tag[] annotations = ReflectionUtils.getRepeatableAnnotationsArray(InheritingClass.class, Tag.class);
  Assert.assertNotNull(annotations);
  Assert.assertTrue(annotations.length == 1);
  Assert.assertNotNull(annotations[0]);
  Assert.assertEquals("inherited tag", annotations[0].name());
}
origin: prestodb/presto

  @Test
  public void testJsonRoundTrip()
  {
    MongoSplit expected = new MongoSplit(new SchemaTableName("schema1", "table1"), TupleDomain.all(), ImmutableList.of());

    String json = codec.toJson(expected);
    MongoSplit actual = codec.fromJson(json);

    assertEquals(actual.getSchemaTableName(), expected.getSchemaTableName());
    assertEquals(actual.getTupleDomain(), TupleDomain.<ColumnHandle>all());
    assertEquals(actual.getAddresses(), ImmutableList.of());
  }
}
origin: prestodb/presto

private static void assertPathToken(String fieldName)
{
  assertTrue(fieldName.indexOf('"') < 0);
  assertEquals(tokenizePath("$." + fieldName), ImmutableList.of(fieldName));
  assertEquals(tokenizePath("$.foo." + fieldName + ".bar"), ImmutableList.of("foo", fieldName, "bar"));
  assertPathTokenQuoting(fieldName);
}
origin: spring-projects/spring-framework

@Test
@Transactional(propagation = Propagation.NOT_SUPPORTED)
void verifyResourceAnnotationInjectedFields() {
  assertInTransaction(false);
  assertEquals(foo, "Foo", "The foo field should have been injected via @Resource.");
}
origin: prestodb/presto

@Test
public void testGroupByNanRow()
{
  MaterializedResult actual = computeActual("SELECT a, b, c FROM (VALUES ROW(nan(), 1, 2), ROW(nan(), 1, 2)) t(a, b, c) GROUP BY 1, 2, 3");
  List<MaterializedRow> actualRows = actual.getMaterializedRows();
  assertEquals(actualRows.size(), 1);
  assertTrue(Double.isNaN((Double) actualRows.get(0).getField(0)));
  assertEquals(actualRows.get(0).getField(1), 1);
  assertEquals(actualRows.get(0).getField(2), 2);
}
origin: prestodb/presto

private static void assertColumnList(List<Column> actual, List<com.amazonaws.services.glue.model.Column> expected)
{
  if (expected == null) {
    assertNull(actual);
  }
  assertEquals(actual.size(), expected.size());
  for (int i = 0; i < expected.size(); i++) {
    assertColumn(actual.get(i), expected.get(i));
  }
}
origin: prestodb/presto

@Test
public void testSingleThread()
{
  config.setControlGateway(URL);
  config.setThreadCount(1);
  List<QueryPair> rewrittenQueries = rewriteQueries(parser, config, queryPairs);
  assertEquals(rewrittenQueries.size(), queryPairs.size());
}
origin: prestodb/presto

@Test
public void testEmptyBuildSql()
    throws SQLException
{
  TupleDomain<ColumnHandle> tupleDomain = TupleDomain.withColumnDomains(ImmutableMap.of(
      columns.get(0), Domain.all(BIGINT),
      columns.get(1), Domain.onlyNull(DOUBLE)));
  Connection connection = database.getConnection();
  try (PreparedStatement preparedStatement = new QueryBuilder("\"").buildSql(jdbcClient, connection, "", "", "test_table", columns, tupleDomain, Optional.empty());
      ResultSet resultSet = preparedStatement.executeQuery()) {
    assertEquals(resultSet.next(), false);
  }
}
origin: prestodb/presto

@Test
public void testIterator()
{
  WorkProcessor<Integer> processor = processorFrom(ImmutableList.of(
      ProcessState.ofResult(1),
      ProcessState.ofResult(2),
      ProcessState.finished()));
  Iterator<Integer> iterator = processor.iterator();
  assertTrue(iterator.hasNext());
  assertEquals(iterator.next(), (Integer) 1);
  assertTrue(iterator.hasNext());
  assertEquals(iterator.next(), (Integer) 2);
  assertFalse(iterator.hasNext());
}
origin: prestodb/presto

@Test
public void testGetUpdateCount()
    throws Exception
{
  try (Connection connection = createConnection()) {
    try (Statement statement = connection.createStatement()) {
      assertTrue(statement.execute("SELECT 123 x, 'foo' y"));
      assertEquals(statement.getUpdateCount(), -1);
      assertEquals(statement.getLargeUpdateCount(), -1);
    }
  }
}
origin: prestodb/presto

@Test
public void testJoinOrder()
{
  PlanBuilder planBuilder = new PlanBuilder(new PlanNodeIdAllocator(), dummyMetadata());
  TableScanNode a = planBuilder.tableScan(emptyList(), emptyMap());
  TableScanNode b = planBuilder.tableScan(emptyList(), emptyMap());
  List<PlanNodeId> order = scheduleOrder(planBuilder.join(JoinNode.Type.INNER, a, b));
  assertEquals(order, ImmutableList.of(b.getId(), a.getId()));
}
origin: spring-projects/spring-framework

@Test
void autowiringFromConfigClass() {
  assertNotNull(employee, "The employee should have been autowired.");
  assertEquals(employee.getName(), "John Smith");
  assertNotNull(pet, "The pet should have been autowired.");
  assertEquals(pet.getName(), "Fido");
}
origin: spring-projects/spring-framework

@Test
@Transactional(propagation = Propagation.NOT_SUPPORTED)
void verifyResourceAnnotationInjectedMethods() {
  assertInTransaction(false);
  assertEquals(bar, "Bar", "The setBar() method should have been injected via @Resource.");
}
org.testngAssertassertEquals

Javadoc

Asserts that two bytes are equal. If they are not, an AssertionError is thrown.

Popular methods of Assert

  • assertTrue
  • assertFalse
    Asserts that a condition is false. If it isn't, an AssertionError, with the given message, is thrown
  • assertNotNull
    Asserts that an object isn't null. If it is, an AssertionFailedError, with the given message, is thr
  • fail
    Fails a test with the given message and wrapping the original exception.
  • assertNull
    Asserts that an object is null. If it is not, an AssertionFailedError, with the given message, is th
  • assertNotEquals
  • assertSame
    Asserts that two objects refer to the same object. If they do not, an AssertionFailedError, with the
  • assertNotSame
    Asserts that two objects do not refer to the same objects. If they do, an AssertionError, with the g
  • assertThrows
    Asserts that runnable throws an exception when invoked. If it does not, an AssertionError is thrown.
  • assertEqualsNoOrder
    Asserts that two arrays contain the same elements in no particular order. If they do not, an Asserti
  • expectThrows
    Asserts that runnable throws an exception of type throwableClass when executed and returns the excep
  • assertEqualsDeep
  • expectThrows,
  • assertEqualsDeep,
  • assertNotEqualsDeep,
  • assertArrayEquals,
  • assertEqualsImpl,
  • checkRefEqualityAndLength,
  • failAssertNoEqual,
  • failNotEquals,
  • failNotSame

Popular in Java

  • Reactive rest calls using spring rest template
  • getSupportFragmentManager (FragmentActivity)
  • scheduleAtFixedRate (Timer)
  • runOnUiThread (Activity)
  • PrintStream (java.io)
    Fake signature of an existing Java class.
  • NumberFormat (java.text)
    The abstract base class for all number formats. This class provides the interface for formatting and
  • BlockingQueue (java.util.concurrent)
    A java.util.Queue that additionally supports operations that wait for the queue to become non-empty
  • JPanel (javax.swing)
  • Response (javax.ws.rs.core)
    Defines the contract between a returned instance and the runtime when an application needs to provid
  • Options (org.apache.commons.cli)
    Main entry-point into the library. Options represents a collection of Option objects, which describ
  • From CI to AI: The AI layer in your organization
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now