Skip to content

Instantly share code, notes, and snippets.

@jbarotin
Last active August 26, 2021 08:34
Show Gist options
  • Save jbarotin/996c0c000975cff9855b5c3b5414865c to your computer and use it in GitHub Desktop.
Save jbarotin/996c0c000975cff9855b5c3b5414865c to your computer and use it in GitHub Desktop.
Unit test KO for check size on java client of seaweed
package seaweedfs.client;
import org.junit.Test;
import java.io.IOException;
import static org.junit.Assert.assertEquals;
public class SeaweedWriteTest {
@Test
public void testWriteFileAndReadSize() throws IOException {
FilerClient filerClient = new FilerClient("localhost", 18888);
SeaweedOutputStream seaweedOutputStream = new SeaweedOutputStream(filerClient, "/test/writeandread");
seaweedOutputStream.write("One test line\n".getBytes());
seaweedOutputStream.close();
FilerProto.Entry e = filerClient.lookupEntry("/test", "writeandread");
assertEquals(14, e.getAttributes().getFileSize());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment