@@ -0,0 +1,2007 @@
+/*%0A * Copyright (c) 2015 Spotify AB%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22); you may not%0A * use this file except in compliance with the License. You may obtain a copy of%0A * the License at%0A *%0A * http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS, WITHOUT%0A * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the%0A * License for the specific language governing permissions and limitations under%0A * the License.%0A */%0Apackage com.spotify.folsom;%0A%0Aimport com.google.common.base.Charsets;%0Aimport org.junit.After;%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0A%0Aimport static org.junit.Assert.assertEquals;%0A%0Apublic class MemcacheClientBuilderTest %7B%0A%0A  private EmbeddedServer server;%0A%0A  @Before%0A  public void setUp() throws Exception %7B%0A    server = new EmbeddedServer(false);%0A  %7D%0A%0A  @After%0A  public void tearDown() throws Exception %7B%0A    server.stop();%0A  %7D%0A%0A  @Test%0A  public void testValidLatin1() throws Exception %7B%0A    AsciiMemcacheClient%3CString%3E client = MemcacheClientBuilder.newStringClient()%0A            .withKeyCharset(Charsets.ISO_8859_1)%0A            .connectAscii();%0A    IntegrationTest.awaitConnected(client);%0A    assertEquals(null, client.get(%22R%C3%A4ksm%C3%B6rg%C3%A5s%22).get());%0A  %7D%0A%0A  @Test%0A  public void testValidUTF8() throws Exception %7B%0A    AsciiMemcacheClient%3CString%3E client = MemcacheClientBuilder.newStringClient()%0A            .withKeyCharset(Charsets.UTF_8)%0A            .connectAscii();%0A    IntegrationTest.awaitConnected(client);%0A    assertEquals(null, client.get(%22R%C3%A4ksm%C3%B6rg%C3%A5s%22).get());%0A  %7D%0A%0A  @Test(expected = IllegalArgumentException.class)%0A  public void testInvalidUTF16() throws Exception %7B%0A    AsciiMemcacheClient%3CString%3E client = MemcacheClientBuilder.newStringClient()%0A            .withKeyCharset(Charsets.UTF_16)%0A            .connectAscii();%0A    IntegrationTest.awaitConnected(client);%0A    client.get(%22Key%22).get();%0A  %7D%0A%7D%0A

Add new test