forked from apache/accumulo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactors MultipleStoresIT to function more similarly to how other fate tests are run (the two store types are tested in their own separate concrete classes). Created MultipleStoresTestRunner which is very similar to FateTestRunner. MultipleStoresIT is now an abstract class implemented by two new classes MetaMultipleStoresIT and UserMultipleStoresIT. closes apache#4903
- Loading branch information
1 parent
93e4862
commit 340604c
Showing
4 changed files
with
259 additions
and
135 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
test/src/main/java/org/apache/accumulo/test/fate/MultipleStoresTestRunner.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF 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 | ||
* | ||
* https://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.apache.accumulo.test.fate; | ||
|
||
import java.util.function.Predicate; | ||
|
||
import org.apache.accumulo.core.fate.FateStore; | ||
import org.apache.accumulo.core.fate.zookeeper.ZooUtil; | ||
import org.apache.zookeeper.KeeperException; | ||
|
||
public interface MultipleStoresTestRunner { | ||
|
||
void executeSleepingEnvTest( | ||
MultipleStoresTestExecutor<MultipleStoresIT.SleepingTestEnv> testMethod) throws Exception; | ||
|
||
void executeLatchEnvTest(MultipleStoresTestExecutor<MultipleStoresIT.LatchTestEnv> testMethod) | ||
throws Exception; | ||
|
||
interface TestStoreFactory<T extends MultipleStoresTestEnv> { | ||
FateStore<T> create(ZooUtil.LockID lockID, Predicate<ZooUtil.LockID> isLockHeld) | ||
throws InterruptedException, KeeperException; | ||
} | ||
|
||
@FunctionalInterface | ||
interface MultipleStoresTestExecutor<T extends MultipleStoresTestEnv> { | ||
void execute(TestStoreFactory<T> fateStoreFactory) throws Exception; | ||
} | ||
|
||
class MultipleStoresTestEnv {} | ||
} |
Oops, something went wrong.