Java Code Examples for org.junit.Assert

The following are top voted examples for showing how to use org.junit.Assert. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: java-red   File: TestRedFuture.java   View source code 6 votes vote down vote up
/**
 * Test the completion and callback invocation of {@link RedFutureHub}
 * pessimistic union of provided futures that later were failed
 */
@Test
public void testPessimisticProvidePostResolveFailure() throws Throwable {
    AtomicBoolean reachedSuccessBlock = new AtomicBoolean(false);
    AtomicBoolean reachedFailureBlock = new AtomicBoolean(false);
    AtomicBoolean reachedFinallyBlock = new AtomicBoolean(false);
    RedFutureHub hub = RedFuture.hub();
    OpenRedFuture future1 = hub.provideFuture();
    OpenRedFuture future2 = hub.provideFuture();
    OpenRedFutureOf<Object> futureOf = hub.provideFutureOf();
    RedFuture union = hub.unitePessimistically();
    union.addSuccessCallback(() -> reachedSuccessBlock.set(true));
    union.addFailureCallback(throwable -> reachedFailureBlock.set(true));
    union.addFinallyCallback(() -> reachedFinallyBlock.set(true));
    Assert.assertFalse(reachedFinallyBlock.get());
    Assert.assertFalse(reachedSuccessBlock.get());
    Assert.assertFalse(reachedFailureBlock.get());
    future1.resolve();
    future2.fail(new TestException());
    futureOf.resolve(new Object());
    Assert.assertTrue(reachedFinallyBlock.get());
    Assert.assertTrue(reachedSuccessBlock.get());
    Assert.assertFalse(reachedFailureBlock.get());
}
 
Example 2
Project: store2store   File: StoreServiceUnitTest.java   View source code 6 votes vote down vote up
@Test
public void testDeleteAllWithError(){
    testStore.shouldThrowError(true);
    models.clear();

    List<TestModel> list = new ArrayList<>();
    list.add(new TestModel(1));
    list.add(new TestModel(2));
    list.add(new TestModel(3));
    memoryStore.insertOrUpdate(list);

    TestSubscriber<Integer> observer = new TestSubscriber<>();
    disposables.add(testStore.deleteAll()
            .subscribeOn(Schedulers.io())
            .subscribeWith(observer));

    observer.awaitTerminalEvent(5, SECONDS);
    observer.assertError(Throwable.class);
    observer.assertErrorMessage("deleteAll.error");

    testStore.shouldThrowError(false); // disable error
    Assert.assertEquals(3, models.size());
}
 
Example 3
Project: nfse   File: LoteRpsConsultaSituacaoTest.java   View source code 6 votes vote down vote up
@Test
public void xmlDeveSerGeradoCorretamente() throws IOException{
  String xmlTest = IOUtils.toString(getClass().getClassLoader().getResourceAsStream("loteRpsConsultaSituacao.xml"));
  LoteRpsConsultaSituacao consultaSituacaoLote = new LoteRpsConsultaSituacao("AP1057893n16X103sfhF4RPm", FabricaDeObjetosFake.getRpsPrestador());
  String xml = consultaSituacaoLote.converterParaXml();
  
  Assert.assertEquals(xml, xmlTest);
}
 
Example 4
Project: openjdk-jdk10   File: ProfilingInfoTest.java   View source code 6 votes vote down vote up
private void testNullSeen(String snippet) {
    ProfilingInfo info = profile(snippet, 1);
    Assert.assertEquals(TriState.FALSE, info.getNullSeen(1));

    continueProfiling(snippet, "ABC");
    Assert.assertEquals(TriState.FALSE, info.getNullSeen(1));

    continueProfiling(snippet, new Object());
    Assert.assertEquals(TriState.FALSE, info.getNullSeen(1));

    if (TriState.TRUE == info.getNullSeen(1)) {
        // See the javadoc comment for ProfilingInfoTest.
        continueProfiling(snippet, (Object) null);
        Assert.assertEquals(TriState.TRUE, info.getNullSeen(1));

        continueProfiling(snippet, 0.0);
        Assert.assertEquals(TriState.TRUE, info.getNullSeen(1));

        continueProfiling(snippet, new Object());
        Assert.assertEquals(TriState.TRUE, info.getNullSeen(1));
    }

    resetProfile(snippet);
    Assert.assertEquals(TriState.FALSE, info.getNullSeen(1));
}
 
Example 5
Project: flink-connectors   File: IntSequenceExactlyOnceValidator.java   View source code 6 votes vote down vote up
@Override
public void restoreState(List<Tuple2<Integer, BitSet>> state) throws Exception {
    if (state.isEmpty()) {
        Assert.fail("Function was restored without state - no checkpoint completed before.");
    }

    if (state.size() > 1) {
        Assert.fail("Function was restored with multiple states. unexpected scale-in");
    }

    Tuple2<Integer, BitSet> s = state.get(0);
    this.numElementsSoFar = s.f0;
    this.duplicateChecker.clear();
    this.duplicateChecker.or(s.f1);

    log.debug("IntSequenceExactlyOnceValidator was restored with {} elements", numElementsSoFar);
}
 
Example 6
Project: JRediClients   File: RedissonSetCacheTest.java   View source code 6 votes vote down vote up
@Test
public void testContains() throws InterruptedException {
    RSetCache<TestObject> set = redisson.getSetCache("set");

    set.add(new TestObject("1", "2"));
    set.add(new TestObject("1", "2"));
    set.add(new TestObject("2", "3"), 1, TimeUnit.SECONDS);
    set.add(new TestObject("3", "4"));
    set.add(new TestObject("5", "6"));

    Thread.sleep(1000);

    Assert.assertFalse(set.contains(new TestObject("2", "3")));
    Assert.assertTrue(set.contains(new TestObject("1", "2")));
    Assert.assertFalse(set.contains(new TestObject("1", "9")));
}
 
Example 7
Project: openjdk-systemtest   File: TestSuite042.java   View source code 5 votes vote down vote up
public void testItem_0172()
{
  boolean caught;
  caught = false;
  try {
    rc_BigDecimal = new BigDecimal(new char[]{'8', '\1', '\1', '\uFFFF', '8', '8', '\uFFFF', '\uFFFF', '8', '\uFFFF', '\234', '8', '8', '\234', '8', '\234', '\0', '\uFFFF', '\234', '\1', '\1', '\uFFFF', '\1', '8', '\uFFFF', '\uFFFF', '\1', '\234', '8', '8', '\1', '\1', '\234', '\0', '\1', '\uFFFF', '\0', '\uFFFF', '\0', '\234', '\uFFFF', '\uFFFF', '\234', '\234', '\1', '8', '\234', '\uFFFF', '8', '8', '\234', '\1', '\1', '8', '\0', '8', '\1', '\uFFFF', '\uFFFF', '\234', '\uFFFF', '\234', '\1', '\234', '\1', '\0', '\234', '\1', '\234', '\234', '\1', '\1', '\1', '\1', '8', '\0', '\uFFFF', '\1', '\234', '8', '\234', '\1', '\uFFFF', '\0', '8', '\234', '8', '\1', '\234', '\0', '\uFFFF', '8', '\0', '\0', '\0', '8', '8', '\1', '\234', '8'}, new MathContext("precision=2147483647 roundingMode=HALF_EVEN"));
  }
  catch (java.lang.NumberFormatException e) {
    caught = true;
  }
  Assert.assertEquals("91.94630872483222%", true, caught);
}
 
Example 8
Project: openjdk-systemtest   File: TestSuite054.java   View source code 5 votes vote down vote up
public void testItem_0251()
{
  boolean caught;
  caught = false;
  try {
    rc_BigDecimal = (new BigDecimal("-9000000000000.0")).pow(-1, new MathContext("precision=0 roundingMode=HALF_EVEN"));
  }
  catch (java.lang.ArithmeticException e) {
    caught = true;
  }
  Assert.assertEquals("91.94630872483222%", true, caught);
}
 
Example 9
Project: openjdk-systemtest   File: TestSuite037.java   View source code 5 votes vote down vote up
public void testItem_0432()
{
  boolean caught;
  caught = false;
  try {
    rc_BigDecimal = (new BigDecimal("0")).setScale(0, 2147483647);
  }
  catch (java.lang.IllegalArgumentException e) {
    caught = true;
  }
  Assert.assertEquals("91.94630872483222%", true, caught);
}
 
Example 10
Project: linkifier   File: RegressionTest.java   View source code 5 votes vote down vote up
@Test
public void test122() throws Throwable {
    if (debug)
        System.out.format("%n%s%n", "RegressionTest0.test122");
    Table table2 = new Table("", ",");
    List<String> list_str3 = table2.getTokenizedLowerCaseTrimmedName();
    DatabaseMetaData databaseMetaData4 = null;
    try {
        table2.getPrimaryKeys(databaseMetaData4, ",", "", ",");
        Assert.fail("Expected exception of type java.lang.NullPointerException");
    } catch (NullPointerException e) {
    }
    Assert.assertNull(list_str3);
}
 
Example 11
Project: openjdk-systemtest   File: TestSuite031.java   View source code 5 votes vote down vote up
public void testItem_0623()
{
  boolean caught;
  caught = false;
  try {
    rc_BigDecimal = new BigDecimal("@W0Y<7W?8EY16NT;[email protected]@UQH5R?<3?LNRD<EH1OJ=XW:MTM9F5WV34");
  }
  catch (java.lang.NumberFormatException e) {
    caught = true;
  }
  Assert.assertEquals("91.94630872483222%", true, caught);
}
 
Example 12
Project: GitHub   File: TypeUtilsTest.java   View source code 5 votes vote down vote up
public void test_cast_to_SqlDate_sql_Date() throws Exception {
    long millis = System.currentTimeMillis();

    JSONObject json = new JSONObject();
    json.put("date", new java.sql.Date(millis));
    Assert.assertEquals(new java.sql.Date(millis), json.getObject("date", java.sql.Date.class));
}
 
Example 13
Project: linkifier   File: RegressionTest.java   View source code 5 votes vote down vote up
@Test
public void test007() throws Throwable {
    if (debug)
        System.out.format("%n%s%n", "RegressionTest0.test007");
    Relationship relationship0 = new Relationship();
    Column column1 = relationship0.getPk();
    Chen chen2 = null;
    try {
        relationship0.setMediumFeatures(chen2);
        Assert.fail("Expected exception of type java.lang.NullPointerException");
    } catch (NullPointerException e) {
    }
    Assert.assertNull(column1);
}
 
Example 14
Project: hashsdn-controller   File: ValidationExceptionTest.java   View source code 5 votes vote down vote up
@Test
public void testEqual5() throws Exception {
    ValidationException.ExceptionMessageWithStackTrace exp = new ValidationException.ExceptionMessageWithStackTrace(
            null, "string2");
    ValidationException.ExceptionMessageWithStackTrace exp2 =
            new ValidationException.ExceptionMessageWithStackTrace(
            "string1", "string2");
    Assert.assertNotEquals(exp, exp2);
}
 
Example 15
Project: flow-platform   File: JobControllerTest.java   View source code 5 votes vote down vote up
@Test
public void should_get_job_zip_success() throws Exception {
    stubDemo();
    Node rootForFlow = createRootFlow("flow1", "yml/flow.yaml");
    Job job = jobService.createFromFlowYml(rootForFlow.getPath(), JobCategory.TAG, null, mockUser);

    job.putEnv(GitEnvs.FLOW_GIT_BRANCH, "master");
    job.setStatus(JobStatus.SUCCESS);
    jobDao.update(job);

    List<NodeResult> nodeResultList = nodeResultService.list(job, true);
    for (NodeResult nodeResult : nodeResultList) {
        nodeResult.setCmdId("xxxx");
        nodeResultService.update(nodeResult);
    }

    MvcResult mvcResult = this.mockMvc.perform(
        get(String.format("/jobs/%s/%s/log/download", job.getNodeName(), job.getNumber()))
    ).andExpect(status().isOk()).andReturn();
    String response = mvcResult.getResponse().getContentAsString();
    Assert.assertNotNull(response);

    Path zipLog = Paths
        .get(workspace.toString(), job.getNodeName(), "log", job.getId().toString(),
            job.getId().toString() + ".zip");
    File zipFile = new File(zipLog.toString());
    Assert.assertEquals(true, zipFile.exists());
}
 
Example 16
Project: openjdk-systemtest   File: TestSuite040.java   View source code 5 votes vote down vote up
public void testItem_0045()
{
  boolean caught;
  caught = false;
  try {
    rc_BigDecimal = new BigDecimal(new char[]{'\1', '\234', '\uFFFF', '\0', '\1', '8', '\uFFFF', '\uFFFF'}, new MathContext("precision=1 roundingMode=HALF_UP"));
  }
  catch (java.lang.NumberFormatException e) {
    caught = true;
  }
  Assert.assertEquals("91.94630872483222%", true, caught);
}
 
Example 17
Project: GitHub   File: JSONSerializerTest.java   View source code 5 votes vote down vote up
public void test_3_s() throws Exception {
    JSONSerializer serializer = new JSONSerializer();
    serializer.write(new JSONAware() {

        public String toJSONString() {
            return "null";
        }
    });

    Assert.assertEquals("null", serializer.getWriter().toString());
}
 
Example 18
Project: openjdk-systemtest   File: TestSuite011.java   View source code 5 votes vote down vote up
public void testItem_0697()
{
  boolean caught;
  caught = false;
  try {
    rc_MathContext = new MathContext("S5:FS:9C;4BQIG?=1VYKGM=<=<R;RBS3O8IHYARO1ST2SHL;6L;S5312X;O4:9:FOMG<DOTQT?6X5NE1T6OB3VCGIQ04J4M4812?");
  }
  catch (java.lang.IllegalArgumentException e) {
    caught = true;
  }
  Assert.assertEquals("91.61073825503355%", true, caught);
}
 
Example 19
Project: linkifier   File: RegressionTest.java   View source code 5 votes vote down vote up
@Test
public void test324() throws Throwable {
    if (debug)
        System.out.format("%n%s%n", "RegressionTest0.test324");
    Relationship relationship0 = new Relationship();
    Column column1 = relationship0.getPk();
    String str2 = relationship0.getSchema();
    Boolean b3 = relationship0.getDataTypeCategoryAgree();
    Column column6 = new Column(",", "");
    column6.setEstimatedRowCount((int) (byte) 0);
    Boolean b9 = column6.isBestAttemptPk();
    relationship0.setPk(column6);
    Boolean b11 = column6.isBestAttemptPk();
    Table[] table_array12 = new Table[] {};
    ArrayList<Table> arraylist_table13 = new ArrayList<Table>();
    boolean b14 = Collections.addAll(arraylist_table13, table_array12);
    List<Table> list_table15 = Optimization.optimize(arraylist_table13);
    column6.setMinLDOtherTable(arraylist_table13);
    column6.setKeywords();
    column6.setDecimalDigits((int) 'a');
    column6.setUniqueConstraint(true);
    Integer i22 = column6.getLD();
    Assert.assertNull(column1);
    Assert.assertNull(str2);
    Assert.assertNull(b3);
    Assert.assertTrue("'" + b9 + "' != '" + false + "'", b9.equals(false));
    Assert.assertTrue("'" + b11 + "' != '" + false + "'", b11.equals(false));
    Assert.assertNotNull(table_array12);
    Assert.assertTrue(b14 == false);
    Assert.assertNotNull(list_table15);
    Assert.assertNull(i22);
}
 
Example 20
Project: openjdk-systemtest   File: TestSuite032.java   View source code 5 votes vote down vote up
public void testItem_0411()
{
  boolean caught;
  caught = false;
  try {
    rc_int = (new BigDecimal("320.0E+2147483647")).intValueExact();
  }
  catch (java.lang.ArithmeticException e) {
    caught = true;
  }
  Assert.assertEquals("91.94630872483222%", true, caught);
}
 
Example 21
Project: incubator-servicecomb-java-chassis   File: TestConfigCenterConfigurationSource.java   View source code 5 votes vote down vote up
@Test
public void testCreate() throws Exception {

  ConfigCenterConfigurationSourceImpl configCenterSource = new ConfigCenterConfigurationSourceImpl();
  configCenterSource.addUpdateListener(new WatchedUpdateListener() {
    @Override
    public void updateConfiguration(WatchedUpdateResult result) {
      Assert.assertTrue(!result.getAdded().isEmpty());
    }
  });
  UpdateHandler udateHandler = Deencapsulation.getField(configCenterSource, UpdateHandler.class);
  Map<String, Object> addedItems = new HashMap<>();
  addedItems.put("testKey", "testValue");
  udateHandler.handle("create", addedItems);
}
 
Example 22
Project: mycat-src-1.6.1-RELEASE   File: ServerParserTest.java   View source code 5 votes vote down vote up
@Test
public void testIsSelectVersionComment() {
    Assert.assertEquals(ServerParseSelect.VERSION_COMMENT,
            ServerParseSelect.parse(" select @@version_comment  ", 7));
    Assert.assertEquals(ServerParseSelect.VERSION_COMMENT, ServerParseSelect.parse("SELECT @@VERSION_COMMENT", 6));
    Assert.assertEquals(ServerParseSelect.VERSION_COMMENT,
            ServerParseSelect.parse(" selECT    @@VERSION_comment  ", 7));
}
 
Example 23
Project: simm-lib   File: BigDecimalUtilsTest.java   View source code 5 votes vote down vote up
@Test
public void sumInStream() {
  List<BigDecimal> list = Arrays.asList(new BigDecimal("1"), new BigDecimal("3"));
  Assert.assertEquals(new BigDecimal("4"), list.stream().reduce(BigDecimalUtils::sum).get());

  List<BigDecimal> list2 = Arrays.asList(new BigDecimal("1"), new BigDecimal("3"), new BigDecimal("5"));
  Assert.assertEquals(new BigDecimal("9"), list2.parallelStream().reduce(BigDecimalUtils::sum).get());
}
 
Example 24
Project: coffee-gb   File: LfsrTest.java   View source code 5 votes vote down vote up
@Test
public void testLfsrWidth7() {
    Lfsr lfsr = new Lfsr();
    int previousValue = 0;
    for (int i = 0; i < 100; i++) {
        lfsr.nextBit(true);
        Assert.assertNotEquals(previousValue, lfsr.getValue());
        previousValue = lfsr.getValue();
    }
}
 
Example 25
Project: GitHub   File: NativePooledByteBufferFactoryTest.java   View source code 5 votes vote down vote up
private void assertArrayEquals(byte[] expected, byte[] actual, int length) {
  Assert.assertTrue(expected.length >= length);
  Assert.assertTrue(actual.length >= length);
  for (int i = 0; i < length; i++) {
    Assert.assertEquals(expected[i], actual[i], i);
  }
}
 
Example 26
Project: angel   File: UpdateFuncTest.java   View source code 5 votes vote down vote up
@Test
public void testMulS() throws Exception {
  UpdateFunc func = new MulS(w2Client.getMatrixId(), 0, 3, -1.0);
  w2Client.update(func).get();

  double[] addResult = pull(w2Client, 3);
  assert(addResult.length == dim);
  for (int i = 0; i < addResult.length; i++) {
    Assert.assertEquals(addResult[i], localArray0[i] * -1.0, delta);
  }
}
 
Example 27
Project: openjdk-systemtest   File: TestSuite040.java   View source code 5 votes vote down vote up
public void testItem_0665()
{
  boolean caught;
  caught = false;
  try {
    rc_BigDecimal = new BigDecimal("BK;?WK<V<[email protected];2C736TFB8SRN3S>K;;5VAO<GX;@>KFUY<[email protected]=0F=4HN9910J");
  }
  catch (java.lang.NumberFormatException e) {
    caught = true;
  }
  Assert.assertEquals("91.94630872483222%", true, caught);
}
 
Example 28
Project: BachelorPraktikum   File: SonySWR21ImporterTest.java   View source code 5 votes vote down vote up
/**
 * Test to see whether the plugin can be loaded.
 */
@Test
public void pluginLoad() {
    PluginManager manager = new DefaultPluginManager(Paths.get("export"));
    manager.loadPlugins();
    Assert.assertTrue(0 != manager.getPlugins().size());
}
 
Example 29
Project: incubator-servicecomb-java-chassis   File: TestPartToMultipartFile.java   View source code 5 votes vote down vote up
@Test
public void isEmptyTrue() {
  new Expectations() {
    {
      part.getSize();
      result = 0;
    }
  };

  Assert.assertTrue(multipartFile.isEmpty());
}
 
Example 30
Project: autorest.java   File: HttpRedirectsTests.java   View source code 5 votes vote down vote up
@Test
@Ignore("Not supported yet")
public void put301() throws Exception {
    client.httpRedirects().put301WithServiceResponseAsync()
        .subscribe(new Action1<ServiceResponseWithHeaders<Void, HttpRedirectsPut301Headers>>() {
            @Override
            public void call(ServiceResponseWithHeaders<Void, HttpRedirectsPut301Headers> response) {
                Assert.assertEquals(301, response.response().code());
                lock.countDown();
            }
        });
    Assert.assertTrue(lock.await(1000, TimeUnit.MILLISECONDS));
}
 
Example 31
Project: incubator-servicecomb-java-chassis   File: TestProducerSchemaFactory.java   View source code 5 votes vote down vote up
@Test
public void testGetOrCreateProducer() throws Exception {
  OperationMeta operationMeta = schemaMeta.ensureFindOperation("add");
  Assert.assertEquals("add", operationMeta.getOperationId());

  SwaggerProducerOperation producerOperation = operationMeta.getExtData(Const.PRODUCER_OPERATION);

  Object addBody = Class.forName("cse.gen.app.ms.schema.addBody").newInstance();
  ReflectUtils.setField(addBody, "x", 1);
  ReflectUtils.setField(addBody, "y", 2);
  Invocation invocation = new Invocation((Endpoint) null, operationMeta, new Object[] {addBody}) {
    @Override
    public String getInvocationQualifiedName() {
      return "";
    }
  };
  Holder<Response> holder = new Holder<>();
  producerOperation.invoke(invocation, resp -> {
    holder.value = resp;
  });
  Assert.assertEquals(3, (int) holder.value.getResult());

  invocation.setSwaggerArguments(new Object[] {1, 2});
  producerOperation.invoke(invocation, resp -> {
    holder.value = resp;
  });
  Assert.assertEquals(true, holder.value.isFailed());
  InvocationException exception = (InvocationException) holder.value.getResult();
  CommonExceptionData data = (CommonExceptionData) exception.getErrorData();
  Assert.assertEquals("Cse Internal Server Error", data.getMessage());
}
 
Example 32
Project: CodeKatas   File: JDK8DeckOfCardsAsSortedSetTest.java   View source code 5 votes vote down vote up
@Test
public void cardsBySuit()
{
    Map<Suit, SortedSet<Card>> jdk1CardsBySuit = this.jdk1Deck.getCardsBySuit();
    Map<Suit, SortedSet<Card>> jdk2CardsBySuit = this.jdk2Deck.getCardsBySuit();
    Assert.assertEquals(jdk1CardsBySuit.get(Suit.CLUBS), jdk2CardsBySuit.get(Suit.CLUBS));
}
 
Example 33
Project: openjdk-systemtest   File: TestSuite003.java   View source code 5 votes vote down vote up
public void testItem_0626()
{
  boolean caught;
  caught = false;
  try {
    rc_BigDecimal = new BigDecimal(new java.math.BigInteger("32"), new MathContext("precision=1 roundingMode=UNNECESSARY"));
  }
  catch (java.lang.ArithmeticException e) {
    caught = true;
  }
  Assert.assertEquals("89.93288590604027%", true, caught);
}
 
Example 34
Project: redirector   File: AppModelRestFacadeTest.java   View source code 5 votes vote down vote up
@Ignore("Do we still need it? We don't get this version from Zk")
@Test
public void testGetModelVersionStatsNull() throws Exception {
    setupSuccessfullyConnectingPerServiceCache(true);
    setupGetVersionThrowsException();
    testee.start();
    
    Assert.assertEquals(RedirectorConstants.NO_MODEL_NODE_VERSION, testee.getModelVersion());
}
 
Example 35
Project: mybatis-generator-plugin   File: UpsertPluginTest.java   View source code 5 votes vote down vote up
/**
 * 测试配置异常
 */
@Test
public void testWarnings() throws IOException, XMLParserException, InvalidConfigurationException, InterruptedException, SQLException {
    // 1. 没有使用mysql数据库
    MyBatisGeneratorTool tool = MyBatisGeneratorTool.create("scripts/UpsertPlugin/mybatis-generator-with-error-driver.xml");
    tool.generate();
    Assert.assertEquals(tool.getWarnings().get(1), "itfsw:插件com.itfsw.mybatis.generator.plugins.UpsertPlugin插件使用前提是数据库为MySQL!");

    // 2. 普通提示
    tool = MyBatisGeneratorTool.create("scripts/UpsertPlugin/mybatis-generator.xml");
    tool.generate();
    Assert.assertEquals(tool.getWarnings().get(0), "itfsw:插件com.itfsw.mybatis.generator.plugins.UpsertPlugin插件您开启了allowMultiQueries支持,注意在jdbc url 配置中增加“allowMultiQueries=true”支持(不怎么建议使用该功能,开启多sql提交会增加sql注入的风险,请确保你所有sql都使用MyBatis书写,请不要使用statement进行sql提交)!");
}
 
Example 36
Project: openjdk-systemtest   File: TestSuite004.java   View source code 5 votes vote down vote up
public void testItem_0113()
{
  boolean caught;
  caught = false;
  try {
    rc_BigDecimal = (new BigDecimal("8507059173023461584739690778423250124.9")).divide(new BigDecimal("0"), -2147483648, 2147483647);
  }
  catch (java.lang.IllegalArgumentException e) {
    caught = true;
  }
  Assert.assertEquals("89.93288590604027%", true, caught);
}
 
Example 37
Project: openjdk-systemtest   File: TestSuite027.java   View source code 4 votes vote down vote up
public void testItem_0955()
{
  rc_BigDecimal = (new BigDecimal("179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368")).min(new BigDecimal("1.0"));
  Assert.assertEquals("1.0", rc_BigDecimal.toString());
}
 
Example 38
Project: openjdk-systemtest   File: TestSuite040.java   View source code 4 votes vote down vote up
public void testItem_0606()
{
  rc_BigDecimal = (new BigDecimal("0.0")).multiply(new BigDecimal("0.0"));
  Assert.assertEquals("0.00", rc_BigDecimal.toString());
}
 
Example 39
Project: sats-core   File: BMValueTest.java   View source code 4 votes vote down vote up
@Test
public void valueOfCompleteBundle() {
    Bundle<BMLicense> bundle = new Bundle<>(bidder.getWorld().getLicenses());
    BigDecimal value = bidder.calculateValue(bundle);
    Assert.assertTrue(bidder.getSetupType() + " value was " + value + " should be " + expextedValuedCompleteBundle, value.compareTo(expextedValuedCompleteBundle) == 0);
}
 
Example 40
Project: openjdk-systemtest   File: TestSuite055.java   View source code 4 votes vote down vote up
public void testItem_0595()
{
  rc_BigDecimal = new BigDecimal(new java.math.BigInteger("32"));
  Assert.assertEquals("32", rc_BigDecimal.toString());
}