Skip to content

Commit

Permalink
Update versions of actions used in workflows (#463)
Browse files Browse the repository at this point in the history
  • Loading branch information
thegridman committed Apr 25, 2023
1 parent f49e4f3 commit 1928c26
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 57 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/build-win.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,16 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Set up JDK
uses: actions/setup-java@v1
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '11'

- name: Cache Maven packages
uses: actions/cache@v1
uses: actions/cache@v3
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,16 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Set up JDK
uses: actions/setup-java@v1
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '11'

- name: Cache Maven packages
uses: actions/cache@v1
uses: actions/cache@v3
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
import com.oracle.bedrock.runtime.java.options.IPv4Preferred;
import com.oracle.bedrock.runtime.java.options.JavaHome;
import com.oracle.bedrock.runtime.java.options.SystemProperty;
import com.oracle.bedrock.runtime.java.profiles.CommercialFeatures;
import com.oracle.bedrock.runtime.java.profiles.RemoteDebugging;
import com.oracle.bedrock.runtime.options.Argument;
import com.oracle.bedrock.runtime.options.Console;
Expand All @@ -57,7 +56,6 @@
import com.oracle.bedrock.runtime.options.Orphanable;
import com.oracle.bedrock.runtime.options.PlatformSeparators;
import com.oracle.bedrock.runtime.options.WorkingDirectory;
import com.oracle.bedrock.testsupport.junit.CheckJDK;
import com.oracle.bedrock.util.Capture;
import org.junit.Assume;
import org.junit.ClassRule;
Expand Down Expand Up @@ -85,7 +83,7 @@
import static org.hamcrest.CoreMatchers.notNullValue;
import static org.hamcrest.CoreMatchers.nullValue;
import static org.hamcrest.CoreMatchers.startsWith;
import static org.junit.Assert.assertThat;
import static org.hamcrest.MatcherAssert.assertThat;

/**
* Functional Tests for {@link LocalJavaApplicationLauncher}s.
Expand Down Expand Up @@ -190,6 +188,7 @@ public void shouldSetRemoteDebugEnabledSuspendedIsTrue() throws Exception
* {@link RemoteDebugging.Behavior#ATTACH_TO_DEBUGGER}
* and assert the process connects back to the debugger
*/
@SuppressWarnings("unused")
@Ignore("This test can cause JVMs to crash on various platforms. Disabled for now until there is a fix.")
@Test
public void shouldEnableRemoteDebugAndConnectBackToDebugger() throws Exception
Expand Down Expand Up @@ -269,10 +268,8 @@ public void shouldCloneApplicationsWhenUsingRemoteDebugging()
* Ensure that we can connect a debugger to the specified {@link JavaApplication}.
*
* @param application the {@link JavaApplication}
*
* @throws Exception
*/
protected void assertCanConnectDebuggerToApplication(JavaApplication application) throws Exception
protected void assertCanConnectDebuggerToApplication(JavaApplication application)
{
InetSocketAddress socket =
application.getOptions().getInstancesOf(RemoteDebugging.Agent.class).iterator().next().getSocketAddress();
Expand Down Expand Up @@ -303,10 +300,8 @@ protected void assertCanConnectDebuggerToApplication(JavaApplication application
* Determine if Java Debugging is available by attempting to launch the Java Debugger.
*
* @return <code>true</code> if "jdb" is available, <code>false</code> otherwise
*
* @throws Exception
*/
protected boolean hasJDB() throws Exception
protected boolean hasJDB()
{
CapturingApplicationConsole console = new CapturingApplicationConsole();

Expand Down Expand Up @@ -334,7 +329,7 @@ protected boolean hasJDB() throws Exception

/**
* Should run the {@link JavaApplication} with remote debug disabled.
*
* <p/>
* NOTE: This test is ignored when running in an IDE in debug mode
* as the {@link JavaVirtualMachine} will pick up the debug settings
* and pass them on to the process causing the test to fail
Expand Down Expand Up @@ -384,7 +379,7 @@ public void shouldCreateOrphans()

server.addListener(listener);

try (JavaApplication parentApplication = getPlatform().launch(JavaApplication.class,
try (JavaApplication ignored = getPlatform().launch(JavaApplication.class,
ClassName.of(ParentApplication.class),
Orphanable.disabled(), // the parent can't be orphaned
SystemProperty.of("server.address",
Expand Down Expand Up @@ -416,6 +411,7 @@ public void shouldCreateOrphans()
}
catch (IOException e)
{
// ignored
}
}

Expand All @@ -437,7 +433,7 @@ public void shouldNotCreateOrphans()

server.addListener(listener);

try (JavaApplication parentApplication = getPlatform().launch(JavaApplication.class,
try (JavaApplication ignored = getPlatform().launch(JavaApplication.class,
ClassName.of(ParentApplication.class),
Orphanable.disabled(),
SystemProperty.of("server.address",
Expand All @@ -459,6 +455,7 @@ public void shouldNotCreateOrphans()
}
catch (IOException e)
{
// ignored
}
}

Expand Down Expand Up @@ -534,14 +531,16 @@ public void shouldSetJavaHome() throws InterruptedException
@Test
public void shouldSetHeapSize()
{
try (JavaApplication application = getPlatform().launch(JavaApplication.class,
//noinspection EmptyTryBlock
try (JavaApplication ignored = getPlatform().launch(JavaApplication.class,
ClassName.of(SleepingApplication.class),
IPv4Preferred.yes(),
DisplayName.of("sleeping"),
HotSpot.Mode.SERVER,
HeapSize.initial(256, HeapSize.Units.MB),
HeapSize.maximum(1, HeapSize.Units.GB)))
{
// empty
}
}

Expand Down Expand Up @@ -642,41 +641,6 @@ public void shouldTerminateHangingApplication()
}


/**
* Should run a {@link JavaApplication} with commercial features.
*
* NOTE: This test is ignored when running in a non-Oracle JDK or in an
* IDE with commercial features enabled.
*/
@Test
public void shouldUnlockCommercialFeatures() throws Exception
{
CheckJDK.assumeOracleJDK();
Assume.assumeThat(CommercialFeatures.autoDetect().isEnabled(), is(false));

try (JavaApplication app = getPlatform().launch(JavaApplication.class,
ClassName.of(SleepingApplication.class),
IPv4Preferred.yes(),
CommercialFeatures.enabled()))
{
List<String> args = app.invoke(new GetProgramArgs());

String commercialFeaturesArgument = null;

for (String arg : args)
{
if (arg.startsWith("-XX:+UnlockCommercialFeatures"))
{
commercialFeaturesArgument = arg;
break;
}
}

assertThat(commercialFeaturesArgument, is(not(nullValue())));
}
}


@Test
public void shouldSetWorkingDirectory() throws Exception
{
Expand All @@ -686,7 +650,7 @@ public void shouldSetWorkingDirectory() throws Exception
String appNameSanitized = PlatformSeparators.autoDetect().asSanitizedFileName(appName);
File expectedDirectory = new File(folder, appNameSanitized);

expectedDirectory.mkdirs();
assertThat(expectedDirectory.mkdirs(), is(true));

try (JavaApplication application = getPlatform().launch(JavaApplication.class,
ClassName.of(SleepingApplication.class),
Expand Down Expand Up @@ -751,12 +715,12 @@ public static class ClientApplicationListener implements RemoteChannelListener
/**
* Was the {@link RemoteChannel} open?
*/
private AtomicBoolean isOpened;
private final AtomicBoolean isOpened;

/**
* Was the {@link RemoteChannel} closed?
*/
private AtomicBoolean isClosed;
private final AtomicBoolean isClosed;


/**
Expand Down

0 comments on commit 1928c26

Please sign in to comment.