src/test/java/org/thegalactic/context/io/ContextSerializerBurmeisterTest.java
@Test
    public void testWithoutMagicHeader() {
        File file;
        String filename = "";
        try {
            file = File.createTempFile("junit", ".cxt");
            filename = file.getPath();
            BufferedWriter writer = new BufferedWriter(new FileWriter(filename));
            writer.write("Example");
            writer.newLine();
            writer.close();
            Context context = new Context(filename);
            assertEquals(context.getExtent("a").toString(), "[1, 2]");
            assertEquals(context.getExtent("b").toString(), "[2]");
            assertEquals(context.getExtent("c").toString(), "[]");
        } catch (Exception e) {
            assertEquals(e.toString(), "java.io.IOException: Burmeister magic header not found");
            new File(filename).delete();
        }
    }
/**
     * Test first line without magic header.
     */
Test first line without magic header.
Test first line without magic header .
@Test
    public void testWithoutMagicHeader() {
        File file;
        String filename = "";
        try {
            file = File.createTempFile("junit", ".cxt");
            filename = file.getPath();
            BufferedWriter writer = new BufferedWriter(new FileWriter(filename));
            writer.write("Example");
            writer.newLine();
            writer.close();
            Context context = new Context(filename);
            assertEquals(context.getExtent("a").toString(), "[1, 2]");
            assertEquals(context.getExtent("b").toString(), "[2]");
            assertEquals(context.getExtent("c").toString(), "[]");
        } catch (Exception e) {
            assertEquals(e.toString(), "java.io.IOException: Burmeister magic header not found");
            new File(filename).delete();
        }
    }
@ Test public void testWithoutMagicHeader ( ) { File file ; String filename = "" ; try { file = File . createTempFile ( "junit" , ".cxt" ) ; filename = file . getPath ( ) ; BufferedWriter writer = new BufferedWriter ( new FileWriter ( filename ) ) ; writer . write ( "Example" ) ; writer . newLine ( ) ; writer . close ( ) ; Context context = new Context ( filename ) ; assertEquals ( context . getExtent ( "a" ) . toString ( ) , "[1, 2]" ) ; assertEquals ( context . getExtent ( "b" ) . toString ( ) , "[2]" ) ; assertEquals ( context . getExtent ( "c" ) . toString ( ) , "[]" ) ; } catch ( Exception e ) { assertEquals ( e . toString ( ) , "java.io.IOException: Burmeister magic header not found" ) ; new File ( filename ) . delete ( ) ; } }
Test first line without magic header.
Test first line without magic header .