Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix #57 #58

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,18 @@ before_install:
- sudo hostname "$(hostname | cut -c1-63)"
- sed -e "s/^\\(127\\.0\\.0\\.1.*\\)/\\1 $(hostname | cut -c1-63)/" /etc/hosts | sudo tee /etc/hosts
- cat /etc/hosts # optionally check the content *after*
jdk:
- oraclejdk8

sudo: required
matrix:
include:
- jdk: oraclejdk8
- jdk: oraclejdk9
dist: trusty
group: edge
addons:
apt:
packages:
- oracle-java9-installer

env:
matrix:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ private enum PidHelper {
Long getPid(Process process) {
try {
// Invoking via reflection to avoid a strong dependency on JDK 9
Method getPid = Process.class.getMethod("getPid");
Method getPid = Process.class.getMethod("pid");
return (Long) getPid.invoke(process);
}
catch (Exception e) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package de.flapdoodle.embed.process.runtime;

import org.junit.Test;

import java.io.IOException;

import static org.junit.Assert.assertNotNull;

public class ProcessesTest {

@Test
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this test run on every platform?

public void processId() throws IOException {
Process process = new ProcessBuilder("sleep", "10").start();
assertNotNull(Processes.processId(process));
}

}