use of com.hazelcast.instance.BuildInfo in project hazelcast by hazelcast.
the class BuildInfoPluginTest method test.
@Test
public void test() throws IOException {
plugin.run(logWriter);
BuildInfo buildInfo = BuildInfoProvider.getBuildInfo();
assertContains("BuildNumber=" + buildInfo.getBuildNumber());
assertContains("Build=" + buildInfo.getBuild());
assertContains("Revision=" + buildInfo.getRevision());
assertContains("Version=" + buildInfo.getVersion());
assertContains("SerialVersion=" + buildInfo.getSerializationVersion());
assertContains("Enterprise=" + buildInfo.isEnterprise());
}
use of com.hazelcast.instance.BuildInfo in project hazelcast-simulator by hazelcast.
the class HazelcastTestUtils method failOnVersionMismatch.
public static void failOnVersionMismatch(String minVersion, String message) {
BuildInfo buildInfo = BuildInfoProvider.getBuildInfo();
String actualVersion = buildInfo.getVersion();
LOGGER.info("Compare version " + actualVersion + " with minimum version " + minVersion + ": " + isMinVersion(minVersion, actualVersion));
if (!isMinVersion(minVersion, actualVersion)) {
fail(format(message, minVersion));
}
}
use of com.hazelcast.instance.BuildInfo in project hazelcast by hazelcast.
the class ClusterJoinManager method sendMasterQuestion.
/**
* Send a {@link WhoisMasterOp} to designated address.
*
* @param toAddress the address to which the operation will be sent.
* @return {@code true} if the operation was sent, otherwise {@code false}.
*/
public boolean sendMasterQuestion(Address toAddress) {
checkNotNull(toAddress, "No endpoint is specified!");
BuildInfo buildInfo = node.getBuildInfo();
Address thisAddress = node.getThisAddress();
JoinMessage joinMessage = new JoinMessage(Packet.VERSION, buildInfo.getBuildNumber(), node.getVersion(), thisAddress, clusterService.getThisUuid(), node.isLiteMember(), node.createConfigCheck());
return nodeEngine.getOperationService().send(new WhoisMasterOp(joinMessage), toAddress);
}
use of com.hazelcast.instance.BuildInfo in project hazelcast by hazelcast.
the class OperationExecutorImpl_AbstractTest method setup.
@Before
public void setup() throws Exception {
loggingService = new LoggingServiceImpl("foo", "jdk", new BuildInfo("1", "1", "1", 1, false, (byte) 1, "1"), true, null);
serializationService = new DefaultSerializationServiceBuilder().build();
config = smallInstanceConfig();
thisAddress = new Address("localhost", 5701);
Node node = Mockito.mock(Node.class);
when(node.getConfig()).thenReturn(config);
when(node.getProperties()).thenReturn(new HazelcastProperties(config));
when(node.getVersion()).thenReturn(new MemberVersion(0, 0, 0));
nodeExtension = new DefaultNodeExtension(node);
handlerFactory = new DummyOperationRunnerFactory();
responsePacketConsumer = new DummyResponsePacketConsumer();
}
use of com.hazelcast.instance.BuildInfo in project hazelcast by hazelcast.
the class LifecycleServiceImpl method fireLifecycleEvent.
public void fireLifecycleEvent(LifecycleEvent.LifecycleState lifecycleState) {
final LifecycleEvent lifecycleEvent = new LifecycleEvent(lifecycleState);
String revision = buildInfo.getRevision();
if (isNullOrEmpty(revision)) {
revision = "";
} else {
revision = " - " + revision;
BuildInfo upstreamInfo = buildInfo.getUpstreamBuildInfo();
if (upstreamInfo != null) {
String upstreamRevision = upstreamInfo.getRevision();
if (!isNullOrEmpty(upstreamRevision)) {
revision += ", " + upstreamRevision;
}
}
}
getLogger().info("HazelcastClient " + buildInfo.getVersion() + " (" + buildInfo.getBuild() + revision + ") is " + lifecycleEvent.getState());
executor.execute(new Runnable() {
@Override
public void run() {
for (LifecycleListener lifecycleListener : lifecycleListeners.values()) {
lifecycleListener.stateChanged(lifecycleEvent);
}
}
});
}
Aggregations