Last active
August 26, 2021 08:34
-
-
Save jbarotin/996c0c000975cff9855b5c3b5414865c to your computer and use it in GitHub Desktop.
Unit test KO for check size on java client of seaweed
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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