1dce2b2fa9d6b26414a8d5a55918e4d7ca2ab1baaElliott Hughes/* 2dce2b2fa9d6b26414a8d5a55918e4d7ca2ab1baaElliott Hughes * Licensed to the Apache Software Foundation (ASF) under one or more 3dce2b2fa9d6b26414a8d5a55918e4d7ca2ab1baaElliott Hughes * contributor license agreements. See the NOTICE file distributed with 4dce2b2fa9d6b26414a8d5a55918e4d7ca2ab1baaElliott Hughes * this work for additional information regarding copyright ownership. 5dce2b2fa9d6b26414a8d5a55918e4d7ca2ab1baaElliott Hughes * The ASF licenses this file to You under the Apache License, Version 2.0 6dce2b2fa9d6b26414a8d5a55918e4d7ca2ab1baaElliott Hughes * (the "License"); you may not use this file except in compliance with 7dce2b2fa9d6b26414a8d5a55918e4d7ca2ab1baaElliott Hughes * the License. You may obtain a copy of the License at 8dce2b2fa9d6b26414a8d5a55918e4d7ca2ab1baaElliott Hughes * 9dce2b2fa9d6b26414a8d5a55918e4d7ca2ab1baaElliott Hughes * http://www.apache.org/licenses/LICENSE-2.0 10dce2b2fa9d6b26414a8d5a55918e4d7ca2ab1baaElliott Hughes * 11dce2b2fa9d6b26414a8d5a55918e4d7ca2ab1baaElliott Hughes * Unless required by applicable law or agreed to in writing, software 12dce2b2fa9d6b26414a8d5a55918e4d7ca2ab1baaElliott Hughes * distributed under the License is distributed on an "AS IS" BASIS, 13dce2b2fa9d6b26414a8d5a55918e4d7ca2ab1baaElliott Hughes * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14dce2b2fa9d6b26414a8d5a55918e4d7ca2ab1baaElliott Hughes * See the License for the specific language governing permissions and 15dce2b2fa9d6b26414a8d5a55918e4d7ca2ab1baaElliott Hughes * limitations under the License. 16dce2b2fa9d6b26414a8d5a55918e4d7ca2ab1baaElliott Hughes */ 17dce2b2fa9d6b26414a8d5a55918e4d7ca2ab1baaElliott Hughes 18e5fea3d504609d22337a5311d3ce0e72314bceeeNarayan Kamathpackage org.apache.harmony.tests.java.nio; 19dce2b2fa9d6b26414a8d5a55918e4d7ca2ab1baaElliott Hughes 20dce2b2fa9d6b26414a8d5a55918e4d7ca2ab1baaElliott Hughesimport java.nio.ByteOrder; 21dce2b2fa9d6b26414a8d5a55918e4d7ca2ab1baaElliott Hughes 22dce2b2fa9d6b26414a8d5a55918e4d7ca2ab1baaElliott Hughesimport junit.framework.TestCase; 23dce2b2fa9d6b26414a8d5a55918e4d7ca2ab1baaElliott Hughes 24dce2b2fa9d6b26414a8d5a55918e4d7ca2ab1baaElliott Hughes/** 25dce2b2fa9d6b26414a8d5a55918e4d7ca2ab1baaElliott Hughes * Test java.nio.ByteOrder 26dce2b2fa9d6b26414a8d5a55918e4d7ca2ab1baaElliott Hughes * 27dce2b2fa9d6b26414a8d5a55918e4d7ca2ab1baaElliott Hughes */ 28dce2b2fa9d6b26414a8d5a55918e4d7ca2ab1baaElliott Hughespublic class ByteOrderTest extends TestCase { 29dce2b2fa9d6b26414a8d5a55918e4d7ca2ab1baaElliott Hughes 30dce2b2fa9d6b26414a8d5a55918e4d7ca2ab1baaElliott Hughes public void testToString() { 31dce2b2fa9d6b26414a8d5a55918e4d7ca2ab1baaElliott Hughes assertEquals(ByteOrder.BIG_ENDIAN.toString(), "BIG_ENDIAN"); 32dce2b2fa9d6b26414a8d5a55918e4d7ca2ab1baaElliott Hughes assertEquals(ByteOrder.LITTLE_ENDIAN.toString(), "LITTLE_ENDIAN"); 33dce2b2fa9d6b26414a8d5a55918e4d7ca2ab1baaElliott Hughes } 34dce2b2fa9d6b26414a8d5a55918e4d7ca2ab1baaElliott Hughes 35dce2b2fa9d6b26414a8d5a55918e4d7ca2ab1baaElliott Hughes public void testNativeOrder() { 36dce2b2fa9d6b26414a8d5a55918e4d7ca2ab1baaElliott Hughes ByteOrder o = ByteOrder.nativeOrder(); 37dce2b2fa9d6b26414a8d5a55918e4d7ca2ab1baaElliott Hughes assertTrue(o == ByteOrder.BIG_ENDIAN || o == ByteOrder.LITTLE_ENDIAN); 38dce2b2fa9d6b26414a8d5a55918e4d7ca2ab1baaElliott Hughes } 39dce2b2fa9d6b26414a8d5a55918e4d7ca2ab1baaElliott Hughes 40dce2b2fa9d6b26414a8d5a55918e4d7ca2ab1baaElliott Hughes} 41