@@ -0,0 +1,2430 @@
+/*%0A * Licensed to Elasticsearch under one or more contributor%0A * license agreements. See the NOTICE file distributed with%0A * this work for additional information regarding copyright%0A * ownership. Elasticsearch licenses this file to you under%0A * the Apache License, Version 2.0 (the %22License%22); you may%0A * not use this file except in compliance with the License.%0A * You may obtain a copy of 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,%0A * software distributed under the License is distributed on an%0A * %22AS IS%22 BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY%0A * KIND, either express or implied.  See the License for the%0A * specific language governing permissions and limitations%0A * under the License.%0A */%0A%0Apackage org.elasticsearch.index.rankeval;%0A%0Aimport org.elasticsearch.common.ParseFieldMatcher;%0Aimport org.elasticsearch.common.xcontent.ToXContent;%0Aimport org.elasticsearch.common.xcontent.XContentBuilder;%0Aimport org.elasticsearch.common.xcontent.XContentFactory;%0Aimport org.elasticsearch.common.xcontent.XContentHelper;%0Aimport org.elasticsearch.common.xcontent.XContentParser;%0Aimport org.elasticsearch.common.xcontent.XContentType;%0Aimport org.elasticsearch.test.ESTestCase;%0A%0Aimport java.io.IOException;%0A%0Apublic class RatedDocumentTests extends ESTestCase %7B%0A%0A    public void testXContentParsing() throws IOException %7B%0A        String index = randomAsciiOfLength(10);%0A        String type = randomAsciiOfLength(10);%0A        String docId = randomAsciiOfLength(10);%0A        int rating = randomInt();%0A        RatedDocument testItem = new RatedDocument(index, type, docId, rating);%0A%0A        XContentBuilder builder = XContentFactory.contentBuilder(randomFrom(XContentType.values()));%0A        if (randomBoolean()) %7B%0A            builder.prettyPrint();%0A        %7D%0A        testItem.toXContent(builder, ToXContent.EMPTY_PARAMS);%0A        XContentBuilder shuffled = shuffleXContent(builder);%0A        XContentParser itemParser = XContentHelper.createParser(shuffled.bytes());%0A        itemParser.nextToken();%0A%0A        RankEvalContext context = new RankEvalContext(ParseFieldMatcher.STRICT, null, null, null);%0A        RatedDocument parsedItem = RatedDocument.fromXContent(itemParser, context);%0A        assertNotSame(testItem, parsedItem);%0A        assertEquals(testItem, parsedItem);%0A        assertEquals(testItem.hashCode(), parsedItem.hashCode());%0A%0A    %7D%0A%0A%7D%0A

Add missing file