id
stringlengths
7
14
test_class
dict
test_case
dict
focal_class
dict
focal_method
dict
repository
dict
17278009_190
{ "fields": [ { "declarator": "PID = 15", "modifier": "private static final", "original_string": "private static final int PID = 15;", "type": "int", "var_name": "PID" }, { "declarator": "sigarProxy", "modifier": "private", "original_string": "private SigarP...
{ "body": "@Test\n public void testGetFileDescriptor() throws Exception {\n assertTrue(procFd == processInfo.getFileDescriptor());\n // Change procFd\n procFd = Mockito.mock(ProcFd.class);\n when(sigarProxy.getProcFd(PID)).thenReturn(procFd);\n // Should not be same until refresh...
{ "fields": [ { "declarator": "LOG = LogFactory.getLog(ProcessInfo.class)", "modifier": "private static final", "original_string": "private static final Log LOG = LogFactory.getLog(ProcessInfo.class);", "type": "Log", "var_name": "LOG" }, { "declarator": "REFRESH_LOCK_A...
{ "body": "@Deprecated\n public ProcFd getFileDescriptor() throws SystemInfoException {\n return priorSnaphot().getFileDescriptor();\n }", "class_method_signature": "ProcessInfo.getFileDescriptor()", "constructor": false, "full_signature": "@Deprecated public ProcFd getFileDescriptor()", "identif...
{ "created": null, "fork": null, "fork_count": 85, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17278009, "size": 138394, "stargazer_count": 150, "stars": null, "updates": null, "url": "https://github.com/rhq-project/rhq" }
17278009_201
{ "fields": [], "file": "modules/core/client-api/src/test/java/org/rhq/core/clientapi/descriptor/PluginTransformerTest.java", "identifier": "PluginTransformerTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void pluginEnabledFlagShouldBeSetToTrue() throws Exception {\n PluginDescriptor pluginDescriptor = new PluginDescriptor();\n\n PluginTransformer transformer = new PluginTransformer();\n\n Plugin plugin = transformer.toPlugin(pluginDescriptor, getTestPluginURL());\n\n ...
{ "fields": [ { "declarator": "LOG = LogFactory.getLog(PluginTransformer.class)", "modifier": "private static final", "original_string": "private static final Log LOG = LogFactory.getLog(PluginTransformer.class);", "type": "Log", "var_name": "LOG" } ], "file": "modules/core/c...
{ "body": "public Plugin toPlugin(PluginDescriptor pluginDescriptor, URL pluginURL) {\n try {\n Plugin plugin = new Plugin();\n plugin.setName(pluginDescriptor.getName());\n\n if (pluginDescriptor.getDisplayName() == null) {\n plugin.setDisplayName(pluginDescript...
{ "created": null, "fork": null, "fork_count": 85, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17278009, "size": 138394, "stargazer_count": 150, "stars": null, "updates": null, "url": "https://github.com/rhq-project/rhq" }
17278009_94
{ "fields": [], "file": "modules/plugins/wfly-10/src/test/java/org/rhq/modules/plugins/wildfly10/TemplatedComponentTest.java", "identifier": "TemplatedComponentTest", "interfaces": "", "superclass": "" }
{ "body": "@SuppressWarnings({ \"rawtypes\", \"unchecked\" })\n @Test\n public void loadResourceConfigurationWithType() throws Exception {\n //tell the method story as it happens: mock or create dependencies and configure\n //those dependencies to get the method under test to completion.\n ...
{ "fields": [ { "declarator": "TYPE_CONFIGURATION = \"__type\"", "modifier": "private final static", "original_string": "private final static String TYPE_CONFIGURATION = \"__type\";", "type": "String", "var_name": "TYPE_CONFIGURATION" }, { "declarator": "NAME_CONFIGURAT...
{ "body": "@Override\n public Configuration loadResourceConfiguration() throws Exception {\n ConfigurationDefinition configDef = context.getResourceType().getResourceConfigurationDefinition();\n\n if (configDef.getDefaultTemplate().getConfiguration().get(TYPE_CONFIGURATION) != null) {\n //...
{ "created": null, "fork": null, "fork_count": 85, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17278009, "size": 138394, "stargazer_count": 150, "stars": null, "updates": null, "url": "https://github.com/rhq-project/rhq" }
17278009_128
{ "fields": [ { "declarator": "httpNetServiceDiscoveryComponent", "modifier": "private", "original_string": "private HTTPNetServiceDiscoveryComponent httpNetServiceDiscoveryComponent;", "type": "HTTPNetServiceDiscoveryComponent", "var_name": "httpNetServiceDiscoveryComponent" }, ...
{ "body": "@Test\n public void testMissingHostForManualProxyMode() {\n try {\n configuration.setSimpleValue(PROXY_MODE, MANUAL.name());\n httpNetServiceDiscoveryComponent.discoverResource(configuration, resourceDiscoveryContext);\n fail(\"Component configuration should be in...
{ "fields": [], "file": "modules/plugins/netservices/src/main/java/org/rhq/plugins/netservices/HTTPNetServiceDiscoveryComponent.java", "identifier": "HTTPNetServiceDiscoveryComponent", "interfaces": "implements ResourceDiscoveryComponent, ManualAddFacet", "methods": [ { "class_method_signature": "HT...
{ "body": "@Override\n public DiscoveredResourceDetails discoverResource(Configuration config,\n ResourceDiscoveryContext resourceDiscoveryContext) throws InvalidPluginConfigurationException {\n // Get the component configuration. This call will also make configuration checks\n HTTPNetServiceC...
{ "created": null, "fork": null, "fork_count": 85, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17278009, "size": 138394, "stargazer_count": 150, "stars": null, "updates": null, "url": "https://github.com/rhq-project/rhq" }
17278009_217
{ "fields": [], "file": "modules/core/domain/src/test/java/org/rhq/core/domain/configuration/RawConfigurationTest.java", "identifier": "RawConfigurationTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void verifyEqualsWhenNeitherRawConfigurationHasContentsOrPathSet() {\n RawConfiguration r1 = new RawConfiguration();\n RawConfiguration r2 = new RawConfiguration();\n\n assertFalse(r1.equals(r2), \"equals() should return false when contents and path is null for both r...
{ "fields": [ { "declarator": "serialVersionUID = 1L", "modifier": "private static final", "original_string": "private static final long serialVersionUID = 1L;", "type": "long", "var_name": "serialVersionUID" }, { "declarator": "id", "modifier": "@GeneratedValue(g...
{ "body": "@Override\n public boolean equals(Object obj) {\n if (obj == null) {\n return false;\n }\n\n if (obj == this) {\n return true;\n }\n\n if (obj instanceof RawConfiguration) {\n RawConfiguration that = (RawConfiguration) obj;\n ...
{ "created": null, "fork": null, "fork_count": 85, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17278009, "size": 138394, "stargazer_count": 150, "stars": null, "updates": null, "url": "https://github.com/rhq-project/rhq" }
17278009_82
{ "fields": [], "file": "modules/enterprise/binding/src/test/java/org/rhq/bindings/util/SummaryFilterTest.java", "identifier": "SummaryFilterTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testFilterAndReturnOrder() throws Exception {\n SummaryFilter filter = new SummaryFilter();\n PropertyDescriptor[] properties = filter.getPropertyDescriptors(new TestEntity(),false);\n\n assert (properties.length == 2);\n assert (properties[0].getName().eq...
{ "fields": [], "file": "modules/enterprise/binding/src/main/java/org/rhq/bindings/util/SummaryFilter.java", "identifier": "SummaryFilter", "interfaces": "", "methods": [ { "class_method_signature": "SummaryFilter.getPropertyDescriptors(Object object, boolean exportMode)", "constructor": false...
{ "body": "public PropertyDescriptor[] getPropertyDescriptors(Object object, boolean exportMode) throws IntrospectionException {\n\n BeanInfo info = Introspector.getBeanInfo(object.getClass(), Object.class);\n\n final Map<PropertyDescriptor, Integer> indexes = new HashMap<PropertyDescriptor, Integer>();...
{ "created": null, "fork": null, "fork_count": 85, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17278009, "size": 138394, "stargazer_count": 150, "stars": null, "updates": null, "url": "https://github.com/rhq-project/rhq" }
17278009_240
{ "fields": [], "file": "modules/core/domain/src/test/java/org/rhq/core/domain/search/SavedSearchTest.java", "identifier": "SavedSearchTest", "interfaces": "", "superclass": "extends AbstractEJB3Test" }
{ "body": "@Test(groups = \"integration.ejb3\")\n public void testInsert() throws Exception {\n getTransactionManager().begin();\n EntityManager entityMgr = getEntityManager();\n try {\n Subject subject = new Subject(\"searcher\", true, true);\n entityMgr.persist(subject)...
{ "fields": [ { "declarator": "serialVersionUID = 1L", "modifier": "private static final", "original_string": "private static final long serialVersionUID = 1L;", "type": "long", "var_name": "serialVersionUID" }, { "declarator": "id", "modifier": "@Id\n @Column(...
{ "body": "public void setGlobal(boolean global) {\n this.global = global;\n }", "class_method_signature": "SavedSearch.setGlobal(boolean global)", "constructor": false, "full_signature": "public void setGlobal(boolean global)", "identifier": "setGlobal", "invocations": [], "modifiers": "public"...
{ "created": null, "fork": null, "fork_count": 85, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17278009, "size": 138394, "stargazer_count": 150, "stars": null, "updates": null, "url": "https://github.com/rhq-project/rhq" }
17278009_8
{ "fields": [ { "declarator": "subjectMgr", "modifier": "", "original_string": "SubjectManagerLocal subjectMgr;", "type": "SubjectManagerLocal", "var_name": "subjectMgr" }, { "declarator": "resourceTypeMgr", "modifier": "", "original_string": "ResourceTypeMa...
{ "body": "@Test\n public void acceptReportWithNoDeletedTypes() {\n InventoryReport report = createReport();\n report.addAddedRoot(new ResourceBuilder()\n .createRandomServer()\n .with(2).randomChildServices()\n .build());\n report.addAddedRoot(new ResourceBuil...
{ "fields": [ { "declarator": "subjectMgr", "modifier": "private", "original_string": "private SubjectManagerLocal subjectMgr;", "type": "SubjectManagerLocal", "var_name": "subjectMgr" }, { "declarator": "resourceTypeMgr", "modifier": "private", "original_st...
{ "body": "public Set<ResourceType> apply(InventoryReport report) {\n Set<ResourceType> resourceTypes = getResourceTypes(report.getAddedRoots());\n Set<ResourceType> staleTypes = new HashSet<ResourceType>();\n\n for (ResourceType type : resourceTypes) {\n // We check two things to dete...
{ "created": null, "fork": null, "fork_count": 85, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17278009, "size": 138394, "stargazer_count": 150, "stars": null, "updates": null, "url": "https://github.com/rhq-project/rhq" }
17278009_169
{ "fields": [ { "declarator": "ENABLED = true", "modifier": "private static final", "original_string": "private static final boolean ENABLED = true;", "type": "boolean", "var_name": "ENABLED" } ], "file": "modules/core/native-system/src/test/java/org/rhq/core/system/NativeSys...
{ "body": "@Test(enabled = ENABLED)\n public void testShutdownInitialize() throws Exception {\n Sigar sigar = null;\n try {\n sigar = new Sigar();\n sigar.getCpu();\n } catch (Throwable t) {\n System.out.println(\"~~~ Native library is not available - cannot te...
{ "fields": [ { "declarator": "log = LogFactory.getLog(NativeSystemInfo.class)", "modifier": "private final", "original_string": "private final Log log = LogFactory.getLog(NativeSystemInfo.class);", "type": "Log", "var_name": "log" }, { "declarator": "sigar", "mod...
{ "body": "public CpuInformation getCpu(int cpuIndex) {\n return new CpuInformation(cpuIndex, sigar);\n }", "class_method_signature": "NativeSystemInfo.getCpu(int cpuIndex)", "constructor": false, "full_signature": "public CpuInformation getCpu(int cpuIndex)", "identifier": "getCpu", "invocations"...
{ "created": null, "fork": null, "fork_count": 85, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17278009, "size": 138394, "stargazer_count": 150, "stars": null, "updates": null, "url": "https://github.com/rhq-project/rhq" }
17278009_186
{ "fields": [ { "declarator": "PID = 15", "modifier": "private static final", "original_string": "private static final int PID = 15;", "type": "int", "var_name": "PID" }, { "declarator": "sigarProxy", "modifier": "private", "original_string": "private SigarP...
{ "body": "@Test\n public void testGetExecutable() throws Exception {\n assertTrue(procExe == processInfo.getExecutable());\n // Change procExe\n procExe = Mockito.mock(ProcExe.class);\n when(sigarProxy.getProcExe(PID)).thenReturn(procExe);\n // Should not be same until refresh i...
{ "fields": [ { "declarator": "LOG = LogFactory.getLog(ProcessInfo.class)", "modifier": "private static final", "original_string": "private static final Log LOG = LogFactory.getLog(ProcessInfo.class);", "type": "Log", "var_name": "LOG" }, { "declarator": "REFRESH_LOCK_A...
{ "body": "@Deprecated\n public ProcExe getExecutable() throws SystemInfoException {\n return priorSnaphot().getExecutable();\n }", "class_method_signature": "ProcessInfo.getExecutable()", "constructor": false, "full_signature": "@Deprecated public ProcExe getExecutable()", "identifier": "getExec...
{ "created": null, "fork": null, "fork_count": 85, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17278009, "size": 138394, "stargazer_count": 150, "stars": null, "updates": null, "url": "https://github.com/rhq-project/rhq" }
17278009_162
{ "fields": [ { "declarator": "TMP_DIR = new File(System.getProperty(\"java.io.tmpdir\"))", "modifier": "private static final", "original_string": "private static final File TMP_DIR = new File(System.getProperty(\"java.io.tmpdir\"));", "type": "File", "var_name": "TMP_DIR" } ],...
{ "body": "@Test\n public void shouldReturnFoundFileForRootContext() throws Exception {\n File logFileDir = createLogFileDir();\n File logFile = File.createTempFile(\"log\", \"ROOT_rt.log\", logFileDir);\n logFile.deleteOnExit();\n assertNotNull(findResponseTimeLogFileInDirectory(\"/\",...
{ "fields": [ { "declarator": "FALLBACK_RESPONSE_TIME_LOG_FILE_DIRECTORY = new File(System.getProperty(\"java.io.tmpdir\")\n + File.separator + \"rhq\" + File.separator + \"rt\")", "modifier": "public static final", "original_string": "public static final File FALLBACK_RESPONSE_TIME_LOG_F...
{ "body": "public static String findResponseTimeLogFileInDirectory(String contextPath, File responseTimeLogFileDirectory) {\n if (contextPath == null) {\n throw new IllegalArgumentException(\"contextPath is null\");\n }\n if (!contextPath.startsWith(\"/\")) {\n throw new Ill...
{ "created": null, "fork": null, "fork_count": 85, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17278009, "size": 138394, "stargazer_count": 150, "stars": null, "updates": null, "url": "https://github.com/rhq-project/rhq" }
17278009_3
{ "fields": [ { "declarator": "nf = NumberFormat.getInstance()", "modifier": "", "original_string": "NumberFormat nf = NumberFormat.getInstance();", "type": "NumberFormat", "var_name": "nf" } ], "file": "modules/enterprise/gui/portal-war/src/test/java/org/rhq/enterprise/gui/l...
{ "body": "@Test\n public void testFormatTimeMetrics() {\n List<MetricDisplaySummary> metricDisplaySummaries = new ArrayList<MetricDisplaySummary>();\n Locale locale = Locale.US;\n MessageResources messageResources = createMessageResources();\n\n // test time\n MetricDisplaySumma...
{ "fields": [ { "declarator": "log = LogFactory.getLog(MonitorUtils.class)", "modifier": "private static", "original_string": "private static Log log = LogFactory.getLog(MonitorUtils.class);", "type": "Log", "var_name": "log" }, { "declarator": "RO = \"ro\"", "mod...
{ "body": "public static Integer formatMetrics(List<MetricDisplaySummary> metricDisplaySummaries, Locale userLocale,\n MessageResources msgs) {\n Integer resourceCount = null;\n try {\n for (MetricDisplaySummary metricDisplaySummary : metricDisplaySummaries) {\n if (Doub...
{ "created": null, "fork": null, "fork_count": 85, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17278009, "size": 138394, "stargazer_count": 150, "stars": null, "updates": null, "url": "https://github.com/rhq-project/rhq" }
17278009_31
{ "fields": [ { "declarator": "dao", "modifier": "", "original_string": "ChangeSetDAO dao;", "type": "ChangeSetDAO", "var_name": "dao" } ], "file": "modules/enterprise/server/plugins/drift-mongodb/src/test/java/org/rhq/enterprise/server/plugins/drift/mongodb/dao/ChangeSetDAOT...
{ "body": "@Test(enabled = ENABLED)\n public void findByChangeSetCriteriaWithCreatedAfterFilter() throws Exception {\n long creationTime = System.currentTimeMillis() - (1000 * 60 * 10); // 10 minutes ago\n MongoDBChangeSet c1 = new MongoDBChangeSet();\n c1.setCategory(DRIFT);\n c1.setV...
{ "fields": [ { "declarator": "morphia", "modifier": "private", "original_string": "private Morphia morphia;", "type": "Morphia", "var_name": "morphia" } ], "file": "modules/enterprise/server/plugins/drift-mongodb/src/main/java/org/rhq/enterprise/server/plugins/drift/mongodb/...
{ "body": "public List<MongoDBChangeSet> findByChangeSetCritiera(DriftChangeSetCriteria criteria) {\n Query<MongoDBChangeSet> query = createQuery();\n \n if (criteria.getFilterId() != null) {\n // There is no need to apply any additional filters if the id filter is specified\n ...
{ "created": null, "fork": null, "fork_count": 85, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17278009, "size": 138394, "stargazer_count": 150, "stars": null, "updates": null, "url": "https://github.com/rhq-project/rhq" }
17278009_135
{ "fields": [ { "declarator": "pingNetServiceDiscoveryComponent", "modifier": "private", "original_string": "private PingNetServiceDiscoveryComponent pingNetServiceDiscoveryComponent;", "type": "PingNetServiceDiscoveryComponent", "var_name": "pingNetServiceDiscoveryComponent" }, ...
{ "body": "@Test\n public void testMalformedAddress() {\n String configAddress = \"pipomolo\";\n try {\n configuration.setSimpleValue(ConfigKeys.ADDRESS, configAddress);\n pingNetServiceDiscoveryComponent.discoverResource(configuration, resourceDiscoveryContext);\n fa...
{ "fields": [ { "declarator": "RESOURCE_NAME_PREFIX = \"Ping \"", "modifier": "private static final", "original_string": "private static final String RESOURCE_NAME_PREFIX = \"Ping \";", "type": "String", "var_name": "RESOURCE_NAME_PREFIX" } ], "file": "modules/plugins/netserv...
{ "body": "@Override\n public DiscoveredResourceDetails discoverResource(Configuration config,\n ResourceDiscoveryContext resourceDiscoveryContext) throws InvalidPluginConfigurationException {\n InetAddress address = PingNetServiceComponent.createComponentConfiguration(config);\n DiscoveredRes...
{ "created": null, "fork": null, "fork_count": 85, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17278009, "size": 138394, "stargazer_count": 150, "stars": null, "updates": null, "url": "https://github.com/rhq-project/rhq" }
17278009_89
{ "fields": [], "file": "modules/common/cassandra-schema/src/test/java/org/rhq/cassandra/schema/UpdateFileTest.java", "identifier": "UpdateFileTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void bindingErrorNoProperties() throws Exception {\n UpdateFile updateFile = new UpdateFile(\"required_binding.xml\");\n updateFile.getOrderedSteps();\n }", "class_method_signature": "UpdateFileTest.bindingErrorNoProperties()", "constructor": false, "full_signature"...
{ "fields": [ { "declarator": "UPDATE_PLAN_ELEMENT = \"updatePlan\"", "modifier": "private static final", "original_string": "private static final String UPDATE_PLAN_ELEMENT = \"updatePlan\";", "type": "String", "var_name": "UPDATE_PLAN_ELEMENT" }, { "declarator": "STEP...
{ "body": "public List<Step> getOrderedSteps() {\n return getStepNodes();\n }", "class_method_signature": "UpdateFile.getOrderedSteps()", "constructor": false, "full_signature": "public List<Step> getOrderedSteps()", "identifier": "getOrderedSteps", "invocations": [ "getStepNodes" ], "modi...
{ "created": null, "fork": null, "fork_count": 85, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17278009, "size": 138394, "stargazer_count": 150, "stars": null, "updates": null, "url": "https://github.com/rhq-project/rhq" }
17278009_66
{ "fields": [ { "declarator": "dao", "modifier": "private", "original_string": "private MetricsDAO dao;", "type": "MetricsDAO", "var_name": "dao" }, { "declarator": "dateTimeService", "modifier": "private", "original_string": "private DateTimeService dateTim...
{ "body": "@Test\n public void submitInvalid24HourMetricWhen6HourMetricsExpired() throws Exception {\n int scheduleId = 100;\n\n dao.insert24HourData(new24HourAggregate(scheduleId, hour(0).minusDays(7), 95.83, 100, 100)).get();\n\n invalidMetricsManager.submit(new24HourAggregate(scheduleId, ho...
{ "fields": [ { "declarator": "log = LogFactory.getLog(InvalidMetricsManager.class)", "modifier": "private static final", "original_string": "private static final Log log = LogFactory.getLog(InvalidMetricsManager.class);", "type": "Log", "var_name": "log" }, { "declarat...
{ "body": "public boolean submit(AggregateNumericMetric metric) {\n DateTime day = dateTimeService.getTimeSlice(new DateTime(metric.getTimestamp()),\n configuration.getSixHourTimeSliceDuration());\n InvalidMetric invalidMetric = new InvalidMetric(day, metric, delay);\n\n if (isShutdown...
{ "created": null, "fork": null, "fork_count": 85, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17278009, "size": 138394, "stargazer_count": 150, "stars": null, "updates": null, "url": "https://github.com/rhq-project/rhq" }
17278009_123
{ "fields": [ { "declarator": "httpNetServiceDiscoveryComponent", "modifier": "private", "original_string": "private HTTPNetServiceDiscoveryComponent httpNetServiceDiscoveryComponent;", "type": "HTTPNetServiceDiscoveryComponent", "var_name": "httpNetServiceDiscoveryComponent" }, ...
{ "body": "@Test\n public void testHeadMethod() {\n try {\n configuration.setSimpleValue(METHOD, HEAD.name());\n configuration.remove(VALIDATE_RESPONSE_PATTERN);\n DiscoveredResourceDetails resourceDetails = httpNetServiceDiscoveryComponent.discoverResource(\n ...
{ "fields": [], "file": "modules/plugins/netservices/src/main/java/org/rhq/plugins/netservices/HTTPNetServiceDiscoveryComponent.java", "identifier": "HTTPNetServiceDiscoveryComponent", "interfaces": "implements ResourceDiscoveryComponent, ManualAddFacet", "methods": [ { "class_method_signature": "HT...
{ "body": "@Override\n public DiscoveredResourceDetails discoverResource(Configuration config,\n ResourceDiscoveryContext resourceDiscoveryContext) throws InvalidPluginConfigurationException {\n // Get the component configuration. This call will also make configuration checks\n HTTPNetServiceC...
{ "created": null, "fork": null, "fork_count": 85, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17278009, "size": 138394, "stargazer_count": 150, "stars": null, "updates": null, "url": "https://github.com/rhq-project/rhq" }
17278009_70
{ "fields": [ { "declarator": "TEST_PRECISION = Math.pow(10, -9)", "modifier": "private static final", "original_string": "private static final double TEST_PRECISION = Math.pow(10, -9);", "type": "double", "var_name": "TEST_PRECISION" }, { "declarator": "metricsServer",...
{ "body": "@Test(dataProvider = \"testDates\")\n public void aggregateRawDataDuring9thHour(DateTime testNow) throws Exception {\n initServer(testNow);\n\n int scheduleId = 123;\n\n DateTime hour0 = hour0();\n DateTime hour9 = hour0.plusHours(9);\n DateTime hour8 = hour9.minusHour...
{ "fields": [ { "declarator": "log = LogFactory.getLog(MetricsServer.class)", "modifier": "private final", "original_string": "private final Log log = LogFactory.getLog(MetricsServer.class);", "type": "Log", "var_name": "log" }, { "declarator": "RAW_DATA_AGE_LIMIT_MAX =...
{ "body": "public Iterable<AggregateNumericMetric> calculateAggregates() {\n return aggregationManager.run();\n }", "class_method_signature": "MetricsServer.calculateAggregates()", "constructor": false, "full_signature": "public Iterable<AggregateNumericMetric> calculateAggregates()", "identifier": ...
{ "created": null, "fork": null, "fork_count": 85, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17278009, "size": 138394, "stargazer_count": 150, "stars": null, "updates": null, "url": "https://github.com/rhq-project/rhq" }
17278009_174
{ "fields": [ { "declarator": "PID = 15", "modifier": "private static final", "original_string": "private static final int PID = 15;", "type": "int", "var_name": "PID" }, { "declarator": "sigarProxy", "modifier": "private", "original_string": "private SigarP...
{ "body": "@Test\n public void testGetNameFromStateWithFileNotExists() throws Exception {\n // Force new test instance because this test case work with data\n // which is initialized at instance creation\n procState = Mockito.mock(ProcState.class);\n when(procState.getName()).thenReturn...
{ "fields": [ { "declarator": "LOG = LogFactory.getLog(ProcessInfo.class)", "modifier": "private static final", "original_string": "private static final Log LOG = LogFactory.getLog(ProcessInfo.class);", "type": "Log", "var_name": "LOG" }, { "declarator": "REFRESH_LOCK_A...
{ "body": "public String getName() {\n return name;\n }", "class_method_signature": "ProcessInfo.getName()", "constructor": false, "full_signature": "public String getName()", "identifier": "getName", "invocations": [], "modifiers": "public", "parameters": "()", "return": "String", "signat...
{ "created": null, "fork": null, "fork_count": 85, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17278009, "size": 138394, "stargazer_count": 150, "stars": null, "updates": null, "url": "https://github.com/rhq-project/rhq" }
17278009_27
{ "fields": [ { "declarator": "dao", "modifier": "", "original_string": "ChangeSetDAO dao;", "type": "ChangeSetDAO", "var_name": "dao" } ], "file": "modules/enterprise/server/plugins/drift-mongodb/src/test/java/org/rhq/enterprise/server/plugins/drift/mongodb/dao/ChangeSetDAOT...
{ "body": "@Test(enabled = ENABLED)\n public void findByChangeSetCriteriaWithVersionFilter() throws Exception {\n MongoDBChangeSet c1 = new MongoDBChangeSet();\n c1.setCategory(DRIFT);\n c1.setVersion(1);\n c1.setResourceId(1);\n c1.setDriftDefinitionId(1);\n dao.save(c1);...
{ "fields": [ { "declarator": "morphia", "modifier": "private", "original_string": "private Morphia morphia;", "type": "Morphia", "var_name": "morphia" } ], "file": "modules/enterprise/server/plugins/drift-mongodb/src/main/java/org/rhq/enterprise/server/plugins/drift/mongodb/...
{ "body": "public List<MongoDBChangeSet> findByChangeSetCritiera(DriftChangeSetCriteria criteria) {\n Query<MongoDBChangeSet> query = createQuery();\n \n if (criteria.getFilterId() != null) {\n // There is no need to apply any additional filters if the id filter is specified\n ...
{ "created": null, "fork": null, "fork_count": 85, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17278009, "size": 138394, "stargazer_count": 150, "stars": null, "updates": null, "url": "https://github.com/rhq-project/rhq" }
17278009_226
{ "fields": [ { "declarator": "TEST_PLATFORM_TYPE = new ResourceType(\"test platform\", \"test plugin\", PLATFORM,\n null)", "modifier": "private static final", "original_string": "private static final ResourceType TEST_PLATFORM_TYPE = new ResourceType(\"test platform\", \"test plugin\", ...
{ "body": "@Test\n public void getBaseServerOrServiceOfTopLevelServer() throws Exception {\n Resource topLevelServer = new Resource();\n topLevelServer.setResourceType(TEST_TOP_LEVEL_SERVER_TYPE);\n assertSame(topLevelServer, getBaseServerOrService(topLevelServer));\n }", "class_method_si...
{ "fields": [], "file": "modules/core/domain/src/main/java/org/rhq/core/domain/util/ResourceUtility.java", "identifier": "ResourceUtility", "interfaces": "", "methods": [ { "class_method_signature": "ResourceUtility.getChildResource(Resource parent, ResourceType type, String key)", "constructo...
{ "body": "public static Resource getBaseServerOrService(Resource resource) {\n if (resource == null) {\n throw new IllegalArgumentException(\"resource is null\");\n }\n Resource current, parent = resource;\n do {\n current = parent;\n parent = current.getP...
{ "created": null, "fork": null, "fork_count": 85, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17278009, "size": 138394, "stargazer_count": 150, "stars": null, "updates": null, "url": "https://github.com/rhq-project/rhq" }
17278009_271
{ "fields": [ { "declarator": "configFacet", "modifier": "", "original_string": "ResourceConfigurationFacet configFacet;", "type": "ResourceConfigurationFacet", "var_name": "configFacet" }, { "declarator": "rawConfigMgmt", "modifier": "", "original_string": ...
{ "body": "@Test\n public void rawConfigsShouldGetLoaded() throws Exception {\n Set<RawConfiguration> rawConfigs = toSet(\n createRawConfiguration(\"/tmp/foo.txt\"),\n createRawConfiguration(\"/tmp/bar.txt\")\n );\n\n addDefaultExpectationsForLoad(rawConfigs);\n\n ...
{ "fields": [ { "declarator": "log = LogFactory.getLog(RawConfigManagement.class)", "modifier": "private final", "original_string": "private final Log log = LogFactory.getLog(RawConfigManagement.class);", "type": "Log", "var_name": "log" } ], "file": "modules/core/plugin-cont...
{ "body": "public Configuration executeLoad(int resourceId) throws PluginContainerException {\n ResourceConfigurationFacet facet = loadResouceConfiguratonFacet(resourceId);\n\n Set<RawConfiguration> rawConfigs = facet.loadRawConfigurations();\n\n if (rawConfigs == null) {\n return null...
{ "created": null, "fork": null, "fork_count": 85, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17278009, "size": 138394, "stargazer_count": 150, "stars": null, "updates": null, "url": "https://github.com/rhq-project/rhq" }
17278009_158
{ "fields": [ { "declarator": "TMP_DIR = new File(System.getProperty(\"java.io.tmpdir\"))", "modifier": "private static final", "original_string": "private static final File TMP_DIR = new File(System.getProperty(\"java.io.tmpdir\"));", "type": "File", "var_name": "TMP_DIR" } ],...
{ "body": "@Test\n public void shouldReturnNullWhenDirectoryArgIsNotADirectory() throws Exception {\n File tempFile = File.createTempFile(\"pipo-\", \".tmp\");\n tempFile.deleteOnExit();\n assertNull(findResponseTimeLogFileInDirectory(\"/pipo\", tempFile));\n }", "class_method_signature":...
{ "fields": [ { "declarator": "FALLBACK_RESPONSE_TIME_LOG_FILE_DIRECTORY = new File(System.getProperty(\"java.io.tmpdir\")\n + File.separator + \"rhq\" + File.separator + \"rt\")", "modifier": "public static final", "original_string": "public static final File FALLBACK_RESPONSE_TIME_LOG_F...
{ "body": "public static String findResponseTimeLogFileInDirectory(String contextPath, File responseTimeLogFileDirectory) {\n if (contextPath == null) {\n throw new IllegalArgumentException(\"contextPath is null\");\n }\n if (!contextPath.startsWith(\"/\")) {\n throw new Ill...
{ "created": null, "fork": null, "fork_count": 85, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17278009, "size": 138394, "stargazer_count": 150, "stars": null, "updates": null, "url": "https://github.com/rhq-project/rhq" }
17278009_267
{ "fields": [ { "declarator": "configFacet", "modifier": "", "original_string": "ResourceConfigurationFacet configFacet;", "type": "ResourceConfigurationFacet", "var_name": "configFacet" }, { "declarator": "structuredMgmt", "modifier": "", "original_string":...
{ "body": "@Test\n public void nullShouldBeReturnedWhenStructuredIsNull() throws Exception {\n context.checking(new Expectations() {{\n atLeast(1).of(componentService).getComponent(resourceId,\n ResourceConfigurationFacet.class,\n ...
{ "fields": [ { "declarator": "log = LogFactory.getLog(StructuredConfigManagement.class)", "modifier": "private final", "original_string": "private final Log log = LogFactory.getLog(StructuredConfigManagement.class);", "type": "Log", "var_name": "log" } ], "file": "modules/co...
{ "body": "public Configuration executeLoad(int resourceId) throws PluginContainerException {\n ResourceConfigurationFacet facet = loadResouceConfiguratonFacet(resourceId);\n\n Configuration configuration = facet.loadStructuredConfiguration();\n\n if (configuration == null) {\n return ...
{ "created": null, "fork": null, "fork_count": 85, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17278009, "size": 138394, "stargazer_count": 150, "stars": null, "updates": null, "url": "https://github.com/rhq-project/rhq" }
17278009_288
{ "fields": [], "file": "modules/core/plugin-container/src/test/java/org/rhq/core/pc/drift/ChangeSetManagerImplTest.java", "identifier": "ChangeSetManagerImplTest", "interfaces": "", "superclass": "extends DriftTest" }
{ "body": "@Test\n public void verifyChangeSetDoesNotExist() throws Exception {\n String config = \"changeset-does-not-exist\";\n assertFalse(changeSetMgr.changeSetExists(resourceId(), createHeaders(config, DRIFT)),\n \"Did not expect to find change set file.\");\n }", "class_method_s...
{ "fields": [ { "declarator": "changeSetsDir", "modifier": "private", "original_string": "private File changeSetsDir;", "type": "File", "var_name": "changeSetsDir" } ], "file": "modules/core/plugin-container/src/main/java/org/rhq/core/pc/drift/ChangeSetManagerImpl.java", "i...
{ "body": "@Override\n public boolean changeSetExists(int resourceId, Headers headers) {\n File changeSetDir = findChangeSetDir(resourceId, headers.getDriftDefinitionName());\n if (changeSetDir == null || !changeSetDir.exists()) {\n return false;\n }\n return new File(changeS...
{ "created": null, "fork": null, "fork_count": 85, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17278009, "size": 138394, "stargazer_count": 150, "stars": null, "updates": null, "url": "https://github.com/rhq-project/rhq" }
17278009_230
{ "fields": [], "file": "modules/core/domain/src/test/java/org/rhq/core/domain/drift/DriftDefinitionTest.java", "identifier": "DriftDefinitionTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void getName() {\n String name = \"test\";\n Configuration config = new Configuration();\n config.put(new PropertySimple(\"name\", name));\n\n DriftDefinition driftDef = new DriftDefinition(config);\n\n assertEquals(driftDef.getName(), name, \"Failed to ...
{ "fields": [ { "declarator": "serialVersionUID = 1L", "modifier": "private static final", "original_string": "private static final long serialVersionUID = 1L;", "type": "long", "var_name": "serialVersionUID" }, { "declarator": "id", "modifier": "@Column(name = \"...
{ "body": "public String getName() {\n return name;\n }", "class_method_signature": "DriftDefinition.getName()", "constructor": false, "full_signature": "public String getName()", "identifier": "getName", "invocations": [], "modifiers": "public", "parameters": "()", "return": "String", "si...
{ "created": null, "fork": null, "fork_count": 85, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17278009, "size": 138394, "stargazer_count": 150, "stars": null, "updates": null, "url": "https://github.com/rhq-project/rhq" }
17278009_119
{ "fields": [ { "declarator": "httpNetServiceDiscoveryComponent", "modifier": "private", "original_string": "private HTTPNetServiceDiscoveryComponent httpNetServiceDiscoveryComponent;", "type": "HTTPNetServiceDiscoveryComponent", "var_name": "httpNetServiceDiscoveryComponent" }, ...
{ "body": "@Test\n public void testMalformedUrl() {\n String configUrl = \"pipomolo\";\n try {\n configuration.setSimpleValue(URL, configUrl);\n httpNetServiceDiscoveryComponent.discoverResource(configuration, resourceDiscoveryContext);\n fail(\"Component configuratio...
{ "fields": [], "file": "modules/plugins/netservices/src/main/java/org/rhq/plugins/netservices/HTTPNetServiceDiscoveryComponent.java", "identifier": "HTTPNetServiceDiscoveryComponent", "interfaces": "implements ResourceDiscoveryComponent, ManualAddFacet", "methods": [ { "class_method_signature": "HT...
{ "body": "@Override\n public DiscoveredResourceDetails discoverResource(Configuration config,\n ResourceDiscoveryContext resourceDiscoveryContext) throws InvalidPluginConfigurationException {\n // Get the component configuration. This call will also make configuration checks\n HTTPNetServiceC...
{ "created": null, "fork": null, "fork_count": 85, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17278009, "size": 138394, "stargazer_count": 150, "stars": null, "updates": null, "url": "https://github.com/rhq-project/rhq" }
17278009_181
{ "fields": [ { "declarator": "PID = 15", "modifier": "private static final", "original_string": "private static final int PID = 15;", "type": "int", "var_name": "PID" }, { "declarator": "sigarProxy", "modifier": "private", "original_string": "private SigarP...
{ "body": "@Test\n public void testGetEnvironmentVariableWithNullEnv() throws Exception {\n assertEquals(processInfo.getEnvironmentVariable(\"anyvar\"), null);\n }", "class_method_signature": "ProcessInfoTest.testGetEnvironmentVariableWithNullEnv()", "constructor": false, "full_signature": "@Test p...
{ "fields": [ { "declarator": "LOG = LogFactory.getLog(ProcessInfo.class)", "modifier": "private static final", "original_string": "private static final Log LOG = LogFactory.getLog(ProcessInfo.class);", "type": "Log", "var_name": "LOG" }, { "declarator": "REFRESH_LOCK_A...
{ "body": "@Nullable\n public String getEnvironmentVariable(@NotNull\n String name) {\n if (this.procEnv == null) {\n return null;\n }\n SystemInfo systemInfo = SystemInfoFactory.createJavaSystemInfo();\n boolean isWindows = systemInfo.getOperatingSystemType() == Operating...
{ "created": null, "fork": null, "fork_count": 85, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17278009, "size": 138394, "stargazer_count": 150, "stars": null, "updates": null, "url": "https://github.com/rhq-project/rhq" }
17278009_247
{ "fields": [ { "declarator": "LEGACY_AMPS_VERSION = \"2.0\"", "modifier": "static final", "original_string": "static final String LEGACY_AMPS_VERSION = \"2.0\";", "type": "String", "var_name": "LEGACY_AMPS_VERSION" }, { "declarator": "NON_LEGACY_AMPS_VERSION = \"2.1\""...
{ "body": "@Test\n public void factoryShouldInitializeLoadStructuredAndRawWithComponentService() throws Exception {\n final boolean daemonOnly = true;\n\n final ResourceComponent resourceComponent = context.mock(ResourceComponent.class);\n\n context.checking(new Expectations() {\n {...
{ "fields": [ { "declarator": "componentService", "modifier": "private final", "original_string": "private final ComponentService componentService;", "type": "ComponentService", "var_name": "componentService" }, { "declarator": "configUtilityService = new ConfigurationU...
{ "body": "public ConfigManagement getStrategy(int resourceId) throws PluginContainerException {\n ConfigManagement configManagement = createStrategy(resourceId);\n initStrategyDependencies(configManagement);\n\n return configManagement;\n }", "class_method_signature": "ConfigManagementFacto...
{ "created": null, "fork": null, "fork_count": 85, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17278009, "size": 138394, "stargazer_count": 150, "stars": null, "updates": null, "url": "https://github.com/rhq-project/rhq" }
17278009_85
{ "fields": [ { "declarator": "TEST_HANDLE = \"calanques\"", "modifier": "private static final", "original_string": "private static final String TEST_HANDLE = \"calanques\";", "type": "String", "var_name": "TEST_HANDLE" }, { "declarator": "contentUploader", "modif...
{ "body": "@Test(expectedExceptions = { IllegalArgumentException.class })\n public void uploadByFileNameShouldThrowIAEWhenFileDoesNotExist() throws Exception {\n File aFileWhichDoesNotExist = aFileWhichDoesNotExist();\n assertFalse(aFileWhichDoesNotExist.exists());\n contentUploader.upload(aFi...
{ "fields": [ { "declarator": "SIZE_32K = 1024 * 32", "modifier": "private static final", "original_string": "private static final int SIZE_32K = 1024 * 32;", "type": "int", "var_name": "SIZE_32K" }, { "declarator": "contentManager", "modifier": "private", "...
{ "body": "public String upload(String filename) {\n if (StringUtil.isBlank(filename)) {\n throw new IllegalArgumentException(\"Empty path\");\n }\n return upload(new File(filename));\n }", "class_method_signature": "ContentUploader.upload(String filename)", "constructor": false...
{ "created": null, "fork": null, "fork_count": 85, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17278009, "size": 138394, "stargazer_count": 150, "stars": null, "updates": null, "url": "https://github.com/rhq-project/rhq" }
17278009_139
{ "fields": [ { "declarator": "portNetServiceDiscoveryComponent", "modifier": "private", "original_string": "private PortNetServiceDiscoveryComponent portNetServiceDiscoveryComponent;", "type": "PortNetServiceDiscoveryComponent", "var_name": "portNetServiceDiscoveryComponent" }, ...
{ "body": "@Test\n public void testMissingPort() {\n configuration.remove(ConfigKeys.PORT);\n try {\n portNetServiceDiscoveryComponent.discoverResource(configuration, resourceDiscoveryContext);\n fail(\"Component configuration should be invalid\");\n } catch (InvalidPlugi...
{ "fields": [ { "declarator": "RESOURCE_PREFIX = \"Port \"", "modifier": "private static final", "original_string": "private static final String RESOURCE_PREFIX = \"Port \";", "type": "String", "var_name": "RESOURCE_PREFIX" }, { "declarator": "SEPARATOR = \":\"", ...
{ "body": "@Override\n public DiscoveredResourceDetails discoverResource(Configuration pluginConfiguration,\n ResourceDiscoveryContext context) throws InvalidPluginConfigurationException {\n PortNetServiceComponentConfiguration componentConfiguration = PortNetServiceComponent\n .createComp...
{ "created": null, "fork": null, "fork_count": 85, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17278009, "size": 138394, "stargazer_count": 150, "stars": null, "updates": null, "url": "https://github.com/rhq-project/rhq" }
17278009_210
{ "fields": [], "file": "modules/core/domain/src/test/java/org/rhq/core/domain/configuration/PropertyListTest.java", "identifier": "PropertyListTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void deepCopyShouldCopyAllSimpleFields() {\n PropertyList original = createPropertyList();\n\n PropertyList copy = original.deepCopy(true);\n\n assertNotSame(copy, original, \"The copy should not reference the original object\");\n\n assertEquals(copy.getId(), ...
{ "fields": [ { "declarator": "serialVersionUID = 1L", "modifier": "private static final", "original_string": "private static final long serialVersionUID = 1L;", "type": "long", "var_name": "serialVersionUID" }, { "declarator": "list = new ArrayList<Property>()", ...
{ "body": "public PropertyList deepCopy(boolean keepId) {\n PropertyList copy = new PropertyList(this, keepId);\n\n for (Property property : list) {\n copy.add(property.deepCopy(false));\n }\n\n return copy;\n }", "class_method_signature": "PropertyList.deepCopy(boolean kee...
{ "created": null, "fork": null, "fork_count": 85, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17278009, "size": 138394, "stargazer_count": 150, "stars": null, "updates": null, "url": "https://github.com/rhq-project/rhq" }
17278009_93
{ "fields": [ { "declarator": "component = new GrubComponent()", "modifier": "private", "original_string": "private GrubComponent component = new GrubComponent();", "type": "GrubComponent", "var_name": "component" }, { "declarator": "pluginConfiguration = new Configurat...
{ "body": "@Test(enabled = false)\n public void loadResourceConfiguration() throws Exception {\n Configuration configuration;\n try {\n configuration = component.loadResourceConfiguration(pluginConfiguration);\n } catch (UnsatisfiedLinkError ule) {\n // Skip tests if auge...
{ "fields": [ { "declarator": "resourceContext", "modifier": "private", "original_string": "private ResourceContext resourceContext;", "type": "ResourceContext", "var_name": "resourceContext" }, { "declarator": "grubFile", "modifier": "private", "original_st...
{ "body": "public Configuration loadResourceConfiguration() throws Exception {\n Configuration pluginConfiguration = resourceContext.getPluginConfiguration();\n\n return loadResourceConfiguration(pluginConfiguration);\n }", "class_method_signature": "GrubComponent.loadResourceConfiguration()", "c...
{ "created": null, "fork": null, "fork_count": 85, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17278009, "size": 138394, "stargazer_count": 150, "stars": null, "updates": null, "url": "https://github.com/rhq-project/rhq" }
17278009_206
{ "fields": [], "file": "modules/core/domain/src/test/java/org/rhq/core/domain/configuration/ConfigurationTest.java", "identifier": "ConfigurationTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void deepCopyShouldNotReturnReferenceToOriginalObjectWhenNotKeepingIds() {\n Configuration original = createConfiguration();\n Configuration copy = original.deepCopy(false);\n\n assertNotSame(copy, original,\n \"Expected a reference to a new Configuration o...
{ "fields": [ { "declarator": "serialVersionUID = 1L", "modifier": "private static final", "original_string": "private static final long serialVersionUID = 1L;", "type": "long", "var_name": "serialVersionUID" }, { "declarator": "QUERY_GET_PLUGIN_CONFIG_BY_RESOURCE_ID = ...
{ "body": "public Configuration deepCopy() {\n return deepCopy(true);\n }", "class_method_signature": "Configuration.deepCopy()", "constructor": false, "full_signature": "public Configuration deepCopy()", "identifier": "deepCopy", "invocations": [ "deepCopy" ], "modifiers": "public", "pa...
{ "created": null, "fork": null, "fork_count": 85, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17278009, "size": 138394, "stargazer_count": 150, "stars": null, "updates": null, "url": "https://github.com/rhq-project/rhq" }
17278009_178
{ "fields": [ { "declarator": "PID = 15", "modifier": "private static final", "original_string": "private static final int PID = 15;", "type": "int", "var_name": "PID" }, { "declarator": "sigarProxy", "modifier": "private", "original_string": "private SigarP...
{ "body": "@Test\n public void testGetCommandLine() throws Exception {\n // Force new proxy and test instance because this test case work on process static data\n // which is initialized at instance creation\n sigarProxy = Mockito.mock(SigarProxy.class);\n String[] array = new String[] ...
{ "fields": [ { "declarator": "LOG = LogFactory.getLog(ProcessInfo.class)", "modifier": "private static final", "original_string": "private static final Log LOG = LogFactory.getLog(ProcessInfo.class);", "type": "Log", "var_name": "LOG" }, { "declarator": "REFRESH_LOCK_A...
{ "body": "public String[] getCommandLine() {\n return commandLine;\n }", "class_method_signature": "ProcessInfo.getCommandLine()", "constructor": false, "full_signature": "public String[] getCommandLine()", "identifier": "getCommandLine", "invocations": [], "modifiers": "public", "parameters"...
{ "created": null, "fork": null, "fork_count": 85, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17278009, "size": 138394, "stargazer_count": 150, "stars": null, "updates": null, "url": "https://github.com/rhq-project/rhq" }
17278009_197
{ "fields": [], "file": "modules/core/client-api/src/test/java/org/rhq/core/clientapi/descriptor/PluginTransformerTest.java", "identifier": "PluginTransformerTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void pluginNameShouldBeSetToDescriptorName() throws Exception {\n PluginDescriptor pluginDescriptor = new PluginDescriptor();\n pluginDescriptor.setName(\"testPlugin\");\n\n PluginTransformer transformer = new PluginTransformer();\n\n Plugin plugin = transforme...
{ "fields": [ { "declarator": "LOG = LogFactory.getLog(PluginTransformer.class)", "modifier": "private static final", "original_string": "private static final Log LOG = LogFactory.getLog(PluginTransformer.class);", "type": "Log", "var_name": "LOG" } ], "file": "modules/core/c...
{ "body": "public Plugin toPlugin(PluginDescriptor pluginDescriptor, URL pluginURL) {\n try {\n Plugin plugin = new Plugin();\n plugin.setName(pluginDescriptor.getName());\n\n if (pluginDescriptor.getDisplayName() == null) {\n plugin.setDisplayName(pluginDescript...
{ "created": null, "fork": null, "fork_count": 85, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17278009, "size": 138394, "stargazer_count": 150, "stars": null, "updates": null, "url": "https://github.com/rhq-project/rhq" }
17278009_251
{ "fields": [ { "declarator": "facet", "modifier": "", "original_string": "ConfigurationFacet facet;", "type": "ConfigurationFacet", "var_name": "facet" }, { "declarator": "configMgmt", "modifier": "", "original_string": "LegacyConfigManagement configMgmt;",...
{ "body": "@Test\n public void nullShouldBeReturnedWhenStructuredIsNull() throws Exception {\n final Configuration config = null;\n\n context.checking(new Expectations() {{\n atLeast(1).of(componentService).getComponent(resourceId,\n ...
{ "fields": [ { "declarator": "log = LogFactory.getLog(LegacyConfigManagement.class)", "modifier": "private static final", "original_string": "private static final Log log = LogFactory.getLog(LegacyConfigManagement.class);", "type": "Log", "var_name": "log" } ], "file": "modu...
{ "body": "public Configuration executeLoad(int resourceId) throws PluginContainerException {\n Configuration configuration = loadConfigFromFacet(resourceId, READ);\n\n if (configuration == null) {\n return null;\n }\n \n ResourceType resourceType = componentService.getRe...
{ "created": null, "fork": null, "fork_count": 85, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17278009, "size": 138394, "stargazer_count": 150, "stars": null, "updates": null, "url": "https://github.com/rhq-project/rhq" }
17278009_50
{ "fields": [ { "declarator": "dao", "modifier": "", "original_string": "ChangeSetDAO dao;", "type": "ChangeSetDAO", "var_name": "dao" } ], "file": "modules/enterprise/server/plugins/drift-mongodb/src/test/java/org/rhq/enterprise/server/plugins/drift/mongodb/dao/ChangeSetDAOT...
{ "body": "@Test(enabled = ENABLED)\n public void findEntriesWithResourceIdAndStartTimeFilter() throws Exception {\n long startTime = System.currentTimeMillis() - (1000 * 60 * 60); // one hour ago\n\n MongoDBChangeSet c1 = createChangeSet(COVERAGE, 1, 1, 1);\n c1.setCtime(startTime - (1000 * ...
{ "fields": [ { "declarator": "morphia", "modifier": "private", "original_string": "private Morphia morphia;", "type": "Morphia", "var_name": "morphia" } ], "file": "modules/enterprise/server/plugins/drift-mongodb/src/main/java/org/rhq/enterprise/server/plugins/drift/mongodb/...
{ "body": "public List<MongoDBChangeSetEntry> findEntries(DriftCriteria criteria) {\n // TODO Add support for driftHandlingModes filter\n\n if (criteria.getFilterId() != null) {\n String[] ids = criteria.getFilterId().split(\":\");\n ObjectId changeSetId = new ObjectId(ids[0]);\n ...
{ "created": null, "fork": null, "fork_count": 85, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17278009, "size": 138394, "stargazer_count": 150, "stars": null, "updates": null, "url": "https://github.com/rhq-project/rhq" }
17278009_103
{ "fields": [], "file": "modules/plugins/wfly-10/src/test/java/org/rhq/modules/plugins/wildfly10/TemplatedSubResourcesComponentTest.java", "identifier": "TemplatedSubResourcesComponentTest", "interfaces": "", "superclass": "" }
{ "body": "@SuppressWarnings({ \"unchecked\" })\n @Test\n public void createResourceWithType() throws Exception {\n //tell the method story as it happens: mock or create dependencies and configure\n //those dependencies to get the method under test to completion.\n CreateResourceReport mock...
{ "fields": [ { "declarator": "TYPE_CONFIGURATION = \"__type\"", "modifier": "private final static", "original_string": "private final static String TYPE_CONFIGURATION = \"__type\";", "type": "String", "var_name": "TYPE_CONFIGURATION" }, { "declarator": "NAME_CONFIGURAT...
{ "body": "@Override\n public CreateResourceReport createResource(CreateResourceReport report) {\n if (report.getResourceConfiguration().get(TYPE_CONFIGURATION) != null) {\n //Need to munge the report and configuration definition for with type in configuration:\n //1) Remove type from ...
{ "created": null, "fork": null, "fork_count": 85, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17278009, "size": 138394, "stargazer_count": 150, "stars": null, "updates": null, "url": "https://github.com/rhq-project/rhq" }
17278009_154
{ "fields": [], "file": "modules/core/util/src/test/java/org/rhq/core/util/file/FileUtilTest.java", "identifier": "FileUtilTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void visitFilesInSubdirectories() throws Exception {\n File dir = new File(toFile(getClass().getResource(\".\")), \"visit-files-in-sub-dirs\");\n deleteDirectory(dir);\n dir.mkdirs();\n\n File file1 = new File(dir, \"file-1\");\n touch(file1);\n\n ...
{ "fields": [ { "declarator": "invalidChars = null", "modifier": "private static", "original_string": "private static IntHashMap invalidChars = null;", "type": "IntHashMap", "var_name": "invalidChars" } ], "file": "modules/core/util/src/main/java/org/rhq/core/util/file/FileUt...
{ "body": "public static void forEachFile(File directory, FileVisitor visitor) {\n Deque<File> directories = new LinkedList<File>();\n directories.push(directory);\n\n while (!directories.isEmpty()) {\n File dir = directories.pop();\n File[] files = dir.listFiles();\n ...
{ "created": null, "fork": null, "fork_count": 85, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17278009, "size": 138394, "stargazer_count": 150, "stars": null, "updates": null, "url": "https://github.com/rhq-project/rhq" }
17278009_292
{ "fields": [ { "declarator": "scheduleQueue", "modifier": "", "original_string": "ScheduleQueue scheduleQueue;", "type": "ScheduleQueue", "var_name": "scheduleQueue" }, { "declarator": "driftClient", "modifier": "", "original_string": "DriftClientTestStub d...
{ "body": "@Test\n public void reportMissingBaseDirWhenNoInitialSnapshotExists() throws Exception {\n final File basedir = new File(resourceDir, \"conf\");\n DriftDefinition def = driftDefinition(\"basedir-does-not-exist\", basedir.getAbsolutePath());\n\n driftClient.setBaseDir(basedir);\n\n ...
{ "fields": [ { "declarator": "log = LogFactory.getLog(DriftDetector.class)", "modifier": "private static final", "original_string": "private static final Log log = LogFactory.getLog(DriftDetector.class);", "type": "Log", "var_name": "log" }, { "declarator": "FILE_CHANG...
{ "body": "@Override\n public void run() {\n log.debug(\"Starting drift detection...\");\n long startTime = System.currentTimeMillis();\n DriftDetectionSchedule schedule;\n while((schedule = scheduleQueue.getNextSchedule()) != null) {\n boolean updateSchedule = true;\n ...
{ "created": null, "fork": null, "fork_count": 85, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17278009, "size": 138394, "stargazer_count": 150, "stars": null, "updates": null, "url": "https://github.com/rhq-project/rhq" }
17278009_11
{ "fields": [], "file": "modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/cloud/util/StorageNodeConfigurationUtilTest.java", "identifier": "StorageNodeConfigurationUtilTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testConfigurationSync() throws Exception {\n StorageNode mockStorageNode = Mockito.mock(StorageNode.class);\n StorageNodeConfigurationComposite oldConfig = new StorageNodeConfigurationComposite(mockStorageNode);\n StorageNodeConfigurationComposite newConfig = new...
{ "fields": [ { "declarator": "log = LogFactory.getLog(StorageNodeConfigurationUtil.class)", "modifier": "private static final", "original_string": "private static final Log log = LogFactory.getLog(StorageNodeConfigurationUtil.class);", "type": "Log", "var_name": "log" }, { ...
{ "body": "public static void syncConfigs(StorageNodeConfigurationComposite newConfig, StorageNodeConfigurationComposite oldConfig) {\n try {\n for (Field field : StorageNodeConfigurationComposite.class.getDeclaredFields()) {\n field.setAccessible(true);\n if(field.isAc...
{ "created": null, "fork": null, "fork_count": 85, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17278009, "size": 138394, "stargazer_count": 150, "stars": null, "updates": null, "url": "https://github.com/rhq-project/rhq" }
17278009_284
{ "fields": [ { "declarator": "PLUGIN_A = \"plugin-A.jar\"", "modifier": "static final", "original_string": "static final String PLUGIN_A = \"plugin-A.jar\";", "type": "String", "var_name": "PLUGIN_A" }, { "declarator": "PLUGIN_B = \"plugin-B-depends-on-A.jar\"", ...
{ "body": "@Test\n public void pluginsShouldBeShutdownInCorrectOrder() throws Exception {\n PluginContainerConfiguration configuration = createConfiguration();\n\n FakePluginLifecycleListenerManager pluginLifecycleListenerMgr = new FakePluginLifecycleListenerManager();\n\n PluginManager plugin...
{ "fields": [ { "declarator": "log = LogFactory.getLog(PluginManager.class)", "modifier": "private static final", "original_string": "private static final Log log = LogFactory.getLog(PluginManager.class);", "type": "Log", "var_name": "log" }, { "declarator": "loadedPlug...
{ "body": "public void shutdown() {\n // Inform the plugins we are shutting them down.\n // We want to shut them down in the reverse order that we initialized them.\n Collections.reverse(this.loadedPlugins);\n for (Plugin plugin : loadedPlugins) {\n PluginLifecycleListener liste...
{ "created": null, "fork": null, "fork_count": 85, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17278009, "size": 138394, "stargazer_count": 150, "stars": null, "updates": null, "url": "https://github.com/rhq-project/rhq" }
17278009_46
{ "fields": [ { "declarator": "dao", "modifier": "", "original_string": "ChangeSetDAO dao;", "type": "ChangeSetDAO", "var_name": "dao" } ], "file": "modules/enterprise/server/plugins/drift-mongodb/src/test/java/org/rhq/enterprise/server/plugins/drift/mongodb/dao/ChangeSetDAOT...
{ "body": "@Test(enabled = ENABLED)\n public void findByDriftCriteriaWithStartTimeFilter() throws Exception {\n long startTime = System.currentTimeMillis() - (1000 * 60 * 60); // one hour ago\n\n int resourceId = 1;\n\n MongoDBChangeSet c1 = createChangeSet(COVERAGE, 1, resourceId, 1);\n ...
{ "fields": [ { "declarator": "morphia", "modifier": "private", "original_string": "private Morphia morphia;", "type": "Morphia", "var_name": "morphia" } ], "file": "modules/enterprise/server/plugins/drift-mongodb/src/main/java/org/rhq/enterprise/server/plugins/drift/mongodb/...
{ "body": "public List<MongoDBChangeSet> findByDriftCriteria(DriftCriteria criteria) {\n Query<MongoDBChangeSet> query = createQuery();\n\n if (criteria.getFilterId() != null) {\n // TODO use the $slice operator\n // The slice operator will allow us to return only the requested ent...
{ "created": null, "fork": null, "fork_count": 85, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17278009, "size": 138394, "stargazer_count": 150, "stars": null, "updates": null, "url": "https://github.com/rhq-project/rhq" }
17278009_115
{ "fields": [ { "declarator": "ENABLE_TESTS = true", "modifier": "private static final", "original_string": "private static final boolean ENABLE_TESTS = true;", "type": "boolean", "var_name": "ENABLE_TESTS" }, { "declarator": "DEST_BASE_DIR_NAME = \"Root File System\"",...
{ "body": "@Test(enabled = ENABLE_TESTS)\n public void testTags() throws Exception {\n ResourceType resourceType = new ResourceType(\"testSimpleBundle\", \"plugin\", ResourceCategory.SERVER, null);\n BundleType bundleType = new BundleType(\"testSimpleBundle\", resourceType);\n Repo repo = new ...
{ "fields": [ { "declarator": "LOG = LogFactory.getLog(AntBundlePluginComponent.class)", "modifier": "private static final", "original_string": "private static final Log LOG = LogFactory.getLog(AntBundlePluginComponent.class);", "type": "Log", "var_name": "LOG" }, { "de...
{ "body": "@Override\n public BundleDeployResult deployBundle(final BundleDeployRequest request) {\n BundleDeployResult result = new BundleDeployResult();\n try {\n BundleResourceDeployment resourceDeployment = request.getResourceDeployment();\n BundleDeployment bundleDeployment...
{ "created": null, "fork": null, "fork_count": 85, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17278009, "size": 138394, "stargazer_count": 150, "stars": null, "updates": null, "url": "https://github.com/rhq-project/rhq" }
17278009_47
{ "fields": [ { "declarator": "dao", "modifier": "", "original_string": "ChangeSetDAO dao;", "type": "ChangeSetDAO", "var_name": "dao" } ], "file": "modules/enterprise/server/plugins/drift-mongodb/src/test/java/org/rhq/enterprise/server/plugins/drift/mongodb/dao/ChangeSetDAOT...
{ "body": "@Test(enabled = ENABLED)\n public void findEntriesWithChangeSetIdFilter() throws Exception {\n MongoDBChangeSet c1 = createChangeSet(COVERAGE, 1, 1, 1);\n MongoDBChangeSetEntry e1 = new MongoDBChangeSetEntry(\"c1-1.txt\", FILE_ADDED);\n c1.add(e1);\n dao.save(c1);\n\n ...
{ "fields": [ { "declarator": "morphia", "modifier": "private", "original_string": "private Morphia morphia;", "type": "Morphia", "var_name": "morphia" } ], "file": "modules/enterprise/server/plugins/drift-mongodb/src/main/java/org/rhq/enterprise/server/plugins/drift/mongodb/...
{ "body": "public List<MongoDBChangeSetEntry> findEntries(DriftCriteria criteria) {\n // TODO Add support for driftHandlingModes filter\n\n if (criteria.getFilterId() != null) {\n String[] ids = criteria.getFilterId().split(\":\");\n ObjectId changeSetId = new ObjectId(ids[0]);\n ...
{ "created": null, "fork": null, "fork_count": 85, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17278009, "size": 138394, "stargazer_count": 150, "stars": null, "updates": null, "url": "https://github.com/rhq-project/rhq" }
17278009_114
{ "fields": [ { "declarator": "ENABLE_TESTS = true", "modifier": "private static final", "original_string": "private static final boolean ENABLE_TESTS = true;", "type": "boolean", "var_name": "ENABLE_TESTS" }, { "declarator": "DEST_BASE_DIR_NAME = \"Root File System\"",...
{ "body": "@Test(enabled = ENABLE_TESTS)\n public void testRawFilesWithDotDotPaths() throws Exception {\n // our test bundle's relative raw file paths that resolve above dest dir will resolve to here\n final File externalDir = new File(this.testFilesBaseDir, \"ext\");\n\n ResourceType resource...
{ "fields": [ { "declarator": "LOG = LogFactory.getLog(AntBundlePluginComponent.class)", "modifier": "private static final", "original_string": "private static final Log LOG = LogFactory.getLog(AntBundlePluginComponent.class);", "type": "Log", "var_name": "LOG" }, { "de...
{ "body": "@Override\n public BundleDeployResult deployBundle(final BundleDeployRequest request) {\n BundleDeployResult result = new BundleDeployResult();\n try {\n BundleResourceDeployment resourceDeployment = request.getResourceDeployment();\n BundleDeployment bundleDeployment...
{ "created": null, "fork": null, "fork_count": 85, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17278009, "size": 138394, "stargazer_count": 150, "stars": null, "updates": null, "url": "https://github.com/rhq-project/rhq" }
17278009_285
{ "fields": [ { "declarator": "basedir", "modifier": "private", "original_string": "private File basedir;", "type": "File", "var_name": "basedir" } ], "file": "modules/core/plugin-container/src/test/java/org/rhq/core/pc/drift/FilterFileVisitorTest.java", "identifier": "Filt...
{ "body": "@Test\n public void doNotVisitFileThatDoesNotMatchInclude() throws Exception {\n touch(basedir, \"server.txt\");\n\n List<Filter> includes = asList(new Filter(basedir.getAbsolutePath(), \"*.html\"));\n List<Filter> excludes = emptyList();\n TestVisitor visitor = new TestVisit...
{ "fields": [ { "declarator": "includes", "modifier": "private", "original_string": "private List<PathFilter> includes;", "type": "List<PathFilter>", "var_name": "includes" }, { "declarator": "excludes", "modifier": "private", "original_string": "private Lis...
{ "body": "private boolean isEmpty(String s) {\n return s == null || s.length() == 0;\n }", "class_method_signature": "FilterFileVisitor.isEmpty(String s)", "constructor": false, "full_signature": "private boolean isEmpty(String s)", "identifier": "isEmpty", "invocations": [ "length" ], "m...
{ "created": null, "fork": null, "fork_count": 85, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17278009, "size": 138394, "stargazer_count": 150, "stars": null, "updates": null, "url": "https://github.com/rhq-project/rhq" }
17278009_10
{ "fields": [ { "declarator": "subjectMgr", "modifier": "", "original_string": "SubjectManagerLocal subjectMgr;", "type": "SubjectManagerLocal", "var_name": "subjectMgr" }, { "declarator": "resourceTypeMgr", "modifier": "", "original_string": "ResourceTypeMa...
{ "body": "@Test\n public void rejectReportWithPluginThatIsNotInstalled() {\n InventoryReport report = createReport();\n report.addAddedRoot(new ResourceBuilder()\n .createRandomServer()\n .with(2).randomChildServices()\n .build());\n report.addAddedRoot(new Re...
{ "fields": [ { "declarator": "subjectMgr", "modifier": "private", "original_string": "private SubjectManagerLocal subjectMgr;", "type": "SubjectManagerLocal", "var_name": "subjectMgr" }, { "declarator": "resourceTypeMgr", "modifier": "private", "original_st...
{ "body": "public Set<ResourceType> apply(InventoryReport report) {\n Set<ResourceType> resourceTypes = getResourceTypes(report.getAddedRoots());\n Set<ResourceType> staleTypes = new HashSet<ResourceType>();\n\n for (ResourceType type : resourceTypes) {\n // We check two things to dete...
{ "created": null, "fork": null, "fork_count": 85, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17278009, "size": 138394, "stargazer_count": 150, "stars": null, "updates": null, "url": "https://github.com/rhq-project/rhq" }
17278009_293
{ "fields": [ { "declarator": "scheduleQueue", "modifier": "", "original_string": "ScheduleQueue scheduleQueue;", "type": "ScheduleQueue", "var_name": "scheduleQueue" }, { "declarator": "driftClient", "modifier": "", "original_string": "DriftClientTestStub d...
{ "body": "@Test\n public void purgeSnapshotWhenSendingInitialChangeSetFails() throws Exception {\n // If we have just generated the initial change set and sending it to\n // the server fails, then there is no prior snapshot version to which\n // we can revert. We therefore need to purge the s...
{ "fields": [ { "declarator": "log = LogFactory.getLog(DriftDetector.class)", "modifier": "private static final", "original_string": "private static final Log log = LogFactory.getLog(DriftDetector.class);", "type": "Log", "var_name": "log" }, { "declarator": "FILE_CHANG...
{ "body": "@Override\n public void run() {\n log.debug(\"Starting drift detection...\");\n long startTime = System.currentTimeMillis();\n DriftDetectionSchedule schedule;\n while((schedule = scheduleQueue.getNextSchedule()) != null) {\n boolean updateSchedule = true;\n ...
{ "created": null, "fork": null, "fork_count": 85, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17278009, "size": 138394, "stargazer_count": 150, "stars": null, "updates": null, "url": "https://github.com/rhq-project/rhq" }
17278009_155
{ "fields": [], "file": "modules/core/util/src/test/java/org/rhq/core/util/file/FileUtilTest.java", "identifier": "FileUtilTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void visitFilesInNestedSubDirectories() throws Exception {\n File dir = new File(toFile(getClass().getResource(\".\")), \"visit-files-in-nested-sub-dirs\");\n deleteDirectory(dir);\n dir.mkdirs();\n\n File file1 = new File(dir, \"file-1\");\n touch(file1...
{ "fields": [ { "declarator": "invalidChars = null", "modifier": "private static", "original_string": "private static IntHashMap invalidChars = null;", "type": "IntHashMap", "var_name": "invalidChars" } ], "file": "modules/core/util/src/main/java/org/rhq/core/util/file/FileUt...
{ "body": "public static void forEachFile(File directory, FileVisitor visitor) {\n Deque<File> directories = new LinkedList<File>();\n directories.push(directory);\n\n while (!directories.isEmpty()) {\n File dir = directories.pop();\n File[] files = dir.listFiles();\n ...
{ "created": null, "fork": null, "fork_count": 85, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17278009, "size": 138394, "stargazer_count": 150, "stars": null, "updates": null, "url": "https://github.com/rhq-project/rhq" }
17278009_51
{ "fields": [ { "declarator": "dao", "modifier": "", "original_string": "ChangeSetDAO dao;", "type": "ChangeSetDAO", "var_name": "dao" } ], "file": "modules/enterprise/server/plugins/drift-mongodb/src/test/java/org/rhq/enterprise/server/plugins/drift/mongodb/dao/ChangeSetDAOT...
{ "body": "@Test(enabled = ENABLED)\n public void findEntriesWithResourceIdAndEndTimeFilter() throws Exception {\n MongoDBChangeSet c1 = createChangeSet(COVERAGE, 1, 1, 1);\n MongoDBChangeSetEntry e1 = new MongoDBChangeSetEntry(\"c1-1.txt\", FILE_ADDED);\n c1.add(e1);\n dao.save(c1);\n\...
{ "fields": [ { "declarator": "morphia", "modifier": "private", "original_string": "private Morphia morphia;", "type": "Morphia", "var_name": "morphia" } ], "file": "modules/enterprise/server/plugins/drift-mongodb/src/main/java/org/rhq/enterprise/server/plugins/drift/mongodb/...
{ "body": "public List<MongoDBChangeSetEntry> findEntries(DriftCriteria criteria) {\n // TODO Add support for driftHandlingModes filter\n\n if (criteria.getFilterId() != null) {\n String[] ids = criteria.getFilterId().split(\":\");\n ObjectId changeSetId = new ObjectId(ids[0]);\n ...
{ "created": null, "fork": null, "fork_count": 85, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17278009, "size": 138394, "stargazer_count": 150, "stars": null, "updates": null, "url": "https://github.com/rhq-project/rhq" }
17278009_102
{ "fields": [ { "declarator": "pluginStats", "modifier": "private", "original_string": "private PluginStats pluginStats;", "type": "PluginStats", "var_name": "pluginStats" }, { "declarator": "executorService", "modifier": "private", "original_string": "priva...
{ "body": "@Test\n public void testMaxRequestTime() throws Exception {\n List<Callable<Long>> generators = new ArrayList<Callable<Long>>();\n for (int i = 0; i < 4; i++) {\n generators.add(newRequestTimeGenerator());\n }\n List<Future<Long>> maxByGeneratorFutures = executorSe...
{ "fields": [ { "declarator": "ourInstance = new PluginStats()", "modifier": "private static", "original_string": "private static PluginStats ourInstance = new PluginStats();", "type": "PluginStats", "var_name": "ourInstance" }, { "declarator": "requestCount = new Atomi...
{ "body": "public long getMaxTime() {\n return maxTime.getAndSet(0);\n }", "class_method_signature": "PluginStats.getMaxTime()", "constructor": false, "full_signature": "public long getMaxTime()", "identifier": "getMaxTime", "invocations": [ "getAndSet" ], "modifiers": "public", "paramet...
{ "created": null, "fork": null, "fork_count": 85, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17278009, "size": 138394, "stargazer_count": 150, "stars": null, "updates": null, "url": "https://github.com/rhq-project/rhq" }
17278009_250
{ "fields": [ { "declarator": "facet", "modifier": "", "original_string": "ConfigurationFacet facet;", "type": "ConfigurationFacet", "var_name": "facet" }, { "declarator": "configMgmt", "modifier": "", "original_string": "LegacyConfigManagement configMgmt;",...
{ "body": "@Test\n public void theConfigNotesShouldGetSet() throws Exception {\n final Configuration config = new Configuration();\n config.setNotes(null);\n\n addDefaultExpectationsForLoad(config);\n\n Configuration loadedConfig = configMgmt.executeLoad(resourceId);\n\n assertNo...
{ "fields": [ { "declarator": "log = LogFactory.getLog(LegacyConfigManagement.class)", "modifier": "private static final", "original_string": "private static final Log log = LogFactory.getLog(LegacyConfigManagement.class);", "type": "Log", "var_name": "log" } ], "file": "modu...
{ "body": "public Configuration executeLoad(int resourceId) throws PluginContainerException {\n Configuration configuration = loadConfigFromFacet(resourceId, READ);\n\n if (configuration == null) {\n return null;\n }\n \n ResourceType resourceType = componentService.getRe...
{ "created": null, "fork": null, "fork_count": 85, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17278009, "size": 138394, "stargazer_count": 150, "stars": null, "updates": null, "url": "https://github.com/rhq-project/rhq" }
17278009_179
{ "fields": [ { "declarator": "PID = 15", "modifier": "private static final", "original_string": "private static final int PID = 15;", "type": "int", "var_name": "PID" }, { "declarator": "sigarProxy", "modifier": "private", "original_string": "private SigarP...
{ "body": "@Test\n public void testGetEmptyEnvironmentVariables() throws Exception {\n assertEquals(processInfo.getEnvironmentVariables(), Collections.EMPTY_MAP);\n }", "class_method_signature": "ProcessInfoTest.testGetEmptyEnvironmentVariables()", "constructor": false, "full_signature": "@Test pub...
{ "fields": [ { "declarator": "LOG = LogFactory.getLog(ProcessInfo.class)", "modifier": "private static final", "original_string": "private static final Log LOG = LogFactory.getLog(ProcessInfo.class);", "type": "Log", "var_name": "LOG" }, { "declarator": "REFRESH_LOCK_A...
{ "body": "public Map<String, String> getEnvironmentVariables() {\n if (this.procEnv == null) {\n return Collections.emptyMap();\n }\n if (this.environmentVariables == null) {\n this.environmentVariables = new HashMap<String, String>(this.procEnv.size());\n System...
{ "created": null, "fork": null, "fork_count": 85, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17278009, "size": 138394, "stargazer_count": 150, "stars": null, "updates": null, "url": "https://github.com/rhq-project/rhq" }
17278009_196
{ "fields": [ { "declarator": "PID = 15", "modifier": "private static final", "original_string": "private static final int PID = 15;", "type": "int", "var_name": "PID" }, { "declarator": "sigarProxy", "modifier": "private", "original_string": "private SigarP...
{ "body": "@Test\n public void testGetParentProcess() {\n when(procState.getPpid()).thenReturn(Long.valueOf(10));\n assertEquals(processInfo.getParentProcess().getPid(), 10);\n when(procState.getPpid()).thenReturn(Long.valueOf(11));\n assertEquals(processInfo.getParentProcess().getPid()...
{ "fields": [ { "declarator": "LOG = LogFactory.getLog(ProcessInfo.class)", "modifier": "private static final", "original_string": "private static final Log LOG = LogFactory.getLog(ProcessInfo.class);", "type": "Log", "var_name": "LOG" }, { "declarator": "REFRESH_LOCK_A...
{ "body": "public ProcessInfo getParentProcess() throws SystemInfoException {\n if (this.parentProcess == null) {\n this.parentProcess = new ProcessInfo(priorSnaphot().getParentPid(), sigar);\n } else {\n this.parentProcess.refresh();\n }\n return this.parentProcess;\...
{ "created": null, "fork": null, "fork_count": 85, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17278009, "size": 138394, "stargazer_count": 150, "stars": null, "updates": null, "url": "https://github.com/rhq-project/rhq" }
17278009_207
{ "fields": [], "file": "modules/core/domain/src/test/java/org/rhq/core/domain/configuration/ConfigurationTest.java", "identifier": "ConfigurationTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void equalsShouldBeFalseWhenArgumentIsNull() {\n Configuration config = new Configuration();\n\n assertFalse(config.equals(null), \"equals() should be false for null argument.\");\n }", "class_method_signature": "ConfigurationTest.equalsShouldBeFalseWhenArgumentIsNull()...
{ "fields": [ { "declarator": "serialVersionUID = 1L", "modifier": "private static final", "original_string": "private static final long serialVersionUID = 1L;", "type": "long", "var_name": "serialVersionUID" }, { "declarator": "QUERY_GET_PLUGIN_CONFIG_BY_RESOURCE_ID = ...
{ "body": "@Override\n public boolean equals(Object obj) {\n if (this == obj) {\n return true;\n }\n\n if (obj == null) {\n return false;\n }\n\n if (!(obj instanceof Configuration)) {\n return false;\n }\n\n Configuration that = (Co...
{ "created": null, "fork": null, "fork_count": 85, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17278009, "size": 138394, "stargazer_count": 150, "stars": null, "updates": null, "url": "https://github.com/rhq-project/rhq" }
17278009_92
{ "fields": [ { "declarator": "log = LogFactory.getLog(MigrateAggregateMetricsTest.class)", "modifier": "private static final", "original_string": "private static final Log log = LogFactory.getLog(MigrateAggregateMetricsTest.class);", "type": "Log", "var_name": "log" }, { ...
{ "body": "@Test\n public void runMigration() throws Exception {\n int numSchedules = Integer.parseInt(System.getProperty(\"numSchedules\", \"10\"));\n Properties properties = new Properties();\n properties.put(SchemaManager.RELATIONAL_DB_CONNECTION_FACTORY_PROP, new DBConnectionFactory() {\n ...
{ "fields": [ { "declarator": "log = LogFactory.getLog(MigrateAggregateMetrics.class)", "modifier": "private static final", "original_string": "private static final Log log = LogFactory.getLog(MigrateAggregateMetrics.class);", "type": "Log", "var_name": "log" }, { "decl...
{ "body": "private void shutdown() {\n if (dbConnectionFactory != null) {\n try {\n log.info(\"Shutting down migration thread pools...\");\n rateMonitor.shutdown();\n progressLogger.finished();\n if (keyScanner != null) {\n ...
{ "created": null, "fork": null, "fork_count": 85, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17278009, "size": 138394, "stargazer_count": 150, "stars": null, "updates": null, "url": "https://github.com/rhq-project/rhq" }
17278009_211
{ "fields": [], "file": "modules/core/domain/src/test/java/org/rhq/core/domain/configuration/PropertyListTest.java", "identifier": "PropertyListTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void deepCopyShouldNotCopyIdFieldWhenFlagIsFalse() {\n PropertyList original = createPropertyList();\n PropertyList copy = original.deepCopy(false);\n\n assertFalse(copy.getId() == original.getId(), \"The original id property should not be copied.\");\n assertE...
{ "fields": [ { "declarator": "serialVersionUID = 1L", "modifier": "private static final", "original_string": "private static final long serialVersionUID = 1L;", "type": "long", "var_name": "serialVersionUID" }, { "declarator": "list = new ArrayList<Property>()", ...
{ "body": "public PropertyList deepCopy(boolean keepId) {\n PropertyList copy = new PropertyList(this, keepId);\n\n for (Property property : list) {\n copy.add(property.deepCopy(false));\n }\n\n return copy;\n }", "class_method_signature": "PropertyList.deepCopy(boolean kee...
{ "created": null, "fork": null, "fork_count": 85, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17278009, "size": 138394, "stargazer_count": 150, "stars": null, "updates": null, "url": "https://github.com/rhq-project/rhq" }
17278009_84
{ "fields": [ { "declarator": "TEST_HANDLE = \"calanques\"", "modifier": "private static final", "original_string": "private static final String TEST_HANDLE = \"calanques\";", "type": "String", "var_name": "TEST_HANDLE" }, { "declarator": "contentUploader", "modif...
{ "body": "@Test(expectedExceptions = { IllegalArgumentException.class })\n public void uploadByFileNameShouldThrowIAEWhenFilenameIsBlank() throws Exception {\n contentUploader.upload(\" \");\n }", "class_method_signature": "ContentUploaderTest.uploadByFileNameShouldThrowIAEWhenFilenameIsBlank()", ...
{ "fields": [ { "declarator": "SIZE_32K = 1024 * 32", "modifier": "private static final", "original_string": "private static final int SIZE_32K = 1024 * 32;", "type": "int", "var_name": "SIZE_32K" }, { "declarator": "contentManager", "modifier": "private", "...
{ "body": "public String upload(String filename) {\n if (StringUtil.isBlank(filename)) {\n throw new IllegalArgumentException(\"Empty path\");\n }\n return upload(new File(filename));\n }", "class_method_signature": "ContentUploader.upload(String filename)", "constructor": false...
{ "created": null, "fork": null, "fork_count": 85, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17278009, "size": 138394, "stargazer_count": 150, "stars": null, "updates": null, "url": "https://github.com/rhq-project/rhq" }
17278009_138
{ "fields": [ { "declarator": "portNetServiceDiscoveryComponent", "modifier": "private", "original_string": "private PortNetServiceDiscoveryComponent portNetServiceDiscoveryComponent;", "type": "PortNetServiceDiscoveryComponent", "var_name": "portNetServiceDiscoveryComponent" }, ...
{ "body": "@Test\n public void testMissingAddress() {\n configuration.remove(ConfigKeys.ADDRESS);\n try {\n portNetServiceDiscoveryComponent.discoverResource(configuration, resourceDiscoveryContext);\n fail(\"Component configuration should be invalid\");\n } catch (Invali...
{ "fields": [ { "declarator": "RESOURCE_PREFIX = \"Port \"", "modifier": "private static final", "original_string": "private static final String RESOURCE_PREFIX = \"Port \";", "type": "String", "var_name": "RESOURCE_PREFIX" }, { "declarator": "SEPARATOR = \":\"", ...
{ "body": "@Override\n public DiscoveredResourceDetails discoverResource(Configuration pluginConfiguration,\n ResourceDiscoveryContext context) throws InvalidPluginConfigurationException {\n PortNetServiceComponentConfiguration componentConfiguration = PortNetServiceComponent\n .createComp...
{ "created": null, "fork": null, "fork_count": 85, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17278009, "size": 138394, "stargazer_count": 150, "stars": null, "updates": null, "url": "https://github.com/rhq-project/rhq" }
17278009_246
{ "fields": [ { "declarator": "LEGACY_AMPS_VERSION = \"2.0\"", "modifier": "static final", "original_string": "static final String LEGACY_AMPS_VERSION = \"2.0\";", "type": "String", "var_name": "LEGACY_AMPS_VERSION" }, { "declarator": "NON_LEGACY_AMPS_VERSION = \"2.1\""...
{ "body": "@Test\n public void factoryShouldInitializeRawConfigMgmtWithConfigurationUtilityService() throws Exception {\n final boolean daemonOnly = true;\n\n final ResourceComponent resourceComponent = context.mock(ResourceComponent.class);\n\n context.checking(new Expectations() {\n ...
{ "fields": [ { "declarator": "componentService", "modifier": "private final", "original_string": "private final ComponentService componentService;", "type": "ComponentService", "var_name": "componentService" }, { "declarator": "configUtilityService = new ConfigurationU...
{ "body": "public ConfigManagement getStrategy(int resourceId) throws PluginContainerException {\n ConfigManagement configManagement = createStrategy(resourceId);\n initStrategyDependencies(configManagement);\n\n return configManagement;\n }", "class_method_signature": "ConfigManagementFacto...
{ "created": null, "fork": null, "fork_count": 85, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17278009, "size": 138394, "stargazer_count": 150, "stars": null, "updates": null, "url": "https://github.com/rhq-project/rhq" }
17278009_180
{ "fields": [ { "declarator": "PID = 15", "modifier": "private static final", "original_string": "private static final int PID = 15;", "type": "int", "var_name": "PID" }, { "declarator": "sigarProxy", "modifier": "private", "original_string": "private SigarP...
{ "body": "@Test\n public void testGetEnvironmentVariables() throws Exception {\n // Force new test instance because this test case work with data\n // which is initialized at instance creation\n Map<String, String> env = new HashMap<String, String>();\n env.put(\"one\", \"1\");\n ...
{ "fields": [ { "declarator": "LOG = LogFactory.getLog(ProcessInfo.class)", "modifier": "private static final", "original_string": "private static final Log LOG = LogFactory.getLog(ProcessInfo.class);", "type": "Log", "var_name": "LOG" }, { "declarator": "REFRESH_LOCK_A...
{ "body": "public Map<String, String> getEnvironmentVariables() {\n if (this.procEnv == null) {\n return Collections.emptyMap();\n }\n if (this.environmentVariables == null) {\n this.environmentVariables = new HashMap<String, String>(this.procEnv.size());\n System...
{ "created": null, "fork": null, "fork_count": 85, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17278009, "size": 138394, "stargazer_count": 150, "stars": null, "updates": null, "url": "https://github.com/rhq-project/rhq" }
17278009_118
{ "fields": [ { "declarator": "httpNetServiceDiscoveryComponent", "modifier": "private", "original_string": "private HTTPNetServiceDiscoveryComponent httpNetServiceDiscoveryComponent;", "type": "HTTPNetServiceDiscoveryComponent", "var_name": "httpNetServiceDiscoveryComponent" }, ...
{ "body": "@Test\n public void testMissingUrl() {\n try {\n configuration.remove(URL);\n httpNetServiceDiscoveryComponent.discoverResource(configuration, resourceDiscoveryContext);\n fail(\"Component configuration should be invalid\");\n } catch (InvalidPluginConfigur...
{ "fields": [], "file": "modules/plugins/netservices/src/main/java/org/rhq/plugins/netservices/HTTPNetServiceDiscoveryComponent.java", "identifier": "HTTPNetServiceDiscoveryComponent", "interfaces": "implements ResourceDiscoveryComponent, ManualAddFacet", "methods": [ { "class_method_signature": "HT...
{ "body": "@Override\n public DiscoveredResourceDetails discoverResource(Configuration config,\n ResourceDiscoveryContext resourceDiscoveryContext) throws InvalidPluginConfigurationException {\n // Get the component configuration. This call will also make configuration checks\n HTTPNetServiceC...
{ "created": null, "fork": null, "fork_count": 85, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17278009, "size": 138394, "stargazer_count": 150, "stars": null, "updates": null, "url": "https://github.com/rhq-project/rhq" }
17278009_231
{ "fields": [], "file": "modules/core/domain/src/test/java/org/rhq/core/domain/drift/DriftDefinitionTest.java", "identifier": "DriftDefinitionTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void getBasedirForFileSystemContext() {\n String basedir = \"/opt/drift/test\";\n Configuration config = new Configuration();\n\n PropertyMap map = new PropertyMap(PROP_BASEDIR);\n map.put(new PropertySimple(PROP_BASEDIR_VALUECONTEXT, fileSystem));\n map...
{ "fields": [ { "declarator": "serialVersionUID = 1L", "modifier": "private static final", "original_string": "private static final long serialVersionUID = 1L;", "type": "long", "var_name": "serialVersionUID" }, { "declarator": "id", "modifier": "@Column(name = \"...
{ "body": "public BaseDirectory getBasedir() {\n PropertyMap map = configuration.getMap(DriftConfigurationDefinition.PROP_BASEDIR);\n if (map == null) {\n return null;\n }\n\n String valueContext = map.getSimpleValue(DriftConfigurationDefinition.PROP_BASEDIR_VALUECONTEXT, null);...
{ "created": null, "fork": null, "fork_count": 85, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17278009, "size": 138394, "stargazer_count": 150, "stars": null, "updates": null, "url": "https://github.com/rhq-project/rhq" }
17278009_266
{ "fields": [ { "declarator": "configFacet", "modifier": "", "original_string": "ResourceConfigurationFacet configFacet;", "type": "ResourceConfigurationFacet", "var_name": "configFacet" }, { "declarator": "structuredMgmt", "modifier": "", "original_string":...
{ "body": "@Test\n public void theConfigNotesShouldGetSet() throws Exception {\n final Configuration config = new Configuration();\n config.setNotes(null);\n\n addDefaultExpectationsForLoad(config);\n\n Configuration loadedConfig = structuredMgmt.executeLoad(resourceId);\n\n asse...
{ "fields": [ { "declarator": "log = LogFactory.getLog(StructuredConfigManagement.class)", "modifier": "private final", "original_string": "private final Log log = LogFactory.getLog(StructuredConfigManagement.class);", "type": "Log", "var_name": "log" } ], "file": "modules/co...
{ "body": "public Configuration executeLoad(int resourceId) throws PluginContainerException {\n ResourceConfigurationFacet facet = loadResouceConfiguratonFacet(resourceId);\n\n Configuration configuration = facet.loadStructuredConfiguration();\n\n if (configuration == null) {\n return ...
{ "created": null, "fork": null, "fork_count": 85, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17278009, "size": 138394, "stargazer_count": 150, "stars": null, "updates": null, "url": "https://github.com/rhq-project/rhq" }
17278009_289
{ "fields": [ { "declarator": "scheduleQueue", "modifier": "", "original_string": "ScheduleQueue scheduleQueue;", "type": "ScheduleQueue", "var_name": "scheduleQueue" }, { "declarator": "driftClient", "modifier": "", "original_string": "DriftClientTestStub d...
{ "body": "@Test\n public void updateScheduleAfterGeneratingCoverageChangeSet() throws Exception {\n DriftDefinition driftDef = driftDefinition(\"update-schedule-after-coverage-changeset\", resourceDir\n .getAbsolutePath());\n DriftDetectionSchedule schedule = new DriftDetectionSchedule(re...
{ "fields": [ { "declarator": "log = LogFactory.getLog(DriftDetector.class)", "modifier": "private static final", "original_string": "private static final Log log = LogFactory.getLog(DriftDetector.class);", "type": "Log", "var_name": "log" }, { "declarator": "FILE_CHANG...
{ "body": "@Override\n public void run() {\n log.debug(\"Starting drift detection...\");\n long startTime = System.currentTimeMillis();\n DriftDetectionSchedule schedule;\n while((schedule = scheduleQueue.getNextSchedule()) != null) {\n boolean updateSchedule = true;\n ...
{ "created": null, "fork": null, "fork_count": 85, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17278009, "size": 138394, "stargazer_count": 150, "stars": null, "updates": null, "url": "https://github.com/rhq-project/rhq" }
17278009_159
{ "fields": [ { "declarator": "TMP_DIR = new File(System.getProperty(\"java.io.tmpdir\"))", "modifier": "private static final", "original_string": "private static final File TMP_DIR = new File(System.getProperty(\"java.io.tmpdir\"));", "type": "File", "var_name": "TMP_DIR" } ],...
{ "body": "@Test\n public void shouldReturnNullWhenNoFileWasFound() throws Exception {\n File logFileDir = createLogFileDir();\n assertNull(findResponseTimeLogFileInDirectory(\"/pipo\", logFileDir));\n }", "class_method_signature": "ResponseTimeLogFinderTest.shouldReturnNullWhenNoFileWasFound()"...
{ "fields": [ { "declarator": "FALLBACK_RESPONSE_TIME_LOG_FILE_DIRECTORY = new File(System.getProperty(\"java.io.tmpdir\")\n + File.separator + \"rhq\" + File.separator + \"rt\")", "modifier": "public static final", "original_string": "public static final File FALLBACK_RESPONSE_TIME_LOG_F...
{ "body": "public static String findResponseTimeLogFileInDirectory(String contextPath, File responseTimeLogFileDirectory) {\n if (contextPath == null) {\n throw new IllegalArgumentException(\"contextPath is null\");\n }\n if (!contextPath.startsWith(\"/\")) {\n throw new Ill...
{ "created": null, "fork": null, "fork_count": 85, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17278009, "size": 138394, "stargazer_count": 150, "stars": null, "updates": null, "url": "https://github.com/rhq-project/rhq" }
17278009_270
{ "fields": [ { "declarator": "configFacet", "modifier": "", "original_string": "ResourceConfigurationFacet configFacet;", "type": "ResourceConfigurationFacet", "var_name": "configFacet" }, { "declarator": "structuredMgmt", "modifier": "", "original_string":...
{ "body": "@Test(expectedExceptions = {ConfigurationUpdateException.class})\n public void exceptionShouldBeThrownWhenUpdateFails() throws Exception {\n final Configuration config = new Configuration();\n\n addDefaultExpectationsForUpdate();\n\n context.checking(new Expectations() {{\n ...
{ "fields": [ { "declarator": "log = LogFactory.getLog(StructuredConfigManagement.class)", "modifier": "private final", "original_string": "private final Log log = LogFactory.getLog(StructuredConfigManagement.class);", "type": "Log", "var_name": "log" } ], "file": "modules/co...
{ "body": "public void executeUpdate(int resourceId, Configuration configuration) throws PluginContainerException {\n try {\n ResourceConfigurationFacet facet = loadResourceConfigFacetWithWriteLock(resourceId);\n facet.validateStructuredConfiguration(configuration);\n facet.per...
{ "created": null, "fork": null, "fork_count": 85, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17278009, "size": 138394, "stargazer_count": 150, "stars": null, "updates": null, "url": "https://github.com/rhq-project/rhq" }
17278009_227
{ "fields": [ { "declarator": "TEST_PLATFORM_TYPE = new ResourceType(\"test platform\", \"test plugin\", PLATFORM,\n null)", "modifier": "private static final", "original_string": "private static final ResourceType TEST_PLATFORM_TYPE = new ResourceType(\"test platform\", \"test plugin\", ...
{ "body": "@Test\n public void getBaseServerOrServiceOfTopLevelService() throws Exception {\n Resource topLevelService = new Resource();\n topLevelService.setResourceType(new ResourceType(\"test topLevelService\", \"test plugin\", SERVICE, null));\n assertSame(topLevelService, getBaseServerOrS...
{ "fields": [], "file": "modules/core/domain/src/main/java/org/rhq/core/domain/util/ResourceUtility.java", "identifier": "ResourceUtility", "interfaces": "", "methods": [ { "class_method_signature": "ResourceUtility.getChildResource(Resource parent, ResourceType type, String key)", "constructo...
{ "body": "public static Resource getBaseServerOrService(Resource resource) {\n if (resource == null) {\n throw new IllegalArgumentException(\"resource is null\");\n }\n Resource current, parent = resource;\n do {\n current = parent;\n parent = current.getP...
{ "created": null, "fork": null, "fork_count": 85, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17278009, "size": 138394, "stargazer_count": 150, "stars": null, "updates": null, "url": "https://github.com/rhq-project/rhq" }
17278009_175
{ "fields": [ { "declarator": "PID = 15", "modifier": "private static final", "original_string": "private static final int PID = 15;", "type": "int", "var_name": "PID" }, { "declarator": "sigarProxy", "modifier": "private", "original_string": "private SigarP...
{ "body": "@Test\n public void testGetNameFromStateWithFileExists() throws Exception {\n // Force new test instance because this test case work with data\n // which is initialized at instance creation\n File tmpFile = File.createTempFile(\"ProcessInfoTest-\", \".tmp\");\n tmpFile.delete...
{ "fields": [ { "declarator": "LOG = LogFactory.getLog(ProcessInfo.class)", "modifier": "private static final", "original_string": "private static final Log LOG = LogFactory.getLog(ProcessInfo.class);", "type": "Log", "var_name": "LOG" }, { "declarator": "REFRESH_LOCK_A...
{ "body": "public String getName() {\n return name;\n }", "class_method_signature": "ProcessInfo.getName()", "constructor": false, "full_signature": "public String getName()", "identifier": "getName", "invocations": [], "modifiers": "public", "parameters": "()", "return": "String", "signat...
{ "created": null, "fork": null, "fork_count": 85, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17278009, "size": 138394, "stargazer_count": 150, "stars": null, "updates": null, "url": "https://github.com/rhq-project/rhq" }
17278009_26
{ "fields": [ { "declarator": "dao", "modifier": "", "original_string": "ChangeSetDAO dao;", "type": "ChangeSetDAO", "var_name": "dao" } ], "file": "modules/enterprise/server/plugins/drift-mongodb/src/test/java/org/rhq/enterprise/server/plugins/drift/mongodb/dao/ChangeSetDAOT...
{ "body": "@Test(enabled = ENABLED)\n public void findByChangeSetCriteriaWithResourceIdFilter() throws Exception {\n MongoDBChangeSet c1 = new MongoDBChangeSet();\n c1.setCategory(DRIFT);\n c1.setVersion(1);\n c1.setResourceId(1);\n c1.setDriftDefinitionId(1);\n dao.save(c...
{ "fields": [ { "declarator": "morphia", "modifier": "private", "original_string": "private Morphia morphia;", "type": "Morphia", "var_name": "morphia" } ], "file": "modules/enterprise/server/plugins/drift-mongodb/src/main/java/org/rhq/enterprise/server/plugins/drift/mongodb/...
{ "body": "public List<MongoDBChangeSet> findByChangeSetCritiera(DriftChangeSetCriteria criteria) {\n Query<MongoDBChangeSet> query = createQuery();\n \n if (criteria.getFilterId() != null) {\n // There is no need to apply any additional filters if the id filter is specified\n ...
{ "created": null, "fork": null, "fork_count": 85, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17278009, "size": 138394, "stargazer_count": 150, "stars": null, "updates": null, "url": "https://github.com/rhq-project/rhq" }
17278009_122
{ "fields": [ { "declarator": "httpNetServiceDiscoveryComponent", "modifier": "private", "original_string": "private HTTPNetServiceDiscoveryComponent httpNetServiceDiscoveryComponent;", "type": "HTTPNetServiceDiscoveryComponent", "var_name": "httpNetServiceDiscoveryComponent" }, ...
{ "body": "@Test\n public void testInvalidHttpMethod() {\n String configMethod = \"DELETE\";\n try {\n configuration.setSimpleValue(METHOD, configMethod);\n httpNetServiceDiscoveryComponent.discoverResource(configuration, resourceDiscoveryContext);\n fail(\"Component ...
{ "fields": [], "file": "modules/plugins/netservices/src/main/java/org/rhq/plugins/netservices/HTTPNetServiceDiscoveryComponent.java", "identifier": "HTTPNetServiceDiscoveryComponent", "interfaces": "implements ResourceDiscoveryComponent, ManualAddFacet", "methods": [ { "class_method_signature": "HT...
{ "body": "@Override\n public DiscoveredResourceDetails discoverResource(Configuration config,\n ResourceDiscoveryContext resourceDiscoveryContext) throws InvalidPluginConfigurationException {\n // Get the component configuration. This call will also make configuration checks\n HTTPNetServiceC...
{ "created": null, "fork": null, "fork_count": 85, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17278009, "size": 138394, "stargazer_count": 150, "stars": null, "updates": null, "url": "https://github.com/rhq-project/rhq" }
17278009_71
{ "fields": [ { "declarator": "TEST_PRECISION = Math.pow(10, -9)", "modifier": "private static final", "original_string": "private static final double TEST_PRECISION = Math.pow(10, -9);", "type": "double", "var_name": "TEST_PRECISION" }, { "declarator": "metricsServer",...
{ "body": "@Test(dataProvider = \"testDates\")\n public void getSummary1HourAggregateForResource(DateTime testNow) throws Exception {\n initServer(testNow);\n\n DateTime beginTime = testNow.minusDays(11);\n DateTime endTime = testNow;\n\n Buckets buckets = new Buckets(beginTime, endTime...
{ "fields": [ { "declarator": "log = LogFactory.getLog(MetricsServer.class)", "modifier": "private final", "original_string": "private final Log log = LogFactory.getLog(MetricsServer.class);", "type": "Log", "var_name": "log" }, { "declarator": "RAW_DATA_AGE_LIMIT_MAX =...
{ "body": "public AggregateNumericMetric getSummaryAggregate(int scheduleId, long beginTime, long endTime) {\n Stopwatch stopwatch = new Stopwatch().start();\n try {\n DateTime begin = new DateTime(beginTime);\n\n if (dateTimeService.isInRawDataRange(begin)) {\n Iter...
{ "created": null, "fork": null, "fork_count": 85, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17278009, "size": 138394, "stargazer_count": 150, "stars": null, "updates": null, "url": "https://github.com/rhq-project/rhq" }
17278009_134
{ "fields": [ { "declarator": "pingNetServiceDiscoveryComponent", "modifier": "private", "original_string": "private PingNetServiceDiscoveryComponent pingNetServiceDiscoveryComponent;", "type": "PingNetServiceDiscoveryComponent", "var_name": "pingNetServiceDiscoveryComponent" }, ...
{ "body": "@Test\n public void testMissingAddress() {\n try {\n configuration.remove(ConfigKeys.ADDRESS);\n pingNetServiceDiscoveryComponent.discoverResource(configuration, resourceDiscoveryContext);\n fail(\"Component configuration should be invalid\");\n } catch (In...
{ "fields": [ { "declarator": "RESOURCE_NAME_PREFIX = \"Ping \"", "modifier": "private static final", "original_string": "private static final String RESOURCE_NAME_PREFIX = \"Ping \";", "type": "String", "var_name": "RESOURCE_NAME_PREFIX" } ], "file": "modules/plugins/netserv...
{ "body": "@Override\n public DiscoveredResourceDetails discoverResource(Configuration config,\n ResourceDiscoveryContext resourceDiscoveryContext) throws InvalidPluginConfigurationException {\n InetAddress address = PingNetServiceComponent.createComponentConfiguration(config);\n DiscoveredRes...
{ "created": null, "fork": null, "fork_count": 85, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17278009, "size": 138394, "stargazer_count": 150, "stars": null, "updates": null, "url": "https://github.com/rhq-project/rhq" }
17278009_88
{ "fields": [], "file": "modules/helpers/metrics-simulator/src/test/java/org/rhq/metrics/simulator/SimulatorTest.java", "identifier": "SimulatorTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void runSimulator() throws Throwable {\n File jsonFile = new File(getClass().getResource(\"test-simulator.json\").toURI());\n SimulationPlanner planner = new SimulationPlanner();\n SimulationPlan plan = planner.create(jsonFile);\n Simulator simulator = new Simu...
{ "fields": [ { "declarator": "log = LogFactory.getLog(Simulator.class)", "modifier": "private final", "original_string": "private final Log log = LogFactory.getLog(Simulator.class);", "type": "Log", "var_name": "log" }, { "declarator": "shutdown = false", "modifi...
{ "body": "public void run(SimulationPlan plan) throws Throwable {\n if (SimulationType.THREADED.equals(plan.getSimulationType())) {\n this.runThreadedSimulation(plan);\n } else if (SimulationType.SEQUENTIAL.equals(plan.getSimulationType())) {\n this.runSequentialSimulation(plan);\...
{ "created": null, "fork": null, "fork_count": 85, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17278009, "size": 138394, "stargazer_count": 150, "stars": null, "updates": null, "url": "https://github.com/rhq-project/rhq" }
17278009_67
{ "fields": [ { "declarator": "TEST_PRECISION = Math.pow(10, -9)", "modifier": "private static final", "original_string": "private static final double TEST_PRECISION = Math.pow(10, -9);", "type": "double", "var_name": "TEST_PRECISION" }, { "declarator": "metricsServer",...
{ "body": "@Test(dataProvider = \"testDates\")\n public void insertMultipleRawNumericDataForOneSchedule(DateTime testNow) throws Exception {\n initServer(testNow);\n\n int scheduleId = 123;\n\n DateTime currentTime = hour(4).plusMinutes(44);\n DateTime threeMinutesAgo = currentTime.minu...
{ "fields": [ { "declarator": "log = LogFactory.getLog(MetricsServer.class)", "modifier": "private final", "original_string": "private final Log log = LogFactory.getLog(MetricsServer.class);", "type": "Log", "var_name": "log" }, { "declarator": "RAW_DATA_AGE_LIMIT_MAX =...
{ "body": "public synchronized void addNumericData(final Set<MeasurementDataNumeric> dataSet, final FutureCallback<Void> callback) {\n if(numericQueue.remainingCapacity() > dataSet.size()) {\n for(final MeasurementDataNumeric data : dataSet) {\n try {\n if(data != n...
{ "created": null, "fork": null, "fork_count": 85, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17278009, "size": 138394, "stargazer_count": 150, "stars": null, "updates": null, "url": "https://github.com/rhq-project/rhq" }
17278009_163
{ "fields": [ { "declarator": "TMP_DIR = new File(System.getProperty(\"java.io.tmpdir\"))", "modifier": "private static final", "original_string": "private static final File TMP_DIR = new File(System.getProperty(\"java.io.tmpdir\"));", "type": "File", "var_name": "TMP_DIR" } ],...
{ "body": "@Test\n public void shouldReturnFoundFileForSubContexts() throws Exception {\n File logFileDir = createLogFileDir();\n File logFile = File.createTempFile(\"log\", \"pipo_molo_molette_rt.log\", logFileDir);\n logFile.deleteOnExit();\n assertNotNull(findResponseTimeLogFileInDir...
{ "fields": [ { "declarator": "FALLBACK_RESPONSE_TIME_LOG_FILE_DIRECTORY = new File(System.getProperty(\"java.io.tmpdir\")\n + File.separator + \"rhq\" + File.separator + \"rt\")", "modifier": "public static final", "original_string": "public static final File FALLBACK_RESPONSE_TIME_LOG_F...
{ "body": "public static String findResponseTimeLogFileInDirectory(String contextPath, File responseTimeLogFileDirectory) {\n if (contextPath == null) {\n throw new IllegalArgumentException(\"contextPath is null\");\n }\n if (!contextPath.startsWith(\"/\")) {\n throw new Ill...
{ "created": null, "fork": null, "fork_count": 85, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17278009, "size": 138394, "stargazer_count": 150, "stars": null, "updates": null, "url": "https://github.com/rhq-project/rhq" }
17278009_2
{ "fields": [ { "declarator": "nf = NumberFormat.getInstance()", "modifier": "", "original_string": "NumberFormat nf = NumberFormat.getInstance();", "type": "NumberFormat", "var_name": "nf" } ], "file": "modules/enterprise/gui/portal-war/src/test/java/org/rhq/enterprise/gui/l...
{ "body": "@Test\n public void testFormatByteMetrics() {\n List<MetricDisplaySummary> metricDisplaySummaries = new ArrayList<MetricDisplaySummary>();\n Locale locale = Locale.US; // This does not work as intended. See RHQ-1129\n MessageResources messageResources = createMessageResources();\n\n...
{ "fields": [ { "declarator": "log = LogFactory.getLog(MonitorUtils.class)", "modifier": "private static", "original_string": "private static Log log = LogFactory.getLog(MonitorUtils.class);", "type": "Log", "var_name": "log" }, { "declarator": "RO = \"ro\"", "mod...
{ "body": "public static Integer formatMetrics(List<MetricDisplaySummary> metricDisplaySummaries, Locale userLocale,\n MessageResources msgs) {\n Integer resourceCount = null;\n try {\n for (MetricDisplaySummary metricDisplaySummary : metricDisplaySummaries) {\n if (Doub...
{ "created": null, "fork": null, "fork_count": 85, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17278009, "size": 138394, "stargazer_count": 150, "stars": null, "updates": null, "url": "https://github.com/rhq-project/rhq" }
17278009_30
{ "fields": [ { "declarator": "dao", "modifier": "", "original_string": "ChangeSetDAO dao;", "type": "ChangeSetDAO", "var_name": "dao" } ], "file": "modules/enterprise/server/plugins/drift-mongodb/src/test/java/org/rhq/enterprise/server/plugins/drift/mongodb/dao/ChangeSetDAOT...
{ "body": "@Test(enabled = ENABLED)\n public void findByChangeSetCriteriaWithDriftDefIdFilter() throws Exception {\n MongoDBChangeSet c1 = new MongoDBChangeSet();\n c1.setCategory(DRIFT);\n c1.setVersion(1);\n c1.setResourceId(1);\n c1.setDriftDefinitionId(1);\n dao.save(c...
{ "fields": [ { "declarator": "morphia", "modifier": "private", "original_string": "private Morphia morphia;", "type": "Morphia", "var_name": "morphia" } ], "file": "modules/enterprise/server/plugins/drift-mongodb/src/main/java/org/rhq/enterprise/server/plugins/drift/mongodb/...
{ "body": "public List<MongoDBChangeSet> findByChangeSetCritiera(DriftChangeSetCriteria criteria) {\n Query<MongoDBChangeSet> query = createQuery();\n \n if (criteria.getFilterId() != null) {\n // There is no need to apply any additional filters if the id filter is specified\n ...
{ "created": null, "fork": null, "fork_count": 85, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17278009, "size": 138394, "stargazer_count": 150, "stars": null, "updates": null, "url": "https://github.com/rhq-project/rhq" }
17288475_38
{ "fields": [ { "declarator": "ANY_SIZE = 11", "modifier": "private static final", "original_string": "private static final int ANY_SIZE = 11;", "type": "int", "var_name": "ANY_SIZE" }, { "declarator": "ANY_POSITION = 2", "modifier": "private static final", ...
{ "body": "@Test public void shouldRemoveElementFromAdapteeCollection() {\n rendererAdapter.remove(ANY_OBJECT);\n\n verify(mockedCollection).remove(ANY_OBJECT);\n }", "class_method_signature": "RendererAdapterTest.shouldRemoveElementFromAdapteeCollection()", "constructor": false, "full_signature": "@Test...
{ "fields": [ { "declarator": "rendererBuilder", "modifier": "private final", "original_string": "private final RendererBuilder<T> rendererBuilder;", "type": "RendererBuilder<T>", "var_name": "rendererBuilder" }, { "declarator": "collection", "modifier": "private"...
{ "body": "public void remove(Object element) {\n collection.remove(element);\n }", "class_method_signature": "RendererAdapter.remove(Object element)", "constructor": false, "full_signature": "public void remove(Object element)", "identifier": "remove", "invocations": [ "remove" ], "modifiers": ...
{ "created": null, "fork": null, "fork_count": 175, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17288475, "size": 11064, "stargazer_count": 1212, "stars": null, "updates": null, "url": "https://github.com/pedrovgs/Renderers" }
17288475_14
{ "fields": [ { "declarator": "ANY_SIZE = 11", "modifier": "private static final", "original_string": "private static final int ANY_SIZE = 11;", "type": "int", "var_name": "ANY_SIZE" }, { "declarator": "ANY_POSITION = 2", "modifier": "private static final", ...
{ "body": "@Test public void shouldReturnPositionAsItemId() {\n assertEquals(ANY_POSITION, adapter.getItemId(ANY_POSITION));\n }", "class_method_signature": "RVRendererAdapterTest.shouldReturnPositionAsItemId()", "constructor": false, "full_signature": "@Test public void shouldReturnPositionAsItemId()", "...
{ "fields": [ { "declarator": "rendererBuilder", "modifier": "private final", "original_string": "private final RendererBuilder<T> rendererBuilder;", "type": "RendererBuilder<T>", "var_name": "rendererBuilder" }, { "declarator": "collection", "modifier": "private"...
{ "body": "@Override public long getItemId(int position) {\n return position;\n }", "class_method_signature": "RVRendererAdapter.getItemId(int position)", "constructor": false, "full_signature": "@Override public long getItemId(int position)", "identifier": "getItemId", "invocations": [], "modifiers":...
{ "created": null, "fork": null, "fork_count": 175, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17288475, "size": 11064, "stargazer_count": 1212, "stars": null, "updates": null, "url": "https://github.com/pedrovgs/Renderers" }
17288475_43
{ "fields": [ { "declarator": "rendererBuilder", "modifier": "private", "original_string": "private ObjectRendererBuilder rendererBuilder;", "type": "ObjectRendererBuilder", "var_name": "rendererBuilder" }, { "declarator": "prototypes", "modifier": "private", ...
{ "body": "@Test public void shouldReturnCreatedRenderer() {\n when(rendererBuilder.getPrototypeClass(mockedContent)).thenReturn(ObjectRenderer.class);\n\n Renderer<Object> renderer =\n buildRenderer(mockedContent, null, mockedParent, mockedLayoutInflater);\n\n assertEquals(objectRenderer.getClass(), ...
{ "fields": [ { "declarator": "prototypes", "modifier": "private", "original_string": "private List<Renderer<? extends T>> prototypes;", "type": "List<Renderer<? extends T>>", "var_name": "prototypes" }, { "declarator": "content", "modifier": "private", "ori...
{ "body": "protected Class getPrototypeClass(T content) {\n if (prototypes.size() == 1) {\n return prototypes.get(0).getClass();\n } else {\n return binding.get(content.getClass());\n }\n }", "class_method_signature": "RendererBuilder.getPrototypeClass(T content)", "constructor": false, "ful...
{ "created": null, "fork": null, "fork_count": 175, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17288475, "size": 11064, "stargazer_count": 1212, "stars": null, "updates": null, "url": "https://github.com/pedrovgs/Renderers" }
17288475_55
{ "fields": [ { "declarator": "ANY_SIZE = 11", "modifier": "private static final", "original_string": "private static final int ANY_SIZE = 11;", "type": "int", "var_name": "ANY_SIZE" }, { "declarator": "ANY_POSITION = 2", "modifier": "private static final", ...
{ "body": "@Test\n public void shouldReturnTheAdapteeCollection() {\n assertEquals(mockedCollection, adapter.getCollection());\n }", "class_method_signature": "RVListRendererAdapterTest.shouldReturnTheAdapteeCollection()", "constructor": false, "full_signature": "@Test public void shouldReturnTheAd...
{ "fields": [ { "declarator": "rendererBuilder", "modifier": "private final", "original_string": "private final RendererBuilder<T> rendererBuilder;", "type": "RendererBuilder<T>", "var_name": "rendererBuilder" }, { "declarator": "collection", "modifier": "private"...
{ "body": "protected AdapteeCollection<T> getCollection() {\n return collection;\n }", "class_method_signature": "RVListRendererAdapter.getCollection()", "constructor": false, "full_signature": "protected AdapteeCollection<T> getCollection()", "identifier": "getCollection", "invocations": [], "m...
{ "created": null, "fork": null, "fork_count": 175, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17288475, "size": 11064, "stargazer_count": 1212, "stars": null, "updates": null, "url": "https://github.com/pedrovgs/Renderers" }
17288475_22
{ "fields": [ { "declarator": "ANY_SIZE = 11", "modifier": "private static final", "original_string": "private static final int ANY_SIZE = 11;", "type": "int", "var_name": "ANY_SIZE" }, { "declarator": "ANY_POSITION = 2", "modifier": "private static final", ...
{ "body": "@Test public void shouldClearElementsFromAdapteeCollection() {\n adapter.clear();\n\n verify(mockedCollection).clear();\n }", "class_method_signature": "RVRendererAdapterTest.shouldClearElementsFromAdapteeCollection()", "constructor": false, "full_signature": "@Test public void shouldClearElem...
{ "fields": [ { "declarator": "rendererBuilder", "modifier": "private final", "original_string": "private final RendererBuilder<T> rendererBuilder;", "type": "RendererBuilder<T>", "var_name": "rendererBuilder" }, { "declarator": "collection", "modifier": "private"...
{ "body": "public void clear() {\n collection.clear();\n }", "class_method_signature": "RVRendererAdapter.clear()", "constructor": false, "full_signature": "public void clear()", "identifier": "clear", "invocations": [ "clear" ], "modifiers": "public", "parameters": "()", "return": "void", ...
{ "created": null, "fork": null, "fork_count": 175, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17288475, "size": 11064, "stargazer_count": 1212, "stars": null, "updates": null, "url": "https://github.com/pedrovgs/Renderers" }
17288475_34
{ "fields": [ { "declarator": "ANY_SIZE = 11", "modifier": "private static final", "original_string": "private static final int ANY_SIZE = 11;", "type": "int", "var_name": "ANY_SIZE" }, { "declarator": "ANY_POSITION = 2", "modifier": "private static final", ...
{ "body": "@Test public void shouldRenderTheRendererBuilt() {\n when(mockedRendererBuilder.build()).thenReturn(mockedRenderer);\n\n rendererAdapter.getView(ANY_POSITION, mockedConvertView, mockedParent);\n\n verify(mockedRenderer).render();\n }", "class_method_signature": "RendererAdapterTest.shouldRender...
{ "fields": [ { "declarator": "rendererBuilder", "modifier": "private final", "original_string": "private final RendererBuilder<T> rendererBuilder;", "type": "RendererBuilder<T>", "var_name": "rendererBuilder" }, { "declarator": "collection", "modifier": "private"...
{ "body": "@Override public View getView(int position, View convertView, ViewGroup parent) {\n T content = getItem(position);\n rendererBuilder.withContent(content);\n rendererBuilder.withConvertView(convertView);\n rendererBuilder.withParent(parent);\n rendererBuilder.withLayoutInflater(LayoutInflater...
{ "created": null, "fork": null, "fork_count": 175, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17288475, "size": 11064, "stargazer_count": 1212, "stars": null, "updates": null, "url": "https://github.com/pedrovgs/Renderers" }
17288475_63
{ "fields": [ { "declarator": "ANY_SIZE = 11", "modifier": "private static final", "original_string": "private static final int ANY_SIZE = 11;", "type": "int", "var_name": "ANY_SIZE" }, { "declarator": "ANY_POSITION = 2", "modifier": "private static final", ...
{ "body": "@Test\n public void shouldRemoveElementFromAdapteeCollection() {\n adapter.remove(ANY_OBJECT);\n\n verify(mockedCollection).remove(ANY_OBJECT);\n }", "class_method_signature": "RVListRendererAdapterTest.shouldRemoveElementFromAdapteeCollection()", "constructor": false, "full_signa...
{ "fields": [ { "declarator": "rendererBuilder", "modifier": "private final", "original_string": "private final RendererBuilder<T> rendererBuilder;", "type": "RendererBuilder<T>", "var_name": "rendererBuilder" }, { "declarator": "collection", "modifier": "private"...
{ "body": "public boolean remove(Object element) {\n return collection.remove(element);\n }", "class_method_signature": "RVListRendererAdapter.remove(Object element)", "constructor": false, "full_signature": "public boolean remove(Object element)", "identifier": "remove", "invocations": [ "rem...
{ "created": null, "fork": null, "fork_count": 175, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17288475, "size": 11064, "stargazer_count": 1212, "stars": null, "updates": null, "url": "https://github.com/pedrovgs/Renderers" }
17288475_18
{ "fields": [ { "declarator": "ANY_SIZE = 11", "modifier": "private static final", "original_string": "private static final int ANY_SIZE = 11;", "type": "int", "var_name": "ANY_SIZE" }, { "declarator": "ANY_POSITION = 2", "modifier": "private static final", ...
{ "body": "@Test public void shouldAddElementToAdapteeCollection() {\n adapter.add(ANY_OBJECT);\n\n verify(mockedCollection).add(ANY_OBJECT);\n }", "class_method_signature": "RVRendererAdapterTest.shouldAddElementToAdapteeCollection()", "constructor": false, "full_signature": "@Test public void shouldAdd...
{ "fields": [ { "declarator": "rendererBuilder", "modifier": "private final", "original_string": "private final RendererBuilder<T> rendererBuilder;", "type": "RendererBuilder<T>", "var_name": "rendererBuilder" }, { "declarator": "collection", "modifier": "private"...
{ "body": "public boolean add(T element) {\n return collection.add(element);\n }", "class_method_signature": "RVRendererAdapter.add(T element)", "constructor": false, "full_signature": "public boolean add(T element)", "identifier": "add", "invocations": [ "add" ], "modifiers": "public", "param...
{ "created": null, "fork": null, "fork_count": 175, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17288475, "size": 11064, "stargazer_count": 1212, "stars": null, "updates": null, "url": "https://github.com/pedrovgs/Renderers" }
17288475_1
{ "fields": [ { "declarator": "ANY_SIZE = 11", "modifier": "private static final", "original_string": "private static final int ANY_SIZE = 11;", "type": "int", "var_name": "ANY_SIZE" }, { "declarator": "ANY_POSITION = 2", "modifier": "private static final", ...
{ "body": "@Test public void shouldReturnCollectionSizeOnGetCount() {\n when(mockedCollection.size()).thenReturn(ANY_SIZE);\n\n assertEquals(ANY_SIZE, adapter.getCount());\n }", "class_method_signature": "VPRendererAdapterTest.shouldReturnCollectionSizeOnGetCount()", "constructor": false, "full_signature...
{ "fields": [ { "declarator": "rendererBuilder", "modifier": "private final", "original_string": "private final RendererBuilder<T> rendererBuilder;", "type": "RendererBuilder<T>", "var_name": "rendererBuilder" }, { "declarator": "collection", "modifier": "private"...
{ "body": "@Override public int getCount() {\n return collection.size();\n }", "class_method_signature": "VPRendererAdapter.getCount()", "constructor": false, "full_signature": "@Override public int getCount()", "identifier": "getCount", "invocations": [ "size" ], "modifiers": "@Override p...
{ "created": null, "fork": null, "fork_count": 175, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17288475, "size": 11064, "stargazer_count": 1212, "stars": null, "updates": null, "url": "https://github.com/pedrovgs/Renderers" }
17288475_59
{ "fields": [ { "declarator": "ANY_SIZE = 11", "modifier": "private static final", "original_string": "private static final int ANY_SIZE = 11;", "type": "int", "var_name": "ANY_SIZE" }, { "declarator": "ANY_POSITION = 2", "modifier": "private static final", ...
{ "body": "@Test\n public void shouldBuildRendererUsingAllNeededDependencies() {\n when(mockedCollection.get(ANY_POSITION)).thenReturn(ANY_OBJECT);\n when(mockedRendererBuilder.buildRendererViewHolder()).thenReturn(mockedRendererViewHolder);\n\n adapter.onCreateViewHolder(mockedParent, ANY_ITE...
{ "fields": [ { "declarator": "rendererBuilder", "modifier": "private final", "original_string": "private final RendererBuilder<T> rendererBuilder;", "type": "RendererBuilder<T>", "var_name": "rendererBuilder" }, { "declarator": "collection", "modifier": "private"...
{ "body": "@Override\n public RendererViewHolder onCreateViewHolder(ViewGroup viewGroup, int viewType) {\n rendererBuilder.withParent(viewGroup);\n rendererBuilder.withLayoutInflater(LayoutInflater.from(viewGroup.getContext()));\n rendererBuilder.withViewType(viewType);\n RendererViewHo...
{ "created": null, "fork": null, "fork_count": 175, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17288475, "size": 11064, "stargazer_count": 1212, "stars": null, "updates": null, "url": "https://github.com/pedrovgs/Renderers" }
17288475_58
{ "fields": [ { "declarator": "ANY_SIZE = 11", "modifier": "private static final", "original_string": "private static final int ANY_SIZE = 11;", "type": "int", "var_name": "ANY_SIZE" }, { "declarator": "ANY_POSITION = 2", "modifier": "private static final", ...
{ "body": "@Test\n public void shouldDelegateIntoRendererBuilderToGetItemViewType() {\n when(mockedCollection.get(ANY_POSITION)).thenReturn(ANY_OBJECT);\n when(mockedRendererBuilder.getItemViewType(ANY_OBJECT)).thenReturn(ANY_ITEM_VIEW_TYPE);\n\n assertEquals(ANY_ITEM_VIEW_TYPE, adapter.getIte...
{ "fields": [ { "declarator": "rendererBuilder", "modifier": "private final", "original_string": "private final RendererBuilder<T> rendererBuilder;", "type": "RendererBuilder<T>", "var_name": "rendererBuilder" }, { "declarator": "collection", "modifier": "private"...
{ "body": "@Override\n public int getItemViewType(int position) {\n T content = getItem(position);\n return rendererBuilder.getItemViewType(content);\n }", "class_method_signature": "RVListRendererAdapter.getItemViewType(int position)", "constructor": false, "full_signature": "@Override publ...
{ "created": null, "fork": null, "fork_count": 175, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17288475, "size": 11064, "stargazer_count": 1212, "stars": null, "updates": null, "url": "https://github.com/pedrovgs/Renderers" }
17288475_0
{ "fields": [ { "declarator": "ANY_SIZE = 11", "modifier": "private static final", "original_string": "private static final int ANY_SIZE = 11;", "type": "int", "var_name": "ANY_SIZE" }, { "declarator": "ANY_POSITION = 2", "modifier": "private static final", ...
{ "body": "@Test public void shouldReturnTheAdapteeCollection() {\n assertEquals(mockedCollection, adapter.getCollection());\n }", "class_method_signature": "VPRendererAdapterTest.shouldReturnTheAdapteeCollection()", "constructor": false, "full_signature": "@Test public void shouldReturnTheAdapteeCollection...
{ "fields": [ { "declarator": "rendererBuilder", "modifier": "private final", "original_string": "private final RendererBuilder<T> rendererBuilder;", "type": "RendererBuilder<T>", "var_name": "rendererBuilder" }, { "declarator": "collection", "modifier": "private"...
{ "body": "protected AdapteeCollection<T> getCollection() {\n return collection;\n }", "class_method_signature": "VPRendererAdapter.getCollection()", "constructor": false, "full_signature": "protected AdapteeCollection<T> getCollection()", "identifier": "getCollection", "invocations": [], "modif...
{ "created": null, "fork": null, "fork_count": 175, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17288475, "size": 11064, "stargazer_count": 1212, "stars": null, "updates": null, "url": "https://github.com/pedrovgs/Renderers" }
17288475_19
{ "fields": [ { "declarator": "ANY_SIZE = 11", "modifier": "private static final", "original_string": "private static final int ANY_SIZE = 11;", "type": "int", "var_name": "ANY_SIZE" }, { "declarator": "ANY_POSITION = 2", "modifier": "private static final", ...
{ "body": "@Test public void shouldAddAllElementsToAdapteeCollection() {\n adapter.addAll(ANY_OBJECT_COLLECTION);\n\n verify(mockedCollection).addAll(ANY_OBJECT_COLLECTION);\n }", "class_method_signature": "RVRendererAdapterTest.shouldAddAllElementsToAdapteeCollection()", "constructor": false, "full_sign...
{ "fields": [ { "declarator": "rendererBuilder", "modifier": "private final", "original_string": "private final RendererBuilder<T> rendererBuilder;", "type": "RendererBuilder<T>", "var_name": "rendererBuilder" }, { "declarator": "collection", "modifier": "private"...
{ "body": "public boolean addAll(Collection<? extends T> elements) {\n return collection.addAll(elements);\n }", "class_method_signature": "RVRendererAdapter.addAll(Collection<? extends T> elements)", "constructor": false, "full_signature": "public boolean addAll(Collection<? extends T> elements)", "ident...
{ "created": null, "fork": null, "fork_count": 175, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17288475, "size": 11064, "stargazer_count": 1212, "stars": null, "updates": null, "url": "https://github.com/pedrovgs/Renderers" }
17288475_62
{ "fields": [ { "declarator": "ANY_SIZE = 11", "modifier": "private static final", "original_string": "private static final int ANY_SIZE = 11;", "type": "int", "var_name": "ANY_SIZE" }, { "declarator": "ANY_POSITION = 2", "modifier": "private static final", ...
{ "body": "@Test\n public void shouldAddAllElementsToAdapteeCollection() {\n adapter.addAll(ANY_OBJECT_COLLECTION);\n\n verify(mockedCollection).addAll(ANY_OBJECT_COLLECTION);\n }", "class_method_signature": "RVListRendererAdapterTest.shouldAddAllElementsToAdapteeCollection()", "constructor": ...
{ "fields": [ { "declarator": "rendererBuilder", "modifier": "private final", "original_string": "private final RendererBuilder<T> rendererBuilder;", "type": "RendererBuilder<T>", "var_name": "rendererBuilder" }, { "declarator": "collection", "modifier": "private"...
{ "body": "public boolean addAll(Collection<? extends T> elements) {\n return collection.addAll(elements);\n }", "class_method_signature": "RVListRendererAdapter.addAll(Collection<? extends T> elements)", "constructor": false, "full_signature": "public boolean addAll(Collection<? extends T> elements)"...
{ "created": null, "fork": null, "fork_count": 175, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17288475, "size": 11064, "stargazer_count": 1212, "stars": null, "updates": null, "url": "https://github.com/pedrovgs/Renderers" }
17288475_35
{ "fields": [ { "declarator": "ANY_SIZE = 11", "modifier": "private static final", "original_string": "private static final int ANY_SIZE = 11;", "type": "int", "var_name": "ANY_SIZE" }, { "declarator": "ANY_POSITION = 2", "modifier": "private static final", ...
{ "body": "@Test public void shouldReturnRendererRootView() {\n when(mockedRendererBuilder.build()).thenReturn(mockedRenderer);\n when(mockedRenderer.getRootView()).thenReturn(mockedView);\n\n View renderedView = rendererAdapter.getView(ANY_POSITION, mockedConvertView, mockedParent);\n\n assertEquals(mock...
{ "fields": [ { "declarator": "rendererBuilder", "modifier": "private final", "original_string": "private final RendererBuilder<T> rendererBuilder;", "type": "RendererBuilder<T>", "var_name": "rendererBuilder" }, { "declarator": "collection", "modifier": "private"...
{ "body": "@Override public View getView(int position, View convertView, ViewGroup parent) {\n T content = getItem(position);\n rendererBuilder.withContent(content);\n rendererBuilder.withConvertView(convertView);\n rendererBuilder.withParent(parent);\n rendererBuilder.withLayoutInflater(LayoutInflater...
{ "created": null, "fork": null, "fork_count": 175, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17288475, "size": 11064, "stargazer_count": 1212, "stars": null, "updates": null, "url": "https://github.com/pedrovgs/Renderers" }
17288475_23
{ "fields": [ { "declarator": "ANY_SIZE = 11", "modifier": "private static final", "original_string": "private static final int ANY_SIZE = 11;", "type": "int", "var_name": "ANY_SIZE" }, { "declarator": "ANY_POSITION = 2", "modifier": "private static final", ...
{ "body": "@Test public void shouldGetRendererFromViewHolderAndUpdateContentOnBind() {\n when(mockedCollection.get(ANY_POSITION)).thenReturn(ANY_OBJECT);\n when(mockedRendererViewHolder.getRenderer()).thenReturn(mockedRenderer);\n\n adapter.onBindViewHolder(mockedRendererViewHolder, ANY_POSITION);\n\n ver...
{ "fields": [ { "declarator": "rendererBuilder", "modifier": "private final", "original_string": "private final RendererBuilder<T> rendererBuilder;", "type": "RendererBuilder<T>", "var_name": "rendererBuilder" }, { "declarator": "collection", "modifier": "private"...
{ "body": "@Override public void onBindViewHolder(RendererViewHolder viewHolder, int position) {\n T content = getItem(position);\n Renderer<T> renderer = viewHolder.getRenderer();\n if (renderer == null) {\n throw new NullRendererBuiltException(\"RendererBuilder have to return a not null renderer\");\n...
{ "created": null, "fork": null, "fork_count": 175, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17288475, "size": 11064, "stargazer_count": 1212, "stars": null, "updates": null, "url": "https://github.com/pedrovgs/Renderers" }
17288475_54
{ "fields": [ { "declarator": "renderer", "modifier": "@Spy private", "original_string": "@Spy private ObjectRenderer renderer;", "type": "ObjectRenderer", "var_name": "renderer" }, { "declarator": "mockedContent", "modifier": "@Mock private", "original_stri...
{ "body": "@Test public void shouldKeepTheContentAfterOnRecycleCall() {\n givenARendererInflatingView(mockedView);\n\n onRecycleRenderer();\n\n assertEquals(mockedContent, renderer.getContent());\n }", "class_method_signature": "RendererTest.shouldKeepTheContentAfterOnRecycleCall()", "constructor": fals...
{ "fields": [ { "declarator": "rootView", "modifier": "private", "original_string": "private View rootView;", "type": "View", "var_name": "rootView" }, { "declarator": "content", "modifier": "private", "original_string": "private T content;", "type": "...
{ "body": "protected final T getContent() {\n return content;\n }", "class_method_signature": "Renderer.getContent()", "constructor": false, "full_signature": "protected final T getContent()", "identifier": "getContent", "invocations": [], "modifiers": "protected final", "parameters": "()", "retur...
{ "created": null, "fork": null, "fork_count": 175, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17288475, "size": 11064, "stargazer_count": 1212, "stars": null, "updates": null, "url": "https://github.com/pedrovgs/Renderers" }
17288475_42
{ "fields": [ { "declarator": "ANY_SIZE = 11", "modifier": "private static final", "original_string": "private static final int ANY_SIZE = 11;", "type": "int", "var_name": "ANY_SIZE" }, { "declarator": "ANY_POSITION = 2", "modifier": "private static final", ...
{ "body": "@Test(expected = IllegalArgumentException.class)\n public void shouldThrowExceptionWhenSetNullCollection() {\n RendererAdapter<Object> adapter = new RendererAdapter<Object>(mockedRendererBuilder);\n\n adapter.setCollection(null);\n }", "class_method_signature": "RendererAdapterTest.shouldThrowExc...
{ "fields": [ { "declarator": "rendererBuilder", "modifier": "private final", "original_string": "private final RendererBuilder<T> rendererBuilder;", "type": "RendererBuilder<T>", "var_name": "rendererBuilder" }, { "declarator": "collection", "modifier": "private"...
{ "body": "public void setCollection(AdapteeCollection<T> collection) {\n if (collection == null) {\n throw new IllegalArgumentException(\"The AdapteeCollection configured can't be null\");\n }\n\n this.collection = collection;\n }", "class_method_signature": "RendererAdapter.setCollection(AdapteeCol...
{ "created": null, "fork": null, "fork_count": 175, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17288475, "size": 11064, "stargazer_count": 1212, "stars": null, "updates": null, "url": "https://github.com/pedrovgs/Renderers" }
17288475_15
{ "fields": [ { "declarator": "ANY_SIZE = 11", "modifier": "private static final", "original_string": "private static final int ANY_SIZE = 11;", "type": "int", "var_name": "ANY_SIZE" }, { "declarator": "ANY_POSITION = 2", "modifier": "private static final", ...
{ "body": "@Test public void shouldDelegateIntoRendererBuilderToGetItemViewType() {\n when(mockedCollection.get(ANY_POSITION)).thenReturn(ANY_OBJECT);\n when(mockedRendererBuilder.getItemViewType(ANY_OBJECT)).thenReturn(ANY_ITEM_VIEW_TYPE);\n\n assertEquals(ANY_ITEM_VIEW_TYPE, adapter.getItemViewType(ANY_POS...
{ "fields": [ { "declarator": "rendererBuilder", "modifier": "private final", "original_string": "private final RendererBuilder<T> rendererBuilder;", "type": "RendererBuilder<T>", "var_name": "rendererBuilder" }, { "declarator": "collection", "modifier": "private"...
{ "body": "@Override public int getItemViewType(int position) {\n T content = getItem(position);\n return rendererBuilder.getItemViewType(content);\n }", "class_method_signature": "RVRendererAdapter.getItemViewType(int position)", "constructor": false, "full_signature": "@Override public int getItemViewT...
{ "created": null, "fork": null, "fork_count": 175, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17288475, "size": 11064, "stargazer_count": 1212, "stars": null, "updates": null, "url": "https://github.com/pedrovgs/Renderers" }
17288475_39
{ "fields": [ { "declarator": "ANY_SIZE = 11", "modifier": "private static final", "original_string": "private static final int ANY_SIZE = 11;", "type": "int", "var_name": "ANY_SIZE" }, { "declarator": "ANY_POSITION = 2", "modifier": "private static final", ...
{ "body": "@Test public void shouldRemoveAllElementsFromAdapteeCollection() {\n rendererAdapter.removeAll(ANY_OBJECT_COLLECTION);\n\n verify(mockedCollection).removeAll(ANY_OBJECT_COLLECTION);\n }", "class_method_signature": "RendererAdapterTest.shouldRemoveAllElementsFromAdapteeCollection()", "constructor...
{ "fields": [ { "declarator": "rendererBuilder", "modifier": "private final", "original_string": "private final RendererBuilder<T> rendererBuilder;", "type": "RendererBuilder<T>", "var_name": "rendererBuilder" }, { "declarator": "collection", "modifier": "private"...
{ "body": "public void removeAll(Collection<?> elements) {\n collection.removeAll(elements);\n }", "class_method_signature": "RendererAdapter.removeAll(Collection<?> elements)", "constructor": false, "full_signature": "public void removeAll(Collection<?> elements)", "identifier": "removeAll", "invocatio...
{ "created": null, "fork": null, "fork_count": 175, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17288475, "size": 11064, "stargazer_count": 1212, "stars": null, "updates": null, "url": "https://github.com/pedrovgs/Renderers" }