APISonar


org.junit.Assert.assertTrue

> org > junit > Assert > assertTrue
org APIs junit APIs Assert APIs assertTrue APIs

Example 1
public void testHasAllowedSubgroupAllowedSubgroups() {
        Group g = getAllowedGroupWithSubgroups();
        Assert.assertTrue(helper.hasAllowedSubgroup(g));
    }
Example 2
public void testWordNumericTokeniztation() {
    String text = "305KW";

    String[] tokenizedText = mTokenizer.tokenize(text);

    Assert.assertTrue("305".equals(tokenizedText[0]));
    Assert.assertTrue("KW".equals(tokenizedText[1]));
    Assert.assertTrue(tokenizedText.length == 2);
  }
Example 3
public void getListArrayOK() {
        // Given
        Assert.assertTrue(ff4jConf.containsKey("propList"));
        // When
        String[] c = ff4jConf.getStringArray("propList");
        // Then
        Assert.assertTrue(Util.list("a","b","c").containsAll(Arrays.asList(c)));
    }
Example 4
public void testListDatabases() throws Exception {
        List<String> dbList = explorer.listDatabases();
        Assert.assertTrue(dbList.size() >= 3);
        Assert.assertTrue(dbList.contains("EDW"));
        Assert.assertTrue(dbList.contains("DEFAULT"));
    }
Example 5
public void testRegisterTimerEventInNanoSeconds() throws Exception {
    Runnable r = new Runnable() {
      @Override
      public void run() {
        isTimerEventInvoked = true;
      }
    };
    heronServer.registerTimerEventInNanoSeconds(0, r);

    runBase();

    Assert.assertTrue(isTimerEventInvoked);
  }
Example 6
public void testSubshell() throws Exception {
        StringLexingstate s = new StringLexingstate();

        s.enterSubshell();

        Assert.assertTrue(s.isSubstringAllowed());
        Assert.assertTrue(s.isInSubshell());

        s.leaveSubshell();

        Assert.assertFalse(s.isInSubshell());
    }
Example 7
public void basicSingleThreaded() throws Exception
    {
        ConcurrentQueueSpec qs = ConcurrentQueueSpec.createBoundedSpsc(16);
        BlockingQueue<Integer> q = BlockingQueueFactory.newBlockingQueue(qs);

        q.put(1);
        Assert.assertTrue(q.take() == 1);

        q.put(2);
        q.put(3);
        q.put(4);
        Assert.assertTrue(q.take() == 2);
        Assert.assertTrue(q.take() == 3);
        Assert.assertTrue(q.take() == 4);
    }
Example 8
public void testCreateValueByValueTwoParametersArrayParams() {
    final Object result = propertyIndexByValue.createValue(mapToTest, "25");

    Assert.assertTrue(result instanceof Collection);

    final Collection<?> collectionResult = (Collection<?>) result;

    Assert.assertEquals(collectionResult.size(), 2);
    Assert.assertTrue(collectionResult.contains(1));
    Assert.assertTrue(collectionResult.contains(2));
  }
Example 9
public static void cleanup() {
        File f = new File(MESSAGE_FILE);
        if (f.isFile()) {
            Assert.assertTrue(f.delete());
        }
    }
Example 10
public void shouldGetWindowSize() {
    openStartActivity();
    Dimension dim = driver().manage().window().getSize();
    Assert.assertTrue(dim.getHeight() > 100);
    Assert.assertTrue(dim.getWidth() > 100);
  }
Example 11
private void assertSameAcls(AclStatus a, AclStatus b) throws Exception {
    Assert.assertTrue(a.getOwner().equals(b.getOwner()));
    Assert.assertTrue(a.getGroup().equals(b.getGroup()));
    Assert.assertTrue(a.isStickyBit() == b.isStickyBit());
    Assert.assertTrue(a.getEntries().size() == b.getEntries().size());
    for (AclEntry e : a.getEntries()) {
      Assert.assertTrue(b.getEntries().contains(e));
    }
    for (AclEntry e : b.getEntries()) {
      Assert.assertTrue(a.getEntries().contains(e));
    }
  }
Example 12
public void testGetAvailableLanguageTags() {
    Object ret = run("FUZZY_LANGS()", new HashMap<>());
    Assert.assertNotNull(ret);
    Assert.assertTrue(ret instanceof List);
    List<String> tags = (List<String>) ret;
    Assert.assertTrue(tags.size() > 0);
    Assert.assertTrue(tags.contains("en"));
    Assert.assertTrue(tags.contains("fr"));
  }
Example 13
public void testIsFiltered2() {
    List<String> output = new ArrayList<>();
    for ( String filename : files ) {
      if ( !Util.isFiltered( filename, "*F*" ) ) {
        output.add( filename );
      }
    }
    Assert.assertTrue( output.contains( "File1.ktr" ) );
    Assert.assertTrue( output.contains( "File2" ) );
    Assert.assertTrue( output.contains( "File3.ktr" ) );
    Assert.assertTrue( output.contains( "MyFile.kjb" ) );
    Assert.assertTrue( output.contains( "TheFile" ) );
    Assert.assertTrue( output.contains( "lowerfile" ) );
    Assert.assertFalse( output.contains( "Albatross" ) );
  }
Example 14
public void testgetPropertiesByKey() {
        // Given
        Assert.assertTrue(ff4jConf.containsKey("name"));
        // When
        Properties conf2 = ff4jConf.getProperties("prop");
        // Then
        Assert.assertTrue(conf2.containsKey("propInt"));
        Assert.assertFalse(conf2.containsKey("name"));
        Assert.assertTrue(ff4jConf.getProperties(null).isEmpty());
    }
Example 15
public void do_pump_succ(Context context) throws Throwable {
    run(context, true);

    Assert.assertEquals(src, outputStream.getBuffer().toString());
    Assert.assertTrue(inputStreamClosed);
    Assert.assertTrue(outputStreamClosed);
  }
Example 16
public void testLocking() throws IOException {
    channel.start();
    Assert.assertTrue(channel.isOpen());
    FileChannel fileChannel = createFileChannel();
    fileChannel.start();
    Assert.assertTrue(!fileChannel.isOpen());
  }
Example 17
public void endsWithTest4() {
    Path path = create("//////a/b/c/d/");
    Assert.assertTrue(path.endsWith("/a//b/c/d///"));
  }
Example 18
public void getServerDigestReporterLogNameKey() {
        String serverDigestReporterLogNameKey = clientTracer.getServerDigestReporterLogNameKey();
        Assert.assertTrue(serverDigestReporterLogNameKey == null);
    }
Example 19
public void getServerDigestReporterLogName() {
        String serverDigestReporterLogName = clientTracer.getServerDigestReporterLogName();
        Assert.assertTrue(serverDigestReporterLogName == null);
    }
Example 20
private void assertFails(Runnable statement) {
        boolean failed = false;
        try {
            statement.run();
        } catch (RuntimeException e) {
            failed = true;
        }
        Assert.assertTrue(failed);
    }
Example 21
private void validateEmpty(Object r1) {
    Result result = (Result)r1;
    Assert.assertTrue(result != null);
    Assert.assertTrue(result.isEmpty());
  }
Example 22
public void destroy_shouldCloseAllConnections() throws SQLException {
        Connection c1 = connectionPool.reserveConnection();
        Connection c2 = connectionPool.reserveConnection();
        connectionPool.destroy();
        Assert.assertTrue(c1.isClosed());
        Assert.assertTrue(c2.isClosed());
    }
Example 23
public void verifyConfig() {
        String s = mongoSourceConnector.verifyAndSetConfig(keyValue);
        Assert.assertTrue(s.contains("Request config key:"));
    }
Example 24
public void testReferences() {

        Map<String, Map<String, Object>> references = dubboReferencesMetadata.references();

        Assert.assertTrue(references.isEmpty());

    }
Example 25
public final void testMkdirNew() {
        if (isWriteable()) {
            Assert.assertTrue(resourceRoot.mkdir(getMount() + "/new-test"));

            File file = new File(getBaseDir(), "new-test");
            Assert.assertTrue(file.isDirectory());
            Assert.assertTrue(file.delete());
        } else {
            Assert.assertFalse(resourceRoot.mkdir(getMount() + "/new-test"));
        }
    }