You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by cl...@apache.org on 2018/05/02 15:40:33 UTC
[3/6] activemq-artemis git commit: NO-JIRA removing obsolete
CloseConnectionFactoryOnGCTest
NO-JIRA removing obsolete CloseConnectionFactoryOnGCTest
Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/f8017d06
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/f8017d06
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/f8017d06
Branch: refs/heads/master
Commit: f8017d0674e6b3016793647fd0d1c28e0df5ee08
Parents: d5f152c
Author: Clebert Suconic <cl...@apache.org>
Authored: Tue May 1 20:52:04 2018 -0400
Committer: Clebert Suconic <cl...@apache.org>
Committed: Wed May 2 11:38:50 2018 -0400
----------------------------------------------------------------------
.../core/client/impl/ServerLocatorImpl.java | 8 ---
.../CloseConnectionFactoryOnGCTest.java | 64 --------------------
2 files changed, 72 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8017d06/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ServerLocatorImpl.java
----------------------------------------------------------------------
diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ServerLocatorImpl.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ServerLocatorImpl.java
index 978cc39..fab1523 100644
--- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ServerLocatorImpl.java
+++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ServerLocatorImpl.java
@@ -214,10 +214,6 @@ public final class ServerLocatorImpl implements ServerLocatorInternal, Discovery
private final Exception traceException = new Exception();
- // To be called when there are ServerLocator being finalized.
- // To be used on test assertions
- public static Runnable finalizeCallback = null;
-
public static synchronized void clearThreadPools() {
ActiveMQClient.clearThreadPools();
}
@@ -1784,10 +1780,6 @@ public final class ServerLocatorImpl implements ServerLocatorInternal, Discovery
if (!isClosed() && finalizeCheck) {
ActiveMQClientLogger.LOGGER.serverLocatorNotClosed(traceException, System.identityHashCode(this));
- if (ServerLocatorImpl.finalizeCallback != null) {
- ServerLocatorImpl.finalizeCallback.run();
- }
-
close();
}
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8017d06/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/connection/CloseConnectionFactoryOnGCTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/connection/CloseConnectionFactoryOnGCTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/connection/CloseConnectionFactoryOnGCTest.java
deleted file mode 100644
index 3a445d8..0000000
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/connection/CloseConnectionFactoryOnGCTest.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.apache.activemq.artemis.tests.integration.jms.connection;
-
-import javax.jms.Connection;
-import java.util.concurrent.atomic.AtomicInteger;
-
-import org.apache.activemq.artemis.api.core.TransportConfiguration;
-import org.apache.activemq.artemis.api.jms.ActiveMQJMSClient;
-import org.apache.activemq.artemis.api.jms.JMSFactoryType;
-import org.apache.activemq.artemis.core.client.impl.ServerLocatorImpl;
-import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
-import org.apache.activemq.artemis.tests.util.JMSTestBase;
-import org.junit.Test;
-
-/**
- * A CloseConnectionOnGCTest
- */
-public class CloseConnectionFactoryOnGCTest extends JMSTestBase {
-
- @Test(timeout = 60000)
- public void testCloseCFOnGC() throws Exception {
-
- final AtomicInteger valueGC = new AtomicInteger(0);
-
- ServerLocatorImpl.finalizeCallback = new Runnable() {
- @Override
- public void run() {
- valueGC.incrementAndGet();
- }
- };
-
- try {
- // System.setOut(out);
- for (int i = 0; i < 100; i++) {
- ActiveMQConnectionFactory cf = ActiveMQJMSClient.createConnectionFactoryWithoutHA(JMSFactoryType.CF, new TransportConfiguration(INVM_CONNECTOR_FACTORY));
- Connection conn = cf.createConnection();
- cf = null;
- conn.close();
- conn = null;
- }
- forceGC();
- } finally {
- ServerLocatorImpl.finalizeCallback = null;
- }
-
- assertEquals("The code is throwing exceptions", 0, valueGC.get());
-
- }
-}