Skip to content

Commit

Permalink
[ALFREDOPS-860] code compiles + removed old integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pvriel committed Jan 6, 2025
1 parent c62414c commit a1749dc
Show file tree
Hide file tree
Showing 29 changed files with 23 additions and 182 deletions.
12 changes: 4 additions & 8 deletions alfred-telemetry-platform/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,13 @@ tasks.withType(JavaCompile) {
}

java {
sourceCompatibility = JavaVersion.VERSION_11
sourceCompatibility = JavaVersion.VERSION_17
withJavadocJar()
withSourcesJar()
}

ext {
// Compiling against AEE 6.1 because:
// * Some MeterBinder implementations monitor Enterprise only components (e.g. Hazelcast caches)
// * Alfresco's Micrometer integration, (MetricsController, MetricsReporter) classes only available as of 6.1.
// Compatibility with 5.x should be covered with integration tests
alfrescoVersion = '6.1.1.11'
alfrescoVersion = '23.1.0'
}

dependencies {
Expand All @@ -39,7 +35,7 @@ dependencies {
alfrescoProvided("io.github.mweirauch:micrometer-jvm-extras:${jvmExtrasVersion}") {
exclude group: "org.slf4j", module: "*"
}
alfrescoProvided 'javax.servlet:javax.servlet-api'
alfrescoProvided 'jakarta.servlet:jakarta.servlet-api'
compileOnly 'org.apache.tomcat:tomcat-catalina:7.0.92'
alfrescoProvided "io.micrometer:micrometer-registry-graphite:${micrometerVersion}"
alfrescoProvided "io.micrometer:micrometer-registry-jmx:${micrometerVersion}"
Expand Down Expand Up @@ -91,4 +87,4 @@ publishing {
}
}

targetCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_17
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

import io.micrometer.core.instrument.MeterRegistry;
import io.micrometer.core.instrument.binder.tomcat.TomcatMetrics;
import jakarta.servlet.ServletContext;
import org.alfresco.error.AlfrescoRuntimeException;
import org.apache.catalina.Manager;
import org.apache.catalina.core.ApplicationContext;
import org.apache.catalina.core.StandardContext;
import org.springframework.web.context.ServletContextAware;

import javax.annotation.Nonnull;
import javax.servlet.ServletContext;
import java.lang.reflect.Field;
import java.util.ArrayList;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package eu.xenit.alfred.telemetry.binder.cache;

import com.hazelcast.core.IMap;
import com.hazelcast.map.IMap;
import eu.xenit.alfred.telemetry.binder.EventTriggeredMeterBinder;
import eu.xenit.alfred.telemetry.binder.NamedMeterBinder;
import eu.xenit.alfred.telemetry.util.ReflectionUtil;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package eu.xenit.alfred.telemetry.alfrescointegration;

import org.apache.camel.spring.GenericBeansException;
import org.apache.camel.NoSuchBeanException;
import org.junit.jupiter.api.Test;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanDefinition;
Expand Down Expand Up @@ -131,7 +131,7 @@ private void setupAlfresco7Beans() {
private void setupNullBeans() {
beanDefinitionRegistry_null = new SimpleBeanDefinitionRegistry();
context_null = mock(ApplicationContext.class);
when(context_null.getBean(DATASOURCE_BEAN_ID)).thenThrow(new GenericBeansException(DATASOURCE_BEAN_ID));
when(context_null.getBean(DATASOURCE_BEAN_ID)).thenThrow(new NoSuchBeanException(DATASOURCE_BEAN_ID));
}

private DataSourceBeanPostProcessor createProcessor(ApplicationContext applicationContext) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
import static org.junit.Assert.assertFalse;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package eu.xenit.alfred.telemetry.binder.cache;

import com.hazelcast.core.IMap;
import com.hazelcast.map.IMap;
import eu.xenit.alfred.telemetry.util.ReflectionUtil;
import io.micrometer.core.instrument.MeterRegistry;
import io.micrometer.core.instrument.Tags;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ void setup() {
@Test
void refresh() {
Floc floc = new Floc();
HashMap<Floc, HashMap<Shard, HashSet<ShardState>>> flocs = new HashMap<>();
Map<Floc, Map<Shard, Set<ShardState>>> flocs = new HashMap<>();
flocs.put(floc, new HashMap<>());
when(shardRegistry.getFlocs()).thenReturn(flocs);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ void testUpdateMetrics() {
shardState.setShardInstance(shardInstance);
HashSet<ShardState> shardStates = new HashSet<>();
shardStates.add(shardState);
HashMap<Shard, HashSet<ShardState>> shardHashSetHashMap = new HashMap<>();
Map<Shard, Set<ShardState>> shardHashSetHashMap = new HashMap<>();
shardHashSetHashMap.put(shard, shardStates);
HashMap<Floc, HashMap<Shard, HashSet<ShardState>>> metricsInformation = new HashMap<>();
Map<Floc, Map<Shard, Set<ShardState>>> metricsInformation = new HashMap<>();
metricsInformation.put(floc, shardHashSetHashMap);

ShardRegistry shardRegistry = Mockito.mock(ShardRegistry.class);
Expand Down Expand Up @@ -70,9 +70,9 @@ void testShardingStateNull() {
shardInstance.setHostName("myInstanceHost");
HashSet<ShardState> shardStates = new HashSet<>();
shardStates.add(null);
HashMap<Shard, HashSet<ShardState>> shardHashSetHashMap = new HashMap<>();
Map<Shard, Set<ShardState>> shardHashSetHashMap = new HashMap<>();
shardHashSetHashMap.put(shard, shardStates);
HashMap<Floc, HashMap<Shard, HashSet<ShardState>>> metricsInformation = new HashMap<>();
Map<Floc, Map<Shard, Set<ShardState>>> metricsInformation = new HashMap<>();
metricsInformation.put(floc, shardHashSetHashMap);
ShardRegistry shardRegistry = Mockito.mock(ShardRegistry.class);
MeterRegistry meterRegistry = new SimpleMeterRegistry();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.CoreMatchers.not;
import static org.hamcrest.CoreMatchers.notNullValue;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.hasEntry;
import static org.hamcrest.Matchers.hasKey;
import static org.hamcrest.Matchers.isEmptyString;
import static org.junit.Assert.assertThat;

import eu.xenit.alfred.telemetry.webscripts.console.AdminConsoleWebscriptResponseModel.TelemetryRegistryModel;
import io.micrometer.core.instrument.simple.SimpleMeterRegistry;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import static eu.xenit.alfred.telemetry.webscripts.stubs.ServerModelStub.enterprise_52;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
import static org.springframework.extensions.webscripts.DeclarativeRegistry.WEBSCRIPT_DESC_XML;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ plugins {
description = "Alfred Telemetry Common module which enables exposure of Metrics using Micrometer"

java {
sourceCompatibility = JavaVersion.VERSION_11
sourceCompatibility = JavaVersion.VERSION_17
withJavadocJar()
withSourcesJar()
}
Expand Down
2 changes: 1 addition & 1 deletion alfred-telemetry-solr/alfred-telemetry-solr4/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ plugins {
description = "Alfred Telemetry Solr4 module which enables exposure of Metrics using Micrometer"

java {
sourceCompatibility = JavaVersion.VERSION_11
sourceCompatibility = JavaVersion.VERSION_17
}


Expand Down
2 changes: 1 addition & 1 deletion alfred-telemetry-solr/alfred-telemetry-solr6/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ plugins {
description = "Alfred Telemetry Solr6 module which enables exposure of Metrics using Micrometer"

java {
sourceCompatibility = JavaVersion.VERSION_11
sourceCompatibility = JavaVersion.VERSION_17
}

apply from: './overload.gradle'
Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ allprojects {
apply plugin: 'jacoco'

compileJava {
options.release = 11
options.release = 17
}
compileTestJava {
options.release = 11
options.release = 17
}

jacocoTestReport {
Expand Down
14 changes: 0 additions & 14 deletions integration-tests/alfresco-community-61/overload.gradle

This file was deleted.

15 changes: 0 additions & 15 deletions integration-tests/alfresco-community-62/overload.gradle

This file was deleted.

15 changes: 0 additions & 15 deletions integration-tests/alfresco-community-70/overload.gradle

This file was deleted.

15 changes: 0 additions & 15 deletions integration-tests/alfresco-community-71/overload.gradle

This file was deleted.

15 changes: 0 additions & 15 deletions integration-tests/alfresco-community-72/overload.gradle

This file was deleted.

17 changes: 0 additions & 17 deletions integration-tests/alfresco-community-73/overload.gradle

This file was deleted.

17 changes: 0 additions & 17 deletions integration-tests/alfresco-community-74/overload.gradle

This file was deleted.

6 changes: 0 additions & 6 deletions integration-tests/alfresco-enterprise-61/overload.gradle

This file was deleted.

6 changes: 0 additions & 6 deletions integration-tests/alfresco-enterprise-62/overload.gradle

This file was deleted.

7 changes: 0 additions & 7 deletions integration-tests/alfresco-enterprise-70/overload.gradle

This file was deleted.

7 changes: 0 additions & 7 deletions integration-tests/alfresco-enterprise-71/overload.gradle

This file was deleted.

7 changes: 0 additions & 7 deletions integration-tests/alfresco-enterprise-72/overload.gradle

This file was deleted.

7 changes: 0 additions & 7 deletions integration-tests/alfresco-enterprise-73/overload.gradle

This file was deleted.

7 changes: 0 additions & 7 deletions integration-tests/alfresco-enterprise-74/overload.gradle

This file was deleted.

2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ include ':alfred-telemetry-solr'

include ':integration-tests'

def integrationTestVersions = ["61", "62", "70","71","72","73","74"];
def integrationTestVersions = [];

if (!hasProperty("community")) {
integrationTestVersions.each { version ->
Expand Down

0 comments on commit a1749dc

Please sign in to comment.