From c6fe25d64d081e9c98a2e92b996731d49f39ddff Mon Sep 17 00:00:00 2001 From: Mathieu Carbou Date: Tue, 22 Nov 2016 17:11:22 -0500 Subject: [PATCH] :construction: #191, #192: Preparing management project for these 2 issues - removed monitoring-service-entity: can be replaced by tms entity for testing - created a testing folder containing the sample entity (that will be augmented for #191 and #192), an entity-tests folder to test entities with passthrough, and ab integration-tests folder to test entities with galvan - removed test folder inside each entities because we cannot test each entity individually: they require to work with the monitoring service and a consumer entity (tms) - testing folder and test entities depends on the distribution packages, like in real life --- .../distribution/management-client/pom.xml | 1 + .../distribution/management-common/pom.xml | 6 + .../distribution/management-server/pom.xml | 2 +- management/management-entity/pom.xml | 1 - .../monitoring-service-entity/README.adoc | 1 - management/monitoring-service-entity/pom.xml | 149 ------------------ .../monitoring/MonitoringServiceProxy.java | 38 ----- .../MonitoringServiceEntityClientService.java | 28 ---- .../MonitoringServiceEntityFactory.java | 74 --------- .../client/MonitoringServiceProxyEntity.java | 26 --- .../server/MonitoringServiceEntity.java | 34 ---- .../MonitoringServiceEntityServerService.java | 49 ------ .../server/MonitoringServiceProxyImpl.java | 66 -------- .../org.terracotta.entity.EntityClientService | 17 -- .../org.terracotta.entity.EntityServerService | 17 -- .../MonitoringServiceProxyTest.java | 82 ---------- ...rg.terracotta.connection.ConnectionService | 1 - management/pom.xml | 3 +- .../org.terracotta.entity.EntityClientService | 1 - .../org.terracotta.entity.EntityServerService | 1 - ...rg.terracotta.connection.ConnectionService | 1 - .../entity-tests}/pom.xml | 49 +++--- .../ManagementAgentServiceTest.java | 37 +++-- .../management/MyManagementProvider.java | 0 .../entity/management/MyObject.java | 0 .../entity/sample}/HelloWorldTest.java | 31 ++-- .../entity/tms/MyManagementProvider.java | 0 .../management/entity/tms/MyObject.java | 0 .../management/entity/tms/TmsAgentTest.java | 0 ...rg.terracotta.connection.ConnectionService | 0 management/testing/integration-tests/pom.xml | 45 ++++++ management/{samples => testing}/pom.xml | 10 +- .../sample-entity}/.gitignore | 0 .../sample-entity}/pom.xml | 64 +++----- .../management/entity/sample}/HelloWorld.java | 2 +- .../sample}/client/HelloWorldEntity.java | 4 +- .../client/HelloWorldEntityClientService.java | 4 +- .../client/HelloWorldEntityFactory.java | 2 +- .../management/ExposedHelloWorldEntity.java | 4 +- .../HelloWorldManagementProvider.java | 4 +- .../HelloWorldManagementRegistry.java | 2 +- .../sample}/server/HelloWorldEntity.java | 4 +- .../server/HelloWorldEntityServerService.java | 6 +- .../entity/sample}/server/HelloWorldImpl.java | 4 +- .../org.terracotta.entity.EntityClientService | 1 + .../org.terracotta.entity.EntityServerService | 1 + management/tms-entity/pom.xml | 1 - .../tms-entity/tms-entity-tests/pom.xml | 107 ------------- ...rg.terracotta.connection.ConnectionService | 1 - pom.xml | 1 + 50 files changed, 160 insertions(+), 822 deletions(-) delete mode 100644 management/monitoring-service-entity/README.adoc delete mode 100644 management/monitoring-service-entity/pom.xml delete mode 100644 management/monitoring-service-entity/src/main/java/org/terracotta/management/entity/monitoring/MonitoringServiceProxy.java delete mode 100644 management/monitoring-service-entity/src/main/java/org/terracotta/management/entity/monitoring/client/MonitoringServiceEntityClientService.java delete mode 100644 management/monitoring-service-entity/src/main/java/org/terracotta/management/entity/monitoring/client/MonitoringServiceEntityFactory.java delete mode 100644 management/monitoring-service-entity/src/main/java/org/terracotta/management/entity/monitoring/client/MonitoringServiceProxyEntity.java delete mode 100644 management/monitoring-service-entity/src/main/java/org/terracotta/management/entity/monitoring/server/MonitoringServiceEntity.java delete mode 100644 management/monitoring-service-entity/src/main/java/org/terracotta/management/entity/monitoring/server/MonitoringServiceEntityServerService.java delete mode 100644 management/monitoring-service-entity/src/main/java/org/terracotta/management/entity/monitoring/server/MonitoringServiceProxyImpl.java delete mode 100644 management/monitoring-service-entity/src/main/resources/META-INF/services/org.terracotta.entity.EntityClientService delete mode 100644 management/monitoring-service-entity/src/main/resources/META-INF/services/org.terracotta.entity.EntityServerService delete mode 100644 management/monitoring-service-entity/src/test/java/org/terracotta/management/entity/monitoring/MonitoringServiceProxyTest.java delete mode 100644 management/monitoring-service-entity/src/test/resources/META-INF/services/org.terracotta.connection.ConnectionService delete mode 100644 management/samples/hello-world-entity/src/main/resources/META-INF/services/org.terracotta.entity.EntityClientService delete mode 100644 management/samples/hello-world-entity/src/main/resources/META-INF/services/org.terracotta.entity.EntityServerService delete mode 100644 management/samples/hello-world-entity/src/test/resources/META-INF/services/org.terracotta.connection.ConnectionService rename management/{management-entity/management-entity-tests => testing/entity-tests}/pom.xml (72%) rename management/{management-entity/management-entity-tests => testing/entity-tests}/src/test/java/org/terracotta/management/entity/management/ManagementAgentServiceTest.java (86%) rename management/{management-entity/management-entity-tests => testing/entity-tests}/src/test/java/org/terracotta/management/entity/management/MyManagementProvider.java (100%) rename management/{management-entity/management-entity-tests => testing/entity-tests}/src/test/java/org/terracotta/management/entity/management/MyObject.java (100%) rename management/{samples/hello-world-entity/src/test/java/org/terracotta/management/entity/helloworld => testing/entity-tests/src/test/java/org/terracotta/management/entity/sample}/HelloWorldTest.java (78%) rename management/{tms-entity/tms-entity-tests => testing/entity-tests}/src/test/java/org/terracotta/management/entity/tms/MyManagementProvider.java (100%) rename management/{tms-entity/tms-entity-tests => testing/entity-tests}/src/test/java/org/terracotta/management/entity/tms/MyObject.java (100%) rename management/{tms-entity/tms-entity-tests => testing/entity-tests}/src/test/java/org/terracotta/management/entity/tms/TmsAgentTest.java (100%) rename management/{management-entity/management-entity-tests => testing/entity-tests}/src/test/resources/META-INF/services/org.terracotta.connection.ConnectionService (100%) create mode 100644 management/testing/integration-tests/pom.xml rename management/{samples => testing}/pom.xml (82%) rename management/{samples/hello-world-entity => testing/sample-entity}/.gitignore (100%) rename management/{samples/hello-world-entity => testing/sample-entity}/pom.xml (68%) rename management/{samples/hello-world-entity/src/main/java/org/terracotta/management/entity/helloworld => testing/sample-entity/src/main/java/org/terracotta/management/entity/sample}/HelloWorld.java (92%) rename management/{samples/hello-world-entity/src/main/java/org/terracotta/management/entity/helloworld => testing/sample-entity/src/main/java/org/terracotta/management/entity/sample}/client/HelloWorldEntity.java (85%) rename management/{samples/hello-world-entity/src/main/java/org/terracotta/management/entity/helloworld => testing/sample-entity/src/main/java/org/terracotta/management/entity/sample}/client/HelloWorldEntityClientService.java (88%) rename management/{samples/hello-world-entity/src/main/java/org/terracotta/management/entity/helloworld => testing/sample-entity/src/main/java/org/terracotta/management/entity/sample}/client/HelloWorldEntityFactory.java (97%) rename management/{samples/hello-world-entity/src/main/java/org/terracotta/management/entity/helloworld => testing/sample-entity/src/main/java/org/terracotta/management/entity/sample}/client/management/ExposedHelloWorldEntity.java (92%) rename management/{samples/hello-world-entity/src/main/java/org/terracotta/management/entity/helloworld => testing/sample-entity/src/main/java/org/terracotta/management/entity/sample}/client/management/HelloWorldManagementProvider.java (90%) rename management/{samples/hello-world-entity/src/main/java/org/terracotta/management/entity/helloworld => testing/sample-entity/src/main/java/org/terracotta/management/entity/sample}/client/management/HelloWorldManagementRegistry.java (94%) rename management/{samples/hello-world-entity/src/main/java/org/terracotta/management/entity/helloworld => testing/sample-entity/src/main/java/org/terracotta/management/entity/sample}/server/HelloWorldEntity.java (86%) rename management/{samples/hello-world-entity/src/main/java/org/terracotta/management/entity/helloworld => testing/sample-entity/src/main/java/org/terracotta/management/entity/sample}/server/HelloWorldEntityServerService.java (85%) rename management/{samples/hello-world-entity/src/main/java/org/terracotta/management/entity/helloworld => testing/sample-entity/src/main/java/org/terracotta/management/entity/sample}/server/HelloWorldImpl.java (86%) create mode 100644 management/testing/sample-entity/src/main/resources/META-INF/services/org.terracotta.entity.EntityClientService create mode 100644 management/testing/sample-entity/src/main/resources/META-INF/services/org.terracotta.entity.EntityServerService delete mode 100644 management/tms-entity/tms-entity-tests/pom.xml delete mode 100644 management/tms-entity/tms-entity-tests/src/test/resources/META-INF/services/org.terracotta.connection.ConnectionService diff --git a/management/distribution/management-client/pom.xml b/management/distribution/management-client/pom.xml index b3a4deae30..222eadb052 100644 --- a/management/distribution/management-client/pom.xml +++ b/management/distribution/management-client/pom.xml @@ -78,6 +78,7 @@ org.terracotta.management:sequence-generator org.terracotta.management:cluster-topology org.terracotta.management:management-registry + org.terracotta:statistics org.terracotta.management.dist:management-common diff --git a/management/distribution/management-common/pom.xml b/management/distribution/management-common/pom.xml index 38304da50b..10010b4534 100644 --- a/management/distribution/management-common/pom.xml +++ b/management/distribution/management-common/pom.xml @@ -62,6 +62,12 @@ statistics ${statistics.version} + + + org.slf4j + slf4j-api + ${slf4j.version} + diff --git a/management/distribution/management-server/pom.xml b/management/distribution/management-server/pom.xml index 49df8d0258..30443d991d 100644 --- a/management/distribution/management-server/pom.xml +++ b/management/distribution/management-server/pom.xml @@ -89,8 +89,8 @@ org.terracotta.management:sequence-generator org.terracotta.management:cluster-topology org.terracotta.management:management-registry - org.terracotta.management.dist:management-common org.terracotta:statistics + org.terracotta.management.dist:management-common org.terracotta:offheap-resource diff --git a/management/management-entity/pom.xml b/management/management-entity/pom.xml index 71ae4ac1e8..fc5f5497b8 100644 --- a/management/management-entity/pom.xml +++ b/management/management-entity/pom.xml @@ -26,7 +26,6 @@ management-entity-common management-entity-client management-entity-server - management-entity-tests diff --git a/management/monitoring-service-entity/README.adoc b/management/monitoring-service-entity/README.adoc deleted file mode 100644 index 4156466e36..0000000000 --- a/management/monitoring-service-entity/README.adoc +++ /dev/null @@ -1 +0,0 @@ -This is just a testing entity to look inside the voltron monitoring service \ No newline at end of file diff --git a/management/monitoring-service-entity/pom.xml b/management/monitoring-service-entity/pom.xml deleted file mode 100644 index 01fe6e1ea9..0000000000 --- a/management/monitoring-service-entity/pom.xml +++ /dev/null @@ -1,149 +0,0 @@ - - - - - org.terracotta.management - terracotta-management - 5.0-SNAPSHOT - - 4.0.0 - - monitoring-service-entity - jar - Terracotta Management :: Monitoring Service Entity - - - 1.8 - - - - - - org.terracotta.voltron.proxy - voltron-proxy-client - ${project.version} - - - org.terracotta.voltron.proxy - voltron-proxy-server - ${project.version} - - - - - org.terracotta.management - management-model - ${project.version} - provided - - - org.terracotta.management - sequence-generator - ${project.version} - provided - - - org.terracotta.management - cluster-topology - ${project.version} - provided - - - - - org.terracotta.management - monitoring-service-api - ${project.version} - provided - - - - - org.terracotta - entity-client-api - provided - - - - - org.terracotta - entity-server-api - provided - - - - junit - junit - test - - - org.terracotta - passthrough-server - test - - - org.terracotta.management - monitoring-service - ${project.version} - test - - - - - - - org.apache.maven.plugins - maven-shade-plugin - 2.4.3 - - - package - - shade - - - false - true - - - - - - org.terracotta.voltron.proxy:voltron-proxy-common - org.terracotta.voltron.proxy:voltron-proxy-client - org.terracotta.voltron.proxy:voltron-proxy-server - - - - - - - - - - \ No newline at end of file diff --git a/management/monitoring-service-entity/src/main/java/org/terracotta/management/entity/monitoring/MonitoringServiceProxy.java b/management/monitoring-service-entity/src/main/java/org/terracotta/management/entity/monitoring/MonitoringServiceProxy.java deleted file mode 100644 index b9a2a1916c..0000000000 --- a/management/monitoring-service-entity/src/main/java/org/terracotta/management/entity/monitoring/MonitoringServiceProxy.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright Terracotta, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.terracotta.management.entity.monitoring; - -import org.terracotta.management.model.cluster.Cluster; -import org.terracotta.management.model.message.Message; - -import java.util.List; - -/** - * @author Mathieu Carbou - */ -public interface MonitoringServiceProxy { - - Cluster readTopology(); - - void createMessageBuffer(int size); - - Message readMessageBuffer(); - - List drainMessageBuffer(); - - void clearMessageBuffer(); - -} diff --git a/management/monitoring-service-entity/src/main/java/org/terracotta/management/entity/monitoring/client/MonitoringServiceEntityClientService.java b/management/monitoring-service-entity/src/main/java/org/terracotta/management/entity/monitoring/client/MonitoringServiceEntityClientService.java deleted file mode 100644 index e14bb32747..0000000000 --- a/management/monitoring-service-entity/src/main/java/org/terracotta/management/entity/monitoring/client/MonitoringServiceEntityClientService.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright Terracotta, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.terracotta.management.entity.monitoring.client; - -import org.terracotta.management.entity.monitoring.MonitoringServiceProxy; -import org.terracotta.voltron.proxy.client.ProxyEntityClientService; - -/** - * @author Mathieu Carbou - */ -public class MonitoringServiceEntityClientService extends ProxyEntityClientService { - public MonitoringServiceEntityClientService() { - super(MonitoringServiceProxyEntity.class, MonitoringServiceProxy.class, Void.class); - } -} diff --git a/management/monitoring-service-entity/src/main/java/org/terracotta/management/entity/monitoring/client/MonitoringServiceEntityFactory.java b/management/monitoring-service-entity/src/main/java/org/terracotta/management/entity/monitoring/client/MonitoringServiceEntityFactory.java deleted file mode 100644 index 5a18746b7c..0000000000 --- a/management/monitoring-service-entity/src/main/java/org/terracotta/management/entity/monitoring/client/MonitoringServiceEntityFactory.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright Terracotta, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.terracotta.management.entity.monitoring.client; - -import org.terracotta.connection.Connection; -import org.terracotta.connection.entity.EntityRef; -import org.terracotta.exception.EntityAlreadyExistsException; -import org.terracotta.exception.EntityNotFoundException; -import org.terracotta.exception.EntityNotProvidedException; -import org.terracotta.exception.EntityVersionMismatchException; - -/** - * @author Mathieu Carbou - */ -public class MonitoringServiceEntityFactory { - - private final Connection connection; - - public MonitoringServiceEntityFactory(Connection connection) { - this.connection = connection; - } - - public MonitoringServiceProxyEntity retrieveOrCreate(String entityName) { - try { - return retrieve(entityName); - } catch (EntityNotFoundException e) { - try { - return create(entityName); - } catch (EntityAlreadyExistsException f) { - throw new AssertionError(e); - } - } - } - - public MonitoringServiceProxyEntity retrieve(String entityName) throws EntityNotFoundException { - try { - return getEntityRef(entityName).fetchEntity(); - } catch (EntityVersionMismatchException e) { - throw new AssertionError(e); - } - } - - public MonitoringServiceProxyEntity create(final String identifier) throws EntityAlreadyExistsException { - EntityRef ref = getEntityRef(identifier); - try { - ref.create(null); - return ref.fetchEntity(); - } catch (EntityNotProvidedException | EntityVersionMismatchException | EntityNotFoundException e) { - throw new AssertionError(e); - } - } - - private EntityRef getEntityRef(String entityName) { - try { - return connection.getEntityRef(MonitoringServiceProxyEntity.class, 1, entityName); - } catch (EntityNotProvidedException e) { - throw new AssertionError(e); - } - } - -} diff --git a/management/monitoring-service-entity/src/main/java/org/terracotta/management/entity/monitoring/client/MonitoringServiceProxyEntity.java b/management/monitoring-service-entity/src/main/java/org/terracotta/management/entity/monitoring/client/MonitoringServiceProxyEntity.java deleted file mode 100644 index 6b43bb4c06..0000000000 --- a/management/monitoring-service-entity/src/main/java/org/terracotta/management/entity/monitoring/client/MonitoringServiceProxyEntity.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright Terracotta, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.terracotta.management.entity.monitoring.client; - -import org.terracotta.management.entity.monitoring.MonitoringServiceProxy; -import org.terracotta.connection.entity.Entity; - -/** - * @author Mathieu Carbou - */ -public interface MonitoringServiceProxyEntity extends MonitoringServiceProxy, Entity { - -} diff --git a/management/monitoring-service-entity/src/main/java/org/terracotta/management/entity/monitoring/server/MonitoringServiceEntity.java b/management/monitoring-service-entity/src/main/java/org/terracotta/management/entity/monitoring/server/MonitoringServiceEntity.java deleted file mode 100644 index 0f6e740991..0000000000 --- a/management/monitoring-service-entity/src/main/java/org/terracotta/management/entity/monitoring/server/MonitoringServiceEntity.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright Terracotta, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.terracotta.management.entity.monitoring.server; - -import org.terracotta.management.entity.monitoring.MonitoringServiceProxy; -import org.terracotta.management.service.monitoring.MonitoringService; -import org.terracotta.voltron.proxy.server.ProxiedServerEntity; - -/** - * @author Mathieu Carbou - */ -class MonitoringServiceEntity extends ProxiedServerEntity { - - private final MonitoringService monitoringService; - - MonitoringServiceEntity(MonitoringService monitoringService) { - super(new MonitoringServiceProxyImpl(monitoringService)); - this.monitoringService = monitoringService; - } - -} diff --git a/management/monitoring-service-entity/src/main/java/org/terracotta/management/entity/monitoring/server/MonitoringServiceEntityServerService.java b/management/monitoring-service-entity/src/main/java/org/terracotta/management/entity/monitoring/server/MonitoringServiceEntityServerService.java deleted file mode 100644 index 96488ca559..0000000000 --- a/management/monitoring-service-entity/src/main/java/org/terracotta/management/entity/monitoring/server/MonitoringServiceEntityServerService.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright Terracotta, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.terracotta.management.entity.monitoring.server; - -import org.terracotta.entity.ServiceRegistry; -import org.terracotta.management.entity.monitoring.MonitoringServiceProxy; -import org.terracotta.management.service.monitoring.MonitoringService; -import org.terracotta.management.service.monitoring.MonitoringServiceConfiguration; -import org.terracotta.voltron.proxy.SerializationCodec; -import org.terracotta.voltron.proxy.server.ProxyServerEntityService; - -/** - * @author Mathieu Carbou - */ -public class MonitoringServiceEntityServerService extends ProxyServerEntityService { - public MonitoringServiceEntityServerService() { - super(MonitoringServiceProxy.class, Void.class, new SerializationCodec()); - } - - @Override - public MonitoringServiceEntity createActiveEntity(ServiceRegistry registry, Void config) { - MonitoringService monitoringService = registry.getService(new MonitoringServiceConfiguration(registry)); - return new MonitoringServiceEntity(monitoringService); - } - - @Override - public long getVersion() { - return 1; - } - - @Override - public boolean handlesEntityType(String typeName) { - return "org.terracotta.management.entity.monitoring.client.MonitoringServiceProxyEntity".equals(typeName); - } - -} diff --git a/management/monitoring-service-entity/src/main/java/org/terracotta/management/entity/monitoring/server/MonitoringServiceProxyImpl.java b/management/monitoring-service-entity/src/main/java/org/terracotta/management/entity/monitoring/server/MonitoringServiceProxyImpl.java deleted file mode 100644 index 98858ee599..0000000000 --- a/management/monitoring-service-entity/src/main/java/org/terracotta/management/entity/monitoring/server/MonitoringServiceProxyImpl.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright Terracotta, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.terracotta.management.entity.monitoring.server; - -import org.terracotta.management.entity.monitoring.MonitoringServiceProxy; -import org.terracotta.management.model.cluster.Cluster; -import org.terracotta.management.model.message.Message; -import org.terracotta.management.service.monitoring.MonitoringService; -import org.terracotta.management.service.monitoring.ReadOnlyBuffer; - -import java.util.ArrayList; -import java.util.List; - -/** - * @author Mathieu Carbou - */ -class MonitoringServiceProxyImpl implements MonitoringServiceProxy { - - private final MonitoringService monitoringService; - private ReadOnlyBuffer messageBuffer; - - MonitoringServiceProxyImpl(MonitoringService monitoringService) { - this.monitoringService = monitoringService; - } - - @Override - public Cluster readTopology() { - return monitoringService.readTopology(); - } - - @Override - public void createMessageBuffer(int size) { - messageBuffer = monitoringService.createMessageBuffer(size); - } - - @Override - public Message readMessageBuffer() { - return messageBuffer.read(); - } - - @Override - public List drainMessageBuffer() { - List messages = new ArrayList<>(messageBuffer.size()); - messageBuffer.drainTo(messages); - return messages; - } - - @Override - public void clearMessageBuffer() { - messageBuffer.clear(); - } - -} diff --git a/management/monitoring-service-entity/src/main/resources/META-INF/services/org.terracotta.entity.EntityClientService b/management/monitoring-service-entity/src/main/resources/META-INF/services/org.terracotta.entity.EntityClientService deleted file mode 100644 index 8d49781477..0000000000 --- a/management/monitoring-service-entity/src/main/resources/META-INF/services/org.terracotta.entity.EntityClientService +++ /dev/null @@ -1,17 +0,0 @@ -# -# Copyright Terracotta, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -org.terracotta.management.entity.monitoring.client.MonitoringServiceEntityClientService diff --git a/management/monitoring-service-entity/src/main/resources/META-INF/services/org.terracotta.entity.EntityServerService b/management/monitoring-service-entity/src/main/resources/META-INF/services/org.terracotta.entity.EntityServerService deleted file mode 100644 index b4d5844bbe..0000000000 --- a/management/monitoring-service-entity/src/main/resources/META-INF/services/org.terracotta.entity.EntityServerService +++ /dev/null @@ -1,17 +0,0 @@ -# -# Copyright Terracotta, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -org.terracotta.management.entity.monitoring.server.MonitoringServiceEntityServerService diff --git a/management/monitoring-service-entity/src/test/java/org/terracotta/management/entity/monitoring/MonitoringServiceProxyTest.java b/management/monitoring-service-entity/src/test/java/org/terracotta/management/entity/monitoring/MonitoringServiceProxyTest.java deleted file mode 100644 index 2bcea4aeef..0000000000 --- a/management/monitoring-service-entity/src/test/java/org/terracotta/management/entity/monitoring/MonitoringServiceProxyTest.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright Terracotta, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.terracotta.management.entity.monitoring; - -import org.junit.After; -import org.junit.Before; -import org.junit.Ignore; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; -import org.terracotta.connection.Connection; -import org.terracotta.connection.ConnectionFactory; -import org.terracotta.management.entity.monitoring.client.MonitoringServiceEntityClientService; -import org.terracotta.management.entity.monitoring.client.MonitoringServiceEntityFactory; -import org.terracotta.management.entity.monitoring.client.MonitoringServiceProxyEntity; -import org.terracotta.management.entity.monitoring.server.MonitoringServiceEntityServerService; -import org.terracotta.management.model.cluster.Cluster; -import org.terracotta.passthrough.PassthroughClusterControl; -import org.terracotta.passthrough.PassthroughServer; - -import java.net.URI; -import java.util.Properties; - -import static org.hamcrest.CoreMatchers.equalTo; -import static org.junit.Assert.assertThat; - -/** - * @author Mathieu Carbou - */ -@RunWith(JUnit4.class) -public class MonitoringServiceProxyTest { - - private PassthroughClusterControl stripeControl; - - @Before - public void setUp() throws Exception { - PassthroughServer activeServer = new PassthroughServer(); - activeServer.setServerName("server-1"); - - activeServer.registerServerEntityService(new MonitoringServiceEntityServerService()); - activeServer.registerClientEntityService(new MonitoringServiceEntityClientService()); - - stripeControl = new PassthroughClusterControl("stripe-1", activeServer); - } - - @After - public void tearDown() throws Exception { - if (stripeControl != null) { - stripeControl.tearDown(); - } - } - - @Test - public void test_read_tree() throws Exception { - try (Connection connection = ConnectionFactory.connect(URI.create("passthrough://stripe-1:9510/cluster-1"), new Properties())) { - - // create, fetch and use the custom entity - - MonitoringServiceEntityFactory monitoringServiceEntityFactory = new MonitoringServiceEntityFactory(connection); - MonitoringServiceProxyEntity entity = monitoringServiceEntityFactory.retrieveOrCreate(getClass().getSimpleName()); - - Cluster cluster = entity.readTopology(); - assertThat(cluster.getStripeCount(), equalTo(1)); - assertThat(cluster.getStripes().values().iterator().next().getServerCount(), equalTo(1)); - assertThat(cluster.serverStream().findAny().get().getServerName(), equalTo("server-1")); - } - } - -} diff --git a/management/monitoring-service-entity/src/test/resources/META-INF/services/org.terracotta.connection.ConnectionService b/management/monitoring-service-entity/src/test/resources/META-INF/services/org.terracotta.connection.ConnectionService deleted file mode 100644 index ab3bcf3c65..0000000000 --- a/management/monitoring-service-entity/src/test/resources/META-INF/services/org.terracotta.connection.ConnectionService +++ /dev/null @@ -1 +0,0 @@ -org.terracotta.passthrough.PassthroughConnectionService diff --git a/management/pom.xml b/management/pom.xml index 5661bf078e..192ef3b762 100644 --- a/management/pom.xml +++ b/management/pom.xml @@ -37,13 +37,12 @@ cluster-topology monitoring-service-api monitoring-service - monitoring-service-entity management-entity tms-entity - samples distribution/management-common distribution/management-client distribution/management-server + testing Terracotta Management diff --git a/management/samples/hello-world-entity/src/main/resources/META-INF/services/org.terracotta.entity.EntityClientService b/management/samples/hello-world-entity/src/main/resources/META-INF/services/org.terracotta.entity.EntityClientService deleted file mode 100644 index 9d6b8eaa20..0000000000 --- a/management/samples/hello-world-entity/src/main/resources/META-INF/services/org.terracotta.entity.EntityClientService +++ /dev/null @@ -1 +0,0 @@ -org.terracotta.management.entity.helloworld.client.HelloWorldEntityClientService \ No newline at end of file diff --git a/management/samples/hello-world-entity/src/main/resources/META-INF/services/org.terracotta.entity.EntityServerService b/management/samples/hello-world-entity/src/main/resources/META-INF/services/org.terracotta.entity.EntityServerService deleted file mode 100644 index f8f01be409..0000000000 --- a/management/samples/hello-world-entity/src/main/resources/META-INF/services/org.terracotta.entity.EntityServerService +++ /dev/null @@ -1 +0,0 @@ -org.terracotta.management.entity.helloworld.server.HelloWorldEntityServerService \ No newline at end of file diff --git a/management/samples/hello-world-entity/src/test/resources/META-INF/services/org.terracotta.connection.ConnectionService b/management/samples/hello-world-entity/src/test/resources/META-INF/services/org.terracotta.connection.ConnectionService deleted file mode 100644 index ab3bcf3c65..0000000000 --- a/management/samples/hello-world-entity/src/test/resources/META-INF/services/org.terracotta.connection.ConnectionService +++ /dev/null @@ -1 +0,0 @@ -org.terracotta.passthrough.PassthroughConnectionService diff --git a/management/management-entity/management-entity-tests/pom.xml b/management/testing/entity-tests/pom.xml similarity index 72% rename from management/management-entity/management-entity-tests/pom.xml rename to management/testing/entity-tests/pom.xml index 673f49e78b..46844052a8 100644 --- a/management/management-entity/management-entity-tests/pom.xml +++ b/management/testing/entity-tests/pom.xml @@ -20,34 +20,29 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - management-entity - org.terracotta.management + testing + org.terracotta.management.testing 5.0-SNAPSHOT 4.0.0 management-entity-tests - Terracotta Management :: Management Entity :: Tests + Terracotta Management :: Testing :: Entity Tests 1.8 + - org.terracotta.management - management-entity-client - ${project.version} - test - - - org.terracotta.management - management-entity-server + org.terracotta.management.testing + sample-entity ${project.version} test - + org.terracotta entity-client-api @@ -70,33 +65,33 @@ monitoring-support test - - junit - junit - test + org.terracotta + offheap-resource + ${project.version} + provided - org.terracotta - passthrough-server + org.terracotta.management.dist + management-server + ${project.version} test + - org.terracotta.management - management-registry - ${project.version} + junit + junit test - org.terracotta.management - monitoring-service-entity - ${project.version} + org.terracotta + passthrough-server test - org.terracotta.management - monitoring-service - ${project.version} + com.fasterxml.jackson.core + jackson-databind + 2.8.0 test diff --git a/management/management-entity/management-entity-tests/src/test/java/org/terracotta/management/entity/management/ManagementAgentServiceTest.java b/management/testing/entity-tests/src/test/java/org/terracotta/management/entity/management/ManagementAgentServiceTest.java similarity index 86% rename from management/management-entity/management-entity-tests/src/test/java/org/terracotta/management/entity/management/ManagementAgentServiceTest.java rename to management/testing/entity-tests/src/test/java/org/terracotta/management/entity/management/ManagementAgentServiceTest.java index 02ce2a7b82..c87c3fd37b 100644 --- a/management/management-entity/management-entity-tests/src/test/java/org/terracotta/management/entity/management/ManagementAgentServiceTest.java +++ b/management/testing/entity-tests/src/test/java/org/terracotta/management/entity/management/ManagementAgentServiceTest.java @@ -26,10 +26,11 @@ import org.terracotta.management.entity.management.client.ManagementAgentEntityFactory; import org.terracotta.management.entity.management.client.ManagementAgentService; import org.terracotta.management.entity.management.server.ManagementAgentEntityServerService; -import org.terracotta.management.entity.monitoring.client.MonitoringServiceEntityClientService; -import org.terracotta.management.entity.monitoring.client.MonitoringServiceEntityFactory; -import org.terracotta.management.entity.monitoring.client.MonitoringServiceProxyEntity; -import org.terracotta.management.entity.monitoring.server.MonitoringServiceEntityServerService; +import org.terracotta.management.entity.tms.TmsAgent; +import org.terracotta.management.entity.tms.TmsAgentConfig; +import org.terracotta.management.entity.tms.client.TmsAgentEntityClientService; +import org.terracotta.management.entity.tms.client.TmsAgentEntityFactory; +import org.terracotta.management.entity.tms.server.TmsAgentEntityServerService; import org.terracotta.management.model.call.ContextualReturn; import org.terracotta.management.model.call.Parameter; import org.terracotta.management.model.cluster.Client; @@ -76,7 +77,7 @@ @RunWith(JUnit4.class) public class ManagementAgentServiceTest { - private static MonitoringServiceProxyEntity consumer; + private static TmsAgent consumer; PassthroughClusterControl stripeControl; @@ -90,11 +91,11 @@ public void setUp() throws Exception { activeServer.setGroupPort(9610); activeServer.registerClientEntityService(new ManagementAgentEntityClientService()); activeServer.registerServerEntityService(new ManagementAgentEntityServerService()); - activeServer.registerServerEntityService(new MonitoringServiceEntityServerService()); - activeServer.registerClientEntityService(new MonitoringServiceEntityClientService()); + activeServer.registerServerEntityService(new TmsAgentEntityServerService()); + activeServer.registerClientEntityService(new TmsAgentEntityClientService()); stripeControl = new PassthroughClusterControl("stripe-1", activeServer); - consumer = new MonitoringServiceEntityFactory(ConnectionFactory.connect(URI.create("passthrough://stripe-1:9510/cluster-1"), new Properties())).retrieveOrCreate("MonitoringConsumerEntity"); + consumer = new TmsAgentEntityFactory(ConnectionFactory.connect(URI.create("passthrough://stripe-1:9510/cluster-1"), new Properties()), "MonitoringConsumerEntity").retrieveOrCreate(new TmsAgentConfig()); } @After @@ -118,7 +119,8 @@ public ContextContainer getContextContainer() { registry.register(new MyObject("myCacheManagerName", "myCacheName1")); registry.register(new MyObject("myCacheManagerName", "myCacheName2")); - consumer.createMessageBuffer(100); + // clear previous messages + consumer.readMessages().get(); try (Connection connection = ConnectionFactory.connect(URI.create("passthrough://stripe-1:9510/cluster-1"), new Properties())) { @@ -133,17 +135,17 @@ public ContextContainer getContextContainer() { assertEquals("UNKNOWN", clientIdentifier.getName()); assertNotNull(clientIdentifier.getConnectionUid()); - List messages = consumer.drainMessageBuffer(); - assertThat(types(messages), equalTo(Arrays.asList("NOTIFICATION", "NOTIFICATION", "NOTIFICATION", "NOTIFICATION"))); + List messages = consumer.readMessages().get(); + assertThat(types(messages), equalTo(Arrays.asList("NOTIFICATION", "NOTIFICATION", "NOTIFICATION", "NOTIFICATION", "TOPOLOGY"))); assertThat(notificationTypes(messages), equalTo(Arrays.asList("CLIENT_CONNECTED", "SERVER_ENTITY_CREATED", "SERVER_ENTITY_FETCHED", "CLIENT_REGISTRY_AVAILABLE"))); assertThat(messages.get(0).unwrap(ContextualNotification.class).get(0).getContext().get(Client.KEY), equalTo(clientIdentifier.getClientId())); assertThat(messages.get(3).unwrap(ContextualNotification.class).get(0).getContext().get(Client.KEY), equalTo(clientIdentifier.getClientId())); managementAgent.setTags("EhcachePounder", "webapp-1", "app-server-node-1"); - messages = consumer.drainMessageBuffer(); - assertThat(messages.size(), equalTo(1)); - assertThat(types(messages), equalTo(Collections.singletonList("NOTIFICATION"))); + messages = consumer.readMessages().get(); + assertThat(messages.size(), equalTo(2)); + assertThat(types(messages), equalTo(Arrays.asList("NOTIFICATION", "TOPOLOGY"))); assertThat(notificationTypes(messages), equalTo(Collections.singletonList("CLIENT_TAGS_UPDATED"))); assertThat(messages.get(0).unwrap(ContextualNotification.class).get(0).getContext().get(Client.KEY), equalTo(clientIdentifier.getClientId())); @@ -153,7 +155,7 @@ public ContextContainer getContextContainer() { managementAgent.pushNotification(notif); managementAgent.pushStatistics(stat, stat); - Cluster cluster = consumer.readTopology(); + Cluster cluster = consumer.readTopology().get(); assertThat(cluster.getClientCount(), equalTo(2)); Client me = cluster.getClient(managementAgent.getClientIdentifier()).get(); @@ -162,8 +164,9 @@ public ContextContainer getContextContainer() { assertThat(registry.getCapabilities(), equalTo(me.getManagementRegistry().get().getCapabilities())); assertThat(registry.getContextContainer(), equalTo(me.getManagementRegistry().get().getContextContainer())); - assertThat(consumer.readMessageBuffer().unwrap(ContextualNotification.class).get(0), equalTo(notif)); - assertThat(consumer.readMessageBuffer().unwrap(ContextualStatistics.class), equalTo(Arrays.asList(stat, stat))); + messages = consumer.readMessages().get(); + assertThat(messages.get(0).unwrap(ContextualNotification.class).get(0), equalTo(notif)); + assertThat(messages.get(1).unwrap(ContextualStatistics.class), equalTo(Arrays.asList(stat, stat))); runManagementCallFromAnotherClient(clientIdentifier); } diff --git a/management/management-entity/management-entity-tests/src/test/java/org/terracotta/management/entity/management/MyManagementProvider.java b/management/testing/entity-tests/src/test/java/org/terracotta/management/entity/management/MyManagementProvider.java similarity index 100% rename from management/management-entity/management-entity-tests/src/test/java/org/terracotta/management/entity/management/MyManagementProvider.java rename to management/testing/entity-tests/src/test/java/org/terracotta/management/entity/management/MyManagementProvider.java diff --git a/management/management-entity/management-entity-tests/src/test/java/org/terracotta/management/entity/management/MyObject.java b/management/testing/entity-tests/src/test/java/org/terracotta/management/entity/management/MyObject.java similarity index 100% rename from management/management-entity/management-entity-tests/src/test/java/org/terracotta/management/entity/management/MyObject.java rename to management/testing/entity-tests/src/test/java/org/terracotta/management/entity/management/MyObject.java diff --git a/management/samples/hello-world-entity/src/test/java/org/terracotta/management/entity/helloworld/HelloWorldTest.java b/management/testing/entity-tests/src/test/java/org/terracotta/management/entity/sample/HelloWorldTest.java similarity index 78% rename from management/samples/hello-world-entity/src/test/java/org/terracotta/management/entity/helloworld/HelloWorldTest.java rename to management/testing/entity-tests/src/test/java/org/terracotta/management/entity/sample/HelloWorldTest.java index 07da964d10..700c82c785 100644 --- a/management/samples/hello-world-entity/src/test/java/org/terracotta/management/entity/helloworld/HelloWorldTest.java +++ b/management/testing/entity-tests/src/test/java/org/terracotta/management/entity/sample/HelloWorldTest.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.terracotta.management.entity.helloworld; +package org.terracotta.management.entity.sample; import org.junit.After; import org.junit.Before; @@ -22,20 +22,21 @@ import org.junit.runners.JUnit4; import org.terracotta.connection.Connection; import org.terracotta.connection.ConnectionFactory; -import org.terracotta.management.entity.helloworld.client.HelloWorldEntity; -import org.terracotta.management.entity.helloworld.client.HelloWorldEntityClientService; -import org.terracotta.management.entity.helloworld.client.HelloWorldEntityFactory; -import org.terracotta.management.entity.helloworld.client.management.HelloWorldManagementRegistry; -import org.terracotta.management.entity.helloworld.server.HelloWorldEntityServerService; import org.terracotta.management.entity.management.ManagementAgentConfig; import org.terracotta.management.entity.management.client.ManagementAgentEntityClientService; import org.terracotta.management.entity.management.client.ManagementAgentEntityFactory; import org.terracotta.management.entity.management.client.ManagementAgentService; import org.terracotta.management.entity.management.server.ManagementAgentEntityServerService; -import org.terracotta.management.entity.monitoring.client.MonitoringServiceEntityClientService; -import org.terracotta.management.entity.monitoring.client.MonitoringServiceEntityFactory; -import org.terracotta.management.entity.monitoring.client.MonitoringServiceProxyEntity; -import org.terracotta.management.entity.monitoring.server.MonitoringServiceEntityServerService; +import org.terracotta.management.entity.sample.client.HelloWorldEntity; +import org.terracotta.management.entity.sample.client.HelloWorldEntityClientService; +import org.terracotta.management.entity.sample.client.HelloWorldEntityFactory; +import org.terracotta.management.entity.sample.client.management.HelloWorldManagementRegistry; +import org.terracotta.management.entity.sample.server.HelloWorldEntityServerService; +import org.terracotta.management.entity.tms.TmsAgentConfig; +import org.terracotta.management.entity.tms.client.TmsAgentEntity; +import org.terracotta.management.entity.tms.client.TmsAgentEntityClientService; +import org.terracotta.management.entity.tms.client.TmsAgentEntityFactory; +import org.terracotta.management.entity.tms.server.TmsAgentEntityServerService; import org.terracotta.management.model.call.Parameter; import org.terracotta.management.model.cluster.Client; import org.terracotta.management.model.cluster.ManagementRegistry; @@ -66,8 +67,8 @@ public void setUp() throws Exception { activeServer.registerServerEntityService(new ManagementAgentEntityServerService()); activeServer.registerClientEntityService(new ManagementAgentEntityClientService()); - activeServer.registerServerEntityService(new MonitoringServiceEntityServerService()); - activeServer.registerClientEntityService(new MonitoringServiceEntityClientService()); + activeServer.registerServerEntityService(new TmsAgentEntityServerService()); + activeServer.registerClientEntityService(new TmsAgentEntityClientService()); stripeControl = new PassthroughClusterControl("stripe-1", activeServer); } @@ -112,10 +113,10 @@ public void test_hello_world_management() throws Exception { // check it has been exposed properly - MonitoringServiceEntityFactory entityFactory = new MonitoringServiceEntityFactory(connection); - MonitoringServiceProxyEntity consumerEntity = entityFactory.retrieveOrCreate(getClass().getSimpleName()); + TmsAgentEntityFactory entityFactory = new TmsAgentEntityFactory(connection, getClass().getSimpleName()); + TmsAgentEntity consumerEntity = entityFactory.retrieveOrCreate(new TmsAgentConfig()); - ManagementRegistry registry = consumerEntity.readTopology() + ManagementRegistry registry = consumerEntity.readTopology().get() .clientStream() .filter(Client::isManageable) .map(client -> client.getManagementRegistry().get()) diff --git a/management/tms-entity/tms-entity-tests/src/test/java/org/terracotta/management/entity/tms/MyManagementProvider.java b/management/testing/entity-tests/src/test/java/org/terracotta/management/entity/tms/MyManagementProvider.java similarity index 100% rename from management/tms-entity/tms-entity-tests/src/test/java/org/terracotta/management/entity/tms/MyManagementProvider.java rename to management/testing/entity-tests/src/test/java/org/terracotta/management/entity/tms/MyManagementProvider.java diff --git a/management/tms-entity/tms-entity-tests/src/test/java/org/terracotta/management/entity/tms/MyObject.java b/management/testing/entity-tests/src/test/java/org/terracotta/management/entity/tms/MyObject.java similarity index 100% rename from management/tms-entity/tms-entity-tests/src/test/java/org/terracotta/management/entity/tms/MyObject.java rename to management/testing/entity-tests/src/test/java/org/terracotta/management/entity/tms/MyObject.java diff --git a/management/tms-entity/tms-entity-tests/src/test/java/org/terracotta/management/entity/tms/TmsAgentTest.java b/management/testing/entity-tests/src/test/java/org/terracotta/management/entity/tms/TmsAgentTest.java similarity index 100% rename from management/tms-entity/tms-entity-tests/src/test/java/org/terracotta/management/entity/tms/TmsAgentTest.java rename to management/testing/entity-tests/src/test/java/org/terracotta/management/entity/tms/TmsAgentTest.java diff --git a/management/management-entity/management-entity-tests/src/test/resources/META-INF/services/org.terracotta.connection.ConnectionService b/management/testing/entity-tests/src/test/resources/META-INF/services/org.terracotta.connection.ConnectionService similarity index 100% rename from management/management-entity/management-entity-tests/src/test/resources/META-INF/services/org.terracotta.connection.ConnectionService rename to management/testing/entity-tests/src/test/resources/META-INF/services/org.terracotta.connection.ConnectionService diff --git a/management/testing/integration-tests/pom.xml b/management/testing/integration-tests/pom.xml new file mode 100644 index 0000000000..066c8017c0 --- /dev/null +++ b/management/testing/integration-tests/pom.xml @@ -0,0 +1,45 @@ + + + + + testing + org.terracotta.management.testing + 5.0-SNAPSHOT + + 4.0.0 + + integration-tests + Terracotta Management :: Testing :: Integration Tests + + + 1.8 + + + + + org.terracotta + galvan-support + ${galvan.version} + test + + + + \ No newline at end of file diff --git a/management/samples/pom.xml b/management/testing/pom.xml similarity index 82% rename from management/samples/pom.xml rename to management/testing/pom.xml index ef9a118647..0e8a2d2c27 100644 --- a/management/samples/pom.xml +++ b/management/testing/pom.xml @@ -27,13 +27,15 @@ 4.0.0 - org.terracotta.management.samples - samples - Terracotta Management :: Samples + org.terracotta.management.testing + testing + Terracotta Management :: Testing pom - hello-world-entity + sample-entity + entity-tests + integration-tests diff --git a/management/samples/hello-world-entity/.gitignore b/management/testing/sample-entity/.gitignore similarity index 100% rename from management/samples/hello-world-entity/.gitignore rename to management/testing/sample-entity/.gitignore diff --git a/management/samples/hello-world-entity/pom.xml b/management/testing/sample-entity/pom.xml similarity index 68% rename from management/samples/hello-world-entity/pom.xml rename to management/testing/sample-entity/pom.xml index ca3c8f005a..0b7729e7cf 100644 --- a/management/samples/hello-world-entity/pom.xml +++ b/management/testing/sample-entity/pom.xml @@ -22,21 +22,32 @@ 4.0.0 - samples - org.terracotta.management.samples + testing + org.terracotta.management.testing 5.0-SNAPSHOT .. - hello-world-entity + sample-entity jar - Terracotta Management :: Samples :: Hello World Entity + Terracotta Management :: Testing :: Sample Entity 1.8 + + org.terracotta.management.dist + management-common + ${project.version} + + + org.terracotta.management.dist + management-client + ${project.version} + + org.terracotta.voltron.proxy @@ -62,48 +73,17 @@ entity-server-api provided - - - - org.terracotta.management - management-registry - ${project.version} - true - - org.terracotta.management - management-entity-client + org.terracotta.management.dist + management-server ${project.version} - true - - - - junit - junit - test + provided org.terracotta - passthrough-server - test - - - org.terracotta.management - monitoring-service - ${project.version} - test - - - org.terracotta.management - management-entity-server - ${project.version} - test - - - org.terracotta.management - monitoring-service-entity + offheap-resource ${project.version} - test + provided @@ -120,9 +100,7 @@ shade - true - plugin - + true org.terracotta.voltron.proxy:voltron-proxy-common diff --git a/management/samples/hello-world-entity/src/main/java/org/terracotta/management/entity/helloworld/HelloWorld.java b/management/testing/sample-entity/src/main/java/org/terracotta/management/entity/sample/HelloWorld.java similarity index 92% rename from management/samples/hello-world-entity/src/main/java/org/terracotta/management/entity/helloworld/HelloWorld.java rename to management/testing/sample-entity/src/main/java/org/terracotta/management/entity/sample/HelloWorld.java index 2928a56a16..2d6f5a5a86 100644 --- a/management/samples/hello-world-entity/src/main/java/org/terracotta/management/entity/helloworld/HelloWorld.java +++ b/management/testing/sample-entity/src/main/java/org/terracotta/management/entity/sample/HelloWorld.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.terracotta.management.entity.helloworld; +package org.terracotta.management.entity.sample; /** * @author Mathieu Carbou diff --git a/management/samples/hello-world-entity/src/main/java/org/terracotta/management/entity/helloworld/client/HelloWorldEntity.java b/management/testing/sample-entity/src/main/java/org/terracotta/management/entity/sample/client/HelloWorldEntity.java similarity index 85% rename from management/samples/hello-world-entity/src/main/java/org/terracotta/management/entity/helloworld/client/HelloWorldEntity.java rename to management/testing/sample-entity/src/main/java/org/terracotta/management/entity/sample/client/HelloWorldEntity.java index d9035e7293..6276610172 100644 --- a/management/samples/hello-world-entity/src/main/java/org/terracotta/management/entity/helloworld/client/HelloWorldEntity.java +++ b/management/testing/sample-entity/src/main/java/org/terracotta/management/entity/sample/client/HelloWorldEntity.java @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.terracotta.management.entity.helloworld.client; +package org.terracotta.management.entity.sample.client; -import org.terracotta.management.entity.helloworld.HelloWorld; +import org.terracotta.management.entity.sample.HelloWorld; import org.terracotta.connection.entity.Entity; /** diff --git a/management/samples/hello-world-entity/src/main/java/org/terracotta/management/entity/helloworld/client/HelloWorldEntityClientService.java b/management/testing/sample-entity/src/main/java/org/terracotta/management/entity/sample/client/HelloWorldEntityClientService.java similarity index 88% rename from management/samples/hello-world-entity/src/main/java/org/terracotta/management/entity/helloworld/client/HelloWorldEntityClientService.java rename to management/testing/sample-entity/src/main/java/org/terracotta/management/entity/sample/client/HelloWorldEntityClientService.java index 3bcef9fb19..846f28e414 100644 --- a/management/samples/hello-world-entity/src/main/java/org/terracotta/management/entity/helloworld/client/HelloWorldEntityClientService.java +++ b/management/testing/sample-entity/src/main/java/org/terracotta/management/entity/sample/client/HelloWorldEntityClientService.java @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.terracotta.management.entity.helloworld.client; +package org.terracotta.management.entity.sample.client; -import org.terracotta.management.entity.helloworld.HelloWorld; +import org.terracotta.management.entity.sample.HelloWorld; import org.terracotta.voltron.proxy.client.ProxyEntityClientService; /** diff --git a/management/samples/hello-world-entity/src/main/java/org/terracotta/management/entity/helloworld/client/HelloWorldEntityFactory.java b/management/testing/sample-entity/src/main/java/org/terracotta/management/entity/sample/client/HelloWorldEntityFactory.java similarity index 97% rename from management/samples/hello-world-entity/src/main/java/org/terracotta/management/entity/helloworld/client/HelloWorldEntityFactory.java rename to management/testing/sample-entity/src/main/java/org/terracotta/management/entity/sample/client/HelloWorldEntityFactory.java index 83163f5f5c..8b15d53e18 100644 --- a/management/samples/hello-world-entity/src/main/java/org/terracotta/management/entity/helloworld/client/HelloWorldEntityFactory.java +++ b/management/testing/sample-entity/src/main/java/org/terracotta/management/entity/sample/client/HelloWorldEntityFactory.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.terracotta.management.entity.helloworld.client; +package org.terracotta.management.entity.sample.client; import org.terracotta.connection.Connection; import org.terracotta.connection.entity.EntityRef; diff --git a/management/samples/hello-world-entity/src/main/java/org/terracotta/management/entity/helloworld/client/management/ExposedHelloWorldEntity.java b/management/testing/sample-entity/src/main/java/org/terracotta/management/entity/sample/client/management/ExposedHelloWorldEntity.java similarity index 92% rename from management/samples/hello-world-entity/src/main/java/org/terracotta/management/entity/helloworld/client/management/ExposedHelloWorldEntity.java rename to management/testing/sample-entity/src/main/java/org/terracotta/management/entity/sample/client/management/ExposedHelloWorldEntity.java index a84fa3d954..763cb9126e 100644 --- a/management/samples/hello-world-entity/src/main/java/org/terracotta/management/entity/helloworld/client/management/ExposedHelloWorldEntity.java +++ b/management/testing/sample-entity/src/main/java/org/terracotta/management/entity/sample/client/management/ExposedHelloWorldEntity.java @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.terracotta.management.entity.helloworld.client.management; +package org.terracotta.management.entity.sample.client.management; -import org.terracotta.management.entity.helloworld.client.HelloWorldEntity; +import org.terracotta.management.entity.sample.client.HelloWorldEntity; import org.terracotta.management.model.capabilities.descriptors.Descriptor; import org.terracotta.management.model.context.Context; import org.terracotta.management.registry.action.Exposed; diff --git a/management/samples/hello-world-entity/src/main/java/org/terracotta/management/entity/helloworld/client/management/HelloWorldManagementProvider.java b/management/testing/sample-entity/src/main/java/org/terracotta/management/entity/sample/client/management/HelloWorldManagementProvider.java similarity index 90% rename from management/samples/hello-world-entity/src/main/java/org/terracotta/management/entity/helloworld/client/management/HelloWorldManagementProvider.java rename to management/testing/sample-entity/src/main/java/org/terracotta/management/entity/sample/client/management/HelloWorldManagementProvider.java index d2407b47ab..8907a43b72 100644 --- a/management/samples/hello-world-entity/src/main/java/org/terracotta/management/entity/helloworld/client/management/HelloWorldManagementProvider.java +++ b/management/testing/sample-entity/src/main/java/org/terracotta/management/entity/sample/client/management/HelloWorldManagementProvider.java @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.terracotta.management.entity.helloworld.client.management; +package org.terracotta.management.entity.sample.client.management; -import org.terracotta.management.entity.helloworld.client.HelloWorldEntity; +import org.terracotta.management.entity.sample.client.HelloWorldEntity; import org.terracotta.management.registry.action.AbstractActionManagementProvider; import org.terracotta.management.registry.action.ExposedObject; import org.terracotta.management.registry.action.Named; diff --git a/management/samples/hello-world-entity/src/main/java/org/terracotta/management/entity/helloworld/client/management/HelloWorldManagementRegistry.java b/management/testing/sample-entity/src/main/java/org/terracotta/management/entity/sample/client/management/HelloWorldManagementRegistry.java similarity index 94% rename from management/samples/hello-world-entity/src/main/java/org/terracotta/management/entity/helloworld/client/management/HelloWorldManagementRegistry.java rename to management/testing/sample-entity/src/main/java/org/terracotta/management/entity/sample/client/management/HelloWorldManagementRegistry.java index 058c9b1d86..f166f4e8e4 100644 --- a/management/samples/hello-world-entity/src/main/java/org/terracotta/management/entity/helloworld/client/management/HelloWorldManagementRegistry.java +++ b/management/testing/sample-entity/src/main/java/org/terracotta/management/entity/sample/client/management/HelloWorldManagementRegistry.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.terracotta.management.entity.helloworld.client.management; +package org.terracotta.management.entity.sample.client.management; import org.terracotta.management.model.context.ContextContainer; import org.terracotta.management.registry.AbstractManagementRegistry; diff --git a/management/samples/hello-world-entity/src/main/java/org/terracotta/management/entity/helloworld/server/HelloWorldEntity.java b/management/testing/sample-entity/src/main/java/org/terracotta/management/entity/sample/server/HelloWorldEntity.java similarity index 86% rename from management/samples/hello-world-entity/src/main/java/org/terracotta/management/entity/helloworld/server/HelloWorldEntity.java rename to management/testing/sample-entity/src/main/java/org/terracotta/management/entity/sample/server/HelloWorldEntity.java index cd70ed4b24..379414a54c 100644 --- a/management/samples/hello-world-entity/src/main/java/org/terracotta/management/entity/helloworld/server/HelloWorldEntity.java +++ b/management/testing/sample-entity/src/main/java/org/terracotta/management/entity/sample/server/HelloWorldEntity.java @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.terracotta.management.entity.helloworld.server; +package org.terracotta.management.entity.sample.server; -import org.terracotta.management.entity.helloworld.HelloWorld; +import org.terracotta.management.entity.sample.HelloWorld; import org.terracotta.voltron.proxy.server.ProxiedServerEntity; /** diff --git a/management/samples/hello-world-entity/src/main/java/org/terracotta/management/entity/helloworld/server/HelloWorldEntityServerService.java b/management/testing/sample-entity/src/main/java/org/terracotta/management/entity/sample/server/HelloWorldEntityServerService.java similarity index 85% rename from management/samples/hello-world-entity/src/main/java/org/terracotta/management/entity/helloworld/server/HelloWorldEntityServerService.java rename to management/testing/sample-entity/src/main/java/org/terracotta/management/entity/sample/server/HelloWorldEntityServerService.java index d5049fdad4..1867fdb029 100644 --- a/management/samples/hello-world-entity/src/main/java/org/terracotta/management/entity/helloworld/server/HelloWorldEntityServerService.java +++ b/management/testing/sample-entity/src/main/java/org/terracotta/management/entity/sample/server/HelloWorldEntityServerService.java @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.terracotta.management.entity.helloworld.server; +package org.terracotta.management.entity.sample.server; -import org.terracotta.management.entity.helloworld.HelloWorld; +import org.terracotta.management.entity.sample.HelloWorld; import org.terracotta.entity.ServiceRegistry; import org.terracotta.voltron.proxy.SerializationCodec; import org.terracotta.voltron.proxy.server.ProxyServerEntityService; @@ -40,7 +40,7 @@ public long getVersion() { @Override public boolean handlesEntityType(String typeName) { - return "org.terracotta.management.entity.helloworld.client.HelloWorldEntity".equals(typeName); + return "org.terracotta.management.entity.sample.client.HelloWorldEntity".equals(typeName); } } diff --git a/management/samples/hello-world-entity/src/main/java/org/terracotta/management/entity/helloworld/server/HelloWorldImpl.java b/management/testing/sample-entity/src/main/java/org/terracotta/management/entity/sample/server/HelloWorldImpl.java similarity index 86% rename from management/samples/hello-world-entity/src/main/java/org/terracotta/management/entity/helloworld/server/HelloWorldImpl.java rename to management/testing/sample-entity/src/main/java/org/terracotta/management/entity/sample/server/HelloWorldImpl.java index 3942412faf..9de5313d2b 100644 --- a/management/samples/hello-world-entity/src/main/java/org/terracotta/management/entity/helloworld/server/HelloWorldImpl.java +++ b/management/testing/sample-entity/src/main/java/org/terracotta/management/entity/sample/server/HelloWorldImpl.java @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.terracotta.management.entity.helloworld.server; +package org.terracotta.management.entity.sample.server; -import org.terracotta.management.entity.helloworld.HelloWorld; +import org.terracotta.management.entity.sample.HelloWorld; /** * @author Mathieu Carbou diff --git a/management/testing/sample-entity/src/main/resources/META-INF/services/org.terracotta.entity.EntityClientService b/management/testing/sample-entity/src/main/resources/META-INF/services/org.terracotta.entity.EntityClientService new file mode 100644 index 0000000000..b56254fc6b --- /dev/null +++ b/management/testing/sample-entity/src/main/resources/META-INF/services/org.terracotta.entity.EntityClientService @@ -0,0 +1 @@ +sample.client.HelloWorldEntityClientService \ No newline at end of file diff --git a/management/testing/sample-entity/src/main/resources/META-INF/services/org.terracotta.entity.EntityServerService b/management/testing/sample-entity/src/main/resources/META-INF/services/org.terracotta.entity.EntityServerService new file mode 100644 index 0000000000..48d4713f89 --- /dev/null +++ b/management/testing/sample-entity/src/main/resources/META-INF/services/org.terracotta.entity.EntityServerService @@ -0,0 +1 @@ +sample.server.HelloWorldEntityServerService \ No newline at end of file diff --git a/management/tms-entity/pom.xml b/management/tms-entity/pom.xml index 182f0cc2ea..a9627e1dac 100644 --- a/management/tms-entity/pom.xml +++ b/management/tms-entity/pom.xml @@ -32,7 +32,6 @@ tms-entity-common tms-entity-client tms-entity-server - tms-entity-tests tms-entity diff --git a/management/tms-entity/tms-entity-tests/pom.xml b/management/tms-entity/tms-entity-tests/pom.xml deleted file mode 100644 index c8945a185f..0000000000 --- a/management/tms-entity/tms-entity-tests/pom.xml +++ /dev/null @@ -1,107 +0,0 @@ - - - - - tms-entity - org.terracotta.management - 5.0-SNAPSHOT - - 4.0.0 - - tms-entity-tests - Terracotta Management :: TMS Entity :: Tests - - - - org.terracotta.management - tms-entity-client - ${project.version} - test - - - org.terracotta.management - tms-entity-server - ${project.version} - test - - - org.terracotta.management - management-entity-client - ${project.version} - test - - - org.terracotta.management - management-entity-server - ${project.version} - test - - - - - org.terracotta - entity-client-api - test - - - - - org.terracotta - entity-server-api - test - - - org.terracotta - standard-cluster-services - test - - - org.terracotta - monitoring-support - test - - - - org.terracotta.management - monitoring-service - ${project.version} - test - - - - junit - junit - test - - - org.terracotta - passthrough-server - test - - - com.fasterxml.jackson.core - jackson-databind - 2.8.0 - test - - - - \ No newline at end of file diff --git a/management/tms-entity/tms-entity-tests/src/test/resources/META-INF/services/org.terracotta.connection.ConnectionService b/management/tms-entity/tms-entity-tests/src/test/resources/META-INF/services/org.terracotta.connection.ConnectionService deleted file mode 100644 index ab3bcf3c65..0000000000 --- a/management/tms-entity/tms-entity-tests/src/test/resources/META-INF/services/org.terracotta.connection.ConnectionService +++ /dev/null @@ -1 +0,0 @@ -org.terracotta.passthrough.PassthroughConnectionService diff --git a/pom.xml b/pom.xml index ad9ecc4410..d8e6e38483 100644 --- a/pom.xml +++ b/pom.xml @@ -30,6 +30,7 @@ 1.0.12.beta 10.0.12.beta 1.0.12.beta + 1.0.12-beta2 1.4.1 UTF-8 UTF-8