missing test

This commit is contained in:
Adrian Cole 2010-11-30 14:07:59 +00:00
parent 46145b0a34
commit 1212f50d51
1 changed files with 40 additions and 0 deletions

View File

@ -0,0 +1,40 @@
/**
*
* Copyright (C) 2010 Cloud Conscious, LLC. <info@cloudconscious.com>
*
* ====================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* ====================================================================
*/
package org.jclouds.io.payloads;
import static org.testng.Assert.assertEquals;
import org.jclouds.io.Payload;
import org.testng.annotations.Test;
import com.google.common.base.Charsets;
/**
*
* @author Adrian Cole
*/
@Test
public class StringPayloadTest {
public void testLengthIsCorrectPerUTF8() {
Payload stringPayload = new StringPayload("unic₪de");
assertEquals(stringPayload.getContentMetadata().getContentLength(), new Long(
"unic₪de".getBytes(Charsets.UTF_8).length));
}
}