[TEST] remove GlobalScopeClusterTests

We removed the global ClusterScope a while ago, its related test can be removed too.
This commit is contained in:
javanna 2015-03-27 15:02:55 +01:00 committed by Luca Cavanna
parent c19b7a2f61
commit 71bd40517d
1 changed files with 0 additions and 64 deletions

View File

@ -1,64 +0,0 @@
/*
* Licensed to Elasticsearch under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch licenses this file to you 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.elasticsearch.test.test;
import com.carrotsearch.randomizedtesting.annotations.Repeat;
import org.elasticsearch.test.ElasticsearchIntegrationTest;
import org.elasticsearch.test.TestCluster;
import org.junit.Test;
import java.io.IOException;
import static org.hamcrest.Matchers.equalTo;
/**
* This test ensures that the cluster initializion for GLOBAL scope is not influencing
* the tests random sequence due to initializtion using the same random instance.
*/
public class GlobalScopeClusterTests extends ElasticsearchIntegrationTest {
private static int ITER = 0;
private static long[] SEQUENCE = new long[100];
private static Long CLUSTER_SEED = null;
@Test
@Repeat(iterations = 10, useConstantSeed = true)
public void testReproducible() throws IOException {
if (ITER++ == 0) {
CLUSTER_SEED = cluster().seed();
for (int i = 0; i < SEQUENCE.length; i++) {
SEQUENCE[i] = randomLong();
}
} else {
assertEquals(CLUSTER_SEED, new Long(cluster().seed()));
for (int i = 0; i < SEQUENCE.length; i++) {
assertThat(SEQUENCE[i], equalTo(randomLong()));
}
}
}
@Override
protected TestCluster buildTestCluster(Scope scope, long seed) throws IOException {
// produce some randomness
int iters = between(1, 100);
for (int i = 0; i < iters; i++) {
randomLong();
}
return super.buildTestCluster(scope, seed);
}
}