forked from eclipse-jkube/jkube
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix eclipse-jkube#364: jkube.watch.postExec property/parameter/config…
…uration is ignored Added support for copying changed files and executing a command provided in postExec option after copying files to the application pod.
- Loading branch information
1 parent
e36a9b0
commit 7c2d103
Showing
8 changed files
with
317 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
jkube-kit/common/src/test/java/org/eclipse/jkube/kit/common/util/TimeUtilTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/** | ||
* Copyright (c) 2019 Red Hat, Inc. | ||
* This program and the accompanying materials are made | ||
* available under the terms of the Eclipse Public License 2.0 | ||
* which is available at: | ||
* | ||
* https://www.eclipse.org/legal/epl-2.0/ | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* | ||
* Contributors: | ||
* Red Hat, Inc. - initial API and implementation | ||
*/ | ||
package org.eclipse.jkube.kit.common.util; | ||
|
||
import org.eclipse.jkube.kit.common.TimeUtil; | ||
import org.junit.Test; | ||
|
||
import java.util.concurrent.TimeUnit; | ||
import java.util.concurrent.atomic.AtomicBoolean; | ||
|
||
import static org.junit.Assert.assertTrue; | ||
|
||
public class TimeUtilTest { | ||
@Test | ||
public void testWaitUntilCondition() throws InterruptedException { | ||
long timeBeforeWait = System.currentTimeMillis(); | ||
AtomicBoolean value = new AtomicBoolean(false); | ||
new Thread(() -> { | ||
try { | ||
TimeUnit.MILLISECONDS.sleep(100); | ||
} catch (InterruptedException interruptedException) { | ||
interruptedException.printStackTrace(); | ||
} | ||
value.set(true); | ||
}).start(); | ||
|
||
TimeUtil.waitUntilCondition(AtomicBoolean::get, value, 200, 50); | ||
long timeAfterWait = System.currentTimeMillis(); | ||
assertTrue(timeAfterWait - timeBeforeWait < 200); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.