Skip to content

Commit

Permalink
integ AbstractTestInfrastructure change from 14.1.1.0 cl 108930 --> c…
Browse files Browse the repository at this point in the history
…e/14.1.1.0

RQ: job.9.20240510163653.8471

[git-p4: depot-paths = "//dev/coherence-ce/release/coherence-ce-v14.1.1.0/": change = 108945]
  • Loading branch information
fryp committed May 10, 2024
1 parent 81a7916 commit 520dd16
Showing 1 changed file with 30 additions and 4 deletions.
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2023, Oracle and/or its affiliates.
* Copyright (c) 2000, 2024, Oracle and/or its affiliates.
*
* Licensed under the Universal Permissive License v 1.0 as shown at
* https://oss.oracle.com/licenses/upl.
Expand All @@ -9,6 +9,9 @@


import com.oracle.bedrock.OptionsByType;
import com.oracle.bedrock.deferred.Deferred;
import com.oracle.bedrock.deferred.PermanentlyUnavailableException;
import com.oracle.bedrock.deferred.TemporarilyUnavailableException;
import com.oracle.bedrock.jacoco.Dump;
import com.oracle.bedrock.runtime.concurrent.RemoteCallable;
import com.oracle.bedrock.runtime.java.options.JavaHome;
Expand Down Expand Up @@ -1048,10 +1051,8 @@ protected static void stopCacheServer(String sServer, boolean fGraceful)
*/
public static void waitForBalanced(CacheService service)
{
SafeService serviceSafe = (SafeService) service;
PartitionedCache serviceReal = (PartitionedCache) serviceSafe.getService();

Eventually.assertThat(invoking(serviceReal).calculateUnbalanced(), is(0));
Eventually.assertDeferred("waitForBalanced for service " + service.getInfo().getServiceName(), new WaitForBalanced(service), is(0));
}

/**
Expand Down Expand Up @@ -1677,6 +1678,31 @@ public String call() throws Exception
}
}

// ----- inner class: WaitForBalanced -----------------------------------

/**
* A Deferred that returns the unbalanced count for a
* partitioned cache service.
*/
public static class WaitForBalanced
implements Deferred<Integer>
{
public WaitForBalanced(CacheService service)
{
f_service = service;
}

@Override
public Integer get() throws TemporarilyUnavailableException, PermanentlyUnavailableException
{
SafeService serviceSafe = (SafeService) f_service;
PartitionedCache serviceReal = (PartitionedCache) serviceSafe.getService();
return serviceReal.calculateUnbalanced();
}

private final CacheService f_service;
}

// ----- data members ---------------------------------------------------

/**
Expand Down

0 comments on commit 520dd16

Please sign in to comment.