Example usage for junit.framework Assert assertTrue

List of usage examples for junit.framework Assert assertTrue

Introduction

In this page you can find the example usage for junit.framework Assert assertTrue.

Prototype

static public void assertTrue(String message, boolean condition) 

Source Link

Document

Asserts that a condition is true.

Usage

From source file:com.indoqa.maven.wadldoc.transformation.Wadl2HtmlPipelineTest.java

@Test
public void simplePipeline() throws Exception {
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    new Wadl2HtmlPipeline(this.getClass().getResource("wadl.xml"), null, true).execute(baos);

    Assert.assertNotNull(baos);//www  .jav  a2 s  . co m
    Diff diff = createDiff("test1-result.html", baos);
    Assert.assertTrue("Pieces of XML are not identical. " + diff, diff.identical());
}

From source file:com.ignou.aadhar.util.BankAccountCreatorTest.java

@Test
public void testValidCreateAccount() {

    JsonWrapper output = creatorObj.createAccount("1234567890");
    Assert.assertEquals("Success response not returned.", "SUCCESS", output.get("status"));
    Assert.assertTrue("No Account ID was returned in Success response",
            ((String) output.get("id")).length() > 0);
}

From source file:com.btobits.automator.fix.ant.task.FixStartTask.java

@Override
protected void validate() throws Exception {
    Assert.assertTrue("Reference to FIX session is not specified", StringUtils.isNotBlank(refId));
}

From source file:com.karriem.tp.tddassignment.TDDTestNGTest.java

@Test
public void truth() {

    Assert.assertTrue("The condition is not true", service.truth());
}

From source file:com.btobits.automator.fix.ant.task.SMTPStopTask.java

@Override
protected void runTestInstructions() throws Exception {
    final Object obj = getProject().getReference(refId);
    Assert.assertNotNull("RefId[" + refId + "]. Failed to get SMTP acceptor.", obj);
    Assert.assertTrue("RefId[" + refId + "]. Unknown SMTP acceptor type: " + obj.getClass().getSimpleName(),
            (obj instanceof IControl));
    ((IControl) obj).stop();//from w w  w  .  j  a v  a2  s  .c  o  m
}

From source file:com.btobits.automator.fix.ant.task.SMTPStartTask.java

@Override
protected void runTestInstructions() throws Exception {
    final Object obj = getProject().getReference(refId);
    Assert.assertNotNull("RefId[" + refId + "]. Failed to get SMTP acceptor.", obj);
    Assert.assertTrue("RefId[" + refId + "]. Unknown SMTP acceptor mode: " + obj.getClass().getSimpleName(),
            (obj instanceof IControl));
    ((IControl) obj).start();//  w  w w.ja v a2  s  .  com
}

From source file:com.btobits.automator.fix.ant.task.FixDisconnectValidate.java

@Override
protected void validate() {
    Assert.assertTrue("Reference to FixDisconnectExpect is not specified", StringUtils.isNotBlank(refId));
    final Object obj = getProject().getReference(refId);
    Assert.assertNotNull("RefId[" + refId + "]. Failed to get FixDisconnectExpect instance.", obj);
    Assert.assertTrue("RefId[" + refId + "]. Referred object is not FixDisconnectExpect instance: "
            + obj.getClass().getSimpleName(), (obj instanceof FixDisconnectExpect));
    expectInstance = (FixDisconnectExpect) obj;
}

From source file:at.tugraz.ist.catroid.test.utils.XMLValidationUtil.java

public static void sendProjectXMLToServerForValidating(String fullPathFilename)
        throws IOException, JSONException {

    String xmlContent = readTextFile(fullPathFilename);

    HashMap<String, String> postValues = new HashMap<String, String>();
    postValues.put("xmlToValidate", xmlContent);

    ConnectionWrapper connection = new ConnectionWrapper();
    String responce = connection.doHttpPost(XML_VALIDATING_URL, postValues);

    JSONObject jsonResponce = new JSONObject(responce);
    Log.i(LOG_TAG, "json responce: " + jsonResponce.toString());
    boolean valid = jsonResponce.getBoolean("valid");
    String message = jsonResponce.optString("message");

    Assert.assertTrue(message, valid);
}

From source file:de.hybris.platform.commons.jalo.FOPFormatterTest.java

@Test
public void testFormat() throws Exception {
    File tempfile = null;// w ww.j  a v a  2 s  .  co m
    try {
        tempfile = formatter.transform(sampleFile.getInputStream(), sampleFile.getInputStream());
        Assert.assertTrue("Should be correctly recognized as a pdf file ", formatter.validate(tempfile));
    } finally {
        FileUtils.deleteQuietly(tempfile);
    }

}

From source file:com.btobits.automator.fix.ant.task.FixSequenceReset.java

@Override
protected void validate() throws Exception {
    Assert.assertTrue("Reference to FIX session is not specified", StringUtils.isNotBlank(refId));
    final Object obj = getProject().getReference(refId);
    Assert.assertNotNull("RefId[" + refId + "]. Failed to get FIX session.", obj);
    Assert.assertTrue("RefId[" + refId + "]. Unknown FIX session mode: " + obj.getClass().getSimpleName(),
            (obj instanceof FixSession));

    fixSession = (FixSession) obj;/*from  w  w w  .j a v  a  2s  .  c o m*/
    Assert.assertTrue("Attribute 'newSeqNum' is required parameter and must be more than 0", newSeqNum > 0);
}