Unnamed: 0
int64
0
6.7k
func
stringlengths
12
89.6k
target
bool
2 classes
project
stringlengths
45
151
1,500
@SuppressWarnings( "serial" ) private static class TestingProcess extends SubProcess<Callable<String>, String> implements Callable<String> { private String message; private transient volatile boolean started = false; @Override protected void startup( String parameter ) ...
false
community_kernel_src_test_java_org_neo4j_metatest_SubProcessTest.java
1,501
private static class Timer { private final String name; private long time = 0; private Long start = null; private long items = 0; Timer( String name ) { this.name = name; } void start() { if ( start == null ) ...
false
enterprise_enterprise-performance-tests_src_main_java_org_neo4j_perftest_enterprise_ccheck_TimingProgress.java
1,502
@Documented public class TestClasspath { @Test public void theTestClasspathShouldNotContainTheOriginalArtifacts() { for ( String lib : System.getProperty("java.class.path").split(":") ) { assertFalse( "test-jar on classpath: " + lib, lib.contains("test-ja...
false
testing-utils_src_test_java_org_neo4j_metatest_TestClasspath.java
1,503
public class ShellBootstrapTest { @Test public void shouldPickUpAllConfigOptions() throws Exception { // GIVEN String host = "test"; int port = 1234; String name = "my shell"; Config config = new Config( stringMap( ShellSettings.remote_shell_host.name(...
false
community_shell_src_test_java_org_neo4j_shell_impl_ShellBootstrapTest.java
1,504
public class SameJvmClient extends AbstractClient { private Output out; private ShellServer server; public SameJvmClient( Map<String, Serializable> initialSession, ShellServer server ) throws ShellException { this( initialSession, server, new SystemOutput() ); } /** * @param server the server to com...
false
community_shell_src_main_java_org_neo4j_shell_impl_SameJvmClient.java
1,505
public class RmiLocation { private String host; private int port; private String name; private RmiLocation() { } private RmiLocation( String host, int port, String name ) { this.host = host; this.port = port; this.name = name; } /** * Creates a new RMI location instance. * @param url the RMI UR...
false
community_shell_src_main_java_org_neo4j_shell_impl_RmiLocation.java
1,506
class RemotelyAvailableServer extends UnicastRemoteObject implements ShellServer { private final ShellServer actual; RemotelyAvailableServer( ShellServer actual ) throws RemoteException { super(); this.actual = actual; } @Override public String getName() throws RemoteException ...
false
community_shell_src_main_java_org_neo4j_shell_impl_RemotelyAvailableServer.java
1,507
public class RemoteOutput extends UnicastRemoteObject implements Output { private RemoteOutput() throws RemoteException { super(); } /** * Convenient method for creating a new instance without having to catch * the {@link RemoteException} * @return a new {@link RemoteOutput} instance. */ public static ...
false
community_shell_src_main_java_org_neo4j_shell_impl_RemoteOutput.java
1,508
public class RemoteClient extends AbstractClient { private ShellServer server; private final RmiLocation serverLocation; private final Output out; public RemoteClient( Map<String, Serializable> initialSession, RmiLocation serverLocation ) throws ShellException { this( initialSession, serverLocation,...
false
community_shell_src_main_java_org_neo4j_shell_impl_RemoteClient.java
1,509
public class RelationshipToNodeIterable extends IterableWrapper<Node, Relationship> { private final Node fromNode; public RelationshipToNodeIterable( Iterable<Relationship> iterableToWrap, Node fromNode ) { super( iterableToWrap ); this.fromNode = fromNode; } @Override protecte...
false
community_shell_src_main_java_org_neo4j_shell_impl_RelationshipToNodeIterable.java
1,510
public class JLineConsole implements Console { private final Object consoleReader; static JLineConsole newConsoleOrNullIfNotFound( ShellClient client ) { try { Object consoleReader = Class.forName( "jline.ConsoleReader" ).newInstance(); consoleReader.getClass().getMethod( "setBellEnabled", Boolea...
false
community_shell_src_main_java_org_neo4j_shell_impl_JLineConsole.java
1,511
public class CollectingOutput extends UnicastRemoteObject implements Output, Serializable, Iterable<String> { private static final long serialVersionUID = 1L; private static final String lineSeparator = System.getProperty( "line.separator" ); private transient StringWriter stringWriter = new StringWriter()...
false
community_shell_src_main_java_org_neo4j_shell_impl_CollectingOutput.java
1,512
public class ClassLister { private static final String CLASS_NAME_ENDING = ".class"; /** * @param <T> the class type. * @param superClass the class which the resulting classes must implement * or extend. * @param lookInThesePackages an optional collection of which java packages * to search in. If null is ...
false
community_shell_src_main_java_org_neo4j_shell_impl_ClassLister.java
1,513
{ @Override public String getReplacement( ShellServer server, Session session ) throws ShellException { return "Hello"; } } );
false
community_shell_src_test_java_org_neo4j_shell_impl_BashVariableInterpreterTest.java
1,514
public class BashVariableInterpreterTest { @Test public void shouldInterpretDate() throws Exception { // WHEN String interpreted = interpreter.interpret( "Date:\\d", server, session ); // THEN String datePart = interpreted.substring( "Date:".length() ); asser...
false
community_shell_src_test_java_org_neo4j_shell_impl_BashVariableInterpreterTest.java
1,515
public static class StaticReplacer implements Replacer { private final String value; /** * @param value the value to return from * {@link #getReplacement(ShellServer, Session)}. */ public StaticReplacer( String value ) { this.value = value;...
false
community_shell_src_main_java_org_neo4j_shell_impl_BashVariableInterpreter.java
1,516
public static class HostReplacer implements Replacer { @Override public String getReplacement( ShellServer server, Session session ) { try { return server.getName(); } catch ( RemoteException e ) { ...
false
community_shell_src_main_java_org_neo4j_shell_impl_BashVariableInterpreter.java
1,517
public static class DateReplacer implements Replacer { private final DateFormat format; /** * @param format the date format, see {@link SimpleDateFormat}. */ public DateReplacer( String format ) { this.format = new SimpleDateFormat( format ); ...
false
community_shell_src_main_java_org_neo4j_shell_impl_BashVariableInterpreter.java
1,518
public class BashVariableInterpreter { private static final Map<String, Replacer> STATIC_REPLACERS = new HashMap<String, Replacer>(); static { STATIC_REPLACERS.put( "d", new DateReplacer( "EEE MMM dd" ) ); STATIC_REPLACERS.put( "h", new HostReplacer() ); STATIC_REPLACERS.put( "H", n...
false
community_shell_src_main_java_org_neo4j_shell_impl_BashVariableInterpreter.java
1,519
public abstract class AbstractClient implements ShellClient { public static final String WARN_UNTERMINATED_INPUT = "Warning: Exiting with unterminated multi-line input."; private static final Set<String> EXIT_COMMANDS = new HashSet<>( Arrays.asList( "exit", "quit", null ) ); private Con...
false
community_shell_src_main_java_org_neo4j_shell_impl_AbstractClient.java
1,520
public abstract class AbstractAppServer extends SimpleAppServer implements AppShellServer { private final Map<String, App> apps = new TreeMap<>(); /** * Constructs a new server. * @throws RemoteException if there's an RMI error. */ public AbstractAppServer() throws RemoteException { super(); ...
false
community_shell_src_main_java_org_neo4j_shell_impl_AbstractAppServer.java
1,521
public abstract class AbstractApp implements App { private final Map<String, OptionDefinition> optionDefinitions = new HashMap<>(); private AppShellServer server; @Override public String getName() { return this.getClass().getSimpleName().toLowerCase(); } @Override public OptionDefinition getOptionDef...
false
community_shell_src_main_java_org_neo4j_shell_impl_AbstractApp.java
1,522
static class ArgReader implements Iterator<String> { private static final int START_INDEX = -1; private int index = START_INDEX; private final String[] args; private Integer mark; ArgReader( String[] args ) { this.args = args; } @Override public boolean hasNext() { return this...
false
community_shell_src_main_java_org_neo4j_shell_apps_extra_ScriptExecutor.java
1,523
public class ShellBootstrap implements Serializable { private final boolean enable; private String host; private final int port; private final String name; private final boolean read_only; ShellBootstrap( Config config ) { this.enable = config.get( ShellSettings.remote_shell_enabled...
false
community_shell_src_main_java_org_neo4j_shell_impl_ShellBootstrap.java
1,524
@Service.Implementation(KernelExtensionFactory.class) public final class ShellServerExtensionFactory extends KernelExtensionFactory<ShellServerExtensionFactory.Dependencies> { static final String KEY = "shell"; public interface Dependencies { Config getConfig(); GraphDatabaseAPI getGraphDa...
false
community_shell_src_main_java_org_neo4j_shell_impl_ShellServerExtensionFactory.java
1,525
public class PathShellApp extends NonTransactionProvidingApp { { addOptionDefinition( "a", new OptionDefinition( OptionValueType.MUST, "Which algorithm to use" ) ); addOptionDefinition( "m", new OptionDefinition( OptionValueType.MUST, "Maximum depth to traverse" ) ); addOptionDefinition( "f"...
false
community_shell_src_main_java_org_neo4j_shell_apps_extra_PathShellApp.java
1,526
public final class ShellServerKernelExtension implements Lifecycle { private Config config; private GraphDatabaseAPI graphDatabaseAPI; private GraphDatabaseShellServer server; public ShellServerKernelExtension( Config config, GraphDatabaseAPI graphDatabaseAPI ) { this.config = config; ...
false
community_shell_src_main_java_org_neo4j_shell_impl_ShellServerKernelExtension.java
1,527
@Service.Implementation( App.class ) public class Cd extends TransactionProvidingApp { private static final String START_ALIAS = "start"; private static final String END_ALIAS = "end"; /** * Constructs a new cd application. */ public Cd() { this.addOptionDefinition( "a", new Optio...
false
community_shell_src_main_java_org_neo4j_shell_kernel_apps_Cd.java
1,528
@Service.Implementation(App.class) public class Begin extends NonTransactionProvidingApp { @Override public String getDescription() { return "Opens a transaction"; } @Override protected Continuation exec( AppCommandParser parser, Session session, Output out ) throws ShellExc...
false
community_shell_src_main_java_org_neo4j_shell_kernel_apps_Begin.java
1,529
private class ReadOnlySchemaProxy implements Schema { private final Schema actual; public ReadOnlySchemaProxy( Schema actual ) { this.actual = actual; } @Override public IndexCreator indexFor( Label label ) { throw readOnlyExcept...
false
community_shell_src_main_java_org_neo4j_shell_kernel_ReadOnlyGraphDatabaseProxy.java
1,530
private class ReadOnlyRelationshipProxy implements Relationship { private final Relationship actual; ReadOnlyRelationshipProxy( Relationship actual ) { this.actual = actual; } @Override public int hashCode() { return actual.hashCo...
false
community_shell_src_main_java_org_neo4j_shell_kernel_ReadOnlyGraphDatabaseProxy.java
1,531
class ReadOnlyRelationshipIndexProxy extends ReadOnlyIndexProxy<Relationship, RelationshipIndex> implements RelationshipIndex { ReadOnlyRelationshipIndexProxy( RelationshipIndex actual ) { super( actual ); } @Override Relationship wrap( Relationsh...
false
community_shell_src_main_java_org_neo4j_shell_kernel_ReadOnlyGraphDatabaseProxy.java
1,532
private class ReadOnlyNodeProxy implements Node { private final Node actual; ReadOnlyNodeProxy( Node actual ) { this.actual = actual; } @Override public int hashCode() { return actual.hashCode(); } @Override ...
false
community_shell_src_main_java_org_neo4j_shell_kernel_ReadOnlyGraphDatabaseProxy.java
1,533
class ReadOnlyNodeIndexProxy extends ReadOnlyIndexProxy<Node, Index<Node>> { ReadOnlyNodeIndexProxy( Index<Node> actual ) { super( actual ); } @Override Node wrap( Node actual ) { return readOnly( actual ); } @Override ...
false
community_shell_src_main_java_org_neo4j_shell_kernel_ReadOnlyGraphDatabaseProxy.java
1,534
abstract class ReadOnlyIndexProxy<T extends PropertyContainer, I extends Index<T>> implements Index<T> { final I actual; ReadOnlyIndexProxy( I actual ) { this.actual = actual; } abstract T wrap( T actual ); @Override public void ...
false
community_shell_src_main_java_org_neo4j_shell_kernel_ReadOnlyGraphDatabaseProxy.java
1,535
private static class ReadOnlyIndexHitsProxy<T extends PropertyContainer> implements IndexHits<T> { private final ReadOnlyIndexProxy<T, ?> index; private final IndexHits<T> actual; ReadOnlyIndexHitsProxy( ReadOnlyIndexProxy<T, ?> index, IndexHits<T> actual ) { ...
false
community_shell_src_main_java_org_neo4j_shell_kernel_ReadOnlyGraphDatabaseProxy.java
1,536
{ @Override protected Relationship underlyingObjectToObject( Relationship relationship ) { return new ReadOnlyRelationshipProxy( relationship ); } };
false
community_shell_src_main_java_org_neo4j_shell_kernel_ReadOnlyGraphDatabaseProxy.java
1,537
{ @Override protected Node underlyingObjectToObject( Node node ) { return new ReadOnlyNodeProxy( node ); } };
false
community_shell_src_main_java_org_neo4j_shell_kernel_ReadOnlyGraphDatabaseProxy.java
1,538
public class ReadOnlyGraphDatabaseProxy implements GraphDatabaseService, GraphDatabaseAPI, IndexManager { private final GraphDatabaseAPI actual; public ReadOnlyGraphDatabaseProxy( GraphDatabaseAPI graphDb ) { this.actual = graphDb; } public Node readOnly( Node actual ) { return...
false
community_shell_src_main_java_org_neo4j_shell_kernel_ReadOnlyGraphDatabaseProxy.java
1,539
public static class WorkingDirReplacer implements Replacer { @Override public String getReplacement( ShellServer server, Session session ) throws ShellException { try { return TransactionProvidingApp.getDisplayName( ...
false
community_shell_src_main_java_org_neo4j_shell_kernel_GraphDatabaseShellServer.java
1,540
public class GraphDatabaseShellServer extends AbstractAppServer { private final GraphDatabaseAPI graphDb; private boolean graphDbCreatedHere; protected final Map<Serializable, Transaction> transactions = new ConcurrentHashMap<Serializable, Transaction>(); /** * @throws RemoteException if an RMI er...
false
community_shell_src_main_java_org_neo4j_shell_kernel_GraphDatabaseShellServer.java
1,541
public class TestShellServerExtension extends KernelExtensionFactoryContractTest { public TestShellServerExtension() { super( ShellServerExtensionFactory.KEY, ShellServerExtensionFactory.class ); } @Override protected Map<String, String> configuration( boolean shouldLoad, int instan...
false
community_shell_src_test_java_org_neo4j_shell_impl_TestShellServerExtension.java
1,542
public class SystemOutput implements Output { private PrintWriter out; public SystemOutput() { try { out = new PrintWriter(new OutputStreamWriter(System.out,"UTF-8")); } catch (UnsupportedEncodingException e) { System.err.println("Unsupported encoding UTF-8, using "+Charset...
false
community_shell_src_main_java_org_neo4j_shell_impl_SystemOutput.java
1,543
public class StandardConsole implements Console { private BufferedReader consoleReader; /** * Prints a formatted string to the console (System.out). * @param format the string/format to print. * @param args values used in conjunction with {@code format}. */ public void format( String format, Object.....
false
community_shell_src_main_java_org_neo4j_shell_impl_StandardConsole.java
1,544
public abstract class SimpleAppServer implements ShellServer { private ShellServer remoteEndPoint; protected final BashVariableInterpreter bashInterpreter = new BashVariableInterpreter(); /** * The default RMI name for a shell server, * see {@link #makeRemotelyAvailable(int, String)}. */ public sta...
false
community_shell_src_main_java_org_neo4j_shell_impl_SimpleAppServer.java
1,545
@SuppressWarnings("UnusedDeclaration") /** * This class is instantiated by reflection (in {@link JLineConsole#newConsoleOrNullIfNotFound}) in order to ensure * that there is no hard dependency on jLine and the console can run in degraded form without it. */ class ShellTabCompletor implements Completor { private ...
false
community_shell_src_main_java_org_neo4j_shell_impl_ShellTabCompletor.java
1,546
public abstract class ScriptExecutor { protected abstract String getPathKey(); protected String getDefaultPaths() { return ".:src:src" + File.separator + "script"; } /** * Executes a groovy script (with arguments) defined in {@code line}. * @param line the line which defines the groovy script with argume...
false
community_shell_src_main_java_org_neo4j_shell_apps_extra_ScriptExecutor.java
1,547
private static class OutputWriter extends Writer { private Output out; OutputWriter( Output out ) { this.out = out; } @Override public Writer append( char c ) throws IOException { out.append( c ); return this; } @Override public Writer append( CharSequence csq, int start, int end...
false
community_shell_src_main_java_org_neo4j_shell_apps_extra_JshExecutor.java
1,548
@Service.Implementation(App.class) public class Commit extends NonTransactionProvidingApp { @Override public String getDescription() { return "Commits a transaction"; } private Transaction getCurrectTransaction() throws ShellException { try { return getServe...
false
community_shell_src_main_java_org_neo4j_shell_kernel_apps_Commit.java
1,549
public class TestConfiguration { private GraphDatabaseService db; private ShellClient client; @Before public void before() throws Exception { db = new TestGraphDatabaseFactory() .newImpermanentDatabaseBuilder() .setConfig( "enable_remote_shell", "true" ) ...
false
community_shell_src_test_java_org_neo4j_shell_TestConfiguration.java
1,550
public class TestApps extends AbstractShellTest { // TODO: FIX THIS BEFORE MERGE @Test @Ignore("I don't get how pwd is supposed to work, and subsequently don't grok how to fix this test.") public void variationsOfCdAndPws() throws Exception { Relationship[] relationships = createRelationshipChai...
false
community_shell_src_test_java_org_neo4j_shell_TestApps.java
1,551
public class TabCompletion implements Serializable { private final Collection<String> candidates; private final int cursor; public TabCompletion( Collection<String> candidates, int cursor ) { this.candidates = candidates; this.cursor = cursor; } public Collection<String> getCan...
false
community_shell_src_main_java_org_neo4j_shell_TabCompletion.java
1,552
public class StartDbWithShell { public static void main( String[] args ) throws Exception { String path = args.length > 0 ? args[0] : "target/test-data/shell-db"; GraphDatabaseService db = new GraphDatabaseFactory(). newEmbeddedDatabaseBuilder( path ). setConfig( ShellSet...
false
community_shell_src_test_java_org_neo4j_shell_StartDbWithShell.java
1,553
{ @Override protected void configure( GraphDatabaseBuilder builder ) { builder.setConfig( ShellSettings.remote_shell_enabled, Settings.TRUE ); } };
false
community_shell_src_test_java_org_neo4j_shell_StartClientTest.java
1,554
public class StartClientTest { @Rule public ImpermanentDatabaseRule db = new ImpermanentDatabaseRule() { @Override protected void configure( GraphDatabaseBuilder builder ) { builder.setConfig( ShellSettings.remote_shell_enabled, Settings.TRUE ); } }; @Tes...
false
community_shell_src_test_java_org_neo4j_shell_StartClientTest.java
1,555
{ @Override public void run() { shutdownIfNecessary( server ); } } );
false
community_shell_src_main_java_org_neo4j_shell_StartClient.java
1,556
public class StartClient { private AtomicBoolean hasBeenShutdown = new AtomicBoolean(); /** * The path to the local (this JVM) {@link GraphDatabaseService} to * start and connect to. */ public static final String ARG_PATH = "path"; /** * Whether or not the shell client should be re...
false
community_shell_src_main_java_org_neo4j_shell_StartClient.java
1,557
public class SilentLocalOutput implements Output { @Override public Appendable append( CharSequence csq ) throws IOException { return this; } @Override public Appendable append( CharSequence csq, int start, int end ) throws IOException { return this; } @Override ...
false
community_shell_src_test_java_org_neo4j_shell_SilentLocalOutput.java
1,558
@Description( "Settings for the remote shell extension" ) public class ShellSettings { @Description("Enable a remote shell server which shell clients can log in to") public static final Setting<Boolean> remote_shell_enabled = setting( "remote_shell_enabled", BOOLEAN, FALSE ); public static final Setting<St...
false
community_shell_src_main_java_org_neo4j_shell_ShellSettings.java
1,559
public abstract class ShellLobby { public static final Map<String, Serializable> NO_INITIAL_SESSION = Collections.unmodifiableMap( Collections.<String,Serializable>emptyMap() ); /** * To get rid of the RemoteException, uses a constructor without arguments. * @param cls the class of the server ...
false
community_shell_src_main_java_org_neo4j_shell_ShellLobby.java
1,560
public class ShellException extends Exception { private static final long serialVersionUID = 1L; private final String stackTraceAsString; public ShellException( String message ) { this( message, (String) null ); } private ShellException( String message, Throwable cause ) { super( messa...
false
community_shell_src_main_java_org_neo4j_shell_ShellException.java
1,561
public class ShellDocTest { private final static String NL = System.getProperty( "line.separator" ); private AppCommandParser parse( final String line ) throws Exception { return new AppCommandParser( new GraphDatabaseShellServer( null ), line ); } @Test public void testParserEasy() th...
false
community_shell_src_test_java_org_neo4j_shell_ShellDocTest.java
1,562
public class SessionTest { private Session session; @Before public void setUp() throws Exception { session = new Session( 1 ); } @Test(expected = ShellException.class) public void cannotSetInvalidVariableName() throws ShellException { session.set( "foo bar", 42 ); }...
false
community_shell_src_test_java_org_neo4j_shell_SessionTest.java
1,563
public class Session { private final Serializable id; private final Map<String, Object> properties = new HashMap<String, Object>(); private final Map<String, String> aliases = new HashMap<String, String>(); public Session( Serializable id ) { this.id = id; } public Serializable...
false
community_shell_src_main_java_org_neo4j_shell_Session.java
1,564
public class ServerClientInteractionTest { private GraphDatabaseAPI db; @Test public void shouldConsiderAndInterpretCustomClientPrompt() throws Exception { // GIVEN client.setSessionVariable( PROMPT_KEY, "MyPrompt \\d \\t$ " ); // WHEN Response response = serve...
false
community_shell_src_test_java_org_neo4j_shell_ServerClientInteractionTest.java
1,565
public class Response implements Serializable { private final String prompt; private final Continuation continuation; public Response( String prompt, Continuation continuation ) { this.prompt = prompt; this.continuation = continuation; } public String getPrompt() { ...
false
community_shell_src_main_java_org_neo4j_shell_Response.java
1,566
public class OutputAsWriterTest { private PrintStream out; private ByteArrayOutputStream buffer; private SystemOutput output; private OutputAsWriter writer; @Before public void setUp() throws Exception { out = System.out; buffer = new ByteArrayOutputStream(); System...
false
community_shell_src_test_java_org_neo4j_shell_OutputAsWriterTest.java
1,567
public class OutputAsWriter extends Writer { private final static String LINE_SEPARATOR = System.getProperty( "line.separator" ); private final Output out; public OutputAsWriter( Output out ) { this.out = out; } @Override public void write( char[] cbuf, int off, int len ) throws IO...
false
community_shell_src_main_java_org_neo4j_shell_OutputAsWriter.java
1,568
public class OptionDefinition { private OptionValueType type; private String description; /** * @param type the type for the option. * @param description the description of the option. */ public OptionDefinition( OptionValueType type, String description ) { this.type = ty...
false
community_shell_src_main_java_org_neo4j_shell_OptionDefinition.java
1,569
public class TestClientReconnect extends AbstractShellTest { @Test public void remoteClientAbleToReconnectAndContinue() throws Exception { makeServerRemotelyAvailable(); ShellClient client = newRemoteClient(); executeCommand( client, "help", "Available commands" ); restartSer...
false
community_shell_src_test_java_org_neo4j_shell_TestClientReconnect.java
1,570
public class TestReadOnlyServer extends AbstractShellTest { @Override protected ShellServer newServer( GraphDatabaseAPI db ) throws ShellException, RemoteException { return new GraphDatabaseShellServer( new ReadOnlyGraphDatabaseProxy( db ) ); } @Test public void executeReadCommands() th...
false
community_shell_src_test_java_org_neo4j_shell_TestReadOnlyServer.java
1,571
public class JshExecutor extends ScriptExecutor { static { String jythonSystemVariableName = "python.home"; if ( System.getProperty( jythonSystemVariableName ) == null ) { String variable = tryFindEnvironmentVariable( "JYTHON_HOME", "JYTHONHOME", "JYTHON", "PYTHON_HOME", "PYTHONHOME", "PYTHON" ); vari...
false
community_shell_src_main_java_org_neo4j_shell_apps_extra_JshExecutor.java
1,572
public class TestRmiPublication { @Test public void jvmShouldDieEvenIfWeLeaveSamveJvmClientIsLeftHanging() throws Exception { assertEquals( 0, spawnJvm( DontShutdownClient.class, "client" ) ); } @Test public void jvmShouldDieEvenIfLocalServerIsLeftHanging() throws Exception { ...
false
community_shell_src_test_java_org_neo4j_shell_TestRmiPublication.java
1,573
public class Jsh extends AbstractApp { public Continuation execute( AppCommandParser parser, Session session, Output out ) throws Exception { String line = parser.getLineWithoutApp(); new JshExecutor().execute( line, session, out ); return Continuation.INPUT_COMPLETE; } @Override public String getDescript...
false
community_shell_src_main_java_org_neo4j_shell_apps_extra_Jsh.java
1,574
public static class GshOutput implements Output { private Output source; GshOutput( Output output ) { this.source = output; } public void print( Serializable object ) throws RemoteException { source.print( object ); } public void println( Serializable object ) throws RemoteException { ...
false
community_shell_src_main_java_org_neo4j_shell_apps_extra_GshExecutor.java
1,575
public class GshExecutor extends ScriptExecutor { private static final String BINDING_CLASS = "groovy.lang.Binding"; private static final String ENGINE_CLASS = "groovy.util.GroovyScriptEngine"; @Override protected String getDefaultPaths() { return super.getDefaultPaths() + ":" + "src" +...
false
community_shell_src_main_java_org_neo4j_shell_apps_extra_GshExecutor.java
1,576
public class Gsh extends AbstractApp { public Continuation execute( AppCommandParser parser, Session session, Output out ) throws Exception { String line = parser.getLineWithoutApp(); new GshExecutor().execute( line, session, out ); return Continuation.INPUT_COMPLETE; } @Override public String getDescrip...
false
community_shell_src_main_java_org_neo4j_shell_apps_extra_Gsh.java
1,577
public class NoopApp extends AbstractApp { @Override public Continuation execute( AppCommandParser parser, Session session, Output out ) throws Exception { return Continuation.INPUT_COMPLETE; } }
false
community_shell_src_main_java_org_neo4j_shell_apps_NoopApp.java
1,578
@Service.Implementation( App.class ) public class Man extends AbstractApp { public static final int CONSOLE_WIDTH = 80; private static Collection<String> availableCommands; public Man() { addOptionDefinition( "l", new OptionDefinition( OptionValueType.NONE, "Display the com...
false
community_shell_src_main_java_org_neo4j_shell_apps_Man.java
1,579
@Service.Implementation( App.class ) public class Help extends Man { }
false
community_shell_src_main_java_org_neo4j_shell_apps_Help.java
1,580
@Service.Implementation(App.class) public class Export extends AbstractApp { @Override public String getDescription() { return "Sets an environment variable. Usage: export <key>=<value>\n" + "F.ex: export NAME=\"Mattias Persson\". Variable names have " + "to be valid ...
false
community_shell_src_main_java_org_neo4j_shell_apps_Export.java
1,581
@Service.Implementation( App.class ) public class Env extends AbstractApp { @Override public String getDescription() { return "Lists all environment variables"; } public Continuation execute( AppCommandParser parser, Session session, Output out ) throws Exception { for ( String key : session.keys() ) { ...
false
community_shell_src_main_java_org_neo4j_shell_apps_Env.java
1,582
@Service.Implementation(App.class) public class Alias extends AbstractApp { @Override public String getDescription() { return "Adds an alias so that it can be used later as a command.\n" + "Usage: alias <key>=<value>"; } public Continuation execute( AppCommandParser parser,...
false
community_shell_src_main_java_org_neo4j_shell_apps_Alias.java
1,583
public class Welcome implements Serializable { private final String message; private final Serializable id; private final String prompt; public Welcome( String message, Serializable id, String prompt ) { this.message = message; this.id = id; this.prompt = prompt; } ...
false
community_shell_src_main_java_org_neo4j_shell_Welcome.java
1,584
public class Variables { /** * The {@link org.neo4j.shell.Session} key to use to store the current node and working * directory (i.e. the path which the client got to it). */ public static final String WORKING_DIR_KEY = "WORKING_DIR"; public static final String CURRENT_KEY = "CURRENT_DIR"; ...
false
community_shell_src_main_java_org_neo4j_shell_Variables.java
1,585
private abstract class Tester implements Runnable { private final String name; ShellClient client; private boolean alive = true; private Exception exception = null; protected Tester( String name ) { this.name = name; try { ...
false
community_shell_src_test_java_org_neo4j_shell_TransactionSoakIT.java
1,586
private class Rollbacker extends Tester { private Rollbacker( String name ) { super( name ); } @Override protected void doStuff() throws Exception { execute( "begin transaction" ); execute( "create (a {name:'a'}), (b {name:'b'}...
false
community_shell_src_test_java_org_neo4j_shell_TransactionSoakIT.java
1,587
private class Reader extends Tester { public Reader( String name ) { super(name); } @Override protected void doStuff() throws Exception { execute( "match n return count(n.name);" ); } }
false
community_shell_src_test_java_org_neo4j_shell_TransactionSoakIT.java
1,588
private class Committer extends Tester { private int count = 0; private Committer( String name ) { super( name ); } @Override protected void doStuff() throws Exception { execute( "begin transaction" ); execute( "create...
false
community_shell_src_test_java_org_neo4j_shell_TransactionSoakIT.java
1,589
@Ignore("Jake 2013-09-13: Exposes bug that will be fixed by kernel API") public class TransactionSoakIT { protected GraphDatabaseAPI db; private ShellServer server; private final Random r = new Random( System.currentTimeMillis() ); @Before public void doBefore() throws Exception { db = ...
false
community_shell_src_test_java_org_neo4j_shell_TransactionSoakIT.java
1,590
public class TextUtil { public static String templateString( String templateString, Map<String, ? extends Object> data ) { return templateString( templateString, "\\$", data ); } public static String templateString( String templateString, String variablePrefix, Map<S...
false
community_shell_src_main_java_org_neo4j_shell_TextUtil.java
1,591
public class TestTransactionApps { protected GraphDatabaseAPI db; private FakeShellServer shellServer; private ShellClient shellClient; @Before public void doBefore() throws Exception { db = (GraphDatabaseAPI)new TestGraphDatabaseFactory().newImpermanentDatabase(); shellServer =...
false
community_shell_src_test_java_org_neo4j_shell_TestTransactionApps.java
1,592
public class CdTest { @Test public void shouldProvideTabCompletions() throws Exception { // GIVEN Node root = createNodeWithSomeSubNodes( "Mattias", "Magnus", "Tobias" ); Cd app = (Cd) server.findApp( "cd" ); app.execute( new AppCommandParser( server, "cd -a " + root.getId() ...
false
community_shell_src_test_java_org_neo4j_shell_kernel_apps_CdTest.java
1,593
public class Dbinfo extends NonTransactionProvidingApp { { addOptionDefinition( "l", new OptionDefinition( OptionValueType.MAY, "List available attributes for the specified bean. " + "Including a description about each attribute." ) ); addOptionDefinition( "g"...
false
community_shell_src_main_java_org_neo4j_shell_kernel_apps_Dbinfo.java
1,594
public class DontShutdownLocalServer { public static void main( String[] args ) throws Exception { GraphDatabaseShellServer server = new GraphDatabaseShellServer( args[0], false, null ); // Intentionally don't shutdown the server } }
false
community_shell_src_test_java_org_neo4j_shell_DontShutdownLocalServer.java
1,595
public class AssertEventually { public static void assertEventually( String message, int timeoutSeconds, Condition condition ) { long startTime = System.currentTimeMillis(); while ( ! condition.evaluate() ) { long currentTime = System.currentTimeMillis(); if ( cur...
false
community_kernel_src_test_java_org_neo4j_test_AssertEventually.java
1,596
public class Progressor { private final long nanos; private Progressor( long nanos ) { this.nanos = nanos; } public void tick() { progress( nanos ); } }
false
community_kernel_src_test_java_org_neo4j_test_ArtificialClock.java
1,597
public class ArtificialClock implements Clock { private volatile long currentTimeNanos; @Override public long currentTimeMillis() { return NANOSECONDS.toMillis( currentTimeNanos ); } public Progressor progressor( long time, TimeUnit unit ) { return new Progressor( unit.toNa...
false
community_kernel_src_test_java_org_neo4j_test_ArtificialClock.java
1,598
{ @Override public NEXT apply( FROM from ) { return function.apply( AlgebraicFunction.this.apply( from ) ); } };
false
community_kernel_src_test_java_org_neo4j_test_AlgebraicFunction.java
1,599
public abstract class AlgebraicFunction<FROM, TO> implements Function<FROM, TO> { public <NEXT> AlgebraicFunction<FROM, NEXT> then( final Function<TO, NEXT> function ) { return new AlgebraicFunction<FROM, NEXT>( repr + " then " + function.toString() ) { @Override public N...
false
community_kernel_src_test_java_org_neo4j_test_AlgebraicFunction.java