Skip to content

Commit

Permalink
Removed infrastructure for JDI tests
Browse files Browse the repository at this point in the history
Initial motivation for doing this change was that JDI test classes
depended on proprietary com.sun packages which are not available on IBM JDK.

At the same time there were only two tests that used this infrastructure.
One of them was obsolete and other one was simply rewritten in a
stochastic way.
  • Loading branch information
lutovich committed Oct 30, 2015
1 parent 0275570 commit 3d60afa
Show file tree
Hide file tree
Showing 17 changed files with 22 additions and 2,366 deletions.
57 changes: 0 additions & 57 deletions advanced/management/pom.xml
Expand Up @@ -28,63 +28,6 @@
<url>https://github.com/neo4j/neo4j/tree/master/advanced/management</url>
</scm>

<profiles>
<profile>
<id>Linux-dependency-jconsole.jar</id>
<activation>
<file>
<exists>${java.home}/../lib/jconsole.jar</exists>
</file>
</activation>
<dependencies>
<dependency>
<groupId>com.sun.tools</groupId>
<artifactId>jconsole</artifactId>
<version>${sun.tools.version}</version>
<scope>system</scope>
<systemPath>${java.home}/../lib/jconsole.jar</systemPath>
<optional>true</optional>
</dependency>
</dependencies>
</profile>
<profile>
<id>Mac-OS-X-dependency-jconsole.jar</id>
<activation>
<file>
<exists>${java.home}/lib/jconsole.jar</exists>
</file>
</activation>
<dependencies>
<dependency>
<groupId>com.sun.tools</groupId>
<artifactId>jconsole</artifactId>
<version>${sun.tools.version}</version>
<scope>system</scope>
<systemPath>${java.home}/lib/jconsole.jar</systemPath>
<optional>true</optional>
</dependency>
</dependencies>
</profile>
<profile>
<id>Windows-dependency-jconsole.jar</id>
<activation>
<os>
<family>Windows</family>
</os>
</activation>
<dependencies>
<dependency>
<groupId>com.sun.tools</groupId>
<artifactId>jconsole</artifactId>
<version>${sun.tools.version}</version>
<scope>system</scope>
<systemPath>${java.home}\\..\\lib\\jconsole.jar</systemPath>
<optional>true</optional>
</dependency>
</dependencies>
</profile>
</profiles>

<licenses>
<license>
<name>GNU Affero General Public License, Version 3</name>
Expand Down
Expand Up @@ -19,23 +19,21 @@
*/
package org.neo4j.metatest;

import static java.util.concurrent.TimeUnit.SECONDS;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import org.junit.Ignore;
import org.junit.Test;

import java.rmi.Remote;
import java.rmi.RemoteException;
import java.rmi.server.UnicastRemoteObject;
import java.util.concurrent.Callable;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;

import org.junit.Ignore;
import org.junit.Test;
import org.neo4j.test.subprocess.BreakPoint;
import org.neo4j.test.subprocess.DebugInterface;
import org.neo4j.test.subprocess.SubProcess;

import static java.util.concurrent.TimeUnit.SECONDS;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;

public class SubProcessTest
{
private static final String MESSAGE = "message";
Expand All @@ -53,6 +51,7 @@ protected void startup( String parameter )
started = true;
}

@Override
public String call() throws Exception
{
while ( !started )
Expand All @@ -76,30 +75,6 @@ public void canInvokeSubprocessMethod() throws Exception
}
}

@Test
public void canDebugSubprocess() throws Exception
{
final AtomicBoolean called = new AtomicBoolean( false );
Callable<String> proc = new TestingProcess().start( MESSAGE,//
new BreakPoint( TestingProcess.class, "call" )
{
@Override
protected void callback( DebugInterface debug )
{
called.set( true );
}
}.enable() );
try
{
assertEquals( MESSAGE, proc.call() );
assertTrue( "breakpoint callback never reached", called.get() );
}
finally
{
SubProcess.stop( proc );
}
}

@Ignore( "not reliable - the processes do exit though" )
@Test
public void subprocessShouldExitWhenParentProcessExits() throws Exception
Expand Down

0 comments on commit 3d60afa

Please sign in to comment.