import junit.framework.TestCase;
import org.infinispan.commons.hash.MurmurHash3;
import org.infinispan.util.TimSort;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
/*
* Copyright (C) 2012 eXo Platform SAS.
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This software 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this software; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
/**
* @author Nicolas Filotto
* @version $Id$
*
*/
public class TestSort extends TestCase
{
private static final Object[] sorted = {new MyClass("eba5a419c0a8010335b4955eb93af680"),
new MyClass("eba5a419c0a8010360a883f7e28db72a[http://www.jcp.org/jcr/1.0]primaryType:1PROPERTY"),
new MyClass("eba5a419c0a8010360a883f7e28db72a"), new MyClass("eba5a419c0a8010360a883f7e28db72a"),
new MyClass("eba5a419c0a8010335b4955eb93af680"), new MyClass("eba5a419c0a8010346b8b39050146684"),
new MyClass("eba5a419c0a8010360a883f7e28db72a"),
new MyClass("00exo0jcr0root0uuid0000000000000[]reindex_test:1NODE"),
new MyClass("eba5a419c0a80103093445685cb11408"),
new MyClass("eba5a419c0a8010335b4955eb93af680[http://www.jcp.org/jcr/1.0]primaryType:1PROPERTY"),
new MyClass("eba5a419c0a80103093445685cb11408"), new MyClass("00exo0jcr0root0uuid0000000000000"),
new MyClass("eba5a419c0a80103093445685cb11408[http://www.jcp.org/jcr/1.0]primaryType:1PROPERTY"),
new MyClass("eba5a416c0a801031df214fd06357c25"), new MyClass("eba5a419c0a8010360a883f7e28db72a"),
new MyClass("eba5a419c0a8010335b4955eb93af680[]sub1.1:1NODE"), new MyClass("eba5a419c0a80103093445685cb11408"),
new MyClass("eba5a419c0a8010335b4955eb93af680"), new MyClass("eba5a419c0a8010360a883f7e28db72a"),
new MyClass("eba5a419c0a8010362ba69dd7c08b9db"), new MyClass("eba5a419c0a8010335b4955eb93af680"),
new MyClass("eba5a416c0a801037fc94ebc3a5d4c9f"), new MyClass("eba5a419c0a8010360a883f7e28db72a[]sub1:1NODE"),
new MyClass("eba5a419c0a80103093445685cb11408"), new MyClass("eba5a416c0a801031df214fd06357c25"),
new MyClass("00exo0jcr0root0uuid0000000000000"), new MyClass("eba5a416c0a801031df214fd06357c25"),
new MyClass("eba5a416c0a801031df214fd06357c25"), new MyClass("eba5a419c0a80103093445685cb11408"),
new MyClass("eba5a419c0a8010360a883f7e28db72a"), new MyClass("eba5a416c0a801031df214fd06357c25"),
new MyClass("eba5a419c0a80103661be6cb1b767b0c")};
public void testSortWithSimpleComparator() throws Exception
{
Comparator