You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@streampark.apache.org by be...@apache.org on 2022/09/14 03:55:59 UTC

[incubator-streampark] branch dev updated: [Improve] remove unnecessary test class to avoid thread blocking. (#1595)

This is an automated email from the ASF dual-hosted git repository.

benjobs pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/incubator-streampark.git


The following commit(s) were added to refs/heads/dev by this push:
     new e6a0432be [Improve] remove unnecessary test class to avoid thread blocking. (#1595)
e6a0432be is described below

commit e6a0432becf25b903fc01abd14de38035f091b4f
Author: Kunni <38...@users.noreply.github.com>
AuthorDate: Wed Sep 14 11:55:53 2022 +0800

    [Improve] remove unnecessary test class to avoid thread blocking. (#1595)
---
 .../src/test/java/RefreshCacheTest.java            | 67 ----------------------
 1 file changed, 67 deletions(-)

diff --git a/streampark-console/streampark-console-service/src/test/java/RefreshCacheTest.java b/streampark-console/streampark-console-service/src/test/java/RefreshCacheTest.java
deleted file mode 100644
index c2de40e48..000000000
--- a/streampark-console/streampark-console-service/src/test/java/RefreshCacheTest.java
+++ /dev/null
@@ -1,67 +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.
- */
-
-import org.apache.streampark.common.util.DateUtils;
-
-import com.github.benmanes.caffeine.cache.Cache;
-import com.github.benmanes.caffeine.cache.Caffeine;
-import org.junit.Test;
-
-import java.util.Date;
-import java.util.TimeZone;
-import java.util.Timer;
-import java.util.TimerTask;
-import java.util.UUID;
-import java.util.concurrent.TimeUnit;
-
-public class RefreshCacheTest {
-
-    Cache<String, String> caffeine = null;
-
-    @Test
-    public void cache() throws Exception {
-        if (caffeine == null) {
-            caffeine = Caffeine.newBuilder()
-                .refreshAfterWrite(10, TimeUnit.SECONDS)
-                .build(this::refresh);
-        }
-        caffeine.put("config", "hadoop");
-        while (true) {
-            System.out.println(caffeine.getIfPresent("config"));
-            Thread.sleep(2000);
-        }
-    }
-
-    public String refresh(String value) {
-        return UUID.randomUUID() + "@" + value;
-    }
-
-    @Test
-    public void task() throws InterruptedException {
-        System.out.println(DateUtils.format(new Date(), DateUtils.fullFormat(), TimeZone.getDefault()));
-        Timer timer = new Timer();
-        timer.schedule(new TimerTask() {
-            @Override
-            public void run() {
-                System.out.println(DateUtils.format(new Date(), DateUtils.fullFormat(), TimeZone.getDefault()));
-            }
-        }, 1000 * 10, 1000 * 10);
-
-        Thread.sleep(Long.MAX_VALUE);
-
-    }
-}