use of com.emc.storageos.systemservices.impl.licensing.LicenseInfoExt in project coprhd-controller by CoprHD.
the class CallHomeEventManagerTest method testLicenExpirationEventFalse.
/**
* Test case which recognizes that a license expiration event should not be sent.
*/
@Test
public void testLicenExpirationEventFalse() throws Exception {
MockCallHomeEventManager manager = new MockCallHomeEventManager();
LicenseInfoExt licenseInfo = new LicenseInfoExt();
Calendar cal = Calendar.getInstance();
cal.add(Calendar.DAY_OF_MONTH, (CallHomeConstants.LICENSE_EXPIRATION_EVENT_THRESHOLD * -1) + 1);
SimpleDateFormat sdf = new SimpleDateFormat("MM/dd/yyyy");
String stringDate = sdf.format(cal.getTime());
licenseInfo.setLastLicenseExpirationDateEventDate(stringDate);
manager.setLicenseInfo(licenseInfo);
Assert.assertFalse(manager.doSendLicenseExpiration(licenseInfo));
}
use of com.emc.storageos.systemservices.impl.licensing.LicenseInfoExt in project coprhd-controller by CoprHD.
the class CallHomeEventManagerTest method testRegistrationEventTrue.
/**
* Test case which recognizes that a registration event should be sent.
*/
@Test
public void testRegistrationEventTrue() throws Exception {
MockCallHomeEventManager manager = new MockCallHomeEventManager();
LicenseInfoExt licenseInfo = new LicenseInfoExt();
manager.setLicenseInfo(licenseInfo);
Assert.assertTrue(manager.doSendRegistration(licenseInfo));
}
use of com.emc.storageos.systemservices.impl.licensing.LicenseInfoExt in project coprhd-controller by CoprHD.
the class CallHomeEventManagerTest method testRegistrationEventNoCallInfoObject.
/**
* test that a registration event is sent if no CallInfo object returned from zookeeper.
*/
@Test
public void testRegistrationEventNoCallInfoObject() throws Exception {
MockCallHomeEventManager manager = new MockCallHomeEventManager();
LicenseInfoExt licenseInfo = null;
Assert.assertTrue(manager.doSendLicenseExpiration(licenseInfo));
}
use of com.emc.storageos.systemservices.impl.licensing.LicenseInfoExt in project coprhd-controller by CoprHD.
the class CallHomeEventManagerTest method testHeartbeatEventTrue.
/**
* Test case which recognizes that a heartbeat event should be sent.
*/
@Test
public void testHeartbeatEventTrue() throws Exception {
MockCallHomeEventManager manager = new MockCallHomeEventManager();
LicenseInfoExt licenseInfo = new LicenseInfoExt();
Calendar cal = Calendar.getInstance();
cal.add(Calendar.DAY_OF_MONTH, CallHomeConstants.HEARTBEART_EVENT_THRESHOLD * -1);
SimpleDateFormat sdf = new SimpleDateFormat("MM/dd/yyyy");
String stringDate = sdf.format(cal.getTime());
licenseInfo.setLastHeartbeatEventDate(stringDate);
manager.setLicenseInfo(licenseInfo);
Assert.assertTrue(manager.doSendHeartBeat(licenseInfo));
}
use of com.emc.storageos.systemservices.impl.licensing.LicenseInfoExt in project coprhd-controller by CoprHD.
the class CallHomeEventManagerTest method testLicenseExpirationEventNoExpirationDate.
/**
* test that a license expiration event is sent if no heartbeat date exists in zookeeper.
*/
@Test
public void testLicenseExpirationEventNoExpirationDate() throws Exception {
MockCallHomeEventManager manager = new MockCallHomeEventManager();
LicenseInfoExt licenseInfo = new LicenseInfoExt();
manager.setLicenseInfo(licenseInfo);
Assert.assertTrue(manager.doSendLicenseExpiration(licenseInfo));
}
Aggregations