/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 6334663
* @summary Test that TabularDataSupport preserves the order elements were added
* @author Eamonn McManus
*/
public class TabularDataOrderTest {
"unus", "duo", "tres", "quatuor", "quinque", "sex", "septem",
"octo", "novem", "decim",
};
static {
}
public static interface TestMXBean {
}
return stringToValue;
}
}
static {
try {
ct = new CompositeType(
"a.b.c", "name and int",
tt = new TabularType(
new String[] {"name"});
} catch (OpenDataException e) {
throw new AssertionError(e);
}
}
ct,
}
return td;
}
// Test that a default TabularData has the order keys were added in
int last = 0;
boolean ordered = true;
ordered = false;
}
if (!ordered)
fail("Order not preserved");
// Now test the undocumented property that causes HashMap to be used
// instead of LinkedHashMap, in case serializing to a 1.3 client.
// We serialize and deserialize in case the implementation handles
// this at serialization time. Then we look at object fields; that's
// not guaranteed to work but at worst it will fail spuriously and
// we'll have to update the test.
boolean found = false;
continue;
f.setAccessible(true);
found = true;
f.getName() + " = " + x);
break;
}
}
if (!found) {
fail("TabularDataSupport does not contain HashMap though " +
COMPAT_PROP_NAME + "=true");
}
else
}
}
}