Ks 20240904 intermittents (#6264)
This commit is contained in:
parent
070f24ad01
commit
b4607c3628
|
@ -34,6 +34,7 @@ public class PartitionSettings {
|
||||||
private boolean myAlwaysOpenNewTransactionForDifferentPartition;
|
private boolean myAlwaysOpenNewTransactionForDifferentPartition;
|
||||||
private boolean myConditionalCreateDuplicateIdentifiersEnabled = false;
|
private boolean myConditionalCreateDuplicateIdentifiersEnabled = false;
|
||||||
|
|
||||||
|
public PartitionSettings() {}
|
||||||
/**
|
/**
|
||||||
* Should we always open a new database transaction if the partition context changes
|
* Should we always open a new database transaction if the partition context changes
|
||||||
*
|
*
|
||||||
|
|
|
@ -40,6 +40,7 @@ public class HashMapResourceProviderExtension<T extends IBaseResource> extends H
|
||||||
|
|
||||||
private final RestfulServerExtension myRestfulServerExtension;
|
private final RestfulServerExtension myRestfulServerExtension;
|
||||||
private boolean myClearBetweenTests = true;
|
private boolean myClearBetweenTests = true;
|
||||||
|
private boolean myInitialized = false;
|
||||||
private final List<T> myUpdates = new ArrayList<>();
|
private final List<T> myUpdates = new ArrayList<>();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -55,7 +56,9 @@ public class HashMapResourceProviderExtension<T extends IBaseResource> extends H
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void afterEach(ExtensionContext context) throws Exception {
|
public void afterEach(ExtensionContext context) throws Exception {
|
||||||
myRestfulServerExtension.getRestfulServer().unregisterProvider(HashMapResourceProviderExtension.this);
|
if (myClearBetweenTests) {
|
||||||
|
myRestfulServerExtension.getRestfulServer().unregisterProvider(HashMapResourceProviderExtension.this);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -77,8 +80,11 @@ public class HashMapResourceProviderExtension<T extends IBaseResource> extends H
|
||||||
if (myClearBetweenTests) {
|
if (myClearBetweenTests) {
|
||||||
clear();
|
clear();
|
||||||
clearCounts();
|
clearCounts();
|
||||||
|
myRestfulServerExtension.getRestfulServer().registerProvider(HashMapResourceProviderExtension.this);
|
||||||
|
} else if (!myInitialized) {
|
||||||
|
myInitialized = true;
|
||||||
|
myRestfulServerExtension.getRestfulServer().registerProvider(HashMapResourceProviderExtension.this);
|
||||||
}
|
}
|
||||||
myRestfulServerExtension.getRestfulServer().registerProvider(HashMapResourceProviderExtension.this);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in New Issue