use of com.adobe.granite.license.ProductInfo in project acs-aem-commons by Adobe-Consulting-Services.
the class DuckDuckGoDocsOperationImpl method activate.
@Activate
protected void activate(Map<String, String> config) {
ProductInfo productInfo = null;
for (ProductInfo i : productInfoService.getInfos()) {
String shortName = i.getShortName();
// currently, this is always 'CQ' but let's futureproof a bit
if (shortName.equalsIgnoreCase("cq") || shortName.equalsIgnoreCase("aem")) {
productInfo = i;
break;
}
}
if (productInfo != null) {
// there's a bug in 6.1 GA which causes productInfo.getShortVersion() to return 6.0,
// so let's use this longer form.
aemVersion = String.format("%s-%s", productInfo.getVersion().getMajor(), productInfo.getVersion().getMinor());
}
log.debug("AEM Version: {}", aemVersion);
log.debug("Product Name: {}", productName);
}
use of com.adobe.granite.license.ProductInfo in project acs-aem-commons by Adobe-Consulting-Services.
the class HealthCheckStatusEmailerTest method setUp.
@Before
public void setUp() throws Exception {
config = new HashMap<String, Object>();
config.put(HealthCheckStatusEmailer.PROP_RECIPIENTS_EMAIL_ADDRESSES, "test@example.com");
// Success
HealthCheckMetadata successMetadata = mock(HealthCheckMetadata.class);
Result successResult = mock(Result.class);
when(successMetadata.getTitle()).thenReturn("hc success");
when(successResult.isOk()).thenReturn(true);
when(successResult.getStatus()).thenReturn(Result.Status.OK);
when(successExecutionResult.getHealthCheckMetadata()).thenReturn(successMetadata);
when(successExecutionResult.getHealthCheckResult()).thenReturn(successResult);
// Failure
HealthCheckMetadata failureMetadata = mock(HealthCheckMetadata.class);
Result failureResult = mock(Result.class);
when(failureMetadata.getTitle()).thenReturn("hc failure");
when(failureResult.isOk()).thenReturn(false);
when(failureResult.getStatus()).thenReturn(Result.Status.CRITICAL);
when(failureExecutionResult.getHealthCheckMetadata()).thenReturn(failureMetadata);
when(failureExecutionResult.getHealthCheckResult()).thenReturn(failureResult);
results = new ArrayList<>();
when(healthCheckExecutor.execute(any(HealthCheckExecutionOptions.class), any(String[].class))).thenReturn(results);
when(productInfoService.getInfos()).thenReturn(new ProductInfo[] { mock(ProductInfo.class) });
Set<String> runModes = new HashSet<String>();
runModes.add("author");
when(slingSettingsService.getRunModes()).thenReturn(runModes);
}
Aggregations