Unnamed: 0 int64 0 6.7k | func stringlengths 12 89.6k | target bool 2
classes | project stringlengths 45 151 |
|---|---|---|---|
1,700 | public class WhiteListClassShutter implements ClassShutter
{
private Set<String> whiteList;
public WhiteListClassShutter(Set<String> whiteList)
{
this.whiteList = whiteList;
}
@Override
public boolean visibleToScripts( String className )
{
return whiteList.contains( classN... | false | community_server_src_main_java_org_neo4j_server_scripting_javascript_WhiteListClassShutter.java |
1,701 | public class TestWhiteListJavaWrapper
{
@After
public void exitContext()
{
try {
Context.exit();
} catch (IllegalStateException e)
{
// Om nom nom
}
}
@Test(expected = SecurityException.class)
public void shouldBlockAttemptsAtAccessingCla... | false | community_server_src_test_java_org_neo4j_server_scripting_javascript_TestWhiteListJavaWrapper.java |
1,702 | public class TestWhiteListClassShutter
{
@Test
public void shouldAllowWhiteListedClasses() throws Exception
{
// Given
Set<String> whiteList = new HashSet<String>();
whiteList.add( getClass().getName() );
WhiteListClassShutter shutter = new WhiteListClassShutter(whiteList);
... | false | community_server_src_test_java_org_neo4j_server_scripting_javascript_TestWhiteListClassShutter.java |
1,703 | public class TestJavascriptSecurityRestrictions
{
public static void methodThatShouldNotBeCallable()
{
}
@BeforeClass
public static void doBullshitGlobalStateCrap()
{
GlobalJavascriptInitializer.initialize( GlobalJavascriptInitializer.Mode.SANDBOXED );
}
@Test
public void... | false | community_server_src_test_java_org_neo4j_server_scripting_javascript_TestJavascriptSecurityRestrictions.java |
1,704 | public class TestJavascriptExecutor
{
@Test
public void shouldExecuteBasicScript() throws Exception
{
// Given
JavascriptExecutor executor = new JavascriptExecutor( "1337;" );
// When
Object out = executor.execute( null );
// Then
assertThat( out, not(nullV... | false | community_server_src_test_java_org_neo4j_server_scripting_javascript_TestJavascriptExecutor.java |
1,705 | public class TestGlobalJavascriptInitializer
{
@Test(expected = RuntimeException.class )
public void shouldNotAllowChangingMode() throws Exception
{
// Given
GlobalJavascriptInitializer.initialize( GlobalJavascriptInitializer.Mode.SANDBOXED );
// When
GlobalJavascriptInitia... | false | community_server_src_test_java_org_neo4j_server_scripting_javascript_TestGlobalJavascriptInitializer.java |
1,706 | public static class Factory implements ScriptExecutor.Factory
{
/**
* Note that you can set sandbox/no sandbox once, after that it is globally defined
* for the JVM. If you create a new factory with a different sandboxing setting, an
* exception will be thrown.
*
... | false | community_server_src_main_java_org_neo4j_server_scripting_javascript_JavascriptExecutor.java |
1,707 | public class StatisticStartupListener implements LifeCycle.Listener
{
private final Server jetty;
private final FilterHolder holder;
private final ConsoleLogger log;
public StatisticStartupListener( Server jetty, StatisticFilter statisticFilter, Logging logging )
{
this.jetty = jetty;
... | false | community_server_src_main_java_org_neo4j_server_statistic_StatisticStartupListener.java |
1,708 | {
@Override
public Node getNodeById( long id )
{
try
{
Thread.sleep( wait );
} catch ( InterruptedException e )
{
throw new RuntimeException( e );
}
... | false | community_server_src_test_java_org_neo4j_server_web_ExecutionTimeLimitTest.java |
1,709 | {
protected Context makeContext()
{
Context cx = super.makeContext();
ClassShutter shutter = new WhiteListClassShutter( UserScriptClassWhiteList.getWhiteList() );
cx.setLanguageVersion( Cont... | false | community_server_src_main_java_org_neo4j_server_scripting_javascript_GlobalJavascriptInitializer.java |
1,710 | @Path( HelloWorldWebResource.ROOT_PATH )
public class HelloWorldWebResource
{
public static final String ROOT_PATH = "/greeting";
@Consumes( "text/plain" )
@Produces( "text/plain" )
@POST
public Response sayHello( String name )
{
return Response.ok()
.entity( "hello, " +... | false | community_server_src_test_java_org_neo4j_server_web_HelloWorldWebResource.java |
1,711 | @Provider
public class WebServerProvider extends InjectableProvider<WebServer>
{
private final WebServer server;
public WebServerProvider( WebServer server )
{
super( WebServer.class );
this.server = server;
}
@Override
public WebServer getValue( HttpContext c )
{
... | false | community_server_src_main_java_org_neo4j_server_web_WebServerProvider.java |
1,712 | {
}; | false | community_server_src_test_java_org_neo4j_server_web_TestJetty9WebServer.java |
1,713 | {
@Override
public <T> T resolveDependency( Class<T> type, SelectionStrategy selector )
throws IllegalArgumentException
{
if ( Logging.class.isAssignableFrom( type ) )
{
return type.cast( DevNullLoggingSe... | false | community_server_src_test_java_org_neo4j_server_web_TestJetty9WebServer.java |
1,714 | @Path("/")
public class TestJetty9WebServer {
@GET
public Response index()
{
return Response.status( Status.NO_CONTENT )
.build();
}
@Test
public void shouldBeAbleToRestart() throws Throwable
{
// TODO: This is needed because WebServer has a cyclic
// dependency to NeoServer, which should... | false | community_server_src_test_java_org_neo4j_server_web_TestJetty9WebServer.java |
1,715 | public class SimpleUriBuilder {
public URI buildURI(String address, int port, boolean isSsl)
{
StringBuilder sb = new StringBuilder();
sb.append( "http" );
if ( isSsl )
{
sb.append( "s" );
}
sb.append( "://" );
sb.append( address );... | false | community_server_src_main_java_org_neo4j_server_web_SimpleUriBuilder.java |
1,716 | @SuppressWarnings( "serial" )
public class NeoServletContainer extends ServletContainer
{
private final Collection<InjectableProvider<?>> injectables;
public NeoServletContainer( Collection<InjectableProvider<?>> injectables )
{
this.injectables = injectables;
}
@Override
protected voi... | false | community_server_src_main_java_org_neo4j_server_web_NeoServletContainer.java |
1,717 | public class NeoJettyErrorHandler extends ErrorHandler
{
@Override
protected void handleErrorPage(HttpServletRequest request, Writer writer, int code,
String message) throws IOException
{
writeErrorPage(request, writer, code, message, false);
}
@Override
... | false | community_server_src_main_java_org_neo4j_server_web_NeoJettyErrorHandler.java |
1,718 | {
@Override
public void run()
{
try
{
cb.await();
}
catch ( InterruptedException e )
{
e.printStackTrace();
... | false | community_server_src_test_java_org_neo4j_server_web_JettyThreadLimitTest.java |
1,719 | public class JettyThreadLimitTest
{
@Rule
public Mute mute = muteAll();
@Test
public void shouldHaveConfigurableJettyThreadPoolSize() throws Exception
{
Jetty9WebServer server = new Jetty9WebServer( DevNullLoggingService.DEV_NULL );
final int maxThreads = 7;
server.setMaxThre... | false | community_server_src_test_java_org_neo4j_server_web_JettyThreadLimitTest.java |
1,720 | public class JettyLifeCycleListenerAdapter implements LifeCycle.Listener
{
@Override
public void lifeCycleStopping( LifeCycle arg0 )
{
}
@Override
public void lifeCycleStopped( LifeCycle arg0 )
{
}
@Override
public void lifeCycleStarting( LifeCycle arg0 )
{
}
@Over... | false | community_server_src_main_java_org_neo4j_server_web_JettyLifeCycleListenerAdapter.java |
1,721 | private static class FilterDefinition
{
private final Filter filter;
private final String pathSpec;
public FilterDefinition(Filter filter, String pathSpec)
{
this.filter = filter;
this.pathSpec = pathSpec;
}
public boolean matches(Filter filter, String pathSpec)
{
return filter == this.fil... | false | community_server_src_main_java_org_neo4j_server_web_Jetty9WebServer.java |
1,722 | {
@Override
public int compare( final String o1, final String o2 )
{
return o2.compareTo( o1 );
}
} ); | false | community_server_src_main_java_org_neo4j_server_web_Jetty9WebServer.java |
1,723 | public class Jetty9WebServer implements WebServer
{
private boolean wadlEnabled;
private Collection<InjectableProvider<?>> defaultInjectables;
private static class FilterDefinition
{
private final Filter filter;
private final String pathSpec;
public FilterDefinition(Filter filter, String pathSpec)
... | false | community_server_src_main_java_org_neo4j_server_web_Jetty9WebServer.java |
1,724 | public static class Packages extends JaxRsServletHolderFactory
{
@Override
protected void configure( ServletHolder servletHolder, String packages )
{
servletHolder.setInitParameter( PackagesResourceConfig.PROPERTY_PACKAGES, packages );
}
} | false | community_server_src_main_java_org_neo4j_server_web_JaxRsServletHolderFactory.java |
1,725 | public static class Classes extends JaxRsServletHolderFactory
{
@Override
protected void configure( ServletHolder servletHolder, String classes )
{
servletHolder.setInitParameter( ClassNamesResourceConfig.PROPERTY_CLASSNAMES, classes );
}
} | false | community_server_src_main_java_org_neo4j_server_web_JaxRsServletHolderFactory.java |
1,726 | public abstract class JaxRsServletHolderFactory
{
private final List<String> items = new ArrayList<String>();
private final List<Injectable<?>> injectables = new ArrayList<Injectable<?>>();
public void add( List<String> items, Collection<Injectable<?>> injectableProviders )
{
this.items.addAll(... | false | community_server_src_main_java_org_neo4j_server_web_JaxRsServletHolderFactory.java |
1,727 | @Provider
public class InjectableWrapper extends InjectableProvider<Object>
{
private final Injectable injectable;
public InjectableWrapper( Injectable injectable )
{
super( injectable.getType() );
this.injectable = injectable;
}
@Override
public Object getValue( HttpContext c ... | false | community_server_src_main_java_org_neo4j_server_web_InjectableWrapper.java |
1,728 | public class HttpHeaderUtils {
private static final String UTF8 = "UTF-8";
public static final Map<String, String> CHARSET = Collections.singletonMap("charset", UTF8);
public static MediaType mediaTypeWithCharsetUtf8(String mediaType)
{
return new MediaType(mediaType, null, CHARSET);
}
... | false | community_server_src_main_java_org_neo4j_server_web_HttpHeaderUtils.java |
1,729 | public class HttpConnectorFactory
{
public ConnectionFactory createHttpConnectionFactory()
{
HttpConfiguration httpConfig = new HttpConfiguration();
httpConfig.setRequestHeaderSize( 20 * 1024 );
httpConfig.setResponseHeaderSize( 20 * 1024 );
return new HttpConnectionFactory( htt... | false | community_server_src_main_java_org_neo4j_server_web_HttpConnectorFactory.java |
1,730 | public class JavascriptExecutor implements ScriptExecutor
{
private final Scriptable prototype;
private final Script compiledScript;
public static class Factory implements ScriptExecutor.Factory
{
/**
* Note that you can set sandbox/no sandbox once, after that it is globally defined
... | false | community_server_src_main_java_org_neo4j_server_scripting_javascript_JavascriptExecutor.java |
1,731 | {
protected Context makeContext()
{
Context cx = super.makeContext();
cx.setLanguageVersion( Context.VERSION_1_7 );
// TODO: This goes up to 9, do performance tests to determine appropriate le... | false | community_server_src_main_java_org_neo4j_server_scripting_javascript_GlobalJavascriptInitializer.java |
1,732 | {
public boolean evaluate()
{
return occursIn( query, new File( logDirectory, "http.log" ) );
}
} ); | false | community_server_src_test_java_org_neo4j_server_web_logging_HTTPLoggingDocIT.java |
1,733 | private static class NullJobScheduler implements JobScheduler
{
@Override
public void scheduleAtFixedRate( Runnable job, String name, long delay, long period )
{
}
} | false | community_server_src_test_java_org_neo4j_server_rrd_RrdFactoryTest.java |
1,734 | {
@Override
public RrdDb get()
{
return db;
}
@Override
public void close() throws IOException
{
try
{
db.close();
}
... | false | community_server_src_main_java_org_neo4j_server_rrd_RrdFactory.java |
1,735 | {
@Override
public void run()
{
try
{
FileUtils.deleteRecursively(tempFile);
}
catch ( IOException e )
{
// Ignore
}
}
}... | false | community_server_src_main_java_org_neo4j_server_rrd_RrdFactory.java |
1,736 | public class RrdFactory
{
public static final int STEP_SIZE = 1;
private static final String RRD_THREAD_NAME = "Statistics Gatherer";
private final Configuration config;
private final ConsoleLogger log;
public RrdFactory( Configuration config, Logging logging )
{
this.config = config;
... | false | community_server_src_main_java_org_neo4j_server_rrd_RrdFactory.java |
1,737 | @Provider
public class RrdDbProvider extends InjectableProvider<RrdDb>
{
private final RrdDbWrapper rrdDbWrapper;
public RrdDbProvider( RrdDbWrapper rrdDbWrapper )
{
super( RrdDb.class );
this.rrdDbWrapper = rrdDbWrapper;
}
@Override
public RrdDb getValue( HttpContext c )
{... | false | community_server_src_main_java_org_neo4j_server_rrd_RrdDbProvider.java |
1,738 | public class RelationshipCountSampleableTest
{
public GraphDatabaseAPI db;
public RelationshipCountSampleable sampleable;
@Test
public void emptyDbHasZeroRelationships()
{
assertThat( sampleable.getValue(), is( 0d ) );
}
@Test
public void addANodeAndSampleableGoesUp()
{
... | false | community_server_src_test_java_org_neo4j_server_rrd_RelationshipCountSampleableTest.java |
1,739 | {
@Override
public String name()
{
return "knows_about";
}
} ); | false | community_server_src_test_java_org_neo4j_server_rrd_PropertyCountSampleableTest.java |
1,740 | public class PropertyCountSampleableTest
{
public Database db;
public PropertyCountSampleable sampleable;
public long referenceNodeId;
@Before
public void setupReferenceNode()
{
db = new WrappedDatabase( (AbstractGraphDatabase) new TestGraphDatabaseFactory().newImpermanentDatabase() );
... | false | community_server_src_test_java_org_neo4j_server_rrd_PropertyCountSampleableTest.java |
1,741 | public class NodeIdsInUseSampleableTest
{
public GraphDatabaseAPI db;
public NodeIdsInUseSampleable sampleable;
@Test
public void emptyDbHasZeroNodesInUse()
{
assertThat( sampleable.getValue(), is( 0d ) );
}
@Test
public void addANodeAndSampleableGoesUp()
{
double o... | false | community_server_src_test_java_org_neo4j_server_rrd_NodeIdsInUseSampleableTest.java |
1,742 | public class MemoryUsedSampleableTest
{
MemoryUsedSampleable sampleable;
@Before
public void setUp() throws Exception
{
sampleable = new MemoryUsedSampleable();
}
@Test
public void memoryUsageIsBetweenZeroAndOneHundred()
{
assertThat( sampleable.getValue(), greaterThan... | false | community_server_src_test_java_org_neo4j_server_rrd_MemoryUsedSampleableTest.java |
1,743 | public class DatabasePrimitivesSampleableBaseDocTest
{
@Test
public void sampleTest() throws MalformedObjectNameException, IOException
{
GraphDatabaseAPI db = (GraphDatabaseAPI)new TestGraphDatabaseFactory().newImpermanentDatabase();
DatabasePrimitivesSampleableBase sampleable = new... | false | community_server_src_test_java_org_neo4j_server_rrd_DatabasePrimitivesSampleableBaseDocTest.java |
1,744 | public class WebHelper
{
private final URI baseUri;
private final GraphDbHelper helper;
public WebHelper( URI baseUri, Database database )
{
this.baseUri = baseUri;
this.helper = new GraphDbHelper( database );
}
public URI createNode()
{
long nodeId = helper.create... | false | community_server_src_test_java_org_neo4j_server_rest_web_WebHelper.java |
1,745 | public static class TransactionUriBuilder implements TransactionUriScheme
{
private final UriInfo uriInfo;
public TransactionUriBuilder( UriInfo uriInfo )
{
this.uriInfo = uriInfo;
}
@Override
public URI txUri( long id )
{
return ... | false | community_server_src_main_java_org_neo4j_server_rest_web_TransactionalService.java |
1,746 | {
@Override
public void write( OutputStream output ) throws IOException, WebApplicationException
{
ExecutionResultSerializer serializer = facade.serializer( output );
serializer.errors( asList( neo4jError ) );
serializer.finish(... | false | community_server_src_main_java_org_neo4j_server_rest_web_TransactionalService.java |
1,747 | {
@Override
public void write( OutputStream output ) throws IOException, WebApplicationException
{
transactionHandle.rollback( facade.serializer( output ) );
}
}; | false | community_server_src_main_java_org_neo4j_server_rest_web_TransactionalService.java |
1,748 | {
@Override
public void write( OutputStream output ) throws IOException, WebApplicationException
{
transactionHandle.commit( facade.deserializer( input ), facade.serializer( output ) );
}
}; | false | community_server_src_main_java_org_neo4j_server_rest_web_TransactionalService.java |
1,749 | {
@Override
public void write( OutputStream output ) throws IOException, WebApplicationException
{
transactionHandle.execute( facade.deserializer( input ), facade.serializer( output ) );
}
}; | false | community_server_src_main_java_org_neo4j_server_rest_web_TransactionalService.java |
1,750 | @Path("/transaction")
public class TransactionalService
{
private final TransactionFacade facade;
private final TransactionUriScheme uriScheme;
public TransactionalService( @Context TransactionFacade facade, @Context UriInfo uriInfo )
{
this.facade = facade;
this.uriScheme = new Transac... | false | community_server_src_main_java_org_neo4j_server_rest_web_TransactionalService.java |
1,751 | public class TransactionWrappingRestfulGraphDatabase extends RestfulGraphDatabase
{
private final AbstractGraphDatabase graph;
private final RestfulGraphDatabase restfulGraphDatabase;
public TransactionWrappingRestfulGraphDatabase( AbstractGraphDatabase graph,
... | false | community_server_src_test_java_org_neo4j_server_rest_web_TransactionWrappingRestfulGraphDatabase.java |
1,752 | public class TransactionWrappedDatabaseActions extends DatabaseActions
{
private final GraphDatabaseAPI graph;
public TransactionWrappedDatabaseActions( LeaseManager leaseManager, ForceMode forced, GraphDatabaseAPI graph )
{
super( leaseManager, forced, graph );
this.graph = graph;
}
... | false | community_server_src_test_java_org_neo4j_server_rest_web_TransactionWrappedDatabaseActions.java |
1,753 | public class RrdFactoryTest
{
private Configuration config;
private Database db;
TargetDirectory target = TargetDirectory.forTest( RrdFactoryTest.class );
@Rule
public TargetDirectory.TestDirectory testDirectory = target.testDirectory();
@Rule
public Mute mute = muteAll();
@Before
... | false | community_server_src_test_java_org_neo4j_server_rrd_RrdFactoryTest.java |
1,754 | private static class TestableRrdFactory extends RrdFactory
{
public String directoryUsed;
private final String tempRrdFile;
public TestableRrdFactory( Configuration config, String tempRrdFile )
{
super( config, DevNullLoggingService.DEV_NULL );
this.tempR... | false | community_server_src_test_java_org_neo4j_server_rrd_RrdFactoryTest.java |
1,755 | public class GlobalJavascriptInitializer
{
private static Mode initializationMode;
public static enum Mode
{
SANDBOXED,
UNSAFE
}
public static synchronized void initialize(Mode requestedMode)
{
if(initializationMode != null)
{
if(initializationMode ... | false | community_server_src_main_java_org_neo4j_server_scripting_javascript_GlobalJavascriptInitializer.java |
1,756 | public class RrdJob implements Runnable {
private static final long MIN_STEP_TIME = 1;
private RrdSampler[] sampler;
private long lastRun = 0;
private TimeSource timeSource;
public RrdJob(RrdSampler... sampler) {
this(new SystemBackedTimeSource(), sampler);
}
public RrdJob(TimeSou... | false | community_server_src_main_java_org_neo4j_server_rrd_RrdJob.java |
1,757 | public class UserScriptClassWhiteList
{
public static Set<String> getWhiteList()
{
HashSet<String> safe = new HashSet<String>();
// Core API concepts
safe.add( Path.class.getName() );
safe.add( Node.class.getName() );
safe.add( Relationship.class.getName() );
s... | false | community_server_src_main_java_org_neo4j_server_scripting_UserScriptClassWhiteList.java |
1,758 | public class TestScriptExecutorFactoryRepository
{
@Test(expected = NoSuchScriptLanguageException.class)
public void shouldThrowNoSuchScriptLanguageExceptionForUnkownLanguages() throws Exception
{
// Given
ScriptExecutorFactoryRepository repo = new ScriptExecutorFactoryRepository( new HashM... | false | community_server_src_test_java_org_neo4j_server_scripting_TestScriptExecutorFactoryRepository.java |
1,759 | public class ScriptExecutorFactoryRepository
{
private final Map<String, ScriptExecutor.Factory> languages;
public ScriptExecutorFactoryRepository( Map<String, ScriptExecutor.Factory> languages )
{
this.languages = Collections.unmodifiableMap( languages );
}
public ScriptExecutor.Factory ... | false | community_server_src_main_java_org_neo4j_server_scripting_ScriptExecutorFactoryRepository.java |
1,760 | public class NoSuchScriptLanguageException extends RuntimeException
{
public NoSuchScriptLanguageException( String msg )
{
super(msg);
}
} | false | community_server_src_main_java_org_neo4j_server_scripting_NoSuchScriptLanguageException.java |
1,761 | public class GroovyScriptExecutor implements ScriptExecutor
{
@Override
public Object execute( Map<String, Object> variables ) throws EvaluationException
{
return null;
}
} | false | community_server_src_main_java_org_neo4j_server_scripting_GroovyScriptExecutor.java |
1,762 | public class RelationshipCountSampleable extends DatabasePrimitivesSampleableBase
{
public RelationshipCountSampleable( NodeManager nodeManager )
{
super( nodeManager );
}
@Override public String getName()
{
return "relationship_count";
}
@Override public double getValue()
... | false | community_server_src_main_java_org_neo4j_server_rrd_sampler_RelationshipCountSampleable.java |
1,763 | public class PropertyCountSampleable extends DatabasePrimitivesSampleableBase
{
public PropertyCountSampleable( NodeManager nodeManager )
{
super( nodeManager );
}
@Override public String getName()
{
return "property_count";
}
@Override public double getValue()
{
... | false | community_server_src_main_java_org_neo4j_server_rrd_sampler_PropertyCountSampleable.java |
1,764 | public class NodeIdsInUseSampleable extends DatabasePrimitivesSampleableBase
{
public NodeIdsInUseSampleable( NodeManager nodeManager )
{
super( nodeManager );
}
@Override public String getName()
{
return "node_count";
}
@Override public double getValue()
{
ret... | false | community_server_src_main_java_org_neo4j_server_rrd_sampler_NodeIdsInUseSampleable.java |
1,765 | public class MemoryUsedSampleable implements Sampleable
{
private final ObjectName memoryName;
public MemoryUsedSampleable()
{
try
{
memoryName = new ObjectName( "java.lang:type=Memory" );
} catch ( MalformedObjectNameException e )
{
throw new Runtim... | false | community_server_src_main_java_org_neo4j_server_rrd_sampler_MemoryUsedSampleable.java |
1,766 | public abstract class DatabasePrimitivesSampleableBase implements Sampleable
{
private final NodeManager nodeManager;
public DatabasePrimitivesSampleableBase( NodeManager nodeManager )
{
if(nodeManager == null)
{
throw new RuntimeException( "Database sampler needs a node manager... | false | community_server_src_main_java_org_neo4j_server_rrd_sampler_DatabasePrimitivesSampleableBase.java |
1,767 | public class UnableToSampleException extends RuntimeException
{
private static final long serialVersionUID = 112443232112435425L;
} | false | community_server_src_main_java_org_neo4j_server_rrd_UnableToSampleException.java |
1,768 | public class SystemBackedTimeSource implements TimeSource
{
@Override
public long getTime()
{
return Util.getTime();
}
} | false | community_server_src_main_java_org_neo4j_server_rrd_SystemBackedTimeSource.java |
1,769 | {
@Override
public void run()
{
try
{
job.run();
} catch ( Exception e )
{
logging.getConsoleLog( getClass() ).warn( "Unable to execute scheduled job", e );
... | false | community_server_src_main_java_org_neo4j_server_rrd_ScheduledJob.java |
1,770 | public class ScheduledJob
{
private final Timer timer;
public ScheduledJob( final Runnable job, String name, long delay, long period, final Logging logging )
{
timer = new Timer( name );
TimerTask runJob = new TimerTask()
{
@Override
public void run()
... | false | community_server_src_main_java_org_neo4j_server_rrd_ScheduledJob.java |
1,771 | private class TestSamplable implements Sampleable
{
private String name;
private double value;
private TestSamplable( String name, double value )
{
this.name = name;
this.value = value;
}
public String getName()
{
retu... | false | community_server_src_test_java_org_neo4j_server_rrd_RrdSamplerTest.java |
1,772 | private class FailingSamplable implements Sampleable
{
private String name;
private FailingSamplable( String name )
{
this.name = name;
}
public String getName()
{
return name;
}
public double getValue()
{
... | false | community_server_src_test_java_org_neo4j_server_rrd_RrdSamplerTest.java |
1,773 | public class RrdSamplerTest
{
@Test
public void canSampleADatabase() throws IOException
{
Sampleable testSamplable = new TestSamplable( "myTest", 15 );
RrdDb rrd = mock( RrdDb.class );
final Sample sample = mock( Sample.class );
when( rrd.createSample( anyLong() ) ).thenRetu... | false | community_server_src_test_java_org_neo4j_server_rrd_RrdSamplerTest.java |
1,774 | public class RrdSamplerImpl implements RrdSampler {
/**
* The current sampling object. This is created when calling #start().
*/
private RrdDb rrdDb;
private Sampleable[] samplables;
/**
* Keep track of whether to run the update task or not.
*/
protected RrdSamplerImpl(RrdDb rrd... | false | community_server_src_main_java_org_neo4j_server_rrd_RrdSamplerImpl.java |
1,775 | public class RrdJobTest {
@Test
public void testGuardsAgainstQuickRuns() throws Exception {
RrdSampler sampler = mock(RrdSampler.class);
TimeSource time = mock(TimeSource.class);
stub(time.getTime())
.toReturn(10000l).toReturn(10000l) // First call (getTime gets called twic... | false | community_server_src_test_java_org_neo4j_server_rrd_RrdJobTest.java |
1,776 | public class HTTPLoggingDocIT extends ExclusiveServerTestBase
{
@Test
public void givenExplicitlyDisabledServerLoggingConfigurationShouldNotLogAccesses() throws Exception
{
// given
File logDirectory = TargetDirectory.forTest( this.getClass() ).cleanDirectory(
"givenExplicitl... | false | community_server_src_test_java_org_neo4j_server_web_logging_HTTPLoggingDocIT.java |
1,777 | public abstract class AbstractExclusiveServerWebadminTest extends ExclusiveServerTestBase {
protected static WebadminWebdriverLibrary wl;
private static WebDriverFacade webdriverFacade;
public static void setupWebdriver(NeoServer server) throws Exception {
webdriverFacade = new WebDriverFacad... | false | community_server_src_webtest_java_org_neo4j_server_webadmin_AbstractExclusiveServerWebadminTest.java |
1,778 | public class Job
{
public final String query;
public final String assertion;
public final String comment;
public Job( final String query, final String assertion, final String comment )
{
this.query = query;
this.assertion = assertion;
... | false | community_shell_src_test_java_org_neo4j_shell_Documenter.java |
1,779 | public class ElementVisible extends BaseMatcher<WebDriver>
{
private final By by;
public static ElementVisible elementVisible(By by) {
return new ElementVisible(by);
}
public ElementVisible(By by) {
this.by = by;
}
@Override
public boolean matches( Object item... | false | community_server_src_webtest_java_org_neo4j_server_webdriver_ElementVisible.java |
1,780 | public class ElementReference {
protected By selector;
protected WebdriverLibrary wl;
protected boolean matchLast;
public ElementReference(WebdriverLibrary wl, By selector) {
this(wl, selector, false);
}
public ElementReference(WebdriverLibrary wl, By selector, boolean matchLa... | false | community_server_src_webtest_java_org_neo4j_server_webdriver_ElementReference.java |
1,781 | public class ElementAttributeIs extends BaseMatcher<ElementReference>
{
private final String attr;
private final String value;
public static ElementAttributeIs elementAttributeIs(String attr, String value) {
return new ElementAttributeIs( attr, value );
}
public ElementAttributeIs... | false | community_server_src_webtest_java_org_neo4j_server_webdriver_ElementAttributeIs.java |
1,782 | public class ConditionTimeoutException extends RuntimeException
{
/**
*
*/
private static final long serialVersionUID = 1L;
public ConditionTimeoutException(String msg) {
this(msg, null);
}
public ConditionTimeoutException(String msg, Throwable cause) {
supe... | false | community_server_src_webtest_java_org_neo4j_server_webdriver_ConditionTimeoutException.java |
1,783 | public class ConditionFailedException extends RuntimeException
{
/**
*
*/
private static final long serialVersionUID = 1L;
public ConditionFailedException(String msg, Throwable cause) {
super(msg, cause);
}
} | false | community_server_src_webtest_java_org_neo4j_server_webdriver_ConditionFailedException.java |
1,784 | public class Condition<T>
{
private final T state;
private final Matcher<T> matcher;
public Condition(Matcher<T> matcher, T state) {
this.matcher = matcher;
this.state = state;
}
public boolean isFulfilled() {
return matcher.matches( state );
}
public ... | false | community_server_src_webtest_java_org_neo4j_server_webdriver_Condition.java |
1,785 | public class BrowserUrlIs extends BaseMatcher<WebDriver>
{
private final String url;
public static BrowserUrlIs browserUrlIs(String url) {
return new BrowserUrlIs( url );
}
public BrowserUrlIs(String url) {
this.url = url;
}
@Override
public boolean matches( Objec... | false | community_server_src_webtest_java_org_neo4j_server_webdriver_BrowserUrlIs.java |
1,786 | public class BrowserTitleIs extends BaseMatcher<WebDriver>
{
private final String title;
public static final BrowserTitleIs browserTitleIs(String title) {
return new BrowserTitleIs( title );
}
public BrowserTitleIs(String title) {
this.title = title;
}
@Override
p... | false | community_server_src_webtest_java_org_neo4j_server_webdriver_BrowserTitleIs.java |
1,787 | {
@Override
protected void serialize( MappingSerializer resourceSerializer )
{
for ( Map.Entry<String, String> entry : uris.entrySet() )
{
resourceSerializer.putUri( entry.getKey(), entry.getValue() );
}
... | false | community_server_src_main_java_org_neo4j_server_webadmin_rest_representations_ServiceDefinitionRepresentation.java |
1,788 | public class ServiceDefinitionRepresentation extends MappingRepresentation
{
private final HashMap<String, String> uris;
private final HashMap<String, String> templates;
private final String basePath;
public ServiceDefinitionRepresentation( String basePath )
{
super( "service-definition" );... | false | community_server_src_main_java_org_neo4j_server_webadmin_rest_representations_ServiceDefinitionRepresentation.java |
1,789 | public class ServerRootRepresentationTest
{
@Test
public void shouldProvideAListOfServiceUris() throws Exception
{
ConsoleService consoleService = new ConsoleService( null, mockDatabase(), DEV_NULL, null );
ServerRootRepresentation srr = new ServerRootRepresentation( new URI( "http://example... | false | community_server_src_test_java_org_neo4j_server_webadmin_rest_representations_ServerRootRepresentationTest.java |
1,790 | {
@Override
protected void serialize( MappingSerializer serializer )
{
for ( Map.Entry<String, String> entry : services.entrySet() )
{
serializer.putString( entry.getKey(), entry.getValue() );
}
... | false | community_server_src_main_java_org_neo4j_server_webadmin_rest_representations_ServerRootRepresentation.java |
1,791 | public class ServerRootRepresentation extends MappingRepresentation
{
private HashMap<String, String> services = new HashMap<String, String>();
public ServerRootRepresentation( URI baseUri, Iterable<AdvertisableService> advertisableServices )
{
super( "services" );
for ( AdvertisableService... | false | community_server_src_main_java_org_neo4j_server_webadmin_rest_representations_ServerRootRepresentation.java |
1,792 | {
@Override
protected void serialize( MappingSerializer serializer )
{
String[] dsNames = rrdData.getDsNames();
for ( int i = 0, l = dsNames.length; i < l; i++ )
{
serializer.putList( dsNames[i], ListRepresen... | false | community_server_src_main_java_org_neo4j_server_webadmin_rest_representations_RrdDataRepresentation.java |
1,793 | public class RrdDataRepresentation extends ObjectRepresentation
{
private final FetchData rrdData;
public RrdDataRepresentation( FetchData rrdData )
{
super( "rrd-data" );
this.rrdData = rrdData;
}
@Mapping( "start_time" )
public ValueRepresentation getStartTime()
{
... | false | community_server_src_main_java_org_neo4j_server_webadmin_rest_representations_RrdDataRepresentation.java |
1,794 | public class NameDescriptionValueRepresentation extends ObjectRepresentation
{
private String name;
private String description;
private Representation value;
public NameDescriptionValueRepresentation( String name, String description, Representation value )
{
super( "nameDescriptionValue" );... | false | community_server_src_main_java_org_neo4j_server_webadmin_rest_representations_NameDescriptionValueRepresentation.java |
1,795 | {
@Override
protected Representation underlyingObjectToObject( MBeanAttributeInfo attrInfo )
{
return new JmxAttributeRepresentation( beanName, attrInfo );
}
} ); | false | community_server_src_main_java_org_neo4j_server_webadmin_rest_representations_JmxMBeanRepresentation.java |
1,796 | public class JmxMBeanRepresentation extends ObjectRepresentation
{
protected ObjectName beanName;
protected MBeanServer jmxServer = ManagementFactory.getPlatformMBeanServer();
public JmxMBeanRepresentation( ObjectName beanInstance )
{
super( "jmxBean" );
this.beanName = beanInstance;
... | false | community_server_src_main_java_org_neo4j_server_webadmin_rest_representations_JmxMBeanRepresentation.java |
1,797 | public class JmxDomainRepresentation extends ObjectRepresentation
{
protected ArrayList<JmxMBeanRepresentation> beans = new ArrayList<JmxMBeanRepresentation>();
protected String domainName;
public JmxDomainRepresentation( String name )
{
super( "jmxDomain" );
this.domainName = name;
... | false | community_server_src_main_java_org_neo4j_server_webadmin_rest_representations_JmxDomainRepresentation.java |
1,798 | public class JmxCompositeDataRepresentation extends ObjectRepresentation
{
protected CompositeData data;
private static final RepresentationDispatcher REPRESENTATION_DISPATCHER = new JmxAttributeRepresentationDispatcher();
public JmxCompositeDataRepresentation( CompositeData data )
{
super( "jm... | false | community_server_src_main_java_org_neo4j_server_webadmin_rest_representations_JmxCompositeDataRepresentation.java |
1,799 | public class ElementTextIs extends BaseMatcher<ElementReference>
{
private final String value;
public static ElementTextIs elementTextIs( String value) {
return new ElementTextIs( value );
}
public ElementTextIs(String value) {
this.value = value;
}
@Override
publ... | false | community_server_src_webtest_java_org_neo4j_server_webdriver_ElementTextIs.java |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.