id
stringlengths
7
14
test_class
dict
test_case
dict
focal_class
dict
focal_method
dict
repository
dict
17278009_25
{ "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 findByChangeSetCriteriaWithIdFilter() 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);\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<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_176
{ "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 testGetBaseName() 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.deleteOnExit();\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 String getBaseName() {\n if (baseName == null) {\n baseName = (getName() != null) ? new File(getName()).getName() : UNKNOWN_PROCESS_NAME;\n }\n return baseName;\n }", "class_method_signature": "ProcessInfo.getBaseName()", "constructor": false, "full_signature...
{ "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_72
{ "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 getSummaryAggregateForGroup(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);\n ...
{ "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_121
{ "fields": [ { "declarator": "httpNetServiceDiscoveryComponent", "modifier": "private", "original_string": "private HTTPNetServiceDiscoveryComponent httpNetServiceDiscoveryComponent;", "type": "HTTPNetServiceDiscoveryComponent", "var_name": "httpNetServiceDiscoveryComponent" }, ...
{ "body": "@Test\n public void testHttpsUrl() {\n try {\n configuration.setSimpleValue(URL, \"https://www.myhost.com/pipo/molo\");\n DiscoveredResourceDetails resourceDetails = httpNetServiceDiscoveryComponent.discoverResource(\n configuration, resourceDiscoveryContext);...
{ "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_208
{ "fields": [], "file": "modules/core/domain/src/test/java/org/rhq/core/domain/configuration/ConfigurationTest.java", "identifier": "ConfigurationTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void equalsShouldBeFalseWhenArgumentIsNotAConfiguration() {\n Configuration config = new Configuration();\n\n assertFalse(config.equals(new Object()), \"equals should return false when argument is not a \"\n + Configuration.class.getSimpleName());\n }", "clas...
{ "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_64
{ "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 submitInvalid24HourAnd6HourMetricsWithEmpty1HourMetric() throws Exception {\n int scheduleId = 100;\n\n dao.insert1HourData(new1HourAggregate(scheduleId, hour(0).minusDays(7).plusHours(12), 100, 100, 100)).get();\n dao.insert1HourData(new1HourAggregate(scheduleId...
{ "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_137
{ "fields": [ { "declarator": "portNetServiceDiscoveryComponent", "modifier": "private", "original_string": "private PortNetServiceDiscoveryComponent portNetServiceDiscoveryComponent;", "type": "PortNetServiceDiscoveryComponent", "var_name": "portNetServiceDiscoveryComponent" }, ...
{ "body": "@Test\n public void testValidComponentConfiguration() {\n try {\n DiscoveredResourceDetails resourceDetails = portNetServiceDiscoveryComponent.discoverResource(\n configuration, resourceDiscoveryContext);\n assertEquals(resourceDetails.getResourceType(), resou...
{ "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_33
{ "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 findByChangeSetCriteriaWithPathFilter() throws Exception {\n MongoDBChangeSet c1 = new MongoDBChangeSet();\n c1.setCategory(DRIFT);\n c1.setVersion(1);\n c1.setResourceId(1);\n c1.setDriftDefinitionId(1);\n \n MongoD...
{ "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_160
{ "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 shouldReturnFoundFile() throws Exception {\n File logFileDir = createLogFileDir();\n File logFile = File.createTempFile(\"log\", \"pipo_rt.log\", logFileDir);\n logFile.deleteOnExit();\n assertNotNull(findResponseTimeLogFileInDirectory(\"/pipo\", logFileDi...
{ "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_1
{ "fields": [ { "declarator": "cmd", "modifier": "", "original_string": "ScriptCommand cmd;", "type": "ScriptCommand", "var_name": "cmd" }, { "declarator": "client", "modifier": "", "original_string": "ClientMain client;", "type": "ClientMain", "...
{ "body": "@Test(enabled=false)\n public void executeShouldSetDefaultBindings() throws Exception {\n client = createClient();\n cmd = new ScriptCommand();\n String script = \"exec var x = 1;\";\n String[] args = asList(script).toArray(new String[] {});\n\n cmd.execute(client, arg...
{ "fields": [ { "declarator": "bindings", "modifier": "private", "original_string": "private StandardBindings bindings;", "type": "StandardBindings", "var_name": "bindings" }, { "declarator": "log = LogFactory.getLog(ScriptCommand.class)", "modifier": "private fin...
{ "body": "public boolean execute(ClientMain client, String[] args) {\n // for a command line session we don't want to reset the bindings for each executed command line, the\n // state, e.g. exporter settings, should be maintained from line to line. Note that scriptFiles\n // executed via 'exec -...
{ "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_249
{ "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 structuredConfigShouldGetLoaded() throws Exception {\n final Configuration config = new Configuration();\n config.put(new PropertySimple(\"x\", \"1\"));\n config.put(new PropertySimple(\"y\", \"2\"));\n\n addDefaultExpectationsForLoad(config);\n\n C...
{ "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_117
{ "fields": [ { "declarator": "httpNetServiceDiscoveryComponent", "modifier": "private", "original_string": "private HTTPNetServiceDiscoveryComponent httpNetServiceDiscoveryComponent;", "type": "HTTPNetServiceDiscoveryComponent", "var_name": "httpNetServiceDiscoveryComponent" }, ...
{ "body": "@Test\n public void testValidComponentConfiguration() {\n try {\n DiscoveredResourceDetails resourceDetails = httpNetServiceDiscoveryComponent.discoverResource(\n configuration, resourceDiscoveryContext);\n assertEquals(resourceDetails.getResourceType(), resou...
{ "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_44
{ "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 findEntriesWithIdFilter() throws Exception {\n MongoDBChangeSet c1 = createChangeSet(COVERAGE, 1, 1, 1);\n MongoDBChangeSetEntry e1 = new MongoDBChangeSetEntry(\"c1-1.txt\", FILE_ADDED);\n MongoDBChangeSetEntry e2 = new MongoDBChangeSetEntry(\"...
{ "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_286
{ "fields": [ { "declarator": "tmpDir", "modifier": "private", "original_string": "private File tmpDir;", "type": "File", "var_name": "tmpDir" }, { "declarator": "driftServerService", "modifier": "private", "original_string": "private TestDriftServerService ...
{ "body": "@Test\n public void cleanUpWhenServerAcksChangeSet() throws Exception {\n DriftDefinition config = driftDefinition(\"clean-up-when-server-acks-changeset\", resourceDir.getAbsolutePath());\n File changeSetDir = changeSetDir(config.getName());\n File snapshotFile = createRandomFile(ch...
{ "fields": [ { "declarator": "log = LogFactory.getLog(DriftManager.class)", "modifier": "private static final", "original_string": "private static final Log log = LogFactory.getLog(DriftManager.class);", "type": "Log", "var_name": "log" }, { "declarator": "pluginContai...
{ "body": "@Override\n public void ackChangeSet(int resourceId, String defName) {\n log.info(\"Received server change set ack for [resourceId: \" + resourceId + \", driftDefinition:\" + defName + \"]\");\n\n File resourceDir = new File(changeSetsDir, Integer.toString(resourceId));\n File chang...
{ "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_269
{ "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 exceptionShouldBeThrownWhenValidationFails() 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_140
{ "fields": [ { "declarator": "portNetServiceDiscoveryComponent", "modifier": "private", "original_string": "private PortNetServiceDiscoveryComponent portNetServiceDiscoveryComponent;", "type": "PortNetServiceDiscoveryComponent", "var_name": "portNetServiceDiscoveryComponent" }, ...
{ "body": "@Test\n public void testInvalidPortNumberFormat() {\n String configPort = \"NaN\";\n configuration.setSimpleValue(ConfigKeys.PORT, configPort);\n try {\n portNetServiceDiscoveryComponent.discoverResource(configuration, resourceDiscoveryContext);\n fail(\"Compon...
{ "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_13
{ "fields": [], "file": "modules/enterprise/server/data-migration/src/test/java/org/rhq/server/metrics/migrator/workers/AggregateDataMigratorTest.java", "identifier": "AggregateDataMigratorTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testMigrateTask() 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 DatabaseType databaseType = DatabaseType.Oracle;\n DataMigratorConfi...
{ "fields": [ { "declarator": "log = LogFactory.getLog(AggregateDataMigrator.class)", "modifier": "private final", "original_string": "private final Log log = LogFactory.getLog(AggregateDataMigrator.class);", "type": "Log", "var_name": "log" }, { "declarator": "config",...
{ "body": "public void migrate() throws Exception {\n performMigration(Task.Migrate);\n if (config.isDeleteDataImmediatelyAfterMigration()) {\n deleteTableData();\n }\n }", "class_method_signature": "AggregateDataMigrator.migrate()", "constructor": false, "full_signature": "pu...
{ "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_290
{ "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 skipDetectionForScheduledThatIsDisabled() throws Exception {\n DriftClientTestStub driftClient = new DriftClientTestStub() {\n {\n setBaseDir(resourceDir);\n }\n\n @Override\n public void sendChangeSetToServer(DriftDet...
{ "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_156
{ "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 shouldThrowIllegalArgumentExceptionForInvalidParameters() {\n assertThrowsIllegalArgumentException(new Runnable() {\n @Override\n public void run() {\n findResponseTimeLogFileInDirectory(null, null);\n }\n }, \"Should fail...
{ "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_228
{ "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 getBaseServerOrServiceOfNestedService() throws Exception {\n ResourceType testServiceType = new ResourceType(\"test service\", \"test plugin\", SERVICE,\n TEST_TOP_LEVEL_SERVER_TYPE);\n Resource service = new Resource();\n service.setResourceType(testS...
{ "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_101
{ "fields": [ { "declarator": "WEBAPP = \"coregui\"", "modifier": "private static final", "original_string": "private static final String WEBAPP = \"coregui\";", "type": "String", "var_name": "WEBAPP" }, { "declarator": "PATH_ATTRIBUTE = \"path\"", "modifier": "pr...
{ "body": "@Test\n public void shouldNotFindResponseTimeFilterLogInManuallyAddedNotLocalManagedServer() throws Exception {\n when(parentResourceComponent.getPath()).thenReturn(PARENT_COMPONENT_PATH_IN_MANAGED_SERVER);\n when(parentResourceComponent.getServerComponent()).thenReturn(hostControllerCompo...
{ "fields": [ { "declarator": "LOG = LogFactory.getLog(WebRuntimeDiscoveryComponent.class)", "modifier": "private static final", "original_string": "private static final Log LOG = LogFactory.getLog(WebRuntimeDiscoveryComponent.class);", "type": "Log", "var_name": "LOG" }, { ...
{ "body": "@Override\n public Set<DiscoveredResourceDetails> discoverResources(ResourceDiscoveryContext<BaseComponent<?>> context)\n throws Exception {\n Set<DiscoveredResourceDetails> discoveredResources = super.discoverResources(context);\n if (discoveredResources.isEmpty()) {\n r...
{ "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_52
{ "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 findEntriesWithChangeSetStartVersionFilter() 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_253
{ "fields": [ { "declarator": "facet", "modifier": "", "original_string": "ConfigurationFacet facet;", "type": "ConfigurationFacet", "var_name": "facet" }, { "declarator": "configMgmt", "modifier": "", "original_string": "LegacyConfigManagement configMgmt;",...
{ "body": "@Test(expectedExceptions = UpdateInProgressException.class)\n public void exceptionShouldBeThrownWhenUpdateDoesNotComplete() throws Exception {\n final Configuration config = new Configuration();\n\n final ConfigurationUpdateReport updateReport = new ConfigurationUpdateReport(config);\n\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 void executeUpdate(int resourceId, Configuration configuration)\n throws PluginContainerException {\n ConfigurationFacet facet = loadConfigurationFacet(resourceId, WRITE);\n ConfigurationUpdateReport report = new ConfigurationUpdateReport(configuration);\n\n facet.updateR...
{ "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_29
{ "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 findByChangeSetCriteriaWithEndVersionFilter() 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_195
{ "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 testIsRunning() {\n for (char state : new char[] { ProcState.RUN, ProcState.SLEEP, ProcState.IDLE }) {\n when(procState.getState()).thenReturn(state);\n assertTrue(processInfo.isRunning());\n }\n for (char state : new char[] { ProcState.ZOMB...
{ "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 boolean isRunning() throws SystemInfoException {\n return priorSnaphot().isRunning();\n }", "class_method_signature": "ProcessInfo.isRunning()", "constructor": false, "full_signature": "@Deprecated public boolean isRunning()", "identifier": "isRunning", "invocati...
{ "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_204
{ "fields": [], "file": "modules/core/client-api/src/test/java/org/rhq/core/clientapi/descriptor/PluginTransformerTest.java", "identifier": "PluginTransformerTest", "interfaces": "", "superclass": "" }
{ "body": "@Test(expectedExceptions = {PluginTransformException.class})\n public void exceptionShouldBeThrownWhenVersionNotFoundInDescriptorOrPluginJarManifest() throws Exception {\n File jarFile = createPluginJARFileWithoutVersionInManifest();\n URL pluginURL = toURL(jarFile);\n\n PluginTrans...
{ "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_91
{ "fields": [], "file": "modules/common/cassandra-schema/src/test/java/org/rhq/cassandra/schema/UpdateFileTest.java", "identifier": "UpdateFileTest", "interfaces": "", "superclass": "" }
{ "body": "@Test(expectedExceptions = RuntimeException.class)\n public void badFileBadXML() {\n UpdateFile updateFile = new UpdateFile(\"bad_file_3.xml\");\n updateFile.getOrderedSteps();\n }", "class_method_signature": "UpdateFileTest.badFileBadXML()", "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_212
{ "fields": [], "file": "modules/core/domain/src/test/java/org/rhq/core/domain/configuration/PropertyMapTest.java", "identifier": "PropertyMapTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void deepCopyShouldCopyAllSimpleFields() {\n PropertyMap original = createPropertyMap();\n PropertyMap copy = original.deepCopy(true);\n\n assertNotSame(copy, original, \"The copy should not reference the original object\");\n\n assertEquals(copy.getId(), origi...
{ "fields": [ { "declarator": "serialVersionUID = 1L", "modifier": "private static final", "original_string": "private static final long serialVersionUID = 1L;", "type": "long", "var_name": "serialVersionUID" }, { "declarator": "map = new LinkedHashMap<String, Property>...
{ "body": "public PropertyMap deepCopy(boolean keepId) {\n PropertyMap copy = new PropertyMap(this, keepId);\n\n for (Property property : map.values()) {\n copy.put(property.deepCopy(keepId));\n }\n\n return copy;\n }", "class_method_signature": "PropertyMap.deepCopy(boolea...
{ "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_68
{ "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 insertLateData(DateTime testNow) throws Exception {\n initServer(testNow);\n\n int scheduleId1 = 123;\n int scheduleId2 = 145;\n int scheduleId3 = 184;\n int scheduleId4 = 149;\n Set<MeasurementDataNumeric> data ...
{ "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_87
{ "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\n public void testUploadByFileName() throws Exception {\n File testFileToSend = createTestFileToSend();\n final File testFileReceived = createTestFileReceived();\n doAnswer(new Answer<Void>() {\n @Override\n public Void answer(InvocationOnMock invocation)...
{ "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_245
{ "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 factoryShouldInitializeRawConfigMgmtWithComponentService() throws Exception {\n final boolean daemonOnly = true;\n\n final ResourceComponent resourceComponent = context.mock(ResourceComponent.class);\n\n context.checking(new Expectations() {\n {\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_183
{ "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 testGetParentPidWithNullState() throws Exception {\n // Force new test instance because this test case work with data\n // which is initialized at instance creation\n when(sigarProxy.getProcState(PID)).thenThrow(new SigarException());\n // This is to avoid...
{ "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 long getParentPid() throws SystemInfoException {\n return priorSnaphot().getParentPid();\n }", "class_method_signature": "ProcessInfo.getParentPid()", "constructor": false, "full_signature": "@Deprecated public long getParentPid()", "identifier": "getParentPid", ...
{ "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_182
{ "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 testGetEnvironmentVariable() 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": "@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_244
{ "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 factoryShouldInitializeStructuredConfigMgmtWithConfigurationUtilityService() 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_69
{ "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 doNotInsertDataThatIsTooOld(DateTime testNow) throws Exception {\n initServer(testNow);\n\n int scheduleId = 123;\n Set<MeasurementDataNumeric> data = ImmutableSet.of(new MeasurementDataNumeric(\n today().minusDays(4).plus...
{ "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_86
{ "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 uploadByFileNameShouldThrowIAEWhenFileIsADirectory() throws Exception {\n File aFileWhichIsADirectory = aFileWhichIsADirectory();\n contentUploader.upload(aFileWhichIsADirectory.getAbsolutePath());\n }", "cla...
{ "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_213
{ "fields": [], "file": "modules/core/domain/src/test/java/org/rhq/core/domain/configuration/PropertyMapTest.java", "identifier": "PropertyMapTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void deepCopyShouldNotCopyIdFieldWhenFlagIsFalse() {\n PropertyMap original = createPropertyMap();\n PropertyMap copy = original.deepCopy(false);\n\n assertNotSame(copy, original, \"The copy should not reference the original object\");\n\n assertFalse(copy.getI...
{ "fields": [ { "declarator": "serialVersionUID = 1L", "modifier": "private static final", "original_string": "private static final long serialVersionUID = 1L;", "type": "long", "var_name": "serialVersionUID" }, { "declarator": "map = new LinkedHashMap<String, Property>...
{ "body": "public PropertyMap deepCopy(boolean keepId) {\n PropertyMap copy = new PropertyMap(this, keepId);\n\n for (Property property : map.values()) {\n copy.put(property.deepCopy(keepId));\n }\n\n return copy;\n }", "class_method_signature": "PropertyMap.deepCopy(boolea...
{ "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_90
{ "fields": [], "file": "modules/common/cassandra-schema/src/test/java/org/rhq/cassandra/schema/UpdateFileTest.java", "identifier": "UpdateFileTest", "interfaces": "", "superclass": "" }
{ "body": "@Test(expectedExceptions = RuntimeException.class)\n public void badFileNoUpdatePlan() {\n UpdateFile updateFile = new UpdateFile(\"bad_file_1.xml\");\n updateFile.getOrderedSteps();\n }", "class_method_signature": "UpdateFileTest.badFileNoUpdatePlan()", "constructor": false, "ful...
{ "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_205
{ "fields": [], "file": "modules/core/domain/src/test/java/org/rhq/core/domain/configuration/ConfigurationTest.java", "identifier": "ConfigurationTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void deepCopyShouldNotReturnReferenceToOriginalObjectWhenKeepingIds() {\n Configuration original = createConfiguration();\n Configuration copy = original.deepCopy(true);\n\n assertNotSame(copy, original,\n \"Expected a reference to a new Configuration objec...
{ "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_28
{ "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 findByChangeSetCriteriaWithStartVersionFilter() 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...
{ "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_194
{ "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 testGetCurrentWorkingDirectory() throws Exception {\n when(procExe.getCwd()).thenReturn(\"adir\");\n assertEquals(processInfo.getCurrentWorkingDirectory(), \"adir\");\n }", "class_method_signature": "ProcessInfoTest.testGetCurrentWorkingDirectory()", "constructor...
{ "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 String getCurrentWorkingDirectory() throws SystemInfoException {\n return priorSnaphot().getCurrentWorkingDirectory();\n }", "class_method_signature": "ProcessInfo.getCurrentWorkingDirectory()", "constructor": false, "full_signature": "@Deprecated public String getCu...
{ "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_252
{ "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 facetShouldBeCalledToUpdateStructured() throws Exception {\n final Configuration config = new Configuration();\n\n final ConfigurationUpdateReport updateReport = new ConfigurationUpdateReport(config);\n\n final boolean isDaemonThread = false;\n\n context.c...
{ "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 void executeUpdate(int resourceId, Configuration configuration)\n throws PluginContainerException {\n ConfigurationFacet facet = loadConfigurationFacet(resourceId, WRITE);\n ConfigurationUpdateReport report = new ConfigurationUpdateReport(configuration);\n\n facet.updateR...
{ "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_100
{ "fields": [ { "declarator": "WEBAPP = \"coregui\"", "modifier": "private static final", "original_string": "private static final String WEBAPP = \"coregui\";", "type": "String", "var_name": "WEBAPP" }, { "declarator": "PATH_ATTRIBUTE = \"path\"", "modifier": "pr...
{ "body": "@Test\n public void shouldFindResponseTimeFilterLogInManagedServer() throws Exception {\n when(parentResourceComponent.getPath()).thenReturn(PARENT_COMPONENT_PATH_IN_MANAGED_SERVER);\n when(parentResourceComponent.getServerComponent()).thenReturn(hostControllerComponent);\n when(hos...
{ "fields": [ { "declarator": "LOG = LogFactory.getLog(WebRuntimeDiscoveryComponent.class)", "modifier": "private static final", "original_string": "private static final Log LOG = LogFactory.getLog(WebRuntimeDiscoveryComponent.class);", "type": "Log", "var_name": "LOG" }, { ...
{ "body": "@Override\n public Set<DiscoveredResourceDetails> discoverResources(ResourceDiscoveryContext<BaseComponent<?>> context)\n throws Exception {\n Set<DiscoveredResourceDetails> discoveredResources = super.discoverResources(context);\n if (discoveredResources.isEmpty()) {\n r...
{ "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_53
{ "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 findEntriesWithChangeSetEndVersionFilter() 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_229
{ "fields": [], "file": "modules/core/domain/src/test/java/org/rhq/core/domain/util/OSGiVersionTest.java", "identifier": "OSGiVersionTest", "interfaces": "", "superclass": "" }
{ "body": "@Test(dataProvider = \"testSplit\")\n public void testSplit(String input) {\n assertEquals(OSGiVersion.split(input), input.split(\"\\\\.\"));\n }", "class_method_signature": "OSGiVersionTest.testSplit(String input)", "constructor": false, "full_signature": "@Test(dataProvider = \"testSpl...
{ "fields": [ { "declarator": "major", "modifier": "private", "original_string": "private int major;", "type": "int", "var_name": "major" }, { "declarator": "minor", "modifier": "private", "original_string": "private Integer minor;", "type": "Integer",...
{ "body": "static String[] split(final String version) {\n if (!version.contains(\".\")) {\n return new String[]{version};\n }\n List<String> result = new ArrayList<String>(4); // we expect 4 elements at most\n String remaining = version;\n for (int i; ; ) {\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_157
{ "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 shouldReturnNullWhenDirectoryArgDoesNotExist() {\n File notExistingFile = null;\n for (int i = 0; i < 2000; i++) {\n File f = new File(TMP_DIR, \"pipo\" + i);\n if (!f.exists()) {\n notExistingFile = f;\n break;\n ...
{ "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_291
{ "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 doNotUpdateScheduleIfItIsTooEarlyToRunDetection() throws Exception {\n DriftDefinition driftDef = driftDefinition(\"schedule-not-ready-test\", resourceDir.getAbsolutePath());\n DriftDetectionSchedule schedule = new DriftDetectionSchedule(resourceId(), driftDef);\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_141
{ "fields": [ { "declarator": "portNetServiceDiscoveryComponent", "modifier": "private", "original_string": "private PortNetServiceDiscoveryComponent portNetServiceDiscoveryComponent;", "type": "PortNetServiceDiscoveryComponent", "var_name": "portNetServiceDiscoveryComponent" }, ...
{ "body": "@Test\n public void testMalformedAddress() {\n String configAddress = \"pipomolo\";\n configuration.setSimpleValue(ConfigKeys.ADDRESS, configAddress);\n try {\n portNetServiceDiscoveryComponent.discoverResource(configuration, resourceDiscoveryContext);\n fail(\...
{ "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_12
{ "fields": [], "file": "modules/enterprise/server/data-migration/src/test/java/org/rhq/server/metrics/migrator/workers/AggregateDataMigratorTest.java", "identifier": "AggregateDataMigratorTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testEstimateTask() 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 DatabaseType databaseType = DatabaseType.Oracle;\n DataMigratorConf...
{ "fields": [ { "declarator": "log = LogFactory.getLog(AggregateDataMigrator.class)", "modifier": "private final", "original_string": "private final Log log = LogFactory.getLog(AggregateDataMigrator.class);", "type": "Log", "var_name": "log" }, { "declarator": "config",...
{ "body": "@Override\n public long estimate() throws Exception {\n long recordCount = this.getRowCount(this.countQuery);\n log.debug(\"Retrieved record count for table \" + migrationTable.toString() + \" -- \" + recordCount);\n\n Telemetry telemetry = this.performMigration(Task.Estimate);\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_287
{ "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 returnNullReaderWhenNoChangeSetExists() throws Exception {\n ChangeSetReader reader = changeSetMgr.getChangeSetReader(resourceId(), \"test\");\n assertNull(reader, \"Expect null for the reader when no change set exists for the drift definition.\");\n }", "class_met...
{ "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 ChangeSetReader getChangeSetReader(int resourceId, String driftDefinitionName) throws IOException {\n File changeSetFile = findChangeSet(resourceId, driftDefinitionName);\n\n if (changeSetFile == null) {\n return null;\n }\n\n return new ChangeSe...
{ "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_268
{ "fields": [ { "declarator": "configFacet", "modifier": "", "original_string": "ResourceConfigurationFacet configFacet;", "type": "ResourceConfigurationFacet", "var_name": "configFacet" }, { "declarator": "structuredMgmt", "modifier": "", "original_string":...
{ "body": "@Test\n public void facetShouldBeCalledToUpdateStructured() throws Exception {\n final Configuration config = new Configuration();\n\n addDefaultExpectationsForUpdate();\n\n context.checking(new Expectations() {{\n oneOf(configFacet).validateStructuredConfiguration(config...
{ "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_116
{ "fields": [ { "declarator": "httpNetServiceDiscoveryComponent", "modifier": "private", "original_string": "private HTTPNetServiceDiscoveryComponent httpNetServiceDiscoveryComponent;", "type": "HTTPNetServiceDiscoveryComponent", "var_name": "httpNetServiceDiscoveryComponent" }, ...
{ "body": "@Test\n public void testDiscoverResources() throws Exception {\n // Manual add only, should always return empty set\n assertEquals(0, httpNetServiceDiscoveryComponent.discoverResources(null).size());\n }", "class_method_signature": "HTTPNetServiceDiscoveryComponentTest.testDiscoverRes...
{ "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 Set discoverResources(ResourceDiscoveryContext resourceDiscoveryContext)\n throws InvalidPluginConfigurationException, Exception {\n // We don't support auto-discovery.\n return Collections.emptySet();\n }", "class_method_signature": "HTTPNetServiceDiscoveryC...
{ "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_45
{ "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 findEntriesWithCategoriesFilter() throws Exception {\n MongoDBChangeSet c1 = createChangeSet(COVERAGE, 1, 1, 1);\n MongoDBChangeSetEntry e1 = new MongoDBChangeSetEntry(\"c1-1.txt\", FILE_ADDED);\n MongoDBChangeSetEntry e2 = new MongoDBChangeSet...
{ "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_248
{ "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 factoryShouldInitializeLoadStructuredAndRawWithConfigurationUtilityService() throws Exception {\n final boolean daemonOnly = true;\n final boolean onlyIfStarted = true;\n\n final ResourceComponent resourceComponent = context.mock(ResourceComponent.class);\n\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_32
{ "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 findByChangeSetCriteriaWithCreatedBeforeFilter() throws Exception {\n long creationTime = System.currentTimeMillis() - (1000 * 60 * 10); // 10 minutes ago\n MongoDBChangeSet c1 = new MongoDBChangeSet();\n c1.setCategory(DRIFT);\n c1.set...
{ "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_161
{ "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 shouldReturnNullIfFoundMoreThanOneFile() throws Exception {\n File logFileDir = createLogFileDir();\n File logFile1 = File.createTempFile(\"log\", \"pipo_rt.log\", logFileDir);\n logFile1.deleteOnExit();\n File logFile2 = File.createTempFile(\"log\", \"pip...
{ "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_0
{ "fields": [ { "declarator": "m_agentTest", "modifier": "private", "original_string": "private AgentTestClass m_agentTest;", "type": "AgentTestClass", "var_name": "m_agentTest" } ], "file": "modules/enterprise/agent/src/test/java/org/rhq/enterprise/agent/AgentConfigurationTe...
{ "body": "@Test\n public void testTransportParams() {\n Preferences prefs = Preferences.userRoot().node(\"rhqtest\").node(\"AgentConfigurationTest\");\n\n // BZ 1166383 - we need to make sure generalizeSocketException=true gets in the params even if we don't specify it\n\n // first make sure ...
{ "fields": [ { "declarator": "LOG = AgentI18NFactory.getLogger(AgentConfiguration.class)", "modifier": "private static final", "original_string": "private static final Logger LOG = AgentI18NFactory.getLogger(AgentConfiguration.class);", "type": "Logger", "var_name": "LOG" }, ...
{ "body": "public String getServerTransportParams() {\n String value = m_preferences.get(AgentConfigurationConstants.SERVER_TRANSPORT_PARAMS,\n AgentConfigurationConstants.DEFAULT_SERVER_TRANSPORT_PARAMS);\n\n // see BZ 1166383\n final String requiredParamName = \"generalizeSocketExcep...
{ "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_65
{ "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 submitInvalid6HourAnd24HourMetricsWhen1HourMetricsExpired() throws Exception {\n int scheduleId = 100;\n\n dao.insert6HourData(new6HourAggregate(scheduleId, hour(0).minusDays(7), 100, 100, 100)).get();\n dao.insert6HourData(new6HourAggregate(scheduleId, hour(0).m...
{ "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_136
{ "fields": [ { "declarator": "portNetServiceDiscoveryComponent", "modifier": "private", "original_string": "private PortNetServiceDiscoveryComponent portNetServiceDiscoveryComponent;", "type": "PortNetServiceDiscoveryComponent", "var_name": "portNetServiceDiscoveryComponent" }, ...
{ "body": "@Test\n public void testDiscoverResources() throws Exception {\n // Manual add only, should always return empty set\n assertEquals(0, portNetServiceDiscoveryComponent.discoverResources(null).size());\n }", "class_method_signature": "PortNetServiceDiscoveryComponentTest.testDiscoverRes...
{ "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 Set<DiscoveredResourceDetails> discoverResources(ResourceDiscoveryContext context)\n throws InvalidPluginConfigurationException, Exception {\n // No automatic discovery\n return Collections.EMPTY_SET;\n }", "class_method_signature": "PortNetServiceDiscoveryCo...
{ "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_209
{ "fields": [], "file": "modules/core/domain/src/test/java/org/rhq/core/domain/configuration/ConfigurationTest.java", "identifier": "ConfigurationTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void equalsShouldBeReflexive() {\n Configuration config = new Configuration();\n\n assertTrue(config.equals(config), \"equals() should be reflexive.\");\n }", "class_method_signature": "ConfigurationTest.equalsShouldBeReflexive()", "constructor": false, "full_signat...
{ "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_73
{ "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 find1HourDataComposites(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);\n ...
{ "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<MeasurementDataNumericHighLowComposite> findDataForResource(int scheduleId, long beginTime,\n long endTime, int numberOfBuckets) {\n Stopwatch stopwatch = new Stopwatch().start();\n try {\n DateTime begin = new DateTime(beginTime);\n\n if (dateTime...
{ "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_120
{ "fields": [ { "declarator": "httpNetServiceDiscoveryComponent", "modifier": "private", "original_string": "private HTTPNetServiceDiscoveryComponent httpNetServiceDiscoveryComponent;", "type": "HTTPNetServiceDiscoveryComponent", "var_name": "httpNetServiceDiscoveryComponent" }, ...
{ "body": "@Test\n public void testNotHttpOrHttpsUrl() {\n String configUrl = \"ftp://pipo.com/molo.zipo\";\n try {\n configuration.setSimpleValue(URL, configUrl);\n httpNetServiceDiscoveryComponent.discoverResource(configuration, resourceDiscoveryContext);\n fail(\"C...
{ "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_198
{ "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 pluginDisplayNameShouldBeSetToDescriptorDisplayName() throws Exception {\n PluginDescriptor pluginDescriptor = new PluginDescriptor();\n pluginDescriptor.setName(\"testPlugin\");\n pluginDescriptor.setDisplayName(\"Test Plugin\");\n\n PluginTransformer tra...
{ "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_24
{ "fields": [ { "declarator": "digestGenerator", "modifier": "private", "original_string": "private MessageDigestGenerator digestGenerator;", "type": "MessageDigestGenerator", "var_name": "digestGenerator" }, { "declarator": "random", "modifier": "private", ...
{ "body": "@Test\n public void findDriftsByCriteriaAndFetchChangeSets() {\n String driftDefName = \"testdef\";\n int driftDefId = 1;\n int resourceId1 = 1;\n int resourceId2 = 2;\n\n MongoDBChangeSet changeSet1 = new MongoDBChangeSet();\n changeSet1.setDriftDefinitionId(dr...
{ "fields": [ { "declarator": "log = LogFactory.getLog(MongoDBDriftServer.class)", "modifier": "private", "original_string": "private Log log = LogFactory.getLog(MongoDBDriftServer.class);", "type": "Log", "var_name": "log" }, { "declarator": "connection", "modifi...
{ "body": "@Override\n public PageList<? extends Drift<?, ?>> findDriftsByCriteria(Subject subject, DriftCriteria criteria) {\n Mapper mapper = new Mapper();\n List<MongoDBChangeSetEntry> entries = changeSetDAO.findEntries(criteria);\n PageList<DriftDTO> results = new PageList<DriftDTO>();\n\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_177
{ "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 testGetEmptyCommandLine() throws Exception {\n assertEquals(processInfo.getCommandLine(), new String[] {});\n }", "class_method_signature": "ProcessInfoTest.testGetEmptyCommandLine()", "constructor": false, "full_signature": "@Test public void testGetEmptyCommandLine(...
{ "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_225
{ "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 getBaseServerOrServiceOfPlatform() throws Exception {\n Resource platform = new Resource();\n platform.setResourceType(TEST_PLATFORM_TYPE);\n assertSame(platform, getBaseServerOrService(platform));\n }", "class_method_signature": "ResourceUtilityTest.getBase...
{ "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_272
{ "fields": [ { "declarator": "configFacet", "modifier": "", "original_string": "ResourceConfigurationFacet configFacet;", "type": "ResourceConfigurationFacet", "var_name": "configFacet" }, { "declarator": "rawConfigMgmt", "modifier": "", "original_string": ...
{ "body": "@Test\n public void theConfigNotesShouldGetSet() throws Exception {\n final Configuration config = new Configuration();\n config.setNotes(null);\n\n addDefaultExpectationsForLoad(EMPTY_SET);\n\n Configuration loadedConfig = rawConfigMgmt.executeLoad(resourceId);\n\n as...
{ "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_264
{ "fields": [ { "declarator": "configFacet", "modifier": "", "original_string": "ResourceConfigurationFacet configFacet;", "type": "ResourceConfigurationFacet", "var_name": "configFacet" }, { "declarator": "structuredAndRawConfigManagement", "modifier": "", ...
{ "body": "@Test(expectedExceptions = {ConfigurationUpdateException.class})\n public void structuredAndSecondRawShouldStillGetUpdatedWhenFirstRawValidationFails() throws Exception {\n final RawConfiguration raw1 = createRawConfiguration(\"/tmp/raw1.txt\");\n final RawConfiguration raw2 = createRawCon...
{ "fields": [ { "declarator": "log = LogFactory.getLog(StructuredAndRawConfigManagement.class)", "modifier": "private final", "original_string": "private final Log log = LogFactory.getLog(StructuredAndRawConfigManagement.class);", "type": "Log", "var_name": "log" } ], "file":...
{ "body": "public void executeUpdate(int resourceId, Configuration configuration) throws PluginContainerException {\n ResourceConfigurationFacet facet = loadResourceConfigFacetWithWriteLock(resourceId);\n\n StringBuilder errors = new StringBuilder();\n\n try {\n facet.validateStructure...
{ "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_233
{ "fields": [], "file": "modules/core/domain/src/test/java/org/rhq/core/domain/drift/DriftDefinitionTest.java", "identifier": "DriftDefinitionTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void getDriftHandlingMode() {\n DriftHandlingMode mode = DriftHandlingMode.normal;\n Configuration config = new Configuration();\n config.put(new PropertySimple(DriftConfigurationDefinition.PROP_DRIFT_HANDLING_MODE, mode.name()));\n DriftDefinition driftDef = n...
{ "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 DriftHandlingMode getDriftHandlingMode() {\n return driftHandlingMode;\n }", "class_method_signature": "DriftDefinition.getDriftHandlingMode()", "constructor": false, "full_signature": "public DriftHandlingMode getDriftHandlingMode()", "identifier": "getDriftHandlingMode", "invoc...
{ "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_49
{ "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 findEntriesWithResourceIdAndCategoryFilters() {\n MongoDBChangeSet c1 = createChangeSet(COVERAGE, 1, 1, 1);\n MongoDBChangeSetEntry e1 = new MongoDBChangeSetEntry(\"c1-1.txt\", FILE_ADDED);\n MongoDBChangeSetEntry e2 = new MongoDBChangeSetEntry...
{ "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_238
{ "fields": [ { "declarator": "TEST_GROUP_DEPS = \"integration.ejb3\"", "modifier": "static final", "original_string": "static final String TEST_GROUP_DEPS = \"integration.ejb3\";", "type": "String", "var_name": "TEST_GROUP_DEPS" }, { "declarator": "entityMgr", "m...
{ "body": "@Test(groups = \"unitils\", dependsOnGroups = TEST_GROUP_DEPS)\n public void findByNameAndPlugin() {\n ResourceType type = (ResourceType) entityMgr.createNamedQuery(QUERY_FIND_BY_NAME_AND_PLUGIN)\n .setParameter(\"name\", \"TestServer1\")\n .setParameter(\"plugin\", \"TestPl...
{ "fields": [ { "declarator": "serialVersionUID = 4L", "modifier": "private static final", "original_string": "private static final long serialVersionUID = 4L;", "type": "long", "var_name": "serialVersionUID" }, { "declarator": "TABLE_NAME = \"RHQ_RESOURCE_TYPE\"", ...
{ "body": "public int getId() {\n return this.id;\n }", "class_method_signature": "ResourceType.getId()", "constructor": false, "full_signature": "public int getId()", "identifier": "getId", "invocations": [], "modifiers": "public", "parameters": "()", "return": "int", "signature": "int ge...
{ "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_111
{ "fields": [ { "declarator": "basedir", "modifier": "private", "original_string": "private File basedir;", "type": "File", "var_name": "basedir" }, { "declarator": "cassandraYamlFile", "modifier": "private", "original_string": "private File cassandraYamlFil...
{ "body": "@Test\n public void updateShouldFailWhenThreadStackSizeIsInvalid() throws Exception {\n createDefaultConfig();\n\n ConfigurationUpdateReport report = new ConfigurationUpdateReport(Configuration.builder()\n .addSimple(\"threadStackSize\", \"128M\").build());\n\n configDele...
{ "fields": [ { "declarator": "log = LogFactory.getLog(StorageNodeConfigDelegate.class)", "modifier": "private", "original_string": "private Log log = LogFactory.getLog(StorageNodeConfigDelegate.class);", "type": "Log", "var_name": "log" }, { "declarator": "jvmOptsFile"...
{ "body": "@Override\n public void updateResourceConfiguration(ConfigurationUpdateReport configurationUpdateReport) {\n updateResourceConfigurationAndRestartIfNecessary(configurationUpdateReport, false);\n }", "class_method_signature": "StorageNodeConfigDelegate.updateResourceConfiguration(Configuratio...
{ "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_42
{ "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 findByDriftCriteriaWithCategoryFilter() throws Exception {\n MongoDBChangeSet c1 = createChangeSet(COVERAGE, 1, 1, 1).add(new MongoDBChangeSetEntry(\"c1-1.txt\", FILE_ADDED));\n dao.save(c1);\n\n MongoDBChangeSet c2 = createChangeSet(DRIFT, 2, ...
{ "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_280
{ "fields": [ { "declarator": "configFacet", "modifier": "", "original_string": "ResourceConfigurationFacet configFacet;", "type": "ResourceConfigurationFacet", "var_name": "configFacet" }, { "declarator": "rawConfigMgmt", "modifier": "", "original_string": ...
{ "body": "@Test(expectedExceptions = {ConfigurationUpdateException.class})\n public void noUpdatesShouldHappenWhenValidationFailsForBothRaws() throws Exception {\n final RawConfiguration raw1 = createRawConfiguration(\"/tmp/raw1.txt\");\n final RawConfiguration raw2 = createRawConfiguration(\"/tmp/r...
{ "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 void executeUpdate(int resourceId, Configuration configuration)\n throws PluginContainerException {\n\n ResourceConfigurationFacet facet = loadResourceConfigFacetWithWriteLock(resourceId);\n StringBuilder errors = new StringBuilder();\n\n for (RawConfiguration rawConfig :...
{ "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_15
{ "fields": [], "file": "modules/enterprise/server/data-migration/src/test/java/org/rhq/server/metrics/migrator/workers/RawDataMigratorTest.java", "identifier": "RawDataMigratorTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testMigrateTask() 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 DatabaseType databaseType = DatabaseType.Oracle;\n DataMigratorConfi...
{ "fields": [ { "declarator": "log = LogFactory.getLog(RawDataMigrator.class)", "modifier": "private final", "original_string": "private final Log log = LogFactory.getLog(RawDataMigrator.class);", "type": "Log", "var_name": "log" }, { "declarator": "tablesNotProcessed =...
{ "body": "public void migrate() throws Exception {\n performMigration(Task.Migrate);\n }", "class_method_signature": "RawDataMigrator.migrate()", "constructor": false, "full_signature": "public void migrate()", "identifier": "migrate", "invocations": [ "performMigration" ], "modifiers": "...
{ "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_279
{ "fields": [ { "declarator": "configFacet", "modifier": "", "original_string": "ResourceConfigurationFacet configFacet;", "type": "ResourceConfigurationFacet", "var_name": "configFacet" }, { "declarator": "rawConfigMgmt", "modifier": "", "original_string": ...
{ "body": "@Test(expectedExceptions = {ConfigurationUpdateException.class})\n public void secondRawShouldStillGetUpdateWhenFirstRawUpdateFails() throws Exception {\n final RawConfiguration raw1 = createRawConfiguration(\"/tmp/raw1.txt\");\n final RawConfiguration raw2 = createRawConfiguration(\"/tmp/...
{ "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 void executeUpdate(int resourceId, Configuration configuration)\n throws PluginContainerException {\n\n ResourceConfigurationFacet facet = loadResourceConfigFacetWithWriteLock(resourceId);\n StringBuilder errors = new StringBuilder();\n\n for (RawConfiguration rawConfig :...
{ "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_107
{ "fields": [ { "declarator": "basedir", "modifier": "private", "original_string": "private File basedir;", "type": "File", "var_name": "basedir" }, { "declarator": "cassandraYamlFile", "modifier": "private", "original_string": "private File cassandraYamlFil...
{ "body": "@Test\n public void minHeapSizeShouldBeTheSameAsMaxHeapSize() throws Exception {\n createDefaultConfig();\n\n Configuration config = new Configuration();\n config.put(new PropertySimple(\"minHeapSize\", \"512M\"));\n config.put(new PropertySimple(\"maxHeapSize\", \"768M\"));\...
{ "fields": [ { "declarator": "log = LogFactory.getLog(StorageNodeConfigDelegate.class)", "modifier": "private", "original_string": "private Log log = LogFactory.getLog(StorageNodeConfigDelegate.class);", "type": "Log", "var_name": "log" }, { "declarator": "jvmOptsFile"...
{ "body": "@Override\n public void updateResourceConfiguration(ConfigurationUpdateReport configurationUpdateReport) {\n updateResourceConfigurationAndRestartIfNecessary(configurationUpdateReport, false);\n }", "class_method_signature": "StorageNodeConfigDelegate.updateResourceConfiguration(Configuratio...
{ "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_54
{ "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 findEntriesWithPathFilter() 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 MongoDB...
{ "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_255
{ "fields": [ { "declarator": "configFacet", "modifier": "", "original_string": "ResourceConfigurationFacet configFacet;", "type": "ResourceConfigurationFacet", "var_name": "configFacet" }, { "declarator": "structuredAndRawConfigManagement", "modifier": "", ...
{ "body": "@Test\n public void rawConfigshouldGetLoaded() throws Exception {\n Configuration config = new Configuration();\n\n Set<RawConfiguration> rawConfigs = toSet(\n createRawConfiguration(\"/tmp/foo.txt\"),\n createRawConfiguration(\"/tmp/bar.txt\")\n );\n\n\n ...
{ "fields": [ { "declarator": "log = LogFactory.getLog(StructuredAndRawConfigManagement.class)", "modifier": "private final", "original_string": "private final Log log = LogFactory.getLog(StructuredAndRawConfigManagement.class);", "type": "Log", "var_name": "log" } ], "file":...
{ "body": "public Configuration executeLoad(int resourceId) throws PluginContainerException {\n ResourceConfigurationFacet facet = loadResouceConfiguratonFacet(resourceId);\n\n Configuration configuration = facet.loadStructuredConfiguration();\n Set<RawConfiguration> rawConfigs = facet.loadRawCon...
{ "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_193
{ "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 testGetCurrentWorkingDirectoryFailure() throws Exception {\n when(procExe.getCwd()).thenThrow(new RuntimeException());\n // This is to avoid NPE in test instance error checking code\n when(sigarProxy.getProcList()).thenReturn(new long[] { PID });\n assertN...
{ "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 String getCurrentWorkingDirectory() throws SystemInfoException {\n return priorSnaphot().getCurrentWorkingDirectory();\n }", "class_method_signature": "ProcessInfo.getCurrentWorkingDirectory()", "constructor": false, "full_signature": "@Deprecated public String getCu...
{ "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_202
{ "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 pluginPathShouldBeSetToPathOfPluginURL() throws Exception {\n File jarFile = createPluginJARFile();\n\n PluginDescriptor pluginDescriptor = new PluginDescriptor();\n URL pluginURL = toURL(jarFile);\n\n PluginTransformer transformer = new PluginTransformer(...
{ "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_78
{ "fields": [ { "declarator": "TEST_PRECISION = Math.pow(10, -10)", "modifier": "private static final", "original_string": "private static final double TEST_PRECISION = Math.pow(10, -10);", "type": "double", "var_name": "TEST_PRECISION" }, { "declarator": "metricsConfig...
{ "body": "@Test\n public void noCalculationTest() throws Exception {\n //tell the method story as it happens: mock dependencies and configure\n //those dependencies to get the method under test to completion.\n StorageSession mockSession = mock(StorageSession.class);\n MetricsDAO mockM...
{ "fields": [ { "declarator": "log = LogFactory.getLog(MetricsBaselineCalculator.class)", "modifier": "private final", "original_string": "private final Log log = LogFactory.getLog(MetricsBaselineCalculator.class);", "type": "Log", "var_name": "log" }, { "declarator": "...
{ "body": "public Map<Integer, MeasurementBaseline> calculateBaselines(Set<Integer> scheduleIds, long startTime, long endTime) {\n Map<Integer, MeasurementBaseline> calculatedBaselines = new HashMap<Integer, MeasurementBaseline>();\n\n MeasurementBaseline measurementBaseline;\n for (Integer sched...
{ "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_97
{ "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 updateResourceConfigurationWithName() 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 void updateResourceConfiguration(ConfigurationUpdateReport report) {\n ConfigurationDefinition configDefCopy = context.getResourceType().getResourceConfigurationDefinition().copy();\n Map<String, PropertyDefinition> propDefs = configDefCopy.getPropertyDefinitions();\n\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_214
{ "fields": [], "file": "modules/core/domain/src/test/java/org/rhq/core/domain/configuration/group/GroupPluginConfigurationUpdateTest.java", "identifier": "GroupPluginConfigurationUpdateTest", "interfaces": "", "superclass": "extends AbstractConfigurationUpdateTest" }
{ "body": "@Test\n public void serializationShouldCopyConfigurationUpdates() throws Exception {\n GroupPluginConfigurationUpdate update = new GroupPluginConfigurationUpdate();\n update.getConfigurationUpdates().add(new PluginConfigurationUpdate(new Resource(), new Configuration(),\n \"rhqa...
{ "fields": [ { "declarator": "QUERY_FIND_BY_GROUP_ID = \"GroupPluginConfigurationUpdate.findByGroupId\"", "modifier": "public static final", "original_string": "public static final String QUERY_FIND_BY_GROUP_ID = \"GroupPluginConfigurationUpdate.findByGroupId\";", "type": "String", ...
{ "body": "public List<PluginConfigurationUpdate> getConfigurationUpdates() {\n return this.configurationUpdates;\n }", "class_method_signature": "GroupPluginConfigurationUpdate.getConfigurationUpdates()", "constructor": false, "full_signature": "public List<PluginConfigurationUpdate> getConfiguration...
{ "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_81
{ "fields": [], "file": "modules/enterprise/binding/src/test/java/org/rhq/bindings/util/ScriptUtilTest.java", "identifier": "ScriptUtilTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void getFileBytes() {\n ScriptUtil scriptUtil = new ScriptUtil(null);\n\n try {\n String fileContents = \"the rain in spain falls mainly on the plain\";\n String tempDir = System.getProperty(\"java.io.tmpdir\");\n File testFile = new File(tem...
{ "fields": [ { "declarator": "remoteClient", "modifier": "private", "original_string": "private RhqFacade remoteClient;", "type": "RhqFacade", "var_name": "remoteClient" }, { "declarator": "scriptEngine", "modifier": "private", "original_string": "private S...
{ "body": "public byte[] getFileBytes(String fileName) {\n File file = new File(fileName);\n long length = file.length();\n\n if (length > Integer.MAX_VALUE) {\n throw new IllegalArgumentException(\"Can not read file larger than \" + Integer.MAX_VALUE + \" byte: \"\n + f...
{ "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_243
{ "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 factoryShouldInitializeStructuredConfigMgmtWithComponentService() throws Exception {\n final ResourceComponent resourceComponent = context.mock(ResourceComponent.class);\n\n context.checking(new Expectations() {\n {\n boolean daemonOnly = true;...
{ "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_39
{ "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 findByChangeSetCriteriaAndSortByVersionDescending() throws Exception {\n MongoDBChangeSet c1 = new MongoDBChangeSet();\n c1.setCategory(COVERAGE);\n c1.setVersion(1);\n c1.setResourceId(1);\n c1.setDriftDefinitionId(1);\n d...
{ "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_185
{ "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 testGetState() throws Exception {\n assertTrue(procState == processInfo.getState());\n // Change procState\n procState = Mockito.mock(ProcState.class);\n when(sigarProxy.getProcState(PID)).thenReturn(procState);\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 ProcState getState() throws SystemInfoException {\n return priorSnaphot().getState();\n }", "class_method_signature": "ProcessInfo.getState()", "constructor": false, "full_signature": "@Deprecated public ProcState getState()", "identifier": "getState", "invocatio...
{ "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_234
{ "fields": [], "file": "modules/core/domain/src/test/java/org/rhq/core/domain/drift/DriftDefinitionTest.java", "identifier": "DriftDefinitionTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void isPinned() {\n Configuration config = new Configuration();\n config.put(new PropertySimple(DriftConfigurationDefinition.PROP_PINNED, true));\n DriftDefinition driftDef = new DriftDefinition(config);\n assertTrue(driftDef.isPinned(), \"Expected drift defini...
{ "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 boolean isPinned() {\n return isPinned;\n }", "class_method_signature": "DriftDefinition.isPinned()", "constructor": false, "full_signature": "public boolean isPinned()", "identifier": "isPinned", "invocations": [], "modifiers": "public", "parameters": "()", "return": "bool...
{ "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_19
{ "fields": [ { "declarator": "digestGenerator", "modifier": "private", "original_string": "private MessageDigestGenerator digestGenerator;", "type": "MessageDigestGenerator", "var_name": "digestGenerator" }, { "declarator": "random", "modifier": "private", ...
{ "body": "@Test\n public void persistChangeSetFileContent() throws Exception {\n int size = 1024;\n File file1 = createRandomFile(getBaseDir(), size);\n File file2 = createRandomFile(getBaseDir(), size);\n\n driftServer.saveChangeSetFiles(null, createChangeSetContentZipFile(file1, file...
{ "fields": [ { "declarator": "log = LogFactory.getLog(MongoDBDriftServer.class)", "modifier": "private", "original_string": "private Log log = LogFactory.getLog(MongoDBDriftServer.class);", "type": "Log", "var_name": "log" }, { "declarator": "connection", "modifi...
{ "body": "@Override\n public void saveChangeSetFiles(final Subject subject, final File changeSetFilesZip) throws Exception {\n String zipFileName = changeSetFilesZip.getName();\n File tmpDir = new File(System.getProperty(\"java.io.tmpdir\"));\n File dir = FileUtil.createTempDirectory(zipFileN...
{ "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_263
{ "fields": [ { "declarator": "configFacet", "modifier": "", "original_string": "ResourceConfigurationFacet configFacet;", "type": "ResourceConfigurationFacet", "var_name": "configFacet" }, { "declarator": "structuredAndRawConfigManagement", "modifier": "", ...
{ "body": "@Test(expectedExceptions = {ConfigurationUpdateException.class})\n public void exceptionShouldBeThrownWhenStructuredUpdateFails() throws Exception {\n final RawConfiguration raw = createRawConfiguration(\"/tmp/raw.txt\");\n\n final Configuration config = new Configuration();\n confi...
{ "fields": [ { "declarator": "log = LogFactory.getLog(StructuredAndRawConfigManagement.class)", "modifier": "private final", "original_string": "private final Log log = LogFactory.getLog(StructuredAndRawConfigManagement.class);", "type": "Log", "var_name": "log" } ], "file":...
{ "body": "public void executeUpdate(int resourceId, Configuration configuration) throws PluginContainerException {\n ResourceConfigurationFacet facet = loadResourceConfigFacetWithWriteLock(resourceId);\n\n StringBuilder errors = new StringBuilder();\n\n try {\n facet.validateStructure...
{ "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_275
{ "fields": [ { "declarator": "configFacet", "modifier": "", "original_string": "ResourceConfigurationFacet configFacet;", "type": "ResourceConfigurationFacet", "var_name": "configFacet" }, { "declarator": "rawConfigMgmt", "modifier": "", "original_string": ...
{ "body": "@Test(expectedExceptions = {ConfigurationUpdateException.class})\n public void exceptionShouldBeThrownWhenValidationFailsForSingleRaw() throws Exception {\n final RawConfiguration raw = createRawConfiguration(\"/tmp/raw.txt\");\n\n final Configuration config = new Configuration();\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 void executeUpdate(int resourceId, Configuration configuration)\n throws PluginContainerException {\n\n ResourceConfigurationFacet facet = loadResourceConfigFacetWithWriteLock(resourceId);\n StringBuilder errors = new StringBuilder();\n\n for (RawConfiguration rawConfig :...
{ "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_58
{ "fields": [ { "declarator": "LOG = LogFactory.getLog(SnmpSenderTest.class)", "modifier": "private static final", "original_string": "private static final Log LOG = LogFactory.getLog(SnmpSenderTest.class);", "type": "Log", "var_name": "LOG" }, { "declarator": "TEST_TRA...
{ "body": "@Test\n public void shouldReturnSimpleFailureForInvalidNotificationParameters() {\n Configuration alertParameters = new Configuration();\n snmpSender.setAlertParameters(alertParameters);\n\n SenderResult result = snmpSender.send(createAlertForResourceWithId(13004, \"\", \"\", HIGH))...
{ "fields": [ { "declarator": "LOG = LogFactory.getLog(SnmpSender.class)", "modifier": "private static final", "original_string": "private static final Log LOG = LogFactory.getLog(SnmpSender.class);", "type": "Log", "var_name": "LOG" }, { "declarator": "resourceManager"...
{ "body": "@Override\n public SenderResult send(Alert alert) {\n\n SnmpInfo info = SnmpInfo.load(alertParameters, preferences);\n if (info.error != null) {\n return SenderResult.getSimpleFailure(info.error);\n }\n if (LOG.isDebugEnabled()) {\n LOG.debug(\"Sending S...
{ "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_222
{ "fields": [], "file": "modules/core/domain/src/test/java/org/rhq/core/domain/configuration/AbstractConfigurationUpdateTest.java", "identifier": "AbstractConfigurationUpdateTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void serializationShouldCopyModifiedTime() throws Exception {\n ResourceConfigurationUpdate update = new ResourceConfigurationUpdate();\n\n ResourceConfigurationUpdate serializedUpdate = TestUtil.serializeAndDeserialize(update);\n\n org.testng.Assert.assertEquals(\n ...
{ "fields": [ { "declarator": "serialVersionUID = 1L", "modifier": "private static final", "original_string": "private static final long serialVersionUID = 1L;", "type": "long", "var_name": "serialVersionUID" }, { "declarator": "configuration", "modifier": "@JoinC...
{ "body": "public long getModifiedTime() {\n return this.modifiedTime;\n }", "class_method_signature": "AbstractConfigurationUpdate.getModifiedTime()", "constructor": false, "full_signature": "public long getModifiedTime()", "identifier": "getModifiedTime", "invocations": [], "modifiers": "publi...
{ "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_23
{ "fields": [ { "declarator": "digestGenerator", "modifier": "private", "original_string": "private MessageDigestGenerator digestGenerator;", "type": "MessageDigestGenerator", "var_name": "digestGenerator" }, { "declarator": "random", "modifier": "private", ...
{ "body": "@Test\n public void findDriftsByCriteriaAndDoNotFetchChangeSets() {\n String driftDefName = \"testdef\";\n int driftDefId = 1;\n int resourceId1 = 1;\n int resourceId2 = 2;\n\n MongoDBChangeSet changeSet1 = new MongoDBChangeSet();\n changeSet1.setDriftDefinition...
{ "fields": [ { "declarator": "log = LogFactory.getLog(MongoDBDriftServer.class)", "modifier": "private", "original_string": "private Log log = LogFactory.getLog(MongoDBDriftServer.class);", "type": "Log", "var_name": "log" }, { "declarator": "connection", "modifi...
{ "body": "@Override\n public PageList<? extends Drift<?, ?>> findDriftsByCriteria(Subject subject, DriftCriteria criteria) {\n Mapper mapper = new Mapper();\n List<MongoDBChangeSetEntry> entries = changeSetDAO.findEntries(criteria);\n PageList<DriftDTO> results = new PageList<DriftDTO>();\n\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_170
{ "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 testGetPid() {\n assertEquals(processInfo.getPid(), PID);\n }", "class_method_signature": "ProcessInfoTest.testGetPid()", "constructor": false, "full_signature": "@Test public void testGetPid()", "identifier": "testGetPid", "invocations": [ "assertEquals", ...
{ "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 long getPid() {\n return pid;\n }", "class_method_signature": "ProcessInfo.getPid()", "constructor": false, "full_signature": "public long getPid()", "identifier": "getPid", "invocations": [], "modifiers": "public", "parameters": "()", "return": "long", "signature": "long...
{ "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_259
{ "fields": [ { "declarator": "configFacet", "modifier": "", "original_string": "ResourceConfigurationFacet configFacet;", "type": "ResourceConfigurationFacet", "var_name": "configFacet" }, { "declarator": "structuredAndRawConfigManagement", "modifier": "", ...
{ "body": "@Test\n public void nullRawsShouldBeIgnored() throws Exception {\n Configuration config = new Configuration();\n config.put(new PropertySimple(\"x\", \"1\"));\n config.put(new PropertySimple(\"y\", \"2\"));\n\n Set<RawConfiguration> rawConfigs = null;\n\n addDefaultExp...
{ "fields": [ { "declarator": "log = LogFactory.getLog(StructuredAndRawConfigManagement.class)", "modifier": "private final", "original_string": "private final Log log = LogFactory.getLog(StructuredAndRawConfigManagement.class);", "type": "Log", "var_name": "log" } ], "file":...
{ "body": "public Configuration executeLoad(int resourceId) throws PluginContainerException {\n ResourceConfigurationFacet facet = loadResouceConfiguratonFacet(resourceId);\n\n Configuration configuration = facet.loadStructuredConfiguration();\n Set<RawConfiguration> rawConfigs = facet.loadRawCon...
{ "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_74
{ "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 find6HourDataCompositesHavingInvalidMax(DateTime testNow) throws Exception {\n initServer(testNow);\n\n DateTime beginTime = testNow.minusDays(30);\n DateTime endTime = testNow;\n\n Buckets buckets = new Buckets(beginTime, endTi...
{ "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<MeasurementDataNumericHighLowComposite> findDataForResource(int scheduleId, long beginTime,\n long endTime, int numberOfBuckets) {\n Stopwatch stopwatch = new Stopwatch().start();\n try {\n DateTime begin = new DateTime(beginTime);\n\n if (dateTime...
{ "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_127
{ "fields": [ { "declarator": "httpNetServiceDiscoveryComponent", "modifier": "private", "original_string": "private HTTPNetServiceDiscoveryComponent httpNetServiceDiscoveryComponent;", "type": "HTTPNetServiceDiscoveryComponent", "var_name": "httpNetServiceDiscoveryComponent" }, ...
{ "body": "@Test\n public void testManualProxyMode() {\n try {\n configuration.setSimpleValue(PROXY_MODE, MANUAL.name());\n configuration.setSimpleValue(PROXY_HOST, \"www.proxy.net\");\n configuration.setSimpleValue(PROXY_PORT, \"8080\");\n DiscoveredResourceDetai...
{ "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_62
{ "fields": [], "file": "modules/enterprise/server/plugins/alert-snmp/src/test/java/org/rhq/enterprise/server/plugins/alertSnmp/SnmpInfoTest.java", "identifier": "SnmpInfoTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void fallBackToGlobalValues() throws Exception {\n Configuration configuration = new Configuration();\n configuration.setSimpleValue(PARAM_VARIABLE_BINDING_PREFIX, \"molo\");\n\n Configuration preferences = new Configuration();\n preferences.put(new PropertySim...
{ "fields": [ { "declarator": "PARAM_HOST = \"host\"", "modifier": "static final", "original_string": "static final String PARAM_HOST = \"host\";", "type": "String", "var_name": "PARAM_HOST" }, { "declarator": "PARAM_PORT = \"port\"", "modifier": "static final", ...
{ "body": "public static SnmpInfo load(Configuration configuration) {\n String host = configuration.getSimpleValue(PARAM_HOST, null); // required\n String port = configuration.getSimpleValue(PARAM_PORT, DEFAULT_PORT);\n String oid = configuration.getSimpleValue(PARAM_VARIABLE_BINDING_PREFIX, 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" }