io.vertx.ext.unit.TestContext.assertNotEquals()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(11.2k)|赞(0)|评价(0)|浏览(84)

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

TestContext.assertNotEquals介绍

暂无

代码示例

代码示例来源:origin: io.vertx/vertx-rx-java

/**
 * Assert the <code>first</code> argument is not equals to the <code>second</code> argument. If the arguments are equals
 * an assertion error is thrown otherwise the execution continue.
 * @param first the first object to test
 * @param second the second object to test
 * @param message the failure message
 * @return a reference to this, so the API can be used fluently
 */
public io.vertx.rxjava.ext.unit.TestContext assertNotEquals(Object first, Object second, String message) { 
 delegate.assertNotEquals(first, second, message);
 return this;
}

代码示例来源:origin: io.vertx/vertx-rx-java

/**
 * Assert the <code>first</code> argument is not equals to the <code>second</code> argument. If the arguments are equals
 * an assertion error is thrown otherwise the execution continue.
 * @param first the first object to test
 * @param second the second object to test
 * @return a reference to this, so the API can be used fluently
 */
public io.vertx.rxjava.ext.unit.TestContext assertNotEquals(Object first, Object second) { 
 delegate.assertNotEquals(first, second);
 return this;
}

代码示例来源:origin: vert-x3/vertx-rx

/**
 * Assert the <code>first</code> argument is not equals to the <code>second</code> argument. If the arguments are equals
 * an assertion error is thrown otherwise the execution continue.
 * @param first the first object to test
 * @param second the second object to test
 * @return a reference to this, so the API can be used fluently
 */
public io.vertx.rxjava.ext.unit.TestContext assertNotEquals(Object first, Object second) { 
 delegate.assertNotEquals(first, second);
 return this;
}

代码示例来源:origin: vert-x3/vertx-rx

/**
 * Assert the <code>first</code> argument is not equals to the <code>second</code> argument. If the arguments are equals
 * an assertion error is thrown otherwise the execution continue.
 * @param first the first object to test
 * @param second the second object to test
 * @param message the failure message
 * @return a reference to this, so the API can be used fluently
 */
public io.vertx.rxjava.ext.unit.TestContext assertNotEquals(Object first, Object second, String message) { 
 delegate.assertNotEquals(first, second, message);
 return this;
}

代码示例来源:origin: io.vertx/vertx-lang-groovy

public static io.vertx.ext.unit.TestContext assertNotEquals(io.vertx.ext.unit.TestContext j_receiver, java.lang.Object first, java.lang.Object second) {
 io.vertx.core.impl.ConversionHelper.fromObject(j_receiver.assertNotEquals(io.vertx.core.impl.ConversionHelper.toObject(first),
  io.vertx.core.impl.ConversionHelper.toObject(second)));
 return j_receiver;
}
public static io.vertx.ext.unit.TestContext assertNotEquals(io.vertx.ext.unit.TestContext j_receiver, java.lang.Object first, java.lang.Object second, java.lang.String message) {

代码示例来源:origin: io.vertx/vertx-lang-groovy

public static io.vertx.ext.unit.TestContext assertNotEquals(io.vertx.ext.unit.TestContext j_receiver, java.lang.Object first, java.lang.Object second, java.lang.String message) {
 io.vertx.core.impl.ConversionHelper.fromObject(j_receiver.assertNotEquals(io.vertx.core.impl.ConversionHelper.toObject(first),
  io.vertx.core.impl.ConversionHelper.toObject(second),
  message));
 return j_receiver;
}
public static <T>io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Object>> asyncAssertSuccess(io.vertx.ext.unit.TestContext j_receiver) {

代码示例来源:origin: io.vertx/vertx-shell

@Test
public void testWrite(TestContext context) throws IOException {
 startTelnet(context, term -> {
  term.write("hello_from_server");
 });
 client.connect("localhost", server.actualPort());
 Reader reader = new InputStreamReader(client.getInputStream());
 StringBuilder sb = new StringBuilder("hello_from_server");
 while (sb.length() > 0) {
  int c = reader.read();
  context.assertNotEquals(-1, c);
  context.assertEquals(c, (int)sb.charAt(0));
  sb.deleteCharAt(0);
 }
}

代码示例来源:origin: io.vertx/vertx-kafka-client

@Test
 public void testUnequality(final TestContext context) {
  final TopicPartition t1 = new TopicPartition("topic1", 0);
  final TopicPartition t2 = new TopicPartition("topic1", 1);
  final TopicPartition t3 = new TopicPartition("topic2", 0);
  final TopicPartition t4 = new TopicPartition("topic2", 1);
  final JsonObject t5 = new JsonObject();

  context.assertNotEquals(t1, t2);
  context.assertNotEquals(t1.hashCode(), t2.hashCode());

  context.assertNotEquals(t3, t4);
  context.assertNotEquals(t3.hashCode(), t4.hashCode());

  context.assertNotEquals(t3, t5);
  context.assertNotEquals(t3.hashCode(), t5.hashCode());

  context.assertFalse(t1.equals(null));
  context.assertFalse(t1.equals(t5));
 }
}

代码示例来源:origin: io.vertx/vertx-auth-oauth2

@Test
public void shouldRefreshAToken(TestContext should) {
 final Async test = should.async();
 keycloak.authenticate(new JsonObject().put("username", "test-user").put("password", "tiger"), authn -> {
  should.assertTrue(authn.succeeded());
  should.assertNotNull(authn.result());
  // generate a access token from the user
  AccessToken token = (AccessToken) authn.result();
  final String origToken = token.opaqueAccessToken();
  token.refresh(refresh -> {
   should.assertTrue(refresh.succeeded());
   should.assertNotEquals(origToken, token.opaqueAccessToken());
   test.complete();
  });
 });
}

代码示例来源:origin: io.vertx/vertx-grpc

@Test
 public void testBilto(TestContext ctx) throws Exception {
  Async started = ctx.async();
  List<GrpcVerticle> verticles = Collections.synchronizedList(new ArrayList<>());
  vertx.deployVerticle(() -> {
   GrpcVerticle verticle = new GrpcVerticle(0);
   verticles.add(verticle);
   return verticle;
  }, new DeploymentOptions().setInstances(2), ctx.asyncAssertSuccess(v -> started.complete()));
  started.awaitSuccess(10000);
  ctx.assertEquals(2, verticles.size());
  ctx.assertNotEquals(verticles.get(0).server.getPort(), verticles.get(1).server.getPort());
 }
}

代码示例来源:origin: io.vertx/vertx-tcp-eventbus-bridge

@Test
public void testSendMessageWithReplyBacktrack(TestContext context) {
 // Send a request and get a response
 NetClient client = vertx.createNetClient();
 final Async async = context.async();
 client.connect(7000, "localhost", conn -> {
  context.assertFalse(conn.failed());
  NetSocket socket = conn.result();
  final FrameParser parser = new FrameParser(parse -> {
   context.assertTrue(parse.succeeded());
   JsonObject frame = parse.result();
   context.assertNotEquals("err", frame.getString("type"));
   context.assertEquals("Hello vert.x", frame.getJsonObject("body").getString("value"));
   client.close();
   async.complete();
  });
  socket.handler(parser);
  FrameHelper.sendFrame("send", "hello", "#backtrack", new JsonObject().put("value", "vert.x"), socket);
 });
}

代码示例来源:origin: io.vertx/vertx-mysql-postgresql-client-jasync

protected void checkConsistency(TestContext context, Async async, SQLConnection conn, long id1, String name1, long id2, String name2) {
 conn.queryWithParams("SELECT name FROM test_table WHERE id = ?", new JsonArray().add(id1), ar5 -> {
  ensureSuccess(context, ar5);
  ResultSet resultSet1 = ar5.result();
  context.assertEquals(name1, resultSet1.getResults().get(0).getString(0));
  conn.queryWithParams("SELECT name FROM test_table WHERE id = ?", new JsonArray().add(id2), ar6 -> {
   ensureSuccess(context, ar6);
   ResultSet resultSet2 = ar6.result();
   context.assertNotEquals(id1, id2);
   context.assertEquals(name2, resultSet2.getResults().get(0).getString(0));
   async.complete();
  });
 });
}

代码示例来源:origin: vert-x3/vertx-mysql-postgresql-client

protected void checkConsistency(TestContext context, Async async, SQLConnection conn, long id1, String name1, long id2, String name2) {
 conn.queryWithParams("SELECT name FROM test_table WHERE id = ?", new JsonArray().add(id1), ar5 -> {
  ensureSuccess(context, ar5);
  ResultSet resultSet1 = ar5.result();
  context.assertEquals(name1, resultSet1.getResults().get(0).getString(0));
  conn.queryWithParams("SELECT name FROM test_table WHERE id = ?", new JsonArray().add(id2), ar6 -> {
   ensureSuccess(context, ar6);
   ResultSet resultSet2 = ar6.result();
   context.assertNotEquals(id1, id2);
   context.assertEquals(name2, resultSet2.getResults().get(0).getString(0));
   async.complete();
  });
 });
}

代码示例来源:origin: vert-x3/vertx-mysql-postgresql-client

protected void checkConsistency(TestContext context, Async async, SQLConnection conn, long id1, String name1, long id2, String name2) {
 conn.queryWithParams("SELECT name FROM test_table WHERE id = ?", new JsonArray().add(id1), ar5 -> {
  ensureSuccess(context, ar5);
  ResultSet resultSet1 = ar5.result();
  context.assertEquals(name1, resultSet1.getResults().get(0).getString(0));
  conn.queryWithParams("SELECT name FROM test_table WHERE id = ?", new JsonArray().add(id2), ar6 -> {
   ensureSuccess(context, ar6);
   ResultSet resultSet2 = ar6.result();
   context.assertNotEquals(id1, id2);
   context.assertEquals(name2, resultSet2.getResults().get(0).getString(0));
   async.complete();
  });
 });
}

代码示例来源:origin: io.vertx/vertx-mysql-postgresql-client-jasync

@Test
public void testCharset(TestContext context) {
 Async async = context.async();
 showEncoding(context, "iso-8859-1", encoding1 -> {
  showEncoding(context, "utf-8", encoding2 -> {
   context.assertNotEquals(encoding1, encoding2);
   async.complete();
  });
 });
}

代码示例来源:origin: vert-x3/vertx-mysql-postgresql-client

@Test
public void testCharset(TestContext context) {
 Async async = context.async();
 showEncoding(context, "iso-8859-1", encoding1 -> {
  showEncoding(context, "utf-8", encoding2 -> {
   context.assertNotEquals(encoding1, encoding2);
   async.complete();
  });
 });
}

代码示例来源:origin: vert-x3/vertx-mysql-postgresql-client

@Test
public void testCharset(TestContext context) {
 Async async = context.async();
 showEncoding(context, "iso-8859-1", encoding1 -> {
  showEncoding(context, "utf-8", encoding2 -> {
   context.assertNotEquals(encoding1, encoding2);
   async.complete();
  });
 });
}

代码示例来源:origin: reactiverse/reactive-pg-client

@Test
public void testNotEqualGetColumnNameRows(TestContext ctx) {
 Async async = ctx.async();
 PgClient.connect(vertx, options, ctx.asyncAssertSuccess(conn -> {
  conn.query("SELECT 2 \"foo\"",
   ctx.asyncAssertSuccess(result -> {
    Row row = result.iterator().next();
    ctx.assertNotEquals("bar",row.getColumnName(0));
    async.complete();
   }));
 }));
}

代码示例来源:origin: vietj/vertx-http-proxy

@Test
public void testPublicExpiration(TestContext ctx) throws Exception {
 Async latch = ctx.async();
 testPublic(ctx, resp1 -> {
  vertx.setTimer(6000, id -> {
   client.getNow(8080, "localhost", "/", resp2 -> {
    ctx.assertEquals(200, resp2.statusCode());
    resp2.bodyHandler(buff2 -> {
     ctx.assertEquals("content", buff2.toString());
     ctx.assertEquals(2, hits.get());
     ctx.assertNotEquals(resp1.getHeader(HttpHeaders.DATE), resp2.getHeader(HttpHeaders.DATE));
     latch.complete();
    });
   });
  });
 });
}

代码示例来源:origin: vietj/vertx-http-proxy

@Test
public void testPublicInvalidClientMaxAge(TestContext ctx) throws Exception {
 Async latch = ctx.async();
 testPublic(ctx, resp1 -> {
  vertx.setTimer(1000, id -> {
   client.get(8080, "localhost", "/", resp2 -> {
    ctx.assertEquals(200, resp2.statusCode());
    resp2.bodyHandler(buff2 -> {
     ctx.assertEquals("content", buff2.toString());
     ctx.assertEquals(2, hits.get());
     ctx.assertNotEquals(resp1.getHeader(HttpHeaders.DATE), resp2.getHeader(HttpHeaders.DATE));
     latch.complete();
    });
   }).putHeader(HttpHeaders.CACHE_CONTROL, "max-age=1").end();
  });
 });
}

相关文章