id
stringlengths
7
14
test_class
dict
test_case
dict
focal_class
dict
focal_method
dict
repository
dict
9239473_32
{ "fields": [ { "declarator": "jerseyHandler", "modifier": "", "original_string": "DefaultJerseyHandler jerseyHandler;", "type": "DefaultJerseyHandler", "var_name": "jerseyHandler" }, { "declarator": "config = new JsonObject()", "modifier": "", "original_str...
{ "body": "@Test\n public void testGetBaseURI() throws Exception {\n URI baseUri = URI.create(\"/test\");\n when(options.getBaseUri()).thenReturn(baseUri);\n\n URI result = jerseyHandler.getBaseUri();\n assertEquals(baseUri, result);\n }", "class_method_signature": "DefaultJerseyHa...
{ "fields": [ { "declarator": "containerProvider", "modifier": "private", "original_string": "private Provider<VertxContainer> containerProvider;", "type": "Provider<VertxContainer>", "var_name": "containerProvider" }, { "declarator": "container", "modifier": "pri...
{ "body": "@Override\n public URI getBaseUri() {\n if (baseUri == null) {\n baseUri = getContainer().getOptions().getBaseUri();\n if (baseUri == null) {\n throw new IllegalStateException(\"baseUri is null, have you called init() first?\");\n }\n }\n ...
{ "created": null, "fork": null, "fork_count": 46, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 9239473, "size": 975, "stargazer_count": 147, "stars": null, "updates": null, "url": "https://github.com/ef-labs/vertx-jersey" }
9239473_12
{ "fields": [ { "declarator": "vertx", "modifier": "@Mock\n private", "original_string": "@Mock\n private Vertx vertx;", "type": "Vertx", "var_name": "vertx" }, { "declarator": "context", "modifier": "@Mock\n private", "original_string": "@Mock\n ...
{ "body": "@Test\n public void testGetComponents() throws Exception {\n\n config.put(DefaultJerseyOptions.CONFIG_COMPONENTS, new JsonArray().add(MyObj.class.getName()));\n config.put(DefaultJerseyOptions.CONFIG_FEATURES, new JsonArray().add(MyBinder.class.getName()));\n\n Set<Class<?>> instanc...
{ "fields": [ { "declarator": "CONFIG_HOST = \"host\"", "modifier": "public final static", "original_string": "public final static String CONFIG_HOST = \"host\";", "type": "String", "var_name": "CONFIG_HOST" }, { "declarator": "CONFIG_PORT = \"port\"", "modifier":...
{ "body": "@Override\n public Set<Class<?>> getComponents() {\n Set<Class<?>> set = new HashSet<>();\n ClassLoader cl = Thread.currentThread().getContextClassLoader();\n\n Consumer<JsonArray> reader = array -> {\n if (array != null && array.size() > 0) {\n for (int i ...
{ "created": null, "fork": null, "fork_count": 46, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 9239473, "size": 975, "stargazer_count": 147, "stars": null, "updates": null, "url": "https://github.com/ef-labs/vertx-jersey" }
9239473_45
{ "fields": [], "file": "vertx-jersey/src/test/java/com/englishtown/vertx/hk2/BootstrapBinderTest.java", "identifier": "BootstrapBinderTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testConfigure() throws Exception {\n\n BootstrapBinder binder = new BootstrapBinder();\n DynamicConfiguration dynamicConfiguration = mock(DynamicConfiguration.class);\n binder.bind(dynamicConfiguration);\n\n }", "class_method_signature": "BootstrapBinderTest...
{ "fields": [], "file": "vertx-jersey/src/main/java/com/englishtown/vertx/hk2/BootstrapBinder.java", "identifier": "BootstrapBinder", "interfaces": "", "methods": [ { "class_method_signature": "BootstrapBinder.configure()", "constructor": false, "full_signature": "@Override protected voi...
{ "body": "@Override\n protected void configure() {\n install(new HK2JerseyBinder());\n }", "class_method_signature": "BootstrapBinder.configure()", "constructor": false, "full_signature": "@Override protected void configure()", "identifier": "configure", "invocations": [ "install" ], "...
{ "created": null, "fork": null, "fork_count": 46, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 9239473, "size": 975, "stargazer_count": 147, "stars": null, "updates": null, "url": "https://github.com/ef-labs/vertx-jersey" }
9239473_53
{ "fields": [ { "declarator": "feature = new JacksonFeature()", "modifier": "private", "original_string": "private JacksonFeature feature = new JacksonFeature();", "type": "JacksonFeature", "var_name": "feature" }, { "declarator": "properties = new HashMap<>()", "...
{ "body": "@Test\n public void testConfigure_Disable() throws Exception {\n\n properties.put(JacksonFeature.PROPERTY_DISABLE, true);\n boolean result;\n\n result = feature.configure(context);\n assertFalse(result);\n\n verify(context, never()).register(Matchers.<JacksonFeature.Bi...
{ "fields": [ { "declarator": "PROPERTY_DISABLE = \"vertx.jersey.jackson.disable\"", "modifier": "public static final", "original_string": "public static final String PROPERTY_DISABLE = \"vertx.jersey.jackson.disable\";", "type": "String", "var_name": "PROPERTY_DISABLE" } ], ...
{ "body": "@Override\n public boolean configure(FeatureContext context) {\n\n Configuration config = context.getConfiguration();\n boolean disabled = PropertiesHelper.isProperty(config.getProperties(), PROPERTY_DISABLE);\n\n if (disabled) {\n return false;\n }\n\n if (...
{ "created": null, "fork": null, "fork_count": 46, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 9239473, "size": 975, "stargazer_count": 147, "stars": null, "updates": null, "url": "https://github.com/ef-labs/vertx-jersey" }
9239473_5
{ "fields": [ { "declarator": "container", "modifier": "private", "original_string": "private DefaultVertxContainer container;", "type": "DefaultVertxContainer", "var_name": "container" }, { "declarator": "locator", "modifier": "private", "original_string": ...
{ "body": "@Test\n public void testStart() throws Exception {\n\n packages.add(\"com.englishtown.vertx.jersey.resources\");\n container = new DefaultVertxContainer(vertx, options, locator, null);\n container.start();\n\n assertEquals(options, container.getOptions());\n assertNotN...
{ "fields": [ { "declarator": "vertx", "modifier": "private final", "original_string": "private final Vertx vertx;", "type": "Vertx", "var_name": "vertx" }, { "declarator": "locator", "modifier": "private final", "original_string": "private final ServiceLoca...
{ "body": "@Override\n public void start() {\n if (started) {\n return;\n }\n ApplicationHandler handler = getApplicationHandler();\n if (handler == null) {\n throw new IllegalStateException(\"ApplicationHandler cannot be null\");\n }\n handler.onStar...
{ "created": null, "fork": null, "fork_count": 46, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 9239473, "size": 975, "stargazer_count": 147, "stars": null, "updates": null, "url": "https://github.com/ef-labs/vertx-jersey" }
9239473_28
{ "fields": [ { "declarator": "jerseyHandler", "modifier": "", "original_string": "DefaultJerseyHandler jerseyHandler;", "type": "DefaultJerseyHandler", "var_name": "jerseyHandler" }, { "declarator": "config = new JsonObject()", "modifier": "", "original_str...
{ "body": "@Test\n public void testHandle_RequestProcessors() throws Exception {\n\n when(request.headers()).thenReturn(mock(MultiMap.class));\n when(request.method()).thenReturn(HttpMethod.GET);\n InputStream inputStream = null;\n\n VertxRequestProcessor rp1 = mock(VertxRequestProcesso...
{ "fields": [ { "declarator": "containerProvider", "modifier": "private", "original_string": "private Provider<VertxContainer> containerProvider;", "type": "Provider<VertxContainer>", "var_name": "containerProvider" }, { "declarator": "container", "modifier": "pri...
{ "body": "@Override\n public void handle(final HttpServerRequest vertxRequest) {\n\n // Wait for the body for jersey to handle form/json/xml params\n if (shouldReadData(vertxRequest)) {\n if (logger.isDebugEnabled()) {\n logger.debug(\"DefaultJerseyHandler - handle request ...
{ "created": null, "fork": null, "fork_count": 46, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 9239473, "size": 975, "stargazer_count": 147, "stars": null, "updates": null, "url": "https://github.com/ef-labs/vertx-jersey" }
9239473_35
{ "fields": [ { "declarator": "writer", "modifier": "", "original_string": "VertxResponseWriter writer;", "type": "VertxResponseWriter", "var_name": "writer" }, { "declarator": "responseProcessors = new ArrayList<>()", "modifier": "", "original_string": "Lis...
{ "body": "@Test\n public void testWrite() throws Exception {\n\n ContainerResponse cr = mock(ContainerResponse.class);\n MultivaluedMap<String, String> headers = new MultivaluedHashMap<>();\n when(cr.getStatusInfo()).thenReturn(mock(Response.StatusType.class));\n when(cr.getStringHeade...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(VertxResponseWriter.class)", "modifier": "private static final", "original_string": "private static final Logger logger = LoggerFactory.getLogger(VertxResponseWriter.class);", "type": "Logger", "var_name": "logger" }...
{ "body": "@Override\n public OutputStream writeResponseStatusAndHeaders(long contentLength, ContainerResponse responseContext) throws ContainerException {\n jerseyResponse = responseContext;\n HttpServerResponse response = vertxRequest.response();\n\n // Write the status\n response.set...
{ "created": null, "fork": null, "fork_count": 46, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 9239473, "size": 975, "stargazer_count": 147, "stars": null, "updates": null, "url": "https://github.com/ef-labs/vertx-jersey" }
9239473_23
{ "fields": [ { "declarator": "jerseyServer", "modifier": "", "original_string": "DefaultJerseyServer jerseyServer;", "type": "DefaultJerseyServer", "var_name": "jerseyServer" }, { "declarator": "baseUri = URI.create(\"http://test.englishtown.com/test\")", "modifi...
{ "body": "@Test\n public void testGetHandler() throws Exception {\n jerseyServer.start();\n JerseyHandler handler = jerseyServer.getHandler();\n assertEquals(jerseyHandler, handler);\n }", "class_method_signature": "DefaultJerseyServerTest.testGetHandler()", "constructor": false, "fu...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(DefaultJerseyServer.class)", "modifier": "private static final", "original_string": "private static final Logger logger = LoggerFactory.getLogger(DefaultJerseyServer.class);", "type": "Logger", "var_name": "logger" }...
{ "body": "@Override\n public JerseyHandler getHandler() {\n return jerseyHandler;\n }", "class_method_signature": "DefaultJerseyServer.getHandler()", "constructor": false, "full_signature": "@Override public JerseyHandler getHandler()", "identifier": "getHandler", "invocations": [], "modifie...
{ "created": null, "fork": null, "fork_count": 46, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 9239473, "size": 975, "stargazer_count": 147, "stars": null, "updates": null, "url": "https://github.com/ef-labs/vertx-jersey" }
9239473_19
{ "fields": [ { "declarator": "vertx", "modifier": "@Mock\n private", "original_string": "@Mock\n private Vertx vertx;", "type": "Vertx", "var_name": "vertx" }, { "declarator": "context", "modifier": "@Mock\n private", "original_string": "@Mock\n ...
{ "body": "@Test\n public void testGetProperties_Null() throws Exception {\n\n JsonObject rc = new JsonObject().put(\"prop1\", \"a\");\n config.put(DefaultJerseyOptions.CONFIG_RESOURCE_CONFIG, rc);\n assertEquals(rc.getMap(), options.getProperties());\n\n }", "class_method_signature": "De...
{ "fields": [ { "declarator": "CONFIG_HOST = \"host\"", "modifier": "public final static", "original_string": "public final static String CONFIG_HOST = \"host\";", "type": "String", "var_name": "CONFIG_HOST" }, { "declarator": "CONFIG_PORT = \"port\"", "modifier":...
{ "body": "@Override\n public Map<String, Object> getProperties() {\n JsonObject json = null;\n JsonObject tmp;\n\n tmp = config.getJsonObject(CONFIG_PROPERTIES);\n if (tmp != null) {\n json = tmp;\n }\n\n tmp = config.getJsonObject(CONFIG_RESOURCE_CONFIG);\n ...
{ "created": null, "fork": null, "fork_count": 46, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 9239473, "size": 975, "stargazer_count": 147, "stars": null, "updates": null, "url": "https://github.com/ef-labs/vertx-jersey" }
9239473_39
{ "fields": [ { "declarator": "writer", "modifier": "", "original_string": "VertxResponseWriter writer;", "type": "VertxResponseWriter", "var_name": "writer" }, { "declarator": "responseProcessors = new ArrayList<>()", "modifier": "", "original_string": "Lis...
{ "body": "@Test\n public void testCommit() throws Exception {\n\n VertxPostResponseProcessor processor1 = mock(VertxPostResponseProcessor.class);\n VertxPostResponseProcessor processor2 = mock(VertxPostResponseProcessor.class);\n postResponseProcessors.add(processor1);\n postResponsePr...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(VertxResponseWriter.class)", "modifier": "private static final", "original_string": "private static final Logger logger = LoggerFactory.getLogger(VertxResponseWriter.class);", "type": "Logger", "var_name": "logger" }...
{ "body": "@Override\n public void commit() {\n // End the vertx response if not a write stream\n if (!isWriteStream) {\n end();\n }\n }", "class_method_signature": "VertxResponseWriter.commit()", "constructor": false, "full_signature": "@Override public void commit()", "...
{ "created": null, "fork": null, "fork_count": 46, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 9239473, "size": 975, "stargazer_count": 147, "stars": null, "updates": null, "url": "https://github.com/ef-labs/vertx-jersey" }
9239473_2
{ "fields": [ { "declarator": "whenJerseyServer", "modifier": "private", "original_string": "private DefaultWhenJerseyServer whenJerseyServer;", "type": "DefaultWhenJerseyServer", "var_name": "whenJerseyServer" }, { "declarator": "done = new Done<>()", "modifier":...
{ "body": "@Test\n public void testCreateServer_Success() throws Exception {\n\n when(result.succeeded()).thenReturn(true);\n\n whenJerseyServer.createServer()\n .then(done.onFulfilled, done.onRejected);\n\n verify(server).start(any(), any(), handlerCaptor.capture());\n\n ...
{ "fields": [ { "declarator": "vertx", "modifier": "private final", "original_string": "private final Vertx vertx;", "type": "Vertx", "var_name": "vertx" }, { "declarator": "jerseyServerProvider", "modifier": "private final", "original_string": "private fina...
{ "body": "@Override\n public Promise<JerseyServer> createServer(@Nullable JerseyServerOptions options, @Nullable JerseyOptions jerseyOptions) {\n final Deferred<JerseyServer> d = when.defer();\n\n try {\n JerseyServer jerseyServer = jerseyServerProvider.get();\n jerseyServer.st...
{ "created": null, "fork": null, "fork_count": 46, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 9239473, "size": 975, "stargazer_count": 147, "stars": null, "updates": null, "url": "https://github.com/ef-labs/vertx-jersey" }
9239473_42
{ "fields": [ { "declarator": "server", "modifier": "", "original_string": "GuiceJerseyServer server;", "type": "GuiceJerseyServer", "var_name": "server" }, { "declarator": "handler", "modifier": "@Mock", "original_string": "@Mock\n JerseyHandler handler;...
{ "body": "@Test\n @SuppressWarnings(\"unchecked\")\n public void testInjectMultiBindings() throws Exception {\n\n Key<?> key;\n\n key = Key.get(new TypeLiteral<Set<ContainerRequestFilter>>() {\n });\n Set<ContainerRequestFilter> requestFilters = (Set<ContainerRequestFilter>) injecto...
{ "fields": [], "file": "vertx-jersey/src/main/java/com/englishtown/vertx/guice/GuiceJerseyServer.java", "identifier": "GuiceJerseyServer", "interfaces": "", "methods": [ { "class_method_signature": "GuiceJerseyServer.GuiceJerseyServer(JerseyHandler jerseyHandler, VertxContainer container, Provider<...
{ "body": "protected void injectMultibindings(ServiceLocator locator, Injector injector) {\n\n injectMultiBindings(locator, injector, new Key<Set<ContainerRequestFilter>>() {\n }, ContainerRequestFilter.class);\n injectMultiBindings(locator, injector, new Key<Set<ContainerResponseFilter>>() {\n ...
{ "created": null, "fork": null, "fork_count": 46, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 9239473, "size": 975, "stargazer_count": 147, "stars": null, "updates": null, "url": "https://github.com/ef-labs/vertx-jersey" }
9239473_15
{ "fields": [ { "declarator": "vertx", "modifier": "@Mock\n private", "original_string": "@Mock\n private Vertx vertx;", "type": "Vertx", "var_name": "vertx" }, { "declarator": "context", "modifier": "@Mock\n private", "original_string": "@Mock\n ...
{ "body": "@Test(expected = RuntimeException.class)\n public void testGetInstances_Fail() throws Exception {\n\n config.put(DefaultJerseyOptions.CONFIG_INSTANCES, new JsonArray().add(MyObj.class.getName() + \".invalid\"));\n options.getInstances();\n fail();\n\n }", "class_method_signatur...
{ "fields": [ { "declarator": "CONFIG_HOST = \"host\"", "modifier": "public final static", "original_string": "public final static String CONFIG_HOST = \"host\";", "type": "String", "var_name": "CONFIG_HOST" }, { "declarator": "CONFIG_PORT = \"port\"", "modifier":...
{ "body": "@Override\n public Set<Object> getInstances() {\n Set<Object> set = new HashSet<>();\n ClassLoader cl = Thread.currentThread().getContextClassLoader();\n\n Consumer<JsonArray> reader = array -> {\n if (array != null && array.size() > 0) {\n for (int i = 0; ...
{ "created": null, "fork": null, "fork_count": 46, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 9239473, "size": 975, "stargazer_count": 147, "stars": null, "updates": null, "url": "https://github.com/ef-labs/vertx-jersey" }
9239473_14
{ "fields": [ { "declarator": "vertx", "modifier": "@Mock\n private", "original_string": "@Mock\n private Vertx vertx;", "type": "Vertx", "var_name": "vertx" }, { "declarator": "context", "modifier": "@Mock\n private", "original_string": "@Mock\n ...
{ "body": "@Test\n public void testGetInstances() throws Exception {\n\n config.put(DefaultJerseyOptions.CONFIG_INSTANCES, new JsonArray().add(MyObj.class.getName()));\n config.put(DefaultJerseyOptions.CONFIG_BINDERS, new JsonArray().add(MyBinder.class.getName()));\n\n Set<Object> instances = ...
{ "fields": [ { "declarator": "CONFIG_HOST = \"host\"", "modifier": "public final static", "original_string": "public final static String CONFIG_HOST = \"host\";", "type": "String", "var_name": "CONFIG_HOST" }, { "declarator": "CONFIG_PORT = \"port\"", "modifier":...
{ "body": "@Override\n public Set<Object> getInstances() {\n Set<Object> set = new HashSet<>();\n ClassLoader cl = Thread.currentThread().getContextClassLoader();\n\n Consumer<JsonArray> reader = array -> {\n if (array != null && array.size() > 0) {\n for (int i = 0; ...
{ "created": null, "fork": null, "fork_count": 46, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 9239473, "size": 975, "stargazer_count": 147, "stars": null, "updates": null, "url": "https://github.com/ef-labs/vertx-jersey" }
9239473_43
{ "fields": [ { "declarator": "binder", "modifier": "", "original_string": "GuiceJerseyBinder binder;", "type": "GuiceJerseyBinder", "var_name": "binder" }, { "declarator": "builder", "modifier": "@Mock", "original_string": "@Mock\n Binder builder;", ...
{ "body": "@Test\n public void testConfigure() throws Exception {\n\n binder.configure(builder);\n\n // 9 types are explicitly bound\n verify(builder, times(9)).bind((Class<?>) any(Class.class));\n\n // 11 multi-bindings are installed\n verify(builder, times(11)).install(any(Modu...
{ "fields": [], "file": "vertx-jersey/src/main/java/com/englishtown/vertx/guice/GuiceJerseyBinder.java", "identifier": "GuiceJerseyBinder", "interfaces": "", "methods": [ { "class_method_signature": "GuiceJerseyBinder.configure()", "constructor": false, "full_signature": "@Override prote...
{ "body": "@Override\n protected void configure() {\n\n // Create HK2 service locator and bind jersey injections\n ServiceLocator locator = ServiceLocatorFactory.getInstance().create(null);\n bind(ServiceLocator.class).toInstance(locator);\n\n bind(VertxContainer.class).to(DefaultVertxC...
{ "created": null, "fork": null, "fork_count": 46, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 9239473, "size": 975, "stargazer_count": 147, "stars": null, "updates": null, "url": "https://github.com/ef-labs/vertx-jersey" }
9239473_3
{ "fields": [ { "declarator": "whenJerseyServer", "modifier": "private", "original_string": "private DefaultWhenJerseyServer whenJerseyServer;", "type": "DefaultWhenJerseyServer", "var_name": "whenJerseyServer" }, { "declarator": "done = new Done<>()", "modifier":...
{ "body": "@Test\n public void testCreateServer_Fail() throws Exception {\n\n when(result.succeeded()).thenReturn(false);\n\n whenJerseyServer.createServer()\n .then(done.onFulfilled, done.onRejected);\n\n verify(server).start(any(), any(), handlerCaptor.capture());\n\n h...
{ "fields": [ { "declarator": "vertx", "modifier": "private final", "original_string": "private final Vertx vertx;", "type": "Vertx", "var_name": "vertx" }, { "declarator": "jerseyServerProvider", "modifier": "private final", "original_string": "private fina...
{ "body": "@Override\n public Promise<JerseyServer> createServer(@Nullable JerseyServerOptions options, @Nullable JerseyOptions jerseyOptions) {\n final Deferred<JerseyServer> d = when.defer();\n\n try {\n JerseyServer jerseyServer = jerseyServerProvider.get();\n jerseyServer.st...
{ "created": null, "fork": null, "fork_count": 46, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 9239473, "size": 975, "stargazer_count": 147, "stars": null, "updates": null, "url": "https://github.com/ef-labs/vertx-jersey" }
9239473_38
{ "fields": [ { "declarator": "writer", "modifier": "", "original_string": "VertxResponseWriter writer;", "type": "VertxResponseWriter", "var_name": "writer" }, { "declarator": "responseProcessors = new ArrayList<>()", "modifier": "", "original_string": "Lis...
{ "body": "@Test\n public void testSetSuspendTimeout() throws Exception {\n\n ContainerResponseWriter.TimeoutHandler timeoutHandler = mock(ContainerResponseWriter.TimeoutHandler.class);\n\n try {\n writer.setSuspendTimeout(10, TimeUnit.SECONDS);\n fail();\n } catch (Illeg...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(VertxResponseWriter.class)", "modifier": "private static final", "original_string": "private static final Logger logger = LoggerFactory.getLogger(VertxResponseWriter.class);", "type": "Logger", "var_name": "logger" }...
{ "body": "@Override\n public void setSuspendTimeout(long timeOut, TimeUnit timeUnit) throws IllegalStateException {\n\n if (timeoutHandler == null) {\n throw new IllegalStateException(\"The timeoutHandler is null\");\n }\n\n suspend(timeOut, timeUnit, timeoutHandler);\n\n }", ...
{ "created": null, "fork": null, "fork_count": 46, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 9239473, "size": 975, "stargazer_count": 147, "stars": null, "updates": null, "url": "https://github.com/ef-labs/vertx-jersey" }
9239473_18
{ "fields": [ { "declarator": "vertx", "modifier": "@Mock\n private", "original_string": "@Mock\n private Vertx vertx;", "type": "Vertx", "var_name": "vertx" }, { "declarator": "context", "modifier": "@Mock\n private", "original_string": "@Mock\n ...
{ "body": "@Test\n public void testGetProperties_Both() throws Exception {\n\n JsonObject props = new JsonObject().put(\"prop1\", \"a\");\n JsonObject rc = new JsonObject().put(\"prop2\", \"b\");\n config.put(DefaultJerseyOptions.CONFIG_PROPERTIES, props);\n config.put(DefaultJerseyOpti...
{ "fields": [ { "declarator": "CONFIG_HOST = \"host\"", "modifier": "public final static", "original_string": "public final static String CONFIG_HOST = \"host\";", "type": "String", "var_name": "CONFIG_HOST" }, { "declarator": "CONFIG_PORT = \"port\"", "modifier":...
{ "body": "@Override\n public Map<String, Object> getProperties() {\n JsonObject json = null;\n JsonObject tmp;\n\n tmp = config.getJsonObject(CONFIG_PROPERTIES);\n if (tmp != null) {\n json = tmp;\n }\n\n tmp = config.getJsonObject(CONFIG_RESOURCE_CONFIG);\n ...
{ "created": null, "fork": null, "fork_count": 46, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 9239473, "size": 975, "stargazer_count": 147, "stars": null, "updates": null, "url": "https://github.com/ef-labs/vertx-jersey" }
9239473_22
{ "fields": [ { "declarator": "jerseyServer", "modifier": "", "original_string": "DefaultJerseyServer jerseyServer;", "type": "DefaultJerseyServer", "var_name": "jerseyServer" }, { "declarator": "baseUri = URI.create(\"http://test.englishtown.com/test\")", "modifi...
{ "body": "@Test\n public void testInit_Listen_Result() throws Exception {\n\n jerseyServer.start(doneHandler);\n verifyExecuteBlocking();\n\n verify(httpServer).listen(handlerCaptor.capture());\n Handler<AsyncResult<HttpServer>> handler = handlerCaptor.getValue();\n\n when(async...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(DefaultJerseyServer.class)", "modifier": "private static final", "original_string": "private static final Logger logger = LoggerFactory.getLogger(DefaultJerseyServer.class);", "type": "Logger", "var_name": "logger" }...
{ "body": "@Override\n public void start(@Nullable JerseyServerOptions options, @Nullable JerseyOptions jerseyOptions, @Nullable Handler<AsyncResult<HttpServer>> doneHandler) {\n\n if (options == null) {\n options = optionsProvider.get();\n }\n\n HttpServerOptions serverOptions = op...
{ "created": null, "fork": null, "fork_count": 46, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 9239473, "size": 975, "stargazer_count": 147, "stars": null, "updates": null, "url": "https://github.com/ef-labs/vertx-jersey" }
9239473_34
{ "fields": [ { "declarator": "writer", "modifier": "", "original_string": "VertxResponseWriter writer;", "type": "VertxResponseWriter", "var_name": "writer" }, { "declarator": "responseProcessors = new ArrayList<>()", "modifier": "", "original_string": "Lis...
{ "body": "@Test\n public void testWriteResponse_Throw() throws Exception {\n\n ContainerResponse cr = mock(ContainerResponse.class);\n MultivaluedMap<String, String> headers = new MultivaluedHashMap<>();\n when(cr.getStatusInfo()).thenReturn(mock(Response.StatusType.class));\n when(cr....
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(VertxResponseWriter.class)", "modifier": "private static final", "original_string": "private static final Logger logger = LoggerFactory.getLogger(VertxResponseWriter.class);", "type": "Logger", "var_name": "logger" }...
{ "body": "@Override\n public OutputStream writeResponseStatusAndHeaders(long contentLength, ContainerResponse responseContext) throws ContainerException {\n jerseyResponse = responseContext;\n HttpServerResponse response = vertxRequest.response();\n\n // Write the status\n response.set...
{ "created": null, "fork": null, "fork_count": 46, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 9239473, "size": 975, "stargazer_count": 147, "stars": null, "updates": null, "url": "https://github.com/ef-labs/vertx-jersey" }
9239473_21
{ "fields": [ { "declarator": "jerseyServer", "modifier": "", "original_string": "DefaultJerseyServer jerseyServer;", "type": "DefaultJerseyServer", "var_name": "jerseyServer" }, { "declarator": "baseUri = URI.create(\"http://test.englishtown.com/test\")", "modifi...
{ "body": "@Test\n public void testInit_With_Config() throws Exception {\n\n String host = \"test.englishtown.com\";\n int port = 8888;\n int bufferSize = 1024;\n boolean ssl = true;\n boolean compressionSupported = true;\n\n when(serverOptions.getHost()).thenReturn(host);...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(DefaultJerseyServer.class)", "modifier": "private static final", "original_string": "private static final Logger logger = LoggerFactory.getLogger(DefaultJerseyServer.class);", "type": "Logger", "var_name": "logger" }...
{ "body": "@Override\n public void start(@Nullable JerseyServerOptions options, @Nullable JerseyOptions jerseyOptions, @Nullable Handler<AsyncResult<HttpServer>> doneHandler) {\n\n if (options == null) {\n options = optionsProvider.get();\n }\n\n HttpServerOptions serverOptions = op...
{ "created": null, "fork": null, "fork_count": 46, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 9239473, "size": 975, "stargazer_count": 147, "stars": null, "updates": null, "url": "https://github.com/ef-labs/vertx-jersey" }
9239473_37
{ "fields": [ { "declarator": "writer", "modifier": "", "original_string": "VertxResponseWriter writer;", "type": "VertxResponseWriter", "var_name": "writer" }, { "declarator": "responseProcessors = new ArrayList<>()", "modifier": "", "original_string": "Lis...
{ "body": "@Test\n public void testSuspend() throws Exception {\n\n boolean result;\n ContainerResponseWriter.TimeoutHandler timeoutHandler = mock(ContainerResponseWriter.TimeoutHandler.class);\n\n result = writer.suspend(10, TimeUnit.SECONDS, timeoutHandler);\n assertTrue(result);\n ...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(VertxResponseWriter.class)", "modifier": "private static final", "original_string": "private static final Logger logger = LoggerFactory.getLogger(VertxResponseWriter.class);", "type": "Logger", "var_name": "logger" }...
{ "body": "@Override\n public boolean suspend(long timeOut, TimeUnit timeUnit, TimeoutHandler timeoutHandler) {\n // TODO: If already suspended should return false according to documentation\n // Store the timeout handler\n this.timeoutHandler = timeoutHandler;\n\n // Cancel any existin...
{ "created": null, "fork": null, "fork_count": 46, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 9239473, "size": 975, "stargazer_count": 147, "stars": null, "updates": null, "url": "https://github.com/ef-labs/vertx-jersey" }
9239473_17
{ "fields": [ { "declarator": "vertx", "modifier": "@Mock\n private", "original_string": "@Mock\n private Vertx vertx;", "type": "Vertx", "var_name": "vertx" }, { "declarator": "context", "modifier": "@Mock\n private", "original_string": "@Mock\n ...
{ "body": "@Test\n public void testGetProperties_Resource_Config() throws Exception {\n\n JsonObject rc = new JsonObject().put(\"prop1\", \"a\");\n config.put(DefaultJerseyOptions.CONFIG_RESOURCE_CONFIG, rc);\n assertEquals(rc.getMap(), options.getProperties());\n\n }", "class_method_sign...
{ "fields": [ { "declarator": "CONFIG_HOST = \"host\"", "modifier": "public final static", "original_string": "public final static String CONFIG_HOST = \"host\";", "type": "String", "var_name": "CONFIG_HOST" }, { "declarator": "CONFIG_PORT = \"port\"", "modifier":...
{ "body": "@Override\n public Map<String, Object> getProperties() {\n JsonObject json = null;\n JsonObject tmp;\n\n tmp = config.getJsonObject(CONFIG_PROPERTIES);\n if (tmp != null) {\n json = tmp;\n }\n\n tmp = config.getJsonObject(CONFIG_RESOURCE_CONFIG);\n ...
{ "created": null, "fork": null, "fork_count": 46, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 9239473, "size": 975, "stargazer_count": 147, "stars": null, "updates": null, "url": "https://github.com/ef-labs/vertx-jersey" }
9239473_40
{ "fields": [ { "declarator": "writer", "modifier": "", "original_string": "VertxResponseWriter writer;", "type": "VertxResponseWriter", "var_name": "writer" }, { "declarator": "responseProcessors = new ArrayList<>()", "modifier": "", "original_string": "Lis...
{ "body": "@Test\n public void testFailure() throws Exception {\n\n Throwable error = mock(Throwable.class);\n\n writer.failure(error);\n verify(response, times(1)).setStatusCode(eq(500));\n verify(response, times(1)).setStatusMessage(eq(\"Internal Server Error\"));\n verify(resp...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(VertxResponseWriter.class)", "modifier": "private static final", "original_string": "private static final Logger logger = LoggerFactory.getLogger(VertxResponseWriter.class);", "type": "Logger", "var_name": "logger" }...
{ "body": "@Override\n public void failure(Throwable error) {\n\n logger.error(error.getMessage(), error);\n HttpServerResponse response = vertxRequest.response();\n\n // Set error status and end\n Response.Status status = Response.Status.INTERNAL_SERVER_ERROR;\n response.setStat...
{ "created": null, "fork": null, "fork_count": 46, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 9239473, "size": 975, "stargazer_count": 147, "stars": null, "updates": null, "url": "https://github.com/ef-labs/vertx-jersey" }
9239473_0
{ "fields": [], "file": "vertx-jersey/src/test/java/com/englishtown/vertx/jersey/inject/InternalVertxJerseyBinderTest.java", "identifier": "InternalVertxJerseyBinderTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testConfigure() throws Exception {\n\n InternalVertxJerseyBinder binder = new InternalVertxJerseyBinder(mock(Vertx.class));\n DynamicConfiguration dynamicConfiguration = mock(DynamicConfiguration.class);\n binder.bind(dynamicConfiguration);\n\n }", "class_me...
{ "fields": [ { "declarator": "vertx", "modifier": "private final", "original_string": "private final Vertx vertx;", "type": "Vertx", "var_name": "vertx" } ], "file": "vertx-jersey/src/main/java/com/englishtown/vertx/jersey/inject/InternalVertxJerseyBinder.java", "identifie...
{ "body": "@Override\n protected void configure() {\n\n // Bind the vertx and container instances\n bind(vertx).to(Vertx.class);\n\n // Request and read stream\n bindFactory(VertxRequestReferencingFactory.class).to(HttpServerRequest.class).in(PerLookup.class);\n bindFactory(Vertx...
{ "created": null, "fork": null, "fork_count": 46, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 9239473, "size": 975, "stargazer_count": 147, "stars": null, "updates": null, "url": "https://github.com/ef-labs/vertx-jersey" }
9239473_1
{ "fields": [ { "declarator": "provider", "modifier": "", "original_string": "VertxResponseWriterProvider provider;", "type": "VertxResponseWriterProvider", "var_name": "provider" }, { "declarator": "responseProcessors = new ArrayList<>()", "modifier": "", "...
{ "body": "@Test\n public void testGet() throws Exception {\n\n ContainerResponseWriter writer;\n\n writer = provider.get(vertxRequest, jerseyRequest);\n assertNotNull(writer);\n }", "class_method_signature": "VertxResponseWriterProviderTest.testGet()", "constructor": false, "full_sig...
{ "fields": [ { "declarator": "vertx", "modifier": "private final", "original_string": "private final Vertx vertx;", "type": "Vertx", "var_name": "vertx" }, { "declarator": "responseProcessors", "modifier": "private final", "original_string": "private final ...
{ "body": "@Override\n public ContainerResponseWriter get(\n HttpServerRequest vertxRequest,\n ContainerRequest jerseyRequest) {\n return new VertxResponseWriter(vertxRequest, vertx, responseProcessors, postResponseProcessors);\n }", "class_method_signature": "VertxResponseWriterP...
{ "created": null, "fork": null, "fork_count": 46, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 9239473, "size": 975, "stargazer_count": 147, "stars": null, "updates": null, "url": "https://github.com/ef-labs/vertx-jersey" }
9239473_41
{ "fields": [ { "declarator": "writer", "modifier": "", "original_string": "VertxResponseWriter writer;", "type": "VertxResponseWriter", "var_name": "writer" }, { "declarator": "responseProcessors = new ArrayList<>()", "modifier": "", "original_string": "Lis...
{ "body": "@Test\n public void testEnableResponseBuffering() throws Exception {\n\n boolean result;\n\n result = writer.enableResponseBuffering();\n assertFalse(result);\n\n }", "class_method_signature": "VertxResponseWriterTest.testEnableResponseBuffering()", "constructor": false, "f...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(VertxResponseWriter.class)", "modifier": "private static final", "original_string": "private static final Logger logger = LoggerFactory.getLogger(VertxResponseWriter.class);", "type": "Logger", "var_name": "logger" }...
{ "body": "@Override\n public boolean enableResponseBuffering() {\n return false;\n }", "class_method_signature": "VertxResponseWriter.enableResponseBuffering()", "constructor": false, "full_signature": "@Override public boolean enableResponseBuffering()", "identifier": "enableResponseBuffering",...
{ "created": null, "fork": null, "fork_count": 46, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 9239473, "size": 975, "stargazer_count": 147, "stars": null, "updates": null, "url": "https://github.com/ef-labs/vertx-jersey" }
9239473_16
{ "fields": [ { "declarator": "vertx", "modifier": "@Mock\n private", "original_string": "@Mock\n private Vertx vertx;", "type": "Vertx", "var_name": "vertx" }, { "declarator": "context", "modifier": "@Mock\n private", "original_string": "@Mock\n ...
{ "body": "@Test\n public void testGetProperties() throws Exception {\n\n JsonObject props = new JsonObject().put(\"prop1\", \"a\");\n config.put(DefaultJerseyOptions.CONFIG_PROPERTIES, props);\n assertEquals(props.getMap(), options.getProperties());\n\n }", "class_method_signature": "Def...
{ "fields": [ { "declarator": "CONFIG_HOST = \"host\"", "modifier": "public final static", "original_string": "public final static String CONFIG_HOST = \"host\";", "type": "String", "var_name": "CONFIG_HOST" }, { "declarator": "CONFIG_PORT = \"port\"", "modifier":...
{ "body": "@Override\n public Map<String, Object> getProperties() {\n JsonObject json = null;\n JsonObject tmp;\n\n tmp = config.getJsonObject(CONFIG_PROPERTIES);\n if (tmp != null) {\n json = tmp;\n }\n\n tmp = config.getJsonObject(CONFIG_RESOURCE_CONFIG);\n ...
{ "created": null, "fork": null, "fork_count": 46, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 9239473, "size": 975, "stargazer_count": 147, "stars": null, "updates": null, "url": "https://github.com/ef-labs/vertx-jersey" }
9239473_36
{ "fields": [ { "declarator": "writer", "modifier": "", "original_string": "VertxResponseWriter writer;", "type": "VertxResponseWriter", "var_name": "writer" }, { "declarator": "responseProcessors = new ArrayList<>()", "modifier": "", "original_string": "Lis...
{ "body": "@Test\n public void testWrite_Chunked() throws Exception {\n\n ContainerResponse cr = mock(ContainerResponse.class);\n MultivaluedMap<String, String> headers = new MultivaluedHashMap<>();\n when(cr.getStatusInfo()).thenReturn(mock(Response.StatusType.class));\n when(cr.getStr...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(VertxResponseWriter.class)", "modifier": "private static final", "original_string": "private static final Logger logger = LoggerFactory.getLogger(VertxResponseWriter.class);", "type": "Logger", "var_name": "logger" }...
{ "body": "@Override\n public OutputStream writeResponseStatusAndHeaders(long contentLength, ContainerResponse responseContext) throws ContainerException {\n jerseyResponse = responseContext;\n HttpServerResponse response = vertxRequest.response();\n\n // Write the status\n response.set...
{ "created": null, "fork": null, "fork_count": 46, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 9239473, "size": 975, "stargazer_count": 147, "stars": null, "updates": null, "url": "https://github.com/ef-labs/vertx-jersey" }
9239473_20
{ "fields": [ { "declarator": "jerseyServer", "modifier": "", "original_string": "DefaultJerseyServer jerseyServer;", "type": "DefaultJerseyServer", "var_name": "jerseyServer" }, { "declarator": "baseUri = URI.create(\"http://test.englishtown.com/test\")", "modifi...
{ "body": "@Test\n public void testInit_Default_Config() throws Exception {\n when(serverOptions.getHost()).thenReturn(\"0.0.0.0\");\n when(serverOptions.getPort()).thenReturn(80);\n jerseyServer.start();\n verifyExecuteBlocking();\n verifyResults(80, \"0.0.0.0\");\n }", "cl...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(DefaultJerseyServer.class)", "modifier": "private static final", "original_string": "private static final Logger logger = LoggerFactory.getLogger(DefaultJerseyServer.class);", "type": "Logger", "var_name": "logger" }...
{ "body": "@Override\n public void start(@Nullable JerseyServerOptions options, @Nullable JerseyOptions jerseyOptions, @Nullable Handler<AsyncResult<HttpServer>> doneHandler) {\n\n if (options == null) {\n options = optionsProvider.get();\n }\n\n HttpServerOptions serverOptions = op...
{ "created": null, "fork": null, "fork_count": 46, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 9239473, "size": 975, "stargazer_count": 147, "stars": null, "updates": null, "url": "https://github.com/ef-labs/vertx-jersey" }
9239473_11
{ "fields": [ { "declarator": "vertx", "modifier": "@Mock\n private", "original_string": "@Mock\n private Vertx vertx;", "type": "Vertx", "var_name": "vertx" }, { "declarator": "context", "modifier": "@Mock\n private", "original_string": "@Mock\n ...
{ "body": "@Test\n public void testGetPackages() throws Exception {\n\n String package1 = \"com.englishtown.vertx.jersey.resources1\";\n String package2 = \"com.englishtown.vertx.jersey.resources2\";\n\n config.put(DefaultJerseyOptions.CONFIG_RESOURCES, new JsonArray().add(package1));\n ...
{ "fields": [ { "declarator": "CONFIG_HOST = \"host\"", "modifier": "public final static", "original_string": "public final static String CONFIG_HOST = \"host\";", "type": "String", "var_name": "CONFIG_HOST" }, { "declarator": "CONFIG_PORT = \"port\"", "modifier":...
{ "body": "@Override\n public List<String> getPackages() {\n List<String> list = new ArrayList<>();\n\n Consumer<JsonArray> reader = array -> {\n if ((array != null && !array.isEmpty())) {\n for (int i = 0; i < array.size(); i++) {\n list.add(array.getStri...
{ "created": null, "fork": null, "fork_count": 46, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 9239473, "size": 975, "stargazer_count": 147, "stars": null, "updates": null, "url": "https://github.com/ef-labs/vertx-jersey" }
9239473_46
{ "fields": [ { "declarator": "mockitoRule = MockitoJUnit.rule()", "modifier": "@Rule\n public", "original_string": "@Rule\n public MockitoRule mockitoRule = MockitoJUnit.rule();", "type": "MockitoRule", "var_name": "mockitoRule" }, { "declarator": "configId = \"c...
{ "body": "@Test\n public void testInitParamsCreation() throws Exception {\n servletConfig = new SwaggerServletConfig(context, configuration);\n\n assertNotNull(servletConfig);\n\n assertEquals(configId, servletConfig.getInitParameter(CONFIG_ID_KEY));\n assertEquals(scannerId, servletCo...
{ "fields": [ { "declarator": "context", "modifier": "private", "original_string": "private ServletContext context;", "type": "ServletContext", "var_name": "context" }, { "declarator": "initParams = new HashMap<>()", "modifier": "private", "original_string":...
{ "body": "@Override\n public String getInitParameter(String name) {\n return initParams.get(name);\n }", "class_method_signature": "SwaggerServletConfig.getInitParameter(String name)", "constructor": false, "full_signature": "@Override public String getInitParameter(String name)", "identifier": ...
{ "created": null, "fork": null, "fork_count": 46, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 9239473, "size": 975, "stargazer_count": 147, "stars": null, "updates": null, "url": "https://github.com/ef-labs/vertx-jersey" }
9239473_50
{ "fields": [ { "declarator": "feature = new SwaggerFeature()", "modifier": "private", "original_string": "private SwaggerFeature feature = new SwaggerFeature();", "type": "SwaggerFeature", "var_name": "feature" }, { "declarator": "properties = new HashMap<>()", "...
{ "body": "@Test\n public void testConfigure() throws Exception {\n\n boolean result = feature.configure(context);\n\n assertTrue(result);\n verify(context).register(eq(SwaggerCorsFilter.class));\n verify(context).register(eq(ApiListingResource.class));\n verify(context).register...
{ "fields": [ { "declarator": "PROPERTY_DISABLE = \"vertx.jersey.swagger.disable\"", "modifier": "public static final", "original_string": "public static final String PROPERTY_DISABLE = \"vertx.jersey.swagger.disable\";", "type": "String", "var_name": "PROPERTY_DISABLE" }, { ...
{ "body": "@Override\n public boolean configure(FeatureContext context) {\n\n Configuration config = context.getConfiguration();\n\n if (PropertiesHelper.isProperty(config.getProperties(), PROPERTY_DISABLE)) {\n return false;\n }\n\n if (!PropertiesHelper.isProperty(config.ge...
{ "created": null, "fork": null, "fork_count": 46, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 9239473, "size": 975, "stargazer_count": 147, "stars": null, "updates": null, "url": "https://github.com/ef-labs/vertx-jersey" }
9239473_6
{ "fields": [ { "declarator": "container", "modifier": "private", "original_string": "private DefaultVertxContainer container;", "type": "DefaultVertxContainer", "var_name": "container" }, { "declarator": "locator", "modifier": "private", "original_string": ...
{ "body": "@Test\n public void testStop() throws Exception {\n\n packages.add(\"com.englishtown.vertx.jersey.resources\");\n container = new DefaultVertxContainer(vertx, options, locator, null);\n container.start();\n\n container.stop();\n // Can't mock applicationHandler so can'...
{ "fields": [ { "declarator": "vertx", "modifier": "private final", "original_string": "private final Vertx vertx;", "type": "Vertx", "var_name": "vertx" }, { "declarator": "locator", "modifier": "private final", "original_string": "private final ServiceLoca...
{ "body": "@Override\n public void stop() {\n if (!started) {\n return;\n }\n getApplicationHandler().onShutdown(this);\n applicationHandlerDelegate = null;\n started = false;\n }", "class_method_signature": "DefaultVertxContainer.stop()", "constructor": false, ...
{ "created": null, "fork": null, "fork_count": 46, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 9239473, "size": 975, "stargazer_count": 147, "stars": null, "updates": null, "url": "https://github.com/ef-labs/vertx-jersey" }
9239473_27
{ "fields": [ { "declarator": "jerseyHandler", "modifier": "", "original_string": "DefaultJerseyHandler jerseyHandler;", "type": "DefaultJerseyHandler", "var_name": "jerseyHandler" }, { "declarator": "config = new JsonObject()", "modifier": "", "original_str...
{ "body": "@Test\n public void testHandle_JSON_POST() throws Exception {\n\n DefaultHttpHeaders headers = new DefaultHttpHeaders();\n headers.add(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON);\n when(request.method()).thenReturn(HttpMethod.POST);\n when(request.headers()).thenRe...
{ "fields": [ { "declarator": "containerProvider", "modifier": "private", "original_string": "private Provider<VertxContainer> containerProvider;", "type": "Provider<VertxContainer>", "var_name": "containerProvider" }, { "declarator": "container", "modifier": "pri...
{ "body": "@Override\n public void handle(final HttpServerRequest vertxRequest) {\n\n // Wait for the body for jersey to handle form/json/xml params\n if (shouldReadData(vertxRequest)) {\n if (logger.isDebugEnabled()) {\n logger.debug(\"DefaultJerseyHandler - handle request ...
{ "created": null, "fork": null, "fork_count": 46, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 9239473, "size": 975, "stargazer_count": 147, "stars": null, "updates": null, "url": "https://github.com/ef-labs/vertx-jersey" }
9239473_31
{ "fields": [ { "declarator": "jerseyHandler", "modifier": "", "original_string": "DefaultJerseyHandler jerseyHandler;", "type": "DefaultJerseyHandler", "var_name": "jerseyHandler" }, { "declarator": "config = new JsonObject()", "modifier": "", "original_str...
{ "body": "@Test\n public void testGetAbsoluteURI() throws Exception {\n URI uri;\n\n String absoluteUri = \"http://0.0.0.0:80/test\";\n String host = \"test.englishtown.com\";\n String badUrl = \"http://test.englishtown.com/test?a=b=c|d=e\";\n\n HttpServerRequest request = mock(...
{ "fields": [ { "declarator": "containerProvider", "modifier": "private", "original_string": "private Provider<VertxContainer> containerProvider;", "type": "Provider<VertxContainer>", "var_name": "containerProvider" }, { "declarator": "container", "modifier": "pri...
{ "body": "protected URI getAbsoluteURI(HttpServerRequest vertxRequest) {\n\n URI absoluteUri;\n String hostAndPort = vertxRequest.headers().get(HttpHeaders.HOST);\n\n try {\n absoluteUri = URI.create(vertxRequest.absoluteURI());\n\n if (hostAndPort != null && !hostAndPort.i...
{ "created": null, "fork": null, "fork_count": 46, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 9239473, "size": 975, "stargazer_count": 147, "stars": null, "updates": null, "url": "https://github.com/ef-labs/vertx-jersey" }
9239473_30
{ "fields": [ { "declarator": "jerseyHandler", "modifier": "", "original_string": "DefaultJerseyHandler jerseyHandler;", "type": "DefaultJerseyHandler", "var_name": "jerseyHandler" }, { "declarator": "config = new JsonObject()", "modifier": "", "original_str...
{ "body": "@Test\n public void testShouldReadData() throws Exception {\n\n boolean result;\n\n DefaultHttpHeaders headers = new DefaultHttpHeaders();\n headers.add(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_OCTET_STREAM);\n\n when(request.method()).thenReturn(HttpMethod.GET).thenRe...
{ "fields": [ { "declarator": "containerProvider", "modifier": "private", "original_string": "private Provider<VertxContainer> containerProvider;", "type": "Provider<VertxContainer>", "var_name": "containerProvider" }, { "declarator": "container", "modifier": "pri...
{ "body": "protected boolean shouldReadData(HttpServerRequest vertxRequest) {\n\n HttpMethod method = vertxRequest.method();\n\n // Only read input stream data for post/put/patch methods\n if (!(HttpMethod.POST == method || HttpMethod.PUT == method || HttpMethod.PATCH == method)) {\n r...
{ "created": null, "fork": null, "fork_count": 46, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 9239473, "size": 975, "stargazer_count": 147, "stars": null, "updates": null, "url": "https://github.com/ef-labs/vertx-jersey" }
9239473_26
{ "fields": [ { "declarator": "jerseyHandler", "modifier": "", "original_string": "DefaultJerseyHandler jerseyHandler;", "type": "DefaultJerseyHandler", "var_name": "jerseyHandler" }, { "declarator": "config = new JsonObject()", "modifier": "", "original_str...
{ "body": "@Test\n public void testHandle() throws Exception {\n\n when(request.method()).thenReturn(HttpMethod.GET);\n when(request.headers()).thenReturn(mock(MultiMap.class));\n\n jerseyHandler.handle(request);\n verify(applicationHandlerDelegate).handle(any(ContainerRequest.class));\...
{ "fields": [ { "declarator": "containerProvider", "modifier": "private", "original_string": "private Provider<VertxContainer> containerProvider;", "type": "Provider<VertxContainer>", "var_name": "containerProvider" }, { "declarator": "container", "modifier": "pri...
{ "body": "@Override\n public void handle(final HttpServerRequest vertxRequest) {\n\n // Wait for the body for jersey to handle form/json/xml params\n if (shouldReadData(vertxRequest)) {\n if (logger.isDebugEnabled()) {\n logger.debug(\"DefaultJerseyHandler - handle request ...
{ "created": null, "fork": null, "fork_count": 46, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 9239473, "size": 975, "stargazer_count": 147, "stars": null, "updates": null, "url": "https://github.com/ef-labs/vertx-jersey" }
9239473_7
{ "fields": [ { "declarator": "container", "modifier": "private", "original_string": "private DefaultVertxContainer container;", "type": "DefaultVertxContainer", "var_name": "container" }, { "declarator": "locator", "modifier": "private", "original_string": ...
{ "body": "@Test\n public void testResourceConfigModifier() throws Exception {\n\n boolean[] b = {false};\n\n ApplicationConfigurator configurator = rc -> {\n b[0] = true;\n return rc;\n };\n\n packages.add(\"com.englishtown.vertx.jersey.resources\");\n cont...
{ "fields": [ { "declarator": "vertx", "modifier": "private final", "original_string": "private final Vertx vertx;", "type": "Vertx", "var_name": "vertx" }, { "declarator": "locator", "modifier": "private final", "original_string": "private final ServiceLoca...
{ "body": "@Override\n public void start() {\n if (started) {\n return;\n }\n ApplicationHandler handler = getApplicationHandler();\n if (handler == null) {\n throw new IllegalStateException(\"ApplicationHandler cannot be null\");\n }\n handler.onStar...
{ "created": null, "fork": null, "fork_count": 46, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 9239473, "size": 975, "stargazer_count": 147, "stars": null, "updates": null, "url": "https://github.com/ef-labs/vertx-jersey" }
9239473_51
{ "fields": [ { "declarator": "feature = new SwaggerFeature()", "modifier": "private", "original_string": "private SwaggerFeature feature = new SwaggerFeature();", "type": "SwaggerFeature", "var_name": "feature" }, { "declarator": "properties = new HashMap<>()", "...
{ "body": "@Test\n public void testConfigure_Disable() throws Exception {\n\n properties.put(SwaggerFeature.PROPERTY_DISABLE, true);\n boolean result = feature.configure(context);\n\n assertFalse(result);\n verify(context, never()).register(any());\n\n }", "class_method_signature":...
{ "fields": [ { "declarator": "PROPERTY_DISABLE = \"vertx.jersey.swagger.disable\"", "modifier": "public static final", "original_string": "public static final String PROPERTY_DISABLE = \"vertx.jersey.swagger.disable\";", "type": "String", "var_name": "PROPERTY_DISABLE" }, { ...
{ "body": "@Override\n public boolean configure(FeatureContext context) {\n\n Configuration config = context.getConfiguration();\n\n if (PropertiesHelper.isProperty(config.getProperties(), PROPERTY_DISABLE)) {\n return false;\n }\n\n if (!PropertiesHelper.isProperty(config.ge...
{ "created": null, "fork": null, "fork_count": 46, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 9239473, "size": 975, "stargazer_count": 147, "stars": null, "updates": null, "url": "https://github.com/ef-labs/vertx-jersey" }
9239473_47
{ "fields": [ { "declarator": "mockitoRule = MockitoJUnit.rule()", "modifier": "@Rule\n public", "original_string": "@Rule\n public MockitoRule mockitoRule = MockitoJUnit.rule();", "type": "MockitoRule", "var_name": "mockitoRule" }, { "declarator": "configId = \"c...
{ "body": "@Test\n public void testInitParamsCreation_nullProperty() throws Exception {\n properties.put(CONFIG_ID_KEY, null);\n\n servletConfig = new SwaggerServletConfig(context, configuration);\n\n assertNotNull(servletConfig);\n\n assertNull(servletConfig.getInitParameter(CONFIG_ID_...
{ "fields": [ { "declarator": "context", "modifier": "private", "original_string": "private ServletContext context;", "type": "ServletContext", "var_name": "context" }, { "declarator": "initParams = new HashMap<>()", "modifier": "private", "original_string":...
{ "body": "@Override\n public String getInitParameter(String name) {\n return initParams.get(name);\n }", "class_method_signature": "SwaggerServletConfig.getInitParameter(String name)", "constructor": false, "full_signature": "@Override public String getInitParameter(String name)", "identifier": ...
{ "created": null, "fork": null, "fork_count": 46, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 9239473, "size": 975, "stargazer_count": 147, "stars": null, "updates": null, "url": "https://github.com/ef-labs/vertx-jersey" }
9239473_10
{ "fields": [ { "declarator": "vertx", "modifier": "@Mock\n private", "original_string": "@Mock\n private Vertx vertx;", "type": "Vertx", "var_name": "vertx" }, { "declarator": "context", "modifier": "@Mock\n private", "original_string": "@Mock\n ...
{ "body": "@Test\n public void testGetMaxBodySize() throws Exception {\n\n int expected = DefaultJerseyOptions.DEFAULT_MAX_BODY_SIZE;\n int maxBodySize;\n\n maxBodySize = options.getMaxBodySize();\n assertEquals(expected, maxBodySize);\n\n expected = 12;\n config.put(Defau...
{ "fields": [ { "declarator": "CONFIG_HOST = \"host\"", "modifier": "public final static", "original_string": "public final static String CONFIG_HOST = \"host\";", "type": "String", "var_name": "CONFIG_HOST" }, { "declarator": "CONFIG_PORT = \"port\"", "modifier":...
{ "body": "@Override\n public int getMaxBodySize() {\n return config.getInteger(CONFIG_MAX_BODY_SIZE, DEFAULT_MAX_BODY_SIZE);\n }", "class_method_signature": "DefaultJerseyOptions.getMaxBodySize()", "constructor": false, "full_signature": "@Override public int getMaxBodySize()", "identifier": "ge...
{ "created": null, "fork": null, "fork_count": 46, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 9239473, "size": 975, "stargazer_count": 147, "stars": null, "updates": null, "url": "https://github.com/ef-labs/vertx-jersey" }
78418280_0
{ "fields": [], "file": "app/src/test/java/com/codemate/booklibrary/data/RandomBookGeneratorTest.java", "identifier": "RandomBookGeneratorTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void generatingRandomBooks_ReturnsNonEmptyBookList() {\n List<Book> books = new RandomBookGenerator().generate(15);\n\n assertEquals(15, books.size());\n\n for (Book book : books) {\n assertNotNull(book.getTitle());\n assertNotNull(book.getAuthor...
{ "fields": [ { "declarator": "SUBJECTS = {\n \"Chicken\", \"Pig\", \"Hippo\", \"Dinosaur\", \"Giraffe\", \"Orangutan\",\n \"Bat\", \"Lion\", \"Daddy\", \"Grandpa\", \"Coffee\", \"Dog\", \"Rat\",\n \"Pokemon\", \"Cat\", \"Pensioner\", \"Project Manager\", \"Salesperson\"\n ...
{ "body": "public List<Book> generate(int howMany) {\n List<Book> books = new ArrayList<>();\n\n for (int i = 0; i < howMany; i++) {\n books.add(randomBook());\n }\n\n return books;\n }", "class_method_signature": "RandomBookGenerator.generate(int howMany)", "constructor"...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 78418280, "size": 566, "stargazer_count": 27, "stars": null, "updates": null, "url": "https://github.com/CodemateLtd/Android-Cucumber-BDD-Sample" }
78418280_1
{ "fields": [ { "declarator": "DUMMY_BOOKS = Arrays.asList(\n new Book(\"Sample book one\", \"John Doe\", Date.valueOf(\"2000-10-25\")),\n new Book(\"Sample book two\", \"Jane Doe\", Date.valueOf(\"2016-01-01\")),\n new Book(\"Sample book three\", \"Some One\", Date.valueOf(...
{ "body": "@Test\n public void fetchBooks_LoadsAll_AndShowsThemInUI() {\n presenter.fetchBooks();\n\n verify(mainView).showBooks(DUMMY_BOOKS);\n }", "class_method_signature": "MainPresenterTest.fetchBooks_LoadsAll_AndShowsThemInUI()", "constructor": false, "full_signature": "@Test public voi...
{ "fields": [ { "declarator": "mainView", "modifier": "private final", "original_string": "private final MainView mainView;", "type": "MainView", "var_name": "mainView" }, { "declarator": "library", "modifier": "private final", "original_string": "private fi...
{ "body": "public void fetchBooks() {\n // Populate the library with fake dummy data. In a real app\n // we would have an interactor that would fetch the books from\n // a real API.\n List<Book> books = bookGenerator.generate(45);\n library.addBooks(books);\n\n mainView.showB...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 78418280, "size": 566, "stargazer_count": 27, "stars": null, "updates": null, "url": "https://github.com/CodemateLtd/Android-Cucumber-BDD-Sample" }
15655130_5
{ "fields": [ { "declarator": "factory", "modifier": "@InjectMocks\n private", "original_string": "@InjectMocks\n private ComponentFactory factory;", "type": "ComponentFactory", "var_name": "factory" }, { "declarator": "tridentTopology", "modifier": "@Mock\n...
{ "body": "@Test\n public void should_set_configuration() {\n // Given\n ComponentConfiguration configuration = new ComponentConfiguration(randomAlphabetic(6), new ComponentDescription(TestComponent.class));\n\n Map<String, Stream> inputStreams = new HashMap<String, Stream>();\n Stream ...
{ "fields": [ { "declarator": "tridentTopology", "modifier": "private", "original_string": "private TridentTopology tridentTopology;", "type": "TridentTopology", "var_name": "tridentTopology" }, { "declarator": "config", "modifier": "private", "original_stri...
{ "body": "public Component createComponent(ComponentConfiguration configuration, Map<String, StateFactory> stateFactories, Map<String, Stream> inputStreams) {\n try {\n Component component = configuration.retrieveImplementationClass().newInstance();\n setProperties(component, configurati...
{ "created": null, "fork": null, "fork_count": 0, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 15655130, "size": 2828, "stargazer_count": 5, "stars": null, "updates": null, "url": "https://github.com/pmerienne/stormy-pythian" }
15655130_28
{ "fields": [ { "declarator": "factory", "modifier": "private", "original_string": "private PropertyDescriptionFactory factory;", "type": "PropertyDescriptionFactory", "var_name": "factory" } ], "file": "stormy-pythian-core/src/test/java/stormy/pythian/core/description/Proper...
{ "body": "@Test\n\tpublic void should_retrieve_enum_description() {\n\t\t// Given\n\t\t@Documentation(name = \"Test component\")\n\t\tclass TestComponent implements Component {\n\n\t\t\t@Property(name = \"enum\")\n\t\t\tpublic TestEnum expectedProperty;\n\n\t\t\t@Override\n\t\t\tpublic void init() {\n\n\t\t\t}\n\t\t...
{ "fields": [], "file": "stormy-pythian-core/src/main/java/stormy/pythian/core/description/PropertyDescriptionFactory.java", "identifier": "PropertyDescriptionFactory", "interfaces": "", "methods": [ { "class_method_signature": "PropertyDescriptionFactory.createPropertyDescriptions(Class<?> componen...
{ "body": "@SuppressWarnings(\"unchecked\")\n public List<PropertyDescription> createPropertyDescriptions(Class<?> componentClass) {\n List<PropertyDescription> propertyDescriptions = new ArrayList<>();\n\n Set<Field> propertyFields = getAllFields(componentClass, withAnnotation(Property.class));\n ...
{ "created": null, "fork": null, "fork_count": 0, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 15655130, "size": 2828, "stargazer_count": 5, "stars": null, "updates": null, "url": "https://github.com/pmerienne/stormy-pythian" }
15655130_53
{ "fields": [ { "declarator": "service", "modifier": "@InjectMocks\n private", "original_string": "@InjectMocks\n private LocalCLusterService service;", "type": "LocalCLusterService", "var_name": "service" }, { "declarator": "topologyRepository", "modifier":...
{ "body": "@SuppressWarnings(\"unchecked\")\n @Test(expected = TopologyLaunchException.class)\n public void should_throw_launch_exception_when_storm_submit_fails() throws TopologyLaunchException {\n // Given\n String topologyId = random(6);\n PythianToplogyConfiguration configuration = mock...
{ "fields": [ { "declarator": "topologyRepository", "modifier": "@Autowired\n private", "original_string": "@Autowired\n private TopologyRepository topologyRepository;", "type": "TopologyRepository", "var_name": "topologyRepository" }, { "declarator": "cluster", ...
{ "body": "public void launch(String topologyId) throws TopologyLaunchException {\n PythianToplogyConfiguration configuration = topologyRepository.findById(topologyId);\n if (configuration == null) {\n throw new TopologyLaunchException(\"No topology found with id \" + topologyId);\n }\...
{ "created": null, "fork": null, "fork_count": 0, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 15655130, "size": 2828, "stargazer_count": 5, "stars": null, "updates": null, "url": "https://github.com/pmerienne/stormy-pythian" }
15655130_45
{ "fields": [ { "declarator": "factory", "modifier": "@InjectMocks\n\tprivate", "original_string": "@InjectMocks\n\tprivate PythianStateDescriptionFactory factory;", "type": "PythianStateDescriptionFactory", "var_name": "factory" }, { "declarator": "propertyDescriptionF...
{ "body": "@Test\n\tpublic void should_create_description() {\n\t\t// Given\n\t\t@Documentation(name = \"Name\", description = \"Description\")\n\t\tclass TestState implements PythianState {\n\n\t\t\tpublic StateFactory createStateFactory() {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t}\n\n\t\tList<PropertyDescription> ex...
{ "fields": [ { "declarator": "propertyDescriptionFactory", "modifier": "@Autowired\n\tprivate", "original_string": "@Autowired\n\tprivate PropertyDescriptionFactory propertyDescriptionFactory;", "type": "PropertyDescriptionFactory", "var_name": "propertyDescriptionFactory" } ]...
{ "body": "public PythianStateDescription createDescription(Class<? extends PythianState> clazz) {\n\t\tcheckArgument(clazz != null, \"PythianState class is mandatory\");\n\n\t\tDocumentation documentation = clazz.getAnnotation(Documentation.class);\n\t\tcheckArgument(documentation != null, \"No documentation found f...
{ "created": null, "fork": null, "fork_count": 0, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 15655130, "size": 2828, "stargazer_count": 5, "stars": null, "updates": null, "url": "https://github.com/pmerienne/stormy-pythian" }
15655130_12
{ "fields": [], "file": "stormy-pythian-core/src/test/java/stormy/pythian/core/topology/AvailableComponentPoolTest.java", "identifier": "AvailableComponentPoolTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void should_not_retrieve_not_available_component() {\n // Given\n ComponentConfiguration configuration = createComponentConfigurationWithInputStreams();\n ConnectionConfiguration connection1 = new ConnectionConfiguration(\"\", \"\", configuration.getId(), \"in1\");\n ...
{ "fields": [ { "declarator": "components = new ArrayList<>()", "modifier": "private", "original_string": "private List<ComponentConfiguration> components = new ArrayList<>();", "type": "List<ComponentConfiguration>", "var_name": "components" }, { "declarator": "connect...
{ "body": "public ComponentConfiguration getAvailableComponent() {\n return Iterables.tryFind(components, IS_AVAILABLE).orNull();\n }", "class_method_signature": "AvailableComponentPool.getAvailableComponent()", "constructor": false, "full_signature": "public ComponentConfiguration getAvailableCompone...
{ "created": null, "fork": null, "fork_count": 0, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 15655130, "size": 2828, "stargazer_count": 5, "stars": null, "updates": null, "url": "https://github.com/pmerienne/stormy-pythian" }
15655130_32
{ "fields": [ { "declarator": "factory", "modifier": "@InjectMocks\n private", "original_string": "@InjectMocks\n private InputStreamDescriptionFactory factory;", "type": "InputStreamDescriptionFactory", "var_name": "factory" }, { "declarator": "featureDescriptorF...
{ "body": "@Test(expected = IllegalArgumentException.class)\n public void should_throw_illegal_argument_exception_when_input_stream_annotation_not_applied_on_stream() {\n // Given\n @Documentation(name = \"Test component\")\n class TestComponent implements Component {\n\n @InputStre...
{ "fields": [ { "declarator": "featureDescriptorFactory", "modifier": "@Autowired\n private", "original_string": "@Autowired\n private FeatureDescriptionFactory featureDescriptorFactory;", "type": "FeatureDescriptionFactory", "var_name": "featureDescriptorFactory" } ], ...
{ "body": "@SuppressWarnings(\"unchecked\")\n public List<InputStreamDescription> createInputStreamDescriptions(Class<?> componentClass) {\n List<InputStreamDescription> inputStreamDescriptions = new ArrayList<>();\n\n Set<Field> inputStreamFields = getAllFields(componentClass, withAnnotation(InputSt...
{ "created": null, "fork": null, "fork_count": 0, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 15655130, "size": 2828, "stargazer_count": 5, "stars": null, "updates": null, "url": "https://github.com/pmerienne/stormy-pythian" }
15655130_9
{ "fields": [ { "declarator": "factory", "modifier": "@InjectMocks\n private", "original_string": "@InjectMocks\n private ComponentFactory factory;", "type": "ComponentFactory", "var_name": "factory" }, { "declarator": "tridentTopology", "modifier": "@Mock\n...
{ "body": "@Test\n public void should_set_state_factories() {\n // Given\n StateFactory expectedStateFactory = mock(StateFactory.class);\n Map<String, StateFactory> topologyStateFactories = new HashMap<>();\n topologyStateFactories.put(\"Word count\", expectedStateFactory);\n\n C...
{ "fields": [ { "declarator": "tridentTopology", "modifier": "private", "original_string": "private TridentTopology tridentTopology;", "type": "TridentTopology", "var_name": "tridentTopology" }, { "declarator": "config", "modifier": "private", "original_stri...
{ "body": "public Component createComponent(ComponentConfiguration configuration, Map<String, StateFactory> stateFactories, Map<String, Stream> inputStreams) {\n try {\n Component component = configuration.retrieveImplementationClass().newInstance();\n setProperties(component, configurati...
{ "created": null, "fork": null, "fork_count": 0, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 15655130, "size": 2828, "stargazer_count": 5, "stars": null, "updates": null, "url": "https://github.com/pmerienne/stormy-pythian" }
15655130_24
{ "fields": [ { "declarator": "factory", "modifier": "@InjectMocks\n private", "original_string": "@InjectMocks\n private OutputStreamDescriptionFactory factory;", "type": "OutputStreamDescriptionFactory", "var_name": "factory" }, { "declarator": "featureDescripto...
{ "body": "@Test\n public void should_retrieve_output_stream_descriptions() {\n // Given\n @Documentation(name = \"Test component\")\n class TestComponent implements Component {\n\n @InputStream(name = \"in\")\n public Stream in;\n\n @ListMapper(stream = \"in\"...
{ "fields": [ { "declarator": "featureDescriptorFactory", "modifier": "@Autowired\n private", "original_string": "@Autowired\n private FeatureDescriptionFactory featureDescriptorFactory;", "type": "FeatureDescriptionFactory", "var_name": "featureDescriptorFactory" } ], ...
{ "body": "@SuppressWarnings(\"unchecked\")\n public List<OutputStreamDescription> createOutputStreamDescriptions(Class<?> componentClass) {\n List<OutputStreamDescription> descriptions = new ArrayList<>();\n\n Set<Field> fields = getAllFields(componentClass, withAnnotation(OutputStream.class));\n ...
{ "created": null, "fork": null, "fork_count": 0, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 15655130, "size": 2828, "stargazer_count": 5, "stars": null, "updates": null, "url": "https://github.com/pmerienne/stormy-pythian" }
15655130_49
{ "fields": [ { "declarator": "service", "modifier": "@InjectMocks\n\tprivate", "original_string": "@InjectMocks\n\tprivate DescriptionService service;", "type": "DescriptionService", "var_name": "service" }, { "declarator": "componentDescriptionFactory", "modifie...
{ "body": "@Test\n\tpublic void should_load_state_descriptions() {\n\t\t// Given\n\t\twhen(classRepository.getStateClasses()).thenReturn(newHashSet(State1.class, State2.class));\n\n\t\tPythianStateDescription state1Description = mock(PythianStateDescription.class);\n\t\tPythianStateDescription state2Description = moc...
{ "fields": [ { "declarator": "componentDescriptionFactory", "modifier": "@Autowired\n\tprivate", "original_string": "@Autowired\n\tprivate ComponentDescriptionFactory componentDescriptionFactory;", "type": "ComponentDescriptionFactory", "var_name": "componentDescriptionFactory" ...
{ "body": "public List<PythianStateDescription> findAllStateDescriptions() {\n\t\tSet<Class<? extends PythianState>> classes = classRepository.getStateClasses();\n\t\tList<PythianStateDescription> descriptions = new ArrayList<>();\n\n\t\tfor (Class<? extends PythianState> clazz : classes) {\n\t\t\ttry {\n\t\t\t\tPyth...
{ "created": null, "fork": null, "fork_count": 0, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 15655130, "size": 2828, "stargazer_count": 5, "stars": null, "updates": null, "url": "https://github.com/pmerienne/stormy-pythian" }
15655130_48
{ "fields": [ { "declarator": "service", "modifier": "@InjectMocks\n\tprivate", "original_string": "@InjectMocks\n\tprivate DescriptionService service;", "type": "DescriptionService", "var_name": "service" }, { "declarator": "componentDescriptionFactory", "modifie...
{ "body": "@Test\n\tpublic void should_load_component_descriptions() {\n\t\t// Given\n\t\twhen(classRepository.getComponentClasses()).thenReturn(newHashSet(TestAnalytics.class, TestLearner1.class, TestLearner2.class));\n\n\t\tComponentDescription testAnalyticsDescription = mock(ComponentDescription.class);\n\t\tCompo...
{ "fields": [ { "declarator": "componentDescriptionFactory", "modifier": "@Autowired\n\tprivate", "original_string": "@Autowired\n\tprivate ComponentDescriptionFactory componentDescriptionFactory;", "type": "ComponentDescriptionFactory", "var_name": "componentDescriptionFactory" ...
{ "body": "public List<ComponentDescription> findAllComponentDescriptions() {\n\t\tSet<Class<? extends Component>> classes = classRepository.getComponentClasses();\n\t\tList<ComponentDescription> descriptions = new ArrayList<>();\n\n\t\tfor (Class<? extends Component> componentClass : classes) {\n\t\t\ttry {\n\t\t\t\...
{ "created": null, "fork": null, "fork_count": 0, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 15655130, "size": 2828, "stargazer_count": 5, "stars": null, "updates": null, "url": "https://github.com/pmerienne/stormy-pythian" }
15655130_8
{ "fields": [ { "declarator": "factory", "modifier": "@InjectMocks\n private", "original_string": "@InjectMocks\n private ComponentFactory factory;", "type": "ComponentFactory", "var_name": "factory" }, { "declarator": "tridentTopology", "modifier": "@Mock\n...
{ "body": "@SuppressWarnings(\"unchecked\")\n @Test\n public void should_set_user_selection_output_stream_mapper() {\n // Given\n List<String> selectedFeatures = asList(\"path\", \"response time\", \"ip\");\n OutputStreamDescription outputStreamDescription = new OutputStreamDescription(\"ou...
{ "fields": [ { "declarator": "tridentTopology", "modifier": "private", "original_string": "private TridentTopology tridentTopology;", "type": "TridentTopology", "var_name": "tridentTopology" }, { "declarator": "config", "modifier": "private", "original_stri...
{ "body": "public Component createComponent(ComponentConfiguration configuration, Map<String, StateFactory> stateFactories, Map<String, Stream> inputStreams) {\n try {\n Component component = configuration.retrieveImplementationClass().newInstance();\n setProperties(component, configurati...
{ "created": null, "fork": null, "fork_count": 0, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 15655130, "size": 2828, "stargazer_count": 5, "stars": null, "updates": null, "url": "https://github.com/pmerienne/stormy-pythian" }
15655130_25
{ "fields": [ { "declarator": "factory", "modifier": "@InjectMocks\n private", "original_string": "@InjectMocks\n private OutputStreamDescriptionFactory factory;", "type": "OutputStreamDescriptionFactory", "var_name": "factory" }, { "declarator": "featureDescripto...
{ "body": "@Test\n public void should_retrieve_user_selection_output_stream_descriptions() {\n // Given\n @Documentation(name = \"Test component\")\n class TestComponent implements Component {\n\n @OutputStream(from = \"in\", name = \"out1\")\n private Stream out1;\n\n ...
{ "fields": [ { "declarator": "featureDescriptorFactory", "modifier": "@Autowired\n private", "original_string": "@Autowired\n private FeatureDescriptionFactory featureDescriptorFactory;", "type": "FeatureDescriptionFactory", "var_name": "featureDescriptorFactory" } ], ...
{ "body": "@SuppressWarnings(\"unchecked\")\n public List<OutputStreamDescription> createOutputStreamDescriptions(Class<?> componentClass) {\n List<OutputStreamDescription> descriptions = new ArrayList<>();\n\n Set<Field> fields = getAllFields(componentClass, withAnnotation(OutputStream.class));\n ...
{ "created": null, "fork": null, "fork_count": 0, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 15655130, "size": 2828, "stargazer_count": 5, "stars": null, "updates": null, "url": "https://github.com/pmerienne/stormy-pythian" }
15655130_33
{ "fields": [ { "declarator": "factory", "modifier": "@InjectMocks\n private", "original_string": "@InjectMocks\n private InputStreamDescriptionFactory factory;", "type": "InputStreamDescriptionFactory", "var_name": "factory" }, { "declarator": "featureDescriptorF...
{ "body": "@Test\n public void should_retrieve_inherited_input_stream_descriptions() {\n // Given\n @Documentation(name = \"Test component\")\n class AbstractTestComponent implements Component {\n\n @InputStream(name = \"in1\")\n private Stream in1;\n\n @ListMa...
{ "fields": [ { "declarator": "featureDescriptorFactory", "modifier": "@Autowired\n private", "original_string": "@Autowired\n private FeatureDescriptionFactory featureDescriptorFactory;", "type": "FeatureDescriptionFactory", "var_name": "featureDescriptorFactory" } ], ...
{ "body": "@SuppressWarnings(\"unchecked\")\n public List<InputStreamDescription> createInputStreamDescriptions(Class<?> componentClass) {\n List<InputStreamDescription> inputStreamDescriptions = new ArrayList<>();\n\n Set<Field> inputStreamFields = getAllFields(componentClass, withAnnotation(InputSt...
{ "created": null, "fork": null, "fork_count": 0, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 15655130, "size": 2828, "stargazer_count": 5, "stars": null, "updates": null, "url": "https://github.com/pmerienne/stormy-pythian" }
15655130_13
{ "fields": [], "file": "stormy-pythian-core/src/test/java/stormy/pythian/core/utils/ReflectionHelperTest.java", "identifier": "ReflectionHelperTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void should_find_input_streams() {\n // Given\n class TestComponent implements Component {\n @InputStream(name = \"in1\")\n public Stream clock;\n\n @InputStream(name = \"in2\")\n public Stream words;\n\n @Override\n ...
{ "fields": [], "file": "stormy-pythian-core/src/main/java/stormy/pythian/core/utils/ReflectionHelper.java", "identifier": "ReflectionHelper", "interfaces": "", "methods": [ { "class_method_signature": "ReflectionHelper.getOutputStreams(Component component)", "constructor": false, "full_...
{ "body": "@SuppressWarnings(\"unchecked\")\n public static List<String> getInputStreamNames(Class<? extends Component> componentClazz) {\n List<String> streams = new ArrayList<>();\n // TODO : better with getAnnotations\n Set<Field> fields = getAllFields(componentClazz, withAnnotation(InputSt...
{ "created": null, "fork": null, "fork_count": 0, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 15655130, "size": 2828, "stargazer_count": 5, "stars": null, "updates": null, "url": "https://github.com/pmerienne/stormy-pythian" }
15655130_44
{ "fields": [ { "declarator": "factory", "modifier": "@InjectMocks\n\tprivate", "original_string": "@InjectMocks\n\tprivate ComponentDescriptionFactory factory;", "type": "ComponentDescriptionFactory", "var_name": "factory" }, { "declarator": "propertyDescriptionFactory...
{ "body": "@Test(expected = IllegalArgumentException.class)\n\tpublic void should_fail_with_duplicated_state_names() {\n\t\t// Given\n\t\t@Documentation(name = \"Test component\")\n\t\tclass TestComponent implements Component {\n\n\t\t\t@State(name = \"word count\")\n\t\t\tprivate StateFactory stateFactory1;\n\n\t\t\...
{ "fields": [ { "declarator": "propertyDescriptionFactory", "modifier": "@Autowired\n\tprivate", "original_string": "@Autowired\n\tprivate PropertyDescriptionFactory propertyDescriptionFactory;", "type": "PropertyDescriptionFactory", "var_name": "propertyDescriptionFactory" }, ...
{ "body": "public ComponentDescription createDescription(Class<? extends Component> componentClass) {\n\t\tcheckArgument(componentClass != null, \"Component class is mandatory\");\n\n\t\tDocumentation documentation = componentClass.getAnnotation(Documentation.class);\n\t\tcheckArgument(documentation != null, \"No doc...
{ "created": null, "fork": null, "fork_count": 0, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 15655130, "size": 2828, "stargazer_count": 5, "stars": null, "updates": null, "url": "https://github.com/pmerienne/stormy-pythian" }
15655130_52
{ "fields": [ { "declarator": "service", "modifier": "@InjectMocks\n private", "original_string": "@InjectMocks\n private LocalCLusterService service;", "type": "LocalCLusterService", "var_name": "service" }, { "declarator": "topologyRepository", "modifier":...
{ "body": "@Test(expected = TopologyLaunchException.class)\n public void should_not_launch_not_existing_topology() throws TopologyLaunchException {\n // Given\n String topologyId = random(6);\n given(topologyRepository.findById(topologyId)).willReturn(null);\n\n // When\n service...
{ "fields": [ { "declarator": "topologyRepository", "modifier": "@Autowired\n private", "original_string": "@Autowired\n private TopologyRepository topologyRepository;", "type": "TopologyRepository", "var_name": "topologyRepository" }, { "declarator": "cluster", ...
{ "body": "public void launch(String topologyId) throws TopologyLaunchException {\n PythianToplogyConfiguration configuration = topologyRepository.findById(topologyId);\n if (configuration == null) {\n throw new TopologyLaunchException(\"No topology found with id \" + topologyId);\n }\...
{ "created": null, "fork": null, "fork_count": 0, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 15655130, "size": 2828, "stargazer_count": 5, "stars": null, "updates": null, "url": "https://github.com/pmerienne/stormy-pythian" }
15655130_4
{ "fields": [ { "declarator": "factory", "modifier": "@InjectMocks\n private", "original_string": "@InjectMocks\n private ComponentFactory factory;", "type": "ComponentFactory", "var_name": "factory" }, { "declarator": "tridentTopology", "modifier": "@Mock\n...
{ "body": "@Test\n public void should_set_topology() {\n // Given\n ComponentConfiguration configuration = new ComponentConfiguration(randomAlphabetic(6), new ComponentDescription(TestComponent.class));\n\n Map<String, Stream> inputStreams = new HashMap<String, Stream>();\n Stream expec...
{ "fields": [ { "declarator": "tridentTopology", "modifier": "private", "original_string": "private TridentTopology tridentTopology;", "type": "TridentTopology", "var_name": "tridentTopology" }, { "declarator": "config", "modifier": "private", "original_stri...
{ "body": "public Component createComponent(ComponentConfiguration configuration, Map<String, StateFactory> stateFactories, Map<String, Stream> inputStreams) {\n try {\n Component component = configuration.retrieveImplementationClass().newInstance();\n setProperties(component, configurati...
{ "created": null, "fork": null, "fork_count": 0, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 15655130, "size": 2828, "stargazer_count": 5, "stars": null, "updates": null, "url": "https://github.com/pmerienne/stormy-pythian" }
15655130_29
{ "fields": [ { "declarator": "factory", "modifier": "private", "original_string": "private PropertyDescriptionFactory factory;", "type": "PropertyDescriptionFactory", "var_name": "factory" } ], "file": "stormy-pythian-core/src/test/java/stormy/pythian/core/description/Proper...
{ "body": "@Test(expected = IllegalArgumentException.class)\n\tpublic void should_throw_illegal_argument_exception_with_unsupported_property_description_type() {\n\t\t// Given\n\t\t@Documentation(name = \"Test component\")\n\t\tclass TestComponent implements Component {\n\n\t\t\t@Property(name = \"object\")\n\t\t\tpu...
{ "fields": [], "file": "stormy-pythian-core/src/main/java/stormy/pythian/core/description/PropertyDescriptionFactory.java", "identifier": "PropertyDescriptionFactory", "interfaces": "", "methods": [ { "class_method_signature": "PropertyDescriptionFactory.createPropertyDescriptions(Class<?> componen...
{ "body": "@SuppressWarnings(\"unchecked\")\n public List<PropertyDescription> createPropertyDescriptions(Class<?> componentClass) {\n List<PropertyDescription> propertyDescriptions = new ArrayList<>();\n\n Set<Field> propertyFields = getAllFields(componentClass, withAnnotation(Property.class));\n ...
{ "created": null, "fork": null, "fork_count": 0, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 15655130, "size": 2828, "stargazer_count": 5, "stars": null, "updates": null, "url": "https://github.com/pmerienne/stormy-pythian" }
15655130_34
{ "fields": [ { "declarator": "factory", "modifier": "@InjectMocks\n\tprivate", "original_string": "@InjectMocks\n\tprivate ReferencedStateDescriptionFactory factory;", "type": "ReferencedStateDescriptionFactory", "var_name": "factory" } ], "file": "stormy-pythian-core/src/te...
{ "body": "@Test\n\tpublic void should_create_descriptions() {\n\t\t// Given\n\t\tclass TestComponent implements Component {\n\n\t\t\t@State(name = \"Word count\", description = \"State containing count by word\")\n\t\t\tprivate StateFactory stateFactory;\n\n\t\t\t@Override\n\t\t\tpublic void init() {\n\t\t\t}\n\t\t}...
{ "fields": [], "file": "stormy-pythian-core/src/main/java/stormy/pythian/core/description/ReferencedStateDescriptionFactory.java", "identifier": "ReferencedStateDescriptionFactory", "interfaces": "", "methods": [ { "class_method_signature": "ReferencedStateDescriptionFactory.createDescriptions(Clas...
{ "body": "@SuppressWarnings(\"unchecked\")\n\tpublic List<ReferencedStateDescription> createDescriptions(Class<?> componentClass) {\n\t\tList<ReferencedStateDescription> descriptions = new ArrayList<>();\n\n\t\tSet<Field> fields = getFields(componentClass, withAnnotation(State.class));\n\n\t\tfor (Field field : fiel...
{ "created": null, "fork": null, "fork_count": 0, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 15655130, "size": 2828, "stargazer_count": 5, "stars": null, "updates": null, "url": "https://github.com/pmerienne/stormy-pythian" }
15655130_22
{ "fields": [], "file": "stormy-pythian-core/src/test/java/stormy/pythian/core/utils/ReflectionHelperTest.java", "identifier": "ReflectionHelperTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void should_set_state_factory() {\n // Given\n class TestComponent implements Component {\n\n @State(name = \"Word count\")\n private StateFactory stateFactory;\n\n @Override\n public void init() {\n }\n }\n\n ...
{ "fields": [], "file": "stormy-pythian-core/src/main/java/stormy/pythian/core/utils/ReflectionHelper.java", "identifier": "ReflectionHelper", "interfaces": "", "methods": [ { "class_method_signature": "ReflectionHelper.getOutputStreams(Component component)", "constructor": false, "full_...
{ "body": "@SuppressWarnings(\"unchecked\")\n public static void setStateFactory(Component component, String stateName, StateFactory stateFactory) {\n try {\n Set<Field> fields = getAllFields(component.getClass(), withState(stateName));\n if (fields != null && !fields.isEmpty()) {\n ...
{ "created": null, "fork": null, "fork_count": 0, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 15655130, "size": 2828, "stargazer_count": 5, "stars": null, "updates": null, "url": "https://github.com/pmerienne/stormy-pythian" }
15655130_18
{ "fields": [], "file": "stormy-pythian-core/src/test/java/stormy/pythian/core/utils/ReflectionHelperTest.java", "identifier": "ReflectionHelperTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void should_set_topology() {\n // Given\n class TestComponent implements Component {\n\n @Topology\n private TridentTopology topology;\n\n @Override\n public void init() {\n }\n }\n\n TestComponent componen...
{ "fields": [], "file": "stormy-pythian-core/src/main/java/stormy/pythian/core/utils/ReflectionHelper.java", "identifier": "ReflectionHelper", "interfaces": "", "methods": [ { "class_method_signature": "ReflectionHelper.getOutputStreams(Component component)", "constructor": false, "full_...
{ "body": "@SuppressWarnings(\"unchecked\")\n public static void setTopology(Component component, TridentTopology topology) {\n try {\n Set<Field> fields = getAllFields(component.getClass(), withAnnotation(Topology.class));\n for (Field field : fields) {\n writeField(fie...
{ "created": null, "fork": null, "fork_count": 0, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 15655130, "size": 2828, "stargazer_count": 5, "stars": null, "updates": null, "url": "https://github.com/pmerienne/stormy-pythian" }
15655130_38
{ "fields": [ { "declarator": "factory", "modifier": "@InjectMocks\n\tprivate", "original_string": "@InjectMocks\n\tprivate ComponentDescriptionFactory factory;", "type": "ComponentDescriptionFactory", "var_name": "factory" }, { "declarator": "propertyDescriptionFactory...
{ "body": "@Test\n\tpublic void should_retrieve_name() {\n\t\t// Given\n\t\t@Documentation(name = \"Test component\")\n\t\tclass TestComponent implements Component {\n\t\t\t@Override\n\t\t\tpublic void init() {\n\n\t\t\t}\n\t\t}\n\n\t\t// When\n\t\tComponentDescription actualDescription = factory.createDescription(Te...
{ "fields": [ { "declarator": "propertyDescriptionFactory", "modifier": "@Autowired\n\tprivate", "original_string": "@Autowired\n\tprivate PropertyDescriptionFactory propertyDescriptionFactory;", "type": "PropertyDescriptionFactory", "var_name": "propertyDescriptionFactory" }, ...
{ "body": "public ComponentDescription createDescription(Class<? extends Component> componentClass) {\n\t\tcheckArgument(componentClass != null, \"Component class is mandatory\");\n\n\t\tDocumentation documentation = componentClass.getAnnotation(Documentation.class);\n\t\tcheckArgument(documentation != null, \"No doc...
{ "created": null, "fork": null, "fork_count": 0, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 15655130, "size": 2828, "stargazer_count": 5, "stars": null, "updates": null, "url": "https://github.com/pmerienne/stormy-pythian" }
15655130_3
{ "fields": [ { "declarator": "factory", "modifier": "@InjectMocks\n private", "original_string": "@InjectMocks\n private ComponentFactory factory;", "type": "ComponentFactory", "var_name": "factory" }, { "declarator": "tridentTopology", "modifier": "@Mock\n...
{ "body": "@Test\n public void should_set_input_streams() {\n // Given\n ComponentConfiguration configuration = new ComponentConfiguration(randomAlphabetic(6), new ComponentDescription(TestComponent.class));\n\n Map<String, Stream> inputStreams = new HashMap<String, Stream>();\n Stream ...
{ "fields": [ { "declarator": "tridentTopology", "modifier": "private", "original_string": "private TridentTopology tridentTopology;", "type": "TridentTopology", "var_name": "tridentTopology" }, { "declarator": "config", "modifier": "private", "original_stri...
{ "body": "public Component createComponent(ComponentConfiguration configuration, Map<String, StateFactory> stateFactories, Map<String, Stream> inputStreams) {\n try {\n Component component = configuration.retrieveImplementationClass().newInstance();\n setProperties(component, configurati...
{ "created": null, "fork": null, "fork_count": 0, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 15655130, "size": 2828, "stargazer_count": 5, "stars": null, "updates": null, "url": "https://github.com/pmerienne/stormy-pythian" }
15655130_43
{ "fields": [ { "declarator": "factory", "modifier": "@InjectMocks\n\tprivate", "original_string": "@InjectMocks\n\tprivate ComponentDescriptionFactory factory;", "type": "ComponentDescriptionFactory", "var_name": "factory" }, { "declarator": "propertyDescriptionFactory...
{ "body": "@Test\n\tpublic void should_retrieve_class() {\n\t\t// Given\n\t\t@Documentation(name = \"Test component\")\n\t\tclass TestComponent implements Component {\n\t\t\t@Override\n\t\t\tpublic void init() {\n\n\t\t\t}\n\t\t}\n\n\t\t// When\n\t\tComponentDescription actualDescription = factory.createDescription(T...
{ "fields": [ { "declarator": "propertyDescriptionFactory", "modifier": "@Autowired\n\tprivate", "original_string": "@Autowired\n\tprivate PropertyDescriptionFactory propertyDescriptionFactory;", "type": "PropertyDescriptionFactory", "var_name": "propertyDescriptionFactory" }, ...
{ "body": "public ComponentDescription createDescription(Class<? extends Component> componentClass) {\n\t\tcheckArgument(componentClass != null, \"Component class is mandatory\");\n\n\t\tDocumentation documentation = componentClass.getAnnotation(Documentation.class);\n\t\tcheckArgument(documentation != null, \"No doc...
{ "created": null, "fork": null, "fork_count": 0, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 15655130, "size": 2828, "stargazer_count": 5, "stars": null, "updates": null, "url": "https://github.com/pmerienne/stormy-pythian" }
15655130_14
{ "fields": [], "file": "stormy-pythian-core/src/test/java/stormy/pythian/core/utils/ReflectionHelperTest.java", "identifier": "ReflectionHelperTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void should_set_properties() {\n // Given\n class TestObject {\n @Property(name = \"prop1\")\n public String prop1;\n\n @Property(name = \"prop2\")\n public Integer prop2;\n\n @Property(name = \"prop3\")\n pri...
{ "fields": [], "file": "stormy-pythian-core/src/main/java/stormy/pythian/core/utils/ReflectionHelper.java", "identifier": "ReflectionHelper", "interfaces": "", "methods": [ { "class_method_signature": "ReflectionHelper.getOutputStreams(Component component)", "constructor": false, "full_...
{ "body": "public static void setProperties(Object obj, List<PropertyConfiguration> properties) {\n for (PropertyConfiguration property : properties) {\n setProperty(obj, property);\n }\n }", "class_method_signature": "ReflectionHelper.setProperties(Object obj, List<PropertyConfiguration...
{ "created": null, "fork": null, "fork_count": 0, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 15655130, "size": 2828, "stargazer_count": 5, "stars": null, "updates": null, "url": "https://github.com/pmerienne/stormy-pythian" }
15655130_15
{ "fields": [], "file": "stormy-pythian-core/src/test/java/stormy/pythian/core/utils/ReflectionHelperTest.java", "identifier": "ReflectionHelperTest", "interfaces": "", "superclass": "" }
{ "body": "@Test(expected = IllegalArgumentException.class)\n public void should_fail_when_setting_bad_properties() {\n // Given\n class TestObject {\n @Property(name = \"prop1\")\n public String prop1;\n }\n\n TestObject test = new TestObject();\n List<Prop...
{ "fields": [], "file": "stormy-pythian-core/src/main/java/stormy/pythian/core/utils/ReflectionHelper.java", "identifier": "ReflectionHelper", "interfaces": "", "methods": [ { "class_method_signature": "ReflectionHelper.getOutputStreams(Component component)", "constructor": false, "full_...
{ "body": "public static void setProperties(Object obj, List<PropertyConfiguration> properties) {\n for (PropertyConfiguration property : properties) {\n setProperty(obj, property);\n }\n }", "class_method_signature": "ReflectionHelper.setProperties(Object obj, List<PropertyConfiguration...
{ "created": null, "fork": null, "fork_count": 0, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 15655130, "size": 2828, "stargazer_count": 5, "stars": null, "updates": null, "url": "https://github.com/pmerienne/stormy-pythian" }
15655130_42
{ "fields": [ { "declarator": "factory", "modifier": "@InjectMocks\n\tprivate", "original_string": "@InjectMocks\n\tprivate ComponentDescriptionFactory factory;", "type": "ComponentDescriptionFactory", "var_name": "factory" }, { "declarator": "propertyDescriptionFactory...
{ "body": "@Test\n\tpublic void should_retrieve_no_type() {\n\t\t// Given\n\t\t@Documentation(name = \"Test component\")\n\t\tclass TestComponent implements Component {\n\t\t\t@Override\n\t\t\tpublic void init() {\n\n\t\t\t}\n\t\t}\n\n\t\t// When\n\t\tComponentDescription actualDescription = factory.createDescription...
{ "fields": [ { "declarator": "propertyDescriptionFactory", "modifier": "@Autowired\n\tprivate", "original_string": "@Autowired\n\tprivate PropertyDescriptionFactory propertyDescriptionFactory;", "type": "PropertyDescriptionFactory", "var_name": "propertyDescriptionFactory" }, ...
{ "body": "public ComponentDescription createDescription(Class<? extends Component> componentClass) {\n\t\tcheckArgument(componentClass != null, \"Component class is mandatory\");\n\n\t\tDocumentation documentation = componentClass.getAnnotation(Documentation.class);\n\t\tcheckArgument(documentation != null, \"No doc...
{ "created": null, "fork": null, "fork_count": 0, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 15655130, "size": 2828, "stargazer_count": 5, "stars": null, "updates": null, "url": "https://github.com/pmerienne/stormy-pythian" }
15655130_54
{ "fields": [ { "declarator": "service", "modifier": "@InjectMocks\n private", "original_string": "@InjectMocks\n private LocalCLusterService service;", "type": "LocalCLusterService", "var_name": "service" }, { "declarator": "topologyRepository", "modifier":...
{ "body": "@SuppressWarnings(\"unchecked\")\n @Test(expected = TopologyLaunchException.class)\n public void should_throw_launch_exception_when_topology_is_not_valid() throws TopologyLaunchException {\n // Given\n String topologyId = random(6);\n PythianToplogyConfiguration configuration = m...
{ "fields": [ { "declarator": "topologyRepository", "modifier": "@Autowired\n private", "original_string": "@Autowired\n private TopologyRepository topologyRepository;", "type": "TopologyRepository", "var_name": "topologyRepository" }, { "declarator": "cluster", ...
{ "body": "public void launch(String topologyId) throws TopologyLaunchException {\n PythianToplogyConfiguration configuration = topologyRepository.findById(topologyId);\n if (configuration == null) {\n throw new TopologyLaunchException(\"No topology found with id \" + topologyId);\n }\...
{ "created": null, "fork": null, "fork_count": 0, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 15655130, "size": 2828, "stargazer_count": 5, "stars": null, "updates": null, "url": "https://github.com/pmerienne/stormy-pythian" }
15655130_2
{ "fields": [ { "declarator": "factory", "modifier": "@InjectMocks\n private", "original_string": "@InjectMocks\n private ComponentFactory factory;", "type": "ComponentFactory", "var_name": "factory" }, { "declarator": "tridentTopology", "modifier": "@Mock\n...
{ "body": "@Test\n public void should_set_properties() {\n // Given\n ComponentConfiguration configuration = new ComponentConfiguration(randomAlphabetic(6), new ComponentDescription(TestComponent.class));\n configuration.add(new PropertyConfiguration(\"distributed\", true, new PropertyDescript...
{ "fields": [ { "declarator": "tridentTopology", "modifier": "private", "original_string": "private TridentTopology tridentTopology;", "type": "TridentTopology", "var_name": "tridentTopology" }, { "declarator": "config", "modifier": "private", "original_stri...
{ "body": "public Component createComponent(ComponentConfiguration configuration, Map<String, StateFactory> stateFactories, Map<String, Stream> inputStreams) {\n try {\n Component component = configuration.retrieveImplementationClass().newInstance();\n setProperties(component, configurati...
{ "created": null, "fork": null, "fork_count": 0, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 15655130, "size": 2828, "stargazer_count": 5, "stars": null, "updates": null, "url": "https://github.com/pmerienne/stormy-pythian" }
15655130_39
{ "fields": [ { "declarator": "factory", "modifier": "@InjectMocks\n\tprivate", "original_string": "@InjectMocks\n\tprivate ComponentDescriptionFactory factory;", "type": "ComponentDescriptionFactory", "var_name": "factory" }, { "declarator": "propertyDescriptionFactory...
{ "body": "@Test\n\tpublic void should_retrieve_description() {\n\t\t// Given\n\t\t@Documentation(name = \"Test component\", description = \"Only for test purpose\")\n\t\tclass TestComponent implements Component {\n\t\t\t@Override\n\t\t\tpublic void init() {\n\n\t\t\t}\n\t\t}\n\n\t\t// When\n\t\tComponentDescription ...
{ "fields": [ { "declarator": "propertyDescriptionFactory", "modifier": "@Autowired\n\tprivate", "original_string": "@Autowired\n\tprivate PropertyDescriptionFactory propertyDescriptionFactory;", "type": "PropertyDescriptionFactory", "var_name": "propertyDescriptionFactory" }, ...
{ "body": "public ComponentDescription createDescription(Class<? extends Component> componentClass) {\n\t\tcheckArgument(componentClass != null, \"Component class is mandatory\");\n\n\t\tDocumentation documentation = componentClass.getAnnotation(Documentation.class);\n\t\tcheckArgument(documentation != null, \"No doc...
{ "created": null, "fork": null, "fork_count": 0, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 15655130, "size": 2828, "stargazer_count": 5, "stars": null, "updates": null, "url": "https://github.com/pmerienne/stormy-pythian" }
15655130_19
{ "fields": [], "file": "stormy-pythian-core/src/test/java/stormy/pythian/core/utils/ReflectionHelperTest.java", "identifier": "ReflectionHelperTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void should_set_inherited_topology() {\n // Given\n class AbstractComponent implements Component {\n\n @Topology\n private TridentTopology topology;\n\n @Override\n public void init() {\n }\n }\n class Test...
{ "fields": [], "file": "stormy-pythian-core/src/main/java/stormy/pythian/core/utils/ReflectionHelper.java", "identifier": "ReflectionHelper", "interfaces": "", "methods": [ { "class_method_signature": "ReflectionHelper.getOutputStreams(Component component)", "constructor": false, "full_...
{ "body": "@SuppressWarnings(\"unchecked\")\n public static void setTopology(Component component, TridentTopology topology) {\n try {\n Set<Field> fields = getAllFields(component.getClass(), withAnnotation(Topology.class));\n for (Field field : fields) {\n writeField(fie...
{ "created": null, "fork": null, "fork_count": 0, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 15655130, "size": 2828, "stargazer_count": 5, "stars": null, "updates": null, "url": "https://github.com/pmerienne/stormy-pythian" }
15655130_23
{ "fields": [], "file": "stormy-pythian-core/src/test/java/stormy/pythian/core/utils/ReflectionHelperTest.java", "identifier": "ReflectionHelperTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void should_set_enum_property() {\n // Given\n class Test {\n\n @Property(name = \"gender\")\n public Gender gender;\n\n }\n\n Test test = new Test();\n List<PropertyConfiguration> properties = new ArrayList<>();\n properties...
{ "fields": [], "file": "stormy-pythian-core/src/main/java/stormy/pythian/core/utils/ReflectionHelper.java", "identifier": "ReflectionHelper", "interfaces": "", "methods": [ { "class_method_signature": "ReflectionHelper.getOutputStreams(Component component)", "constructor": false, "full_...
{ "body": "public static void setProperties(Object obj, List<PropertyConfiguration> properties) {\n for (PropertyConfiguration property : properties) {\n setProperty(obj, property);\n }\n }", "class_method_signature": "ReflectionHelper.setProperties(Object obj, List<PropertyConfiguration...
{ "created": null, "fork": null, "fork_count": 0, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 15655130, "size": 2828, "stargazer_count": 5, "stars": null, "updates": null, "url": "https://github.com/pmerienne/stormy-pythian" }
15655130_35
{ "fields": [ { "declarator": "factory", "modifier": "@InjectMocks\n\tprivate", "original_string": "@InjectMocks\n\tprivate ReferencedStateDescriptionFactory factory;", "type": "ReferencedStateDescriptionFactory", "var_name": "factory" } ], "file": "stormy-pythian-core/src/te...
{ "body": "@Test(expected = IllegalArgumentException.class)\n\tpublic void should_fail_if_state_annotation_is_not_on_a_state_factory_field() {\n\t\t// Given\n\t\tclass TestComponent implements Component {\n\n\t\t\t@State(name = \"Word count\")\n\t\t\tprivate Object stateFactory;\n\n\t\t\t@Override\n\t\t\tpublic void ...
{ "fields": [], "file": "stormy-pythian-core/src/main/java/stormy/pythian/core/description/ReferencedStateDescriptionFactory.java", "identifier": "ReferencedStateDescriptionFactory", "interfaces": "", "methods": [ { "class_method_signature": "ReferencedStateDescriptionFactory.createDescriptions(Clas...
{ "body": "@SuppressWarnings(\"unchecked\")\n\tpublic List<ReferencedStateDescription> createDescriptions(Class<?> componentClass) {\n\t\tList<ReferencedStateDescription> descriptions = new ArrayList<>();\n\n\t\tSet<Field> fields = getFields(componentClass, withAnnotation(State.class));\n\n\t\tfor (Field field : fiel...
{ "created": null, "fork": null, "fork_count": 0, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 15655130, "size": 2828, "stargazer_count": 5, "stars": null, "updates": null, "url": "https://github.com/pmerienne/stormy-pythian" }
15655130_20
{ "fields": [], "file": "stormy-pythian-core/src/test/java/stormy/pythian/core/utils/ReflectionHelperTest.java", "identifier": "ReflectionHelperTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void should_set_configuration() {\n // Given\n class TestComponent implements Component {\n\n @Configuration\n private Config config;\n\n @Override\n public void init() {\n }\n }\n\n TestComponent component...
{ "fields": [], "file": "stormy-pythian-core/src/main/java/stormy/pythian/core/utils/ReflectionHelper.java", "identifier": "ReflectionHelper", "interfaces": "", "methods": [ { "class_method_signature": "ReflectionHelper.getOutputStreams(Component component)", "constructor": false, "full_...
{ "body": "@SuppressWarnings(\"unchecked\")\n public static void setConfiguration(Component component, Config config) {\n try {\n Set<Field> fields = getAllFields(component.getClass(), withAnnotation(Configuration.class));\n for (Field field : fields) {\n writeField(fiel...
{ "created": null, "fork": null, "fork_count": 0, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 15655130, "size": 2828, "stargazer_count": 5, "stars": null, "updates": null, "url": "https://github.com/pmerienne/stormy-pythian" }
15655130_36
{ "fields": [ { "declarator": "factory", "modifier": "@InjectMocks\n\tprivate", "original_string": "@InjectMocks\n\tprivate ComponentDescriptionFactory factory;", "type": "ComponentDescriptionFactory", "var_name": "factory" }, { "declarator": "propertyDescriptionFactory...
{ "body": "@Test(expected = IllegalArgumentException.class)\n\tpublic void should_throw_illegal_argument_exception_when_no_component_class() {\n\t\t// When\n\t\tfactory.createDescription(null);\n\t}", "class_method_signature": "ComponentDescriptionFactoryTest.should_throw_illegal_argument_exception_when_no_componen...
{ "fields": [ { "declarator": "propertyDescriptionFactory", "modifier": "@Autowired\n\tprivate", "original_string": "@Autowired\n\tprivate PropertyDescriptionFactory propertyDescriptionFactory;", "type": "PropertyDescriptionFactory", "var_name": "propertyDescriptionFactory" }, ...
{ "body": "public ComponentDescription createDescription(Class<? extends Component> componentClass) {\n\t\tcheckArgument(componentClass != null, \"Component class is mandatory\");\n\n\t\tDocumentation documentation = componentClass.getAnnotation(Documentation.class);\n\t\tcheckArgument(documentation != null, \"No doc...
{ "created": null, "fork": null, "fork_count": 0, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 15655130, "size": 2828, "stargazer_count": 5, "stars": null, "updates": null, "url": "https://github.com/pmerienne/stormy-pythian" }
15655130_16
{ "fields": [], "file": "stormy-pythian-core/src/test/java/stormy/pythian/core/utils/ReflectionHelperTest.java", "identifier": "ReflectionHelperTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void should_set_input_streams() {\n // Given\n class TestComponent implements Component {\n\n @InputStream(name = \"in1\")\n public Stream test;\n\n @InputStream(name = \"in2\")\n public Stream words;\n\n @Override\n ...
{ "fields": [], "file": "stormy-pythian-core/src/main/java/stormy/pythian/core/utils/ReflectionHelper.java", "identifier": "ReflectionHelper", "interfaces": "", "methods": [ { "class_method_signature": "ReflectionHelper.getOutputStreams(Component component)", "constructor": false, "full_...
{ "body": "public static void setInputStreams(Component component, Map<String, Stream> inputStreams) {\n for (Entry<String, Stream> entry : inputStreams.entrySet()) {\n setInputStream(component, entry.getKey(), entry.getValue());\n }\n }", "class_method_signature": "ReflectionHelper.setI...
{ "created": null, "fork": null, "fork_count": 0, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 15655130, "size": 2828, "stargazer_count": 5, "stars": null, "updates": null, "url": "https://github.com/pmerienne/stormy-pythian" }
15655130_41
{ "fields": [ { "declarator": "factory", "modifier": "@InjectMocks\n\tprivate", "original_string": "@InjectMocks\n\tprivate ComponentDescriptionFactory factory;", "type": "ComponentDescriptionFactory", "var_name": "factory" }, { "declarator": "propertyDescriptionFactory...
{ "body": "@Test\n\tpublic void should_retrieve_component_type() {\n\t\t// Given\n\t\t@Documentation(name = \"Test component\", type = STREAM_SOURCE)\n\t\tclass TestComponent implements Component {\n\t\t\t@Override\n\t\t\tpublic void init() {\n\n\t\t\t}\n\t\t}\n\n\t\t// When\n\t\tComponentDescription actualDescriptio...
{ "fields": [ { "declarator": "propertyDescriptionFactory", "modifier": "@Autowired\n\tprivate", "original_string": "@Autowired\n\tprivate PropertyDescriptionFactory propertyDescriptionFactory;", "type": "PropertyDescriptionFactory", "var_name": "propertyDescriptionFactory" }, ...
{ "body": "public ComponentDescription createDescription(Class<? extends Component> componentClass) {\n\t\tcheckArgument(componentClass != null, \"Component class is mandatory\");\n\n\t\tDocumentation documentation = componentClass.getAnnotation(Documentation.class);\n\t\tcheckArgument(documentation != null, \"No doc...
{ "created": null, "fork": null, "fork_count": 0, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 15655130, "size": 2828, "stargazer_count": 5, "stars": null, "updates": null, "url": "https://github.com/pmerienne/stormy-pythian" }
15655130_1
{ "fields": [ { "declarator": "factory", "modifier": "@InjectMocks\n private", "original_string": "@InjectMocks\n private ComponentFactory factory;", "type": "ComponentFactory", "var_name": "factory" }, { "declarator": "tridentTopology", "modifier": "@Mock\n...
{ "body": "@Test\n public void should_create_and_init_component() {\n // Given\n ComponentConfiguration configuration = new ComponentConfiguration(randomAlphabetic(6), new ComponentDescription(TestComponent.class));\n\n // When\n Component component = factory.createComponent(configurati...
{ "fields": [ { "declarator": "tridentTopology", "modifier": "private", "original_string": "private TridentTopology tridentTopology;", "type": "TridentTopology", "var_name": "tridentTopology" }, { "declarator": "config", "modifier": "private", "original_stri...
{ "body": "public Component createComponent(ComponentConfiguration configuration, Map<String, StateFactory> stateFactories, Map<String, Stream> inputStreams) {\n try {\n Component component = configuration.retrieveImplementationClass().newInstance();\n setProperties(component, configurati...
{ "created": null, "fork": null, "fork_count": 0, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 15655130, "size": 2828, "stargazer_count": 5, "stars": null, "updates": null, "url": "https://github.com/pmerienne/stormy-pythian" }
15655130_0
{ "fields": [ { "declarator": "topology", "modifier": "@InjectMocks", "original_string": "@InjectMocks\n PythianTopology topology;", "type": "PythianTopology", "var_name": "topology" }, { "declarator": "componentFactory", "modifier": "@Mock", "original_st...
{ "body": "@Test\n public void should_create_components() {\n // Given\n String componentId = randomAlphabetic(6);\n\n PythianToplogyConfiguration topologyConfiguration = mock(PythianToplogyConfiguration.class);\n\n ComponentConfiguration componentConfiguration = mock(ComponentConfigura...
{ "fields": [ { "declarator": "componentFactory", "modifier": "private", "original_string": "private ComponentFactory componentFactory;", "type": "ComponentFactory", "var_name": "componentFactory" }, { "declarator": "componentPool", "modifier": "private", "o...
{ "body": "public void build(PythianToplogyConfiguration topologyConfiguration) {\n componentPool.addConnections(topologyConfiguration.getConnections());\n componentPool.addComponents(topologyConfiguration.getComponents());\n\n // Init components\n while (!componentPool.isEmpty()) {\n ...
{ "created": null, "fork": null, "fork_count": 0, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 15655130, "size": 2828, "stargazer_count": 5, "stars": null, "updates": null, "url": "https://github.com/pmerienne/stormy-pythian" }
15655130_40
{ "fields": [ { "declarator": "factory", "modifier": "@InjectMocks\n\tprivate", "original_string": "@InjectMocks\n\tprivate ComponentDescriptionFactory factory;", "type": "ComponentDescriptionFactory", "var_name": "factory" }, { "declarator": "propertyDescriptionFactory...
{ "body": "@Test\n\tpublic void should_retrieve_empty_description_when_no_declared_description() {\n\t\t// Given\n\t\t@Documentation(name = \"Test component\")\n\t\tclass TestComponent implements Component {\n\t\t\t@Override\n\t\t\tpublic void init() {\n\n\t\t\t}\n\t\t}\n\n\t\t// When\n\t\tComponentDescription actual...
{ "fields": [ { "declarator": "propertyDescriptionFactory", "modifier": "@Autowired\n\tprivate", "original_string": "@Autowired\n\tprivate PropertyDescriptionFactory propertyDescriptionFactory;", "type": "PropertyDescriptionFactory", "var_name": "propertyDescriptionFactory" }, ...
{ "body": "public ComponentDescription createDescription(Class<? extends Component> componentClass) {\n\t\tcheckArgument(componentClass != null, \"Component class is mandatory\");\n\n\t\tDocumentation documentation = componentClass.getAnnotation(Documentation.class);\n\t\tcheckArgument(documentation != null, \"No doc...
{ "created": null, "fork": null, "fork_count": 0, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 15655130, "size": 2828, "stargazer_count": 5, "stars": null, "updates": null, "url": "https://github.com/pmerienne/stormy-pythian" }
15655130_17
{ "fields": [], "file": "stormy-pythian-core/src/test/java/stormy/pythian/core/utils/ReflectionHelperTest.java", "identifier": "ReflectionHelperTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void should_find_output_stream() {\n // Given\n class TestComponent implements Component {\n\n @OutputStream(from = \"\", name = \"words\")\n public Stream out;\n\n @Override\n public void init() {\n }\n }\n ...
{ "fields": [], "file": "stormy-pythian-core/src/main/java/stormy/pythian/core/utils/ReflectionHelper.java", "identifier": "ReflectionHelper", "interfaces": "", "methods": [ { "class_method_signature": "ReflectionHelper.getOutputStreams(Component component)", "constructor": false, "full_...
{ "body": "@SuppressWarnings(\"unchecked\")\n public static Stream getOutputStream(Object obj, String name) {\n try {\n Set<Field> fields = getAllFields(obj.getClass(), withOutputStream(name));\n if (fields != null && !fields.isEmpty()) {\n Field field = fields.iterator(...
{ "created": null, "fork": null, "fork_count": 0, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 15655130, "size": 2828, "stargazer_count": 5, "stars": null, "updates": null, "url": "https://github.com/pmerienne/stormy-pythian" }
15655130_37
{ "fields": [ { "declarator": "factory", "modifier": "@InjectMocks\n\tprivate", "original_string": "@InjectMocks\n\tprivate ComponentDescriptionFactory factory;", "type": "ComponentDescriptionFactory", "var_name": "factory" }, { "declarator": "propertyDescriptionFactory...
{ "body": "@Test(expected = IllegalArgumentException.class)\n\tpublic void should_throw_illegal_argument_exception_when_no_component_documentation() {\n\t\t// Given\n\t\tclass TestComponent implements Component {\n\t\t\t@Override\n\t\t\tpublic void init() {\n\n\t\t\t}\n\t\t}\n\n\t\t// When\n\t\tfactory.createDescript...
{ "fields": [ { "declarator": "propertyDescriptionFactory", "modifier": "@Autowired\n\tprivate", "original_string": "@Autowired\n\tprivate PropertyDescriptionFactory propertyDescriptionFactory;", "type": "PropertyDescriptionFactory", "var_name": "propertyDescriptionFactory" }, ...
{ "body": "public ComponentDescription createDescription(Class<? extends Component> componentClass) {\n\t\tcheckArgument(componentClass != null, \"Component class is mandatory\");\n\n\t\tDocumentation documentation = componentClass.getAnnotation(Documentation.class);\n\t\tcheckArgument(documentation != null, \"No doc...
{ "created": null, "fork": null, "fork_count": 0, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 15655130, "size": 2828, "stargazer_count": 5, "stars": null, "updates": null, "url": "https://github.com/pmerienne/stormy-pythian" }
15655130_21
{ "fields": [], "file": "stormy-pythian-core/src/test/java/stormy/pythian/core/utils/ReflectionHelperTest.java", "identifier": "ReflectionHelperTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void should_set_features_mapper() {\n // Given\n class TestComponent implements Component {\n\n @NameMapper(stream = \"in\", expectedFeatures = {})\n public NamedFeaturesMapper mapper;\n\n @Override\n public void init() {\n ...
{ "fields": [], "file": "stormy-pythian-core/src/main/java/stormy/pythian/core/utils/ReflectionHelper.java", "identifier": "ReflectionHelper", "interfaces": "", "methods": [ { "class_method_signature": "ReflectionHelper.getOutputStreams(Component component)", "constructor": false, "full_...
{ "body": "@SuppressWarnings(\"unchecked\")\n public static void setFeaturesMapper(Component component, String streamName, NamedFeaturesMapper mapper) {\n try {\n Set<Field> fields = getAllFields(component.getClass(), withNameMapper(streamName));\n if (fields != null && !fields.isEmpty...
{ "created": null, "fork": null, "fork_count": 0, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 15655130, "size": 2828, "stargazer_count": 5, "stars": null, "updates": null, "url": "https://github.com/pmerienne/stormy-pythian" }
15655130_10
{ "fields": [ { "declarator": "EXPECTED_STATE_FACTORY = mock(StateFactory.class)", "modifier": "public static final", "original_string": "public static final StateFactory EXPECTED_STATE_FACTORY = mock(StateFactory.class);", "type": "StateFactory", "var_name": "EXPECTED_STATE_FACTORY"...
{ "body": "@Test\n\tpublic void should_create_state_factory() {\n\t\t// Given\n\t\tfinal PythianStateDescription description = new PythianStateDescription(TestPythianState.class, \"Mocked state\");\n\t\tfinal PythianStateConfiguration expectedStateConfiguration = new PythianStateConfiguration(\"test\", description, E...
{ "fields": [], "file": "stormy-pythian-core/src/main/java/stormy/pythian/core/topology/PythianStateFactory.java", "identifier": "PythianStateFactory", "interfaces": "", "methods": [ { "class_method_signature": "PythianStateFactory.createStateFactories(ComponentConfiguration componentConfiguration)"...
{ "body": "public Map<String, StateFactory> createStateFactories(ComponentConfiguration componentConfiguration) {\n\t\tMap<String, StateFactory> stateFactoriesByIds = new HashMap<>();\n\n\t\tfor (PythianStateConfiguration stateConfiguration : componentConfiguration.getStates()) {\n\t\t\tPythianState pythianState = th...
{ "created": null, "fork": null, "fork_count": 0, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 15655130, "size": 2828, "stargazer_count": 5, "stars": null, "updates": null, "url": "https://github.com/pmerienne/stormy-pythian" }
15655130_47
{ "fields": [ { "declarator": "factory", "modifier": "@InjectMocks\n private", "original_string": "@InjectMocks\n private FeatureDescriptionFactory factory;", "type": "FeatureDescriptionFactory", "var_name": "factory" } ], "file": "stormy-pythian-core/src/test/java/stor...
{ "body": "@Test\n public void should_create_descriptors() {\n // Given\n ExpectedFeature doubleFeature = mock(ExpectedFeature.class);\n when(doubleFeature.name()).thenReturn(\"double\");\n when(doubleFeature.type()).thenReturn(DECIMAL);\n\n ExpectedFeature integerFeature = mock(...
{ "fields": [], "file": "stormy-pythian-core/src/main/java/stormy/pythian/core/description/FeatureDescriptionFactory.java", "identifier": "FeatureDescriptionFactory", "interfaces": "", "methods": [ { "class_method_signature": "FeatureDescriptionFactory.createDescriptions(NameMapper annotation)", ...
{ "body": "public List<FeatureDescription> createDescriptions(NameMapper annotation) {\n List<FeatureDescription> descriptors = new ArrayList<>();\n\n ExpectedFeature[] expectedFeatures = annotation.expectedFeatures();\n if (expectedFeatures != null) {\n for (ExpectedFeature feature : ...
{ "created": null, "fork": null, "fork_count": 0, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 15655130, "size": 2828, "stargazer_count": 5, "stars": null, "updates": null, "url": "https://github.com/pmerienne/stormy-pythian" }
15655130_51
{ "fields": [ { "declarator": "service", "modifier": "@InjectMocks\n private", "original_string": "@InjectMocks\n private LocalCLusterService service;", "type": "LocalCLusterService", "var_name": "service" }, { "declarator": "topologyRepository", "modifier":...
{ "body": "@Test\n public void should_retrieve_topology_states() {\n // Given\n PythianToplogyConfiguration topology1 = new PythianToplogyConfiguration(\"1\", \"topology 1\");\n PythianToplogyConfiguration topology2 = new PythianToplogyConfiguration(\"2\", \"topology 2\");\n PythianTopl...
{ "fields": [ { "declarator": "topologyRepository", "modifier": "@Autowired\n private", "original_string": "@Autowired\n private TopologyRepository topologyRepository;", "type": "TopologyRepository", "var_name": "topologyRepository" }, { "declarator": "cluster", ...
{ "body": "public List<TopologyState> getTopologyStates() {\n List<TopologySummary> summaries = cluster.getClusterInfo().get_topologies();\n List<TopologyState> states = new ArrayList<>(summaries.size());\n\n for (TopologySummary summary : summaries) {\n PythianToplogyConfiguration top...
{ "created": null, "fork": null, "fork_count": 0, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 15655130, "size": 2828, "stargazer_count": 5, "stars": null, "updates": null, "url": "https://github.com/pmerienne/stormy-pythian" }
15655130_7
{ "fields": [ { "declarator": "factory", "modifier": "@InjectMocks\n private", "original_string": "@InjectMocks\n private ComponentFactory factory;", "type": "ComponentFactory", "var_name": "factory" }, { "declarator": "tridentTopology", "modifier": "@Mock\n...
{ "body": "@SuppressWarnings(\"unchecked\")\n @Test\n public void should_set_fixed_feature_output_stream_mapper() {\n // Given\n Map<String, String> mappings = new HashMap<>();\n mappings.put(\"inside\", \"outside\");\n OutputStreamDescription outputStreamDescription = new OutputStre...
{ "fields": [ { "declarator": "tridentTopology", "modifier": "private", "original_string": "private TridentTopology tridentTopology;", "type": "TridentTopology", "var_name": "tridentTopology" }, { "declarator": "config", "modifier": "private", "original_stri...
{ "body": "public Component createComponent(ComponentConfiguration configuration, Map<String, StateFactory> stateFactories, Map<String, Stream> inputStreams) {\n try {\n Component component = configuration.retrieveImplementationClass().newInstance();\n setProperties(component, configurati...
{ "created": null, "fork": null, "fork_count": 0, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 15655130, "size": 2828, "stargazer_count": 5, "stars": null, "updates": null, "url": "https://github.com/pmerienne/stormy-pythian" }
15655130_26
{ "fields": [ { "declarator": "factory", "modifier": "@InjectMocks\n private", "original_string": "@InjectMocks\n private OutputStreamDescriptionFactory factory;", "type": "OutputStreamDescriptionFactory", "var_name": "factory" }, { "declarator": "featureDescripto...
{ "body": "@Test(expected = IllegalArgumentException.class)\n public void should_throw_illegal_argument_exception_when_output_stream_annotation_not_applied_on_stream() {\n // Given\n @Documentation(name = \"Test component\")\n class TestComponent implements Component {\n\n @InputStr...
{ "fields": [ { "declarator": "featureDescriptorFactory", "modifier": "@Autowired\n private", "original_string": "@Autowired\n private FeatureDescriptionFactory featureDescriptorFactory;", "type": "FeatureDescriptionFactory", "var_name": "featureDescriptorFactory" } ], ...
{ "body": "@SuppressWarnings(\"unchecked\")\n public List<OutputStreamDescription> createOutputStreamDescriptions(Class<?> componentClass) {\n List<OutputStreamDescription> descriptions = new ArrayList<>();\n\n Set<Field> fields = getAllFields(componentClass, withAnnotation(OutputStream.class));\n ...
{ "created": null, "fork": null, "fork_count": 0, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 15655130, "size": 2828, "stargazer_count": 5, "stars": null, "updates": null, "url": "https://github.com/pmerienne/stormy-pythian" }
15655130_30
{ "fields": [ { "declarator": "factory", "modifier": "private", "original_string": "private PropertyDescriptionFactory factory;", "type": "PropertyDescriptionFactory", "var_name": "factory" } ], "file": "stormy-pythian-core/src/test/java/stormy/pythian/core/description/Proper...
{ "body": "@Test(expected = IllegalArgumentException.class)\n\tpublic void should_throw_illegal_argument_exception_when_properties_have_same_names() {\n\t\t// Given\n\t\t@Documentation(name = \"Test component\")\n\t\tclass TestComponent implements Component {\n\n\t\t\t@Property(name = \"same name\")\n\t\t\tpublic Str...
{ "fields": [], "file": "stormy-pythian-core/src/main/java/stormy/pythian/core/description/PropertyDescriptionFactory.java", "identifier": "PropertyDescriptionFactory", "interfaces": "", "methods": [ { "class_method_signature": "PropertyDescriptionFactory.createPropertyDescriptions(Class<?> componen...
{ "body": "@SuppressWarnings(\"unchecked\")\n public List<PropertyDescription> createPropertyDescriptions(Class<?> componentClass) {\n List<PropertyDescription> propertyDescriptions = new ArrayList<>();\n\n Set<Field> propertyFields = getAllFields(componentClass, withAnnotation(Property.class));\n ...
{ "created": null, "fork": null, "fork_count": 0, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 15655130, "size": 2828, "stargazer_count": 5, "stars": null, "updates": null, "url": "https://github.com/pmerienne/stormy-pythian" }
15655130_31
{ "fields": [ { "declarator": "factory", "modifier": "@InjectMocks\n private", "original_string": "@InjectMocks\n private InputStreamDescriptionFactory factory;", "type": "InputStreamDescriptionFactory", "var_name": "factory" }, { "declarator": "featureDescriptorF...
{ "body": "@Test\n public void should_retrieve_input_stream_descriptions() {\n // Given\n @Documentation(name = \"Test component\")\n class TestComponent implements Component {\n\n @InputStream(name = \"in1\")\n private Stream in1;\n\n @ListMapper(stream = \"in...
{ "fields": [ { "declarator": "featureDescriptorFactory", "modifier": "@Autowired\n private", "original_string": "@Autowired\n private FeatureDescriptionFactory featureDescriptorFactory;", "type": "FeatureDescriptionFactory", "var_name": "featureDescriptorFactory" } ], ...
{ "body": "@SuppressWarnings(\"unchecked\")\n public List<InputStreamDescription> createInputStreamDescriptions(Class<?> componentClass) {\n List<InputStreamDescription> inputStreamDescriptions = new ArrayList<>();\n\n Set<Field> inputStreamFields = getAllFields(componentClass, withAnnotation(InputSt...
{ "created": null, "fork": null, "fork_count": 0, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 15655130, "size": 2828, "stargazer_count": 5, "stars": null, "updates": null, "url": "https://github.com/pmerienne/stormy-pythian" }
15655130_27
{ "fields": [ { "declarator": "factory", "modifier": "private", "original_string": "private PropertyDescriptionFactory factory;", "type": "PropertyDescriptionFactory", "var_name": "factory" } ], "file": "stormy-pythian-core/src/test/java/stormy/pythian/core/description/Proper...
{ "body": "@Test\n\tpublic void should_retrieve_single_property_description() {\n\t\t// Given\n\t\t@Documentation(name = \"Test component\")\n\t\tclass TestComponent implements Component {\n\n\t\t\t@Property(name = \"expected property\", description = \"tested property\", mandatory = false)\n\t\t\tpublic String expec...
{ "fields": [], "file": "stormy-pythian-core/src/main/java/stormy/pythian/core/description/PropertyDescriptionFactory.java", "identifier": "PropertyDescriptionFactory", "interfaces": "", "methods": [ { "class_method_signature": "PropertyDescriptionFactory.createPropertyDescriptions(Class<?> componen...
{ "body": "@SuppressWarnings(\"unchecked\")\n public List<PropertyDescription> createPropertyDescriptions(Class<?> componentClass) {\n List<PropertyDescription> propertyDescriptions = new ArrayList<>();\n\n Set<Field> propertyFields = getAllFields(componentClass, withAnnotation(Property.class));\n ...
{ "created": null, "fork": null, "fork_count": 0, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 15655130, "size": 2828, "stargazer_count": 5, "stars": null, "updates": null, "url": "https://github.com/pmerienne/stormy-pythian" }
15655130_6
{ "fields": [ { "declarator": "factory", "modifier": "@InjectMocks\n private", "original_string": "@InjectMocks\n private ComponentFactory factory;", "type": "ComponentFactory", "var_name": "factory" }, { "declarator": "tridentTopology", "modifier": "@Mock\n...
{ "body": "@SuppressWarnings(\"unchecked\")\n @Test\n public void should_set_intput_stream_mapper() {\n // Given\n InputStreamDescription inputStreamDescription = new InputStreamDescription(\"in1\", LISTED);\n List<String> selectedFeatures = Arrays.asList(\"age\", \"viewCount\");\n I...
{ "fields": [ { "declarator": "tridentTopology", "modifier": "private", "original_string": "private TridentTopology tridentTopology;", "type": "TridentTopology", "var_name": "tridentTopology" }, { "declarator": "config", "modifier": "private", "original_stri...
{ "body": "public Component createComponent(ComponentConfiguration configuration, Map<String, StateFactory> stateFactories, Map<String, Stream> inputStreams) {\n try {\n Component component = configuration.retrieveImplementationClass().newInstance();\n setProperties(component, configurati...
{ "created": null, "fork": null, "fork_count": 0, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 15655130, "size": 2828, "stargazer_count": 5, "stars": null, "updates": null, "url": "https://github.com/pmerienne/stormy-pythian" }
15655130_50
{ "fields": [ { "declarator": "service", "modifier": "@InjectMocks\n private", "original_string": "@InjectMocks\n private LocalCLusterService service;", "type": "LocalCLusterService", "var_name": "service" }, { "declarator": "topologyRepository", "modifier":...
{ "body": "@SuppressWarnings(\"unchecked\")\n @Test\n public void should_launch_topology() throws Exception {\n // Given\n String topologyId = random(6);\n PythianToplogyConfiguration configuration = mock(PythianToplogyConfiguration.class);\n when(configuration.getComponents()).thenR...
{ "fields": [ { "declarator": "topologyRepository", "modifier": "@Autowired\n private", "original_string": "@Autowired\n private TopologyRepository topologyRepository;", "type": "TopologyRepository", "var_name": "topologyRepository" }, { "declarator": "cluster", ...
{ "body": "public void launch(String topologyId) throws TopologyLaunchException {\n PythianToplogyConfiguration configuration = topologyRepository.findById(topologyId);\n if (configuration == null) {\n throw new TopologyLaunchException(\"No topology found with id \" + topologyId);\n }\...
{ "created": null, "fork": null, "fork_count": 0, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 15655130, "size": 2828, "stargazer_count": 5, "stars": null, "updates": null, "url": "https://github.com/pmerienne/stormy-pythian" }
15655130_46
{ "fields": [ { "declarator": "factory", "modifier": "@InjectMocks\n\tprivate", "original_string": "@InjectMocks\n\tprivate PythianStateDescriptionFactory factory;", "type": "PythianStateDescriptionFactory", "var_name": "factory" }, { "declarator": "propertyDescriptionF...
{ "body": "@Test(expected = IllegalArgumentException.class)\n\tpublic void should_fail_without_documentation() {\n\t\t// Given\n\t\tclass TestState implements PythianState {\n\n\t\t\tpublic StateFactory createStateFactory() {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t}\n\n\t\t// When\n\t\tfactory.createDescription(TestSt...
{ "fields": [ { "declarator": "propertyDescriptionFactory", "modifier": "@Autowired\n\tprivate", "original_string": "@Autowired\n\tprivate PropertyDescriptionFactory propertyDescriptionFactory;", "type": "PropertyDescriptionFactory", "var_name": "propertyDescriptionFactory" } ]...
{ "body": "public PythianStateDescription createDescription(Class<? extends PythianState> clazz) {\n\t\tcheckArgument(clazz != null, \"PythianState class is mandatory\");\n\n\t\tDocumentation documentation = clazz.getAnnotation(Documentation.class);\n\t\tcheckArgument(documentation != null, \"No documentation found f...
{ "created": null, "fork": null, "fork_count": 0, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 15655130, "size": 2828, "stargazer_count": 5, "stars": null, "updates": null, "url": "https://github.com/pmerienne/stormy-pythian" }
15655130_11
{ "fields": [], "file": "stormy-pythian-core/src/test/java/stormy/pythian/core/topology/AvailableComponentPoolTest.java", "identifier": "AvailableComponentPoolTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void should_retrieve_available_component() {\n // Given\n ComponentConfiguration configuration = createComponentConfiguration();\n List<ComponentConfiguration> configurations = asList(configuration);\n\n AvailableComponentPool pool = new AvailableComponentPool(...
{ "fields": [ { "declarator": "components = new ArrayList<>()", "modifier": "private", "original_string": "private List<ComponentConfiguration> components = new ArrayList<>();", "type": "List<ComponentConfiguration>", "var_name": "components" }, { "declarator": "connect...
{ "body": "public ComponentConfiguration getAvailableComponent() {\n return Iterables.tryFind(components, IS_AVAILABLE).orNull();\n }", "class_method_signature": "AvailableComponentPool.getAvailableComponent()", "constructor": false, "full_signature": "public ComponentConfiguration getAvailableCompone...
{ "created": null, "fork": null, "fork_count": 0, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 15655130, "size": 2828, "stargazer_count": 5, "stars": null, "updates": null, "url": "https://github.com/pmerienne/stormy-pythian" }
31622667_0
{ "fields": [], "file": "ElevatorSimulator/src/elevatorsimulator/reinforcementlearning/ElevatorSystemStateTest.java", "identifier": "ElevatorSystemStateTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void testEpsilons() {\n\t\tassertEquals(0, ElevatorSystemState.hashCode(0.0));\n\t\tassertEquals(1, ElevatorSystemState.hashCode(0.05));\n\t\tassertEquals(1, ElevatorSystemState.hashCode(0.1));\n\t\tassertEquals(2, ElevatorSystemState.hashCode(0.15));\n\t\tassertEquals(2, ElevatorSystemStat...
{ "fields": [ { "declarator": "intervalNum", "modifier": "private", "original_string": "private int intervalNum;", "type": "int", "var_name": "intervalNum" }, { "declarator": "totalPassengers", "modifier": "private", "original_string": "private int totalPass...
{ "body": "public static int hashCode(double x) {\n//\t\tSystem.out.println(x + \" - \" + round(x, (int)-Math.log10(RATE_EPSILON)));\n\t\treturn (int)Math.round((round(x, (int)-Math.log10(RATE_EPSILON)) / RATE_EPSILON));\n\t}", "class_method_signature": "ElevatorSystemState.hashCode(double x)", "constructor": fal...
{ "created": null, "fork": null, "fork_count": 7, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 31622667, "size": 2660, "stargazer_count": 8, "stars": null, "updates": null, "url": "https://github.com/svenslaggare/ElevatorSimulator" }