Search in sources :

Example 1 with JournalMetadataException

use of com.questdb.ex.JournalMetadataException in project questdb by bluestreak01.

the class GenericInteropTest method testGenericStructureMismatch.

@Test
public void testGenericStructureMismatch() throws Exception {
    try (JournalWriter writer = makeGenericWriter()) {
        JournalEntryWriter w = writer.entryWriter();
        w.putSym(0, "EURUSD");
        w.putDate(1, 19999);
        w.putDouble(2, 1.24);
        w.putDouble(3, 1.25);
        w.putInt(4, 10000);
        w.putInt(5, 12000);
        w.putInt(6, 1);
        w.putStr(7, "OK");
        w.putStr(8, "system");
        w.putStr(9, "EURUSD:GLOBAL");
        w.putBool(10, true);
        w.putNull(11);
        w.putLong(12, 13141516);
        w.putShort(13, (short) 25000);
        w.append();
        writer.commit();
        writer.close();
    }
    try {
        getFactory().writer(new JournalStructure("test") {

            {
                $str("sym");
                $date("created");
            }
        });
        Assert.fail("Expected exception");
    } catch (JournalMetadataException ignore) {
    // expected
    }
}
Also used : JournalWriter(com.questdb.store.JournalWriter) JournalStructure(com.questdb.store.factory.configuration.JournalStructure) JournalMetadataException(com.questdb.ex.JournalMetadataException) JournalEntryWriter(com.questdb.store.JournalEntryWriter) AbstractTest(com.questdb.test.tools.AbstractTest) Test(org.junit.Test)

Aggregations

JournalMetadataException (com.questdb.ex.JournalMetadataException)1 JournalEntryWriter (com.questdb.store.JournalEntryWriter)1 JournalWriter (com.questdb.store.JournalWriter)1 JournalStructure (com.questdb.store.factory.configuration.JournalStructure)1 AbstractTest (com.questdb.test.tools.AbstractTest)1 Test (org.junit.Test)1