Example usage for junit.framework AssertionFailedError AssertionFailedError

List of usage examples for junit.framework AssertionFailedError AssertionFailedError

Introduction

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

Prototype

public AssertionFailedError(String message) 

Source Link

Usage

From source file:test.org.osuosl.srw.sort.SortToolTests.java

public void testMissingHighFloat() {
    SortTool sorttool = new SortTool();
    SortKey sortkey = new SortKey(SORTKEY_FLOAT);
    sortkey.setMissingValue(SortKey.MISSINGVALUE_HIGHVALUE);
    SortKey[] sortKeys = { sortkey };
    sorttool.setSortKeys(sortKeys);//from  w  ww.  j  a  v  a  2  s .c o m
    log.info("SortTool: " + sorttool);
    try {
        addEntries(sorttool);
        ArrayList sortedlist = sorttool.getEntries();
        assertEquals("Value out of order", "4", ((SortEntry) sortedlist.get(0)).getIdentifier());
        assertEquals("Value out of order", "1", ((SortEntry) sortedlist.get(1)).getIdentifier());
        assertEquals("Value out of order", "5", ((SortEntry) sortedlist.get(2)).getIdentifier());
        assertEquals("Value out of order", "0", ((SortEntry) sortedlist.get(3)).getIdentifier());
        assertEquals("Value out of order", "2", ((SortEntry) sortedlist.get(4)).getIdentifier());
        assertEquals("Value out of order", "3", ((SortEntry) sortedlist.get(5)).getIdentifier());
    } catch (SRWDiagnostic e) {
        throw new AssertionFailedError(e.toString());
    }
}

From source file:test.org.osuosl.srw.sort.SortToolTests.java

public void testMissingLowFloat() {
    SortTool sorttool = new SortTool();
    SortKey sortkey = new SortKey(SORTKEY_FLOAT);
    sortkey.setMissingValue(SortKey.MISSINGVALUE_LOWVALUE);
    SortKey[] sortKeys = { sortkey };
    sorttool.setSortKeys(sortKeys);/*from www  .j a  v  a2 s. c o  m*/
    log.info("SortTool: " + sorttool);
    try {
        addEntries(sorttool);
        ArrayList sortedlist = sorttool.getEntries();
        assertEquals("Value out of order", "2", ((SortEntry) sortedlist.get(0)).getIdentifier());
        assertEquals("Value out of order", "3", ((SortEntry) sortedlist.get(1)).getIdentifier());
        assertEquals("Value out of order", "4", ((SortEntry) sortedlist.get(2)).getIdentifier());
        assertEquals("Value out of order", "1", ((SortEntry) sortedlist.get(3)).getIdentifier());
        assertEquals("Value out of order", "5", ((SortEntry) sortedlist.get(4)).getIdentifier());
        assertEquals("Value out of order", "0", ((SortEntry) sortedlist.get(5)).getIdentifier());

    } catch (SRWDiagnostic e) {
        throw new AssertionFailedError(e.toString());
    }
}

From source file:test.org.osuosl.srw.sort.SortToolTests.java

public void testMissingLowString() {
    SortTool sorttool = new SortTool();
    SortKey sortkey = new SortKey(SORTKEY_STRING);
    sortkey.setMissingValue(SortKey.MISSINGVALUE_LOWVALUE);
    SortKey[] sortKeys = { sortkey };
    sorttool.setSortKeys(sortKeys);//from  www  .  ja  v a  2 s . c  om
    log.info("SortTool: " + sorttool);
    try {
        addEntries(sorttool);
        ArrayList sortedlist = sorttool.getEntries();
        assertEquals("Value out of order", "3", ((SortEntry) sortedlist.get(0)).getIdentifier());
        assertEquals("Value out of order", "0", ((SortEntry) sortedlist.get(1)).getIdentifier());
        assertEquals("Value out of order", "1", ((SortEntry) sortedlist.get(2)).getIdentifier());
        assertEquals("Value out of order", "2", ((SortEntry) sortedlist.get(3)).getIdentifier());
        assertEquals("Value out of order", "5", ((SortEntry) sortedlist.get(4)).getIdentifier());
        assertEquals("Value out of order", "4", ((SortEntry) sortedlist.get(5)).getIdentifier());

    } catch (SRWDiagnostic e) {
        throw new AssertionFailedError(e.toString());
    }
}

From source file:test.org.osuosl.srw.sort.SortToolTests.java

public void testMissingOmitString() {
    SortTool sorttool = new SortTool();
    SortKey sortkey = new SortKey(SORTKEY_STRING);
    sortkey.setMissingValue(SortKey.MISSINGVALUE_OMIT);
    SortKey[] sortKeys = { sortkey };
    sorttool.setSortKeys(sortKeys);// w  w w  .j  a va2  s . c  om
    log.info("SortTool: " + sorttool);
    try {
        addEntries(sorttool);
        ArrayList sortedlist = sorttool.getEntries();
        assertEquals("Value out of order", "0", ((SortEntry) sortedlist.get(0)).getIdentifier());
        assertEquals("Value out of order", "1", ((SortEntry) sortedlist.get(1)).getIdentifier());
        assertEquals("Value out of order", "2", ((SortEntry) sortedlist.get(2)).getIdentifier());
        assertEquals("Value out of order", "5", ((SortEntry) sortedlist.get(3)).getIdentifier());
        assertEquals("Value out of order", "4", ((SortEntry) sortedlist.get(4)).getIdentifier());
    } catch (SRWDiagnostic e) {
        throw new AssertionFailedError(e.toString());
    }
}

From source file:test.org.osuosl.srw.sort.SortToolTests.java

public void testMissingOmitFloat() {
    SortTool sorttool = new SortTool();
    SortKey sortkey = new SortKey(SORTKEY_FLOAT);
    sortkey.setMissingValue(SortKey.MISSINGVALUE_OMIT);
    SortKey[] sortKeys = { sortkey };
    sorttool.setSortKeys(sortKeys);//from ww  w .j  a  v a  2  s.c om
    log.info("SortTool: " + sorttool);
    try {
        addEntries(sorttool);
        ArrayList sortedlist = sorttool.getEntries();
        assertEquals("Value out of order", "4", ((SortEntry) sortedlist.get(0)).getIdentifier());
        assertEquals("Value out of order", "1", ((SortEntry) sortedlist.get(1)).getIdentifier());
        assertEquals("Value out of order", "5", ((SortEntry) sortedlist.get(2)).getIdentifier());
        assertEquals("Value out of order", "0", ((SortEntry) sortedlist.get(3)).getIdentifier());
    } catch (SRWDiagnostic e) {
        throw new AssertionFailedError(e.toString());
    }
}

From source file:test.org.osuosl.srw.sort.SortToolTests.java

public void testMissingConstantFloat() throws SRWDiagnostic {
    SortTool sorttool = new SortTool();
    SortKey sortkey = new SortKey(SORTKEY_FLOAT);
    sortkey.setMissingValue(SortKey.MISSINGVALUE_CONSTANT);
    sortkey.setMissingValueConstant("4.5");
    SortKey[] sortKeys = { sortkey };
    sorttool.setSortKeys(sortKeys);/*from   w  w w .j a v a2s  . c o  m*/
    log.info("SortTool: " + sorttool);
    try {
        addEntries(sorttool);
        ArrayList sortedlist = sorttool.getEntries();
        assertEquals("Value out of order", "4", ((SortEntry) sortedlist.get(0)).getIdentifier());
        assertEquals("Value out of order", "1", ((SortEntry) sortedlist.get(1)).getIdentifier());
        assertEquals("Value out of order", "5", ((SortEntry) sortedlist.get(2)).getIdentifier());
        assertEquals("Value out of order", "2", ((SortEntry) sortedlist.get(3)).getIdentifier());
        assertEquals("Value out of order", "3", ((SortEntry) sortedlist.get(4)).getIdentifier());
        assertEquals("Value out of order", "0", ((SortEntry) sortedlist.get(5)).getIdentifier());

    } catch (SRWDiagnostic e) {
        throw new AssertionFailedError(e.toString());
    }
}

From source file:test.org.osuosl.srw.sort.SortToolTests.java

public void testMissingConstantString() {
    SortTool sorttool = new SortTool();
    SortKey sortkey = new SortKey(SORTKEY_STRING);
    sortkey.setMissingValue(SortKey.MISSINGVALUE_CONSTANT);
    sortkey.setMissingValueConstant("aba");
    SortKey[] sortKeys = { sortkey };
    sorttool.setSortKeys(sortKeys);/*from   www  .  ja v  a2  s.c om*/
    log.info("SortTool: " + sorttool);
    try {
        addEntries(sorttool);
        ArrayList sortedlist = sorttool.getEntries();
        assertEquals("Value out of order", "0", ((SortEntry) sortedlist.get(0)).getIdentifier());
        assertEquals("Value out of order", "1", ((SortEntry) sortedlist.get(1)).getIdentifier());
        assertEquals("Value out of order", "2", ((SortEntry) sortedlist.get(2)).getIdentifier());
        assertEquals("Value out of order", "3", ((SortEntry) sortedlist.get(3)).getIdentifier());
        assertEquals("Value out of order", "5", ((SortEntry) sortedlist.get(4)).getIdentifier());
        assertEquals("Value out of order", "4", ((SortEntry) sortedlist.get(5)).getIdentifier());

    } catch (SRWDiagnostic e) {
        throw new AssertionFailedError(e.toString());
    }
}

From source file:test.org.osuosl.srw.sort.SortToolTests.java

public void testStringsCaseSensitive() {
    SortTool sorttool = new SortTool();
    SortKey sortkey = new SortKey(SORTKEY_STRING);
    sortkey.setCaseSensitive(true);/*from w  w  w  .  ja v  a  2s.c  o  m*/
    SortKey[] sortKeys = { sortkey };
    sorttool.setSortKeys(sortKeys);
    log.info("SortTool: " + sorttool);

    try {
        addEntries(sorttool);
        ArrayList sortedlist = sorttool.getEntries();
        assertEquals("Value out of order", "1", ((SortEntry) sortedlist.get(0)).getIdentifier());
        assertEquals("Value out of order", "0", ((SortEntry) sortedlist.get(1)).getIdentifier());
        assertEquals("Value out of order", "2", ((SortEntry) sortedlist.get(2)).getIdentifier());
        assertEquals("Value out of order", "5", ((SortEntry) sortedlist.get(3)).getIdentifier());
        assertEquals("Value out of order", "4", ((SortEntry) sortedlist.get(4)).getIdentifier());
        assertEquals("Value out of order", "3", ((SortEntry) sortedlist.get(5)).getIdentifier());
    } catch (SRWDiagnostic e) {
        throw new AssertionFailedError(e.toString());
    }
}

From source file:test.org.osuosl.srw.sort.SortToolTests.java

public void testFloatsCaseSensitive() {
    SortTool sorttool = new SortTool();
    SortKey sortkey = new SortKey(SORTKEY_FLOAT);
    sortkey.setCaseSensitive(true);/*  w ww  .j  av  a 2 s . c om*/
    SortKey[] sortKeys = { sortkey };
    sorttool.setSortKeys(sortKeys);
    log.info("SortTool: " + sorttool);
    try {
        addEntries(sorttool);
        ArrayList sortedlist = sorttool.getEntries();
        assertEquals("Value out of order", "4", ((SortEntry) sortedlist.get(0)).getIdentifier());
        assertEquals("Value out of order", "1", ((SortEntry) sortedlist.get(1)).getIdentifier());
        assertEquals("Value out of order", "5", ((SortEntry) sortedlist.get(2)).getIdentifier());
        assertEquals("Value out of order", "0", ((SortEntry) sortedlist.get(3)).getIdentifier());
        assertEquals("Value out of order", "2", ((SortEntry) sortedlist.get(4)).getIdentifier());
        assertEquals("Value out of order", "3", ((SortEntry) sortedlist.get(5)).getIdentifier());
    } catch (SRWDiagnostic e) {
        throw new AssertionFailedError(e.toString());
    }
}

From source file:test.org.osuosl.srw.sort.SortToolTests.java

public void testStringsFloats() {
    SortTool sorttool = new SortTool();
    SortKey sortkey1 = new SortKey(SORTKEY_STRING);
    SortKey sortkey2 = new SortKey(SORTKEY_FLOAT);
    SortKey[] sortKeys = { sortkey1, sortkey2 };
    sorttool.setSortKeys(sortKeys);/*from ww w  . j  ava  2  s . c o m*/
    log.info("SortTool: " + sorttool);
    try {
        addEntries(sorttool);
        ArrayList sortedlist = sorttool.getEntries();
        assertEquals("Value out of order", "1", ((SortEntry) sortedlist.get(0)).getIdentifier());
        assertEquals("Value out of order", "0", ((SortEntry) sortedlist.get(1)).getIdentifier());
        assertEquals("Value out of order", "2", ((SortEntry) sortedlist.get(2)).getIdentifier());
        assertEquals("Value out of order", "5", ((SortEntry) sortedlist.get(3)).getIdentifier());
        assertEquals("Value out of order", "4", ((SortEntry) sortedlist.get(4)).getIdentifier());
        assertEquals("Value out of order", "3", ((SortEntry) sortedlist.get(5)).getIdentifier());
    } catch (SRWDiagnostic e) {
        throw new AssertionFailedError(e.toString());
    }
}